Index of every page on this site: llms.txt
All skills
android avatar

/adaptive

@7f7b217
by androidandroid/skills11k stars
703
Run it yourself

Instructions to make or update an app's UI so that it adapts to different Android devices including phones, tablets, foldables, laptops, desktop, TV, Auto, and XR. It includes how to handle different window sizes, pointing devices (such as mouse) and text entry devices (such as keyboard) using the Compose MediaQuery API, and how to preserve UI, navigation, scroll, and media playback state across configuration changes (such as folding/unfolding a foldable, rotating a device, or resizing a window). It also covers multi-pane layouts using Navigation3 Scenes, adaptive UI components (such as buttons) with varying target sizes, and adaptive layouts (including navigation areas - nav rails and nav bars) using the Compose Grid and FlexBox APIs. It also covers desktop experiences with keyboard shortcuts, tooltips and custom cursors.

Use this Skill: https://skilld.dev/gh/android/skills/adaptive

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescustom_cursors.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Description

Use this document when adding or modifying pointer cursor behavior in a Jetpack Compose application targeting Android large screens and desktop environments.

Workflow

For each following step, search the whole codebase for the listed APIs, write down every match, and only then implement with Modifier.pointerHoverIcon(icon) on the element itself. Pick the cursor type from these steps yourself. Before finishing, re-run the searches: every match is either handled or skipped for a stated reason.

Step 1: Find and process draggable elements (Grab / Grabbing)

Go through the app, find all the draggable elements that would benefit from adding a TYPE_GRAB / TYPE_GRABBING cursor.

  • Search for: dragAndDropSource, detectDragGesturesAfterLongPress, reorderable list items, draggable( on movable content.
  • Examples: Reorderable list items, movable floating windows, map surfaces, draggable sliders, and custom drag-and-drop targets.
  • Implementation: For each one of them, implement the cursor using PointerIcon(android.view.PointerIcon.TYPE_GRAB) for movable surfaces and PointerIcon(android.view.PointerIcon.TYPE_GRABBING) only during an active drag.

Step 2: Find and process handwriting and drawing elements (Crosshair)

Go through the app, find all handwriting or precision drawing elements.

  • Search for: Canvas(, InProgressStrokesView, drawing surfaces in AndroidView, pointerInput blocks that draw strokes or shapes.
  • Examples: Canvas drawing areas, signature capture pads, image cropping tools and spatial selection bounding boxes.
  • Implementation: For each one of them, implement the cursor using PointerIcon.Crosshair.

Step 3: Find and process resizable elements (Resize)

Go through the app, find all splitters, resizable edges, and resize handles.

  • Search for: VerticalDragHandle, paneExpansionDragHandle, paneExpansionDraggable, dragHandle = of sheets, anchoredDraggable, draggable( on a divider.
  • Examples: Split pane dividers (horizontal or vertical), resizable dialog edges, and bottom sheet drag handles.
  • Implementation: For each one, implement the correct system cursor (e.g., PointerIcon(android.view.PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW) for vertical splitters). Match the cursor direction to the handle.

Step 4: Find and process clickable elements (Hand)

Go through the app, find all links, clickable text, and icon-only controls.

  • Search for: IconButton, IconToggleButton, FloatingActionButton, NavigationBarItem, NavigationRailItem, NavigationDrawerItem, navigationSuiteItems, Tab(, clickable on an Icon or Text.
  • Examples: Hyperlinks in text, standalone icon buttons, navigation bar, rail and drawer items, tabs, and active toggle switches.
  • Implementation: For each one, implement PointerIcon.Hand when the element is active. When inactive or disabled, you must default back to PointerIcon.Default. Do not use Hand for every single clickable surface.

Step 5: Find and process text selection elements (Text)

Go through the app, find all custom editable or selectable text regions.

  • Examples: Custom code editors, selectable log outputs, and custom text selection overlays.
  • Implementation: For each one, implement PointerIcon.Text. Ensure you do not override the correct default cursor of standard Compose text fields.

Step 6: Find and process temporarily blocked elements (Wait)

Go through the app, find short, temporarily blocked regions.

  • Examples: Form submission overlays, local processing states, and refreshing panels.
  • Implementation: For each one, implement the cursor using PointerIcon(android.view.PointerIcon.TYPE_WAIT).

Reference links

Consult these references before proceeding with the implementation.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warningtoday3 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill provides instructions for developing adaptive Android UIs using Jetpack Compose and Navigation 3. It references official Google libraries and documentation, and uses standard development workflows. No security concerns were detected.

  • Socket7d

    No alerts

  • Snyktoday

    Risk: MEDIUM · 1 issue

Signed by skilld at 7f7b217. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 1 hour ago.

Activeupdated yesterday
Other metadata
metadata
{
  "author": "Google LLC",
  "last-updated": "2026-11-19",
  "keywords": [
    "android",
    "ui",
    "adaptive",
    "Grid",
    "FlexBox",
    "MediaQuery",
    "navigation",
    "foldables",
    "state",
    "resizability",
    "configuration-changes",
    "keyboard shortcuts",
    "tooltips",
    "custom cursors"
  ]
}

README badge

README badge for android/skills/adaptive