compose-adaptive-layoutslisted
Install: claude install-skill pablitoarango/android-skills
# Compose Adaptive Layouts
Sources of truth: [Adaptive apps](https://developer.android.com/develop/ui/compose/layouts/adaptive), [Build adaptive navigation](https://developer.android.com/develop/ui/compose/layouts/adaptive/build-adaptive-navigation), [Canonical layouts](https://developer.android.com/develop/adaptive-apps/guides/canonical-layouts).
## 1. Adapt to the window, not the device
- Decide layout from the **app window size**, which changes with multi-window, desktop windowing, folding and rotation.
- Do not check device type (`isTablet`), physical screen size, or orientation, and do not lock orientation.
- Keep one adaptive code path instead of separate phone and tablet screens.
```kotlin
val windowSizeClass = currentWindowAdaptiveInfo().windowSizeClass
val isExpanded = windowSizeClass.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND)
val isMediumOrLarger = windowSizeClass.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_MEDIUM_LOWER_BOUND)
```
| Width class | Typical window | Typical layout |
|---|---|---|
| Compact | Phone portrait | Single pane, navigation bar |
| Medium | Phone landscape, small tablet, unfolded foldable | Single pane or two panes, navigation rail |
| Expanded and larger | Tablet landscape, desktop window | Two or more panes, navigation rail or drawer |
- Read the size class once near the top (the app or screen root), and pass layout decisions down as parameters or through a UI state holder (`compose-ui`).
- Width driv