Has anyone used a `NavigableSupportingPaneScaffold...
# compose
j
Has anyone used a
NavigableSupportingPaneScaffold
following the guide found here? I've copied and pasted the code; only change I've made is to add Gray and light Gray background. Try as I might I cannot get the scaffold to behave as I expect, when running on a phone (portrait) only a single pane is displayed at once. What I'm seeing testing on an Pixel 9 Pro XL (emulator as well) is both panes are visible and vertically stacked. The scaffold behaves correctly on tablets. I'm using the the following dependency versions:
Copy code
composeBom = "2025.10.01"
adaptiveVersion = "1.2.0" // adaptive libraries
Has anyone run into this issue before?
j
What is "phone (portrait)" you're testing on? I'm guessing it's smaller than the Pixel you tested on. Make sure your scaffold directive is configured to allow/block as needed.
j
What is "phone (portrait)" you're testing on?
I'm guessing it's smaller than the Pixel you tested
I don't understand what you mean by this. I'm using the default directive. The guide I followed didn't mention needing to customize your value to the listed behavior of a single pane on phones.
j
I don't know what a "default directive" refers to My bad I was thinking in the context of phone size šŸ˜… The default directive is calculated based on current window info https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]al3/adaptive/layout/PaneScaffoldDirective.kt;l=48;bpv=1;bpt=0 It's my understanding that
NavigableSupportingPaneScaffold
is an adaptive component, and will choose whether the supporting pane will be shown based on the provided directive.
If there's not enough space to show a supporting pane, then the scaffold will navigate to it as a new screen rather than displaying it in a split view
So, if your "phone (portrait)" is smaller than your Pixel 9 Pro XL, and your pane directive dictates that "phone (portrait)" isn't big enough, then you'd see the behavior you described
j
So, if your ā€œphone (portrait)ā€ is smaller than your Pixel 9 Pro XL
This doesn’t make any sense to me. What do you mean my phone is smaller than m Pixel 9 Pro XL? My phone isn’t smaller than a Pixel 9 Pro XL. My phone is a Pixel 9 Pro XL.
I was indicating that when running on a phone in the portrait orientation I’m not seeing the expected behavior. On Tablets or in landscape I see the main pane and the supporting pane as I would expect since my device is wide enough to meeting the horizontal panes.
What I don’t understand is why the Pixel 9 Pro XL is trigger two vertical panes.
j
I'm reading "a phone in portrait mode does not have a split layout, but a pixel 9 pro xl in portrait does". Is that not the case?
j
I did not consider the Pixel 9 Pro XL to be a large window device. > In large windows, the main and supporting panes appear side by side. > In small windows, only one pane is visible at a time, switching as users navigate. I’ve not seen any other apps use a vertically split UI on this device. I would expect it would just show a single screen at a time since it’s still phone and that aligns with every app I’ve used on the device.
Also, seeing side by side, I figured it would be horizontally and not vertically stacked. Maybe the documentation is lacking in this area?
j
I haven't seen any apps using these adaptive components at all yet, but if you know of any I'd be interested in checking them out šŸ‘€
j
NowInAndroid for sure uses it. I figured Youtube and Gmail would use them since they work tablets.
j
YouTube definitely isn't written in compose, I'm fairly sure it uses its own thing šŸ¤”
j
You are probably right. I figured since Youtube worked on tablets in a similar fashion it was using these canonical layouts. With that being said the following Github repo has examples using Fragments and Views so I would image the respective components share the same layout principles and running them on my Pixel 9 exhibits the same behavior..