{"name":"build-adaptive-compose-layouts","description":"Adapts a Jetpack Compose layout when the width changes, with more columns in a grid, a list beside its detail on a wide screen, and state kept across a fold. Use when the user wants Compose on a tablet or a foldable, or needs UI state kept when the device folds.","category":"apps","tags":["android","jetpack-compose","layout"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/build-adaptive-compose-layouts","api_url":"https://theskillvault.ai/api/skills/build-adaptive-compose-layouts","raw_url":"https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/raw","body":"# Build adaptive Compose layouts\n\nA Compose layout that only fits a phone turns a tablet into a stretched phone. Walk through a phone width, a foldable, and a tablet, then lock the columns. Change the arrangement when the width changes, and keep state when the device folds.\n\n## When to use\n- A phone layout is being stretched across a tablet or a foldable.\n- A list should sit beside its detail on a wide screen.\n- UI state disappears when a foldable folds or the screen rotates.\n\n## When not to use\n- Skip this when you are choosing a tab row or a rail as a product decision. That choice is a separate skill. This skill is how Compose follows it.\n- Skip this when you are adding typed routes or a saveable back stack. That is a separate skill.\n- Skip this when content meets the system icons. That padding is a separate skill.\n- The UI is SwiftUI or React Native. Do not rewrite it in Compose for this.\n\n## Steps\n1. Confirm the screens are already Compose. A view or fragment screen needs a migration before this layout change.\n2. On a narrow width, keep a single pane. On a wide width, show the list beside the detail. Use a scene strategy for that split, and do not also wrap the same screens in a second list-detail scaffold.\n3. Replace a phone-only bottom container with a suite scaffold so the same items can sit in a rail when the width grows. Still hide that area for a full-screen photo or a camera preview.\n4. Let a long vertical list gain columns as the width grows. Prefer a grid with a minimum cell size over a fixed single column.\n5. Keep UI state and scroll position across a fold, a rotation, or a resize. Values that must survive go in rememberSaveable. The back stack is saved by the nav skill.\n6. Check a phone width, a foldable, and a tablet. On the wide layout the list stays visible beside the detail.\n\n## Gotchas\n- Do not include passwords, tokens, or private records in preview content. A layout error is stretching a phone pane across a tablet.\n- Two split implementations on the same screens fight each other. Pick the scene strategy and stop.\n- Hiding the rail on a phone must still hide it on a wide screen when the content is a full-bleed photo.\n- This is an independent how-to adapted from a Google LLC skill. It is not official Android documentation, and it was not run on a device for this library.\n\n## Portability\nIf you use Views, the width choice still holds, but the suite scaffold and the grid here are Compose. If you use React Native or SwiftUI, keep that stack and only borrow the single-pane or wide-pane decision.\n\n## Done when\n- Narrow width is a single pane, and wide width shows the list beside the detail.\n- A long list gains columns as the width grows.\n- State and scroll position survive a fold or a rotation.\n\n## Example prompt\n\"This Compose feed is a single column on a tablet. Show two columns when the width grows, and show the list beside the detail. Keep the scroll position when the foldable folds.\"\n\n---\nAdapted from \"adaptive\" by Google LLC in android/skills (Apache-2.0). The upstream licence leaves the copyright line unfilled. See LICENSE.txt and NOTICE.txt.","files":["LICENSE.txt","NOTICE.txt"],"license":"Apache-2.0","license_name":"Apache License 2.0","license_url":"https://www.apache.org/licenses/LICENSE-2.0","attribution":"Based on work by Google LLC (android/skills, jetpack-compose/adaptive) (Copyright line in upstream LICENSE.txt is the unfilled Apache template 'Copyright [yyyy] [name of copyright owner]'. Skill metadata.author at this commit is Google LLC. No NOTICE file in the repository., Apache License 2.0), https://github.com/android/skills/tree/6daa53ef27fa2aa87827d183a85c06cedceca833/jetpack-compose/adaptive; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/raw' -o ~/'.claude/skills/build-adaptive-compose-layouts/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/files/LICENSE.txt' -o ~/'.claude/skills/build-adaptive-compose-layouts/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/files/NOTICE.txt' -o ~/'.claude/skills/build-adaptive-compose-layouts/NOTICE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/raw' -o '.cursor/skills/build-adaptive-compose-layouts/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/files/LICENSE.txt' -o '.cursor/skills/build-adaptive-compose-layouts/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/files/NOTICE.txt' -o '.cursor/skills/build-adaptive-compose-layouts/NOTICE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/raw' -o '.agents/skills/build-adaptive-compose-layouts/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/files/LICENSE.txt' -o '.agents/skills/build-adaptive-compose-layouts/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/build-adaptive-compose-layouts/files/NOTICE.txt' -o '.agents/skills/build-adaptive-compose-layouts/NOTICE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-29T03:42:30.374Z"}}