A sample Android project showing how Navigation 3 and Material 3 Adaptive work together to build adaptive multi-pane layouts.
| # | Pattern | Description |
|---|---|---|
| 0 | NavigationSuiteScaffold | Adaptive top-level nav: BottomBar → Rail → Drawer |
| 1 | ListDetailPaneScaffold | List + Detail + Extra pane (3-pane layout) |
| 2 | SupportingPaneScaffold | Main content + supporting pane (video + comments) |
- NavKey — serializable destination identifier
- entry<T> — declares content + metadata (pane role) for a destination
- NavDisplay — renders entries using a SceneStrategy chain
- SceneStrategy — reads metadata to decide layout (single/multi pane)
then— chains strategies; first match wins
Entries declare their pane role via metadata — the entry doesn't know whether it will be shown in single-pane or multi-pane mode:
entry<ListKey>(metadata = listPane()) { ListScreen() }
entry<DetailKey>(metadata = detailPane()) { key -> DetailScreen(key.itemId) }
entry<VideoKey>(metadata = mainPane()) { VideoScreen() }
entry<CommentsKey>(metadata = supportingPane()) { CommentsScreen() }NavDisplay(
sceneStrategy = rememberListDetailSceneStrategy<NavKey>()
then rememberSupportingPaneSceneStrategy<NavKey>(),
)First strategy that recognizes the metadata wins. Entries without matching metadata fall through to single-pane.
app/src/main/java/com/tbahlai/foldsamplenav3/
├── MainActivity.kt ← NavigationSuiteScaffold + NavDisplay + entryProvider
├── nav/
│ ├── NavKeys.kt ← All navigation keys (Serializable)
│ ├── NavigationState.kt ← Back stack management with sub-stacks
│ └── Navigator.kt ← Navigation actions (navigate, goBack)
└── screens/
├── HomeScreen.kt ← Entry point with example links
├── SearchScreen.kt ← Top-level destination
├── ProfileScreen.kt ← Top-level destination
├── ListScreen.kt ← ListDetail: list pane
├── DetailScreen.kt ← ListDetail: detail pane
├── ExtraInfoScreen.kt ← ListDetail: extra pane
├── VideoScreen.kt ← SupportingPane: main pane
└── CommentsScreen.kt ← SupportingPane: supporting pane
- Use a resizable emulator (e.g. Pixel Fold, 7.6" Foldable)
- Resize the window to see:
- Navigation switching between BottomBar / Rail / Drawer
- ListDetail switching between stacked and side-by-side
- SupportingPane showing comments inline or as separate screen
./gradlew assembleDebugRequires:
- Android Studio Ladybug or newer
- Kotlin 2.1.20+
- compileSdk 36
- minSdk 26