Android Design System, Component Gallery, Dummy Data & Signing
Self-contained module governing four core pillars of the Android development cycle:
- Design Language & Window Inset Discipline (Material Design 3 or user-specified design language, status bar, cutout, bottom navigation bar, and multi-screen/density clipping prevention)
- Themed Shared Component Gallery (visual in-app showcase of all shared components across Light/Dark themes and states)
- Deterministic Dummy / Seed Data (reusable development and QA fixtures so every screen and gallery component always has rich data to test)
- Signing Key Conventions (shared debug keystore across builds/worktrees + git-excluded production signing via environment variables)
When to Use
- Bootstrapping a new Android app or design system module (
Wave 0/core:designsystem) - Adding or modifying shared UI components, screens, or themes
- Creating realistic dummy/seed data for development, Compose previews, and live-device interactive testing
- Configuring or auditing
build.gradle.ktssigning configs (debugvs.release)
1. Design Language, Screen Matrix & Window Insets
1.1 Always Use an Explicit Design Language
- Default to Material Design 3 (
androidx.compose.material3) unless the user or repository specifies a custom design language (design/DESIGN_SYSTEM.md, HTML/CSS reference mocks, or Figma tokens). - Define all colors, typography scales, shapes, spacing, and elevation tokens centrally in the theme module—never hardcode raw hex values or ad-hoc font sizes inside feature screens.
1.2 System Bars, Display Cutouts & Edge Clipping Prevention
Every screen must be edge-to-edge (enableEdgeToEdge()) and explicitly handle system window insets so no text, button, or card is ever obscured or cut off:
- Status Bar: Apply
WindowInsets.statusBars(orScaffoldcontentWindowInsets) to top app bars and headers; verify status bar icon contrast (isAppearanceLightStatusBars) in both Light and Dark themes. - Screen Cutout (Notch / Pinhole / Camera Cutout): Apply
WindowInsets.displayCutout/WindowInsets.safeDrawingin both portrait and landscape so interactive elements and text never render underneath a camera cutout. - Bottom Navigation Bar: Apply
WindowInsets.navigationBars/imePadding()to bottom bars, sticky CTAs, FABs, and scrolling listcontentPaddingso neither 3-button navigation nor the gesture navigation bar overlaps bottom content. - Multi-Screen, Resolution & Density Checks:
- Use flexible layouts (
Modifier.weight,FlowRow,BoxWithConstraints, adaptiveWindowWidthSizeClass) and avoid fixed pixel/dp widths or single-line text withoutmaxLines+TextOverflow.Ellipsis. - Verify on device across multiple screen sizes, resolutions, densities (
wm size,wm density), and font scales (font_scale 1.3) to ensure no clipping occurs.
- Use flexible layouts (
1.3 Latest Material Design Animation & Motion Standards
Animations must follow the latest version of Material Design animation/motion (Material 3 Motion System) and interaction-driven principles:
- Expressive Easing & Springs: Use Material 3 standard, emphasized, and decelerated easing curves, and spring physics for natural elasticity.
- Container Transforms & Shared Axis: Morph incoming and outgoing components seamlessly (e.g. card expansion into details, shared axis transitions across tabs/flows).
- Synchronized Motion Discipline: When two distinct UI elements have a synchronized animation (such as sharing the same trigger, e.g. user interaction or gesture):
- Continuous, Not Discrete: Motion must be continuous rather than snapping between discrete states or steps.
- Unified Fling: Fling gestures must use unified kinetic physics across both elements to maintain seamless momentum instead of disconnected or conflicting deceleration curves.
- Smoothness: The animation must remain fluid and smooth.
- Interaction-Driven Animation: Apply
$SKILL_ROOT/interaction-driven-animation/SKILL.mdfor any animation triggered by touching, dragging, scrolling, or swiping (1:1 finger tracking, momentum fling on release, zero jump on touch interruption). - Precedence: A direct instruction from the user takes precedence over this idle rule.
1.4 Cross-Platform Adaptation (Design, Theme, Icon & Style)
For apps that are cross-platform (Kotlin Multiplatform / Compose Multiplatform, Flutter, React Native, or Web targets), design, theme, icon, and style must adapt to their respective platform's practice:
- Android:
- Follow Material Design 3: Material You dynamic color, Material Symbols/Icons, Android predictive back gestures, top/bottom app bars, standard elevation, and system insets.
- iOS / iPadOS / macOS:
- Follow Apple Human Interface Guidelines (HIG): SF Symbols, native navigation bars, segmented controls, Cupertino action sheets/dialogs, swipe-to-go-back gesture physics, and platform translucency/vibrancy.
- Web & Desktop:
- Adapt typography scales, cursor/hover feedback, keyboard focus indicators, mouse-wheel scrolling curves, and responsive desktop window frames.
- Consistency vs. Familiarity: Maintain the app's core brand identity while ensuring navigation patterns, touch targets, icon metaphors, and typography feel completely native and familiar to users on each target platform.
2. Shared Component Gallery (Visual Feedback Showcase)
Every Android app must include an in-app Component Gallery (accessible via a debug navigation route, developer drawer/menu, or dedicated debug Activity like .debug.ComponentGalleryActivity):
- Subtle but Obvious Dev Build Entry Point:
- In dev/debug builds (
isDebuggableorBuildConfig.DEBUG), provide an entry point into the Component Gallery directly within the running app. - Subtle, Not Distracting: The entry point must be subtle yet discoverable (for example, a small, low-contrast floating badge/dot in a screen corner, a subtle developer drawer item, or a discrete action icon). It must never break the overall design, obstruct interactive content, or appear in production/release builds.
- In dev/debug builds (
- Showcase Every Shared Component: Render buttons, cards, input fields, chips, dialogs, top/bottom bars, badges, loading skeletons, and empty/error states in a single scrollable/tabbed catalog.
- Interactive Color Theme Showcase with Live Gallery Theme Update:
- Provide an in-gallery interactive section showcasing all supported color themes: System, Light, Dark, and Material You Expressive Design Dynamic Colour (
dynamicLightColorScheme/dynamicDarkColorSchemeon supported Android versions). Also expose custom product brand color schemes or accessibility variants. - Real-Time Gallery Re-Theming: Toggling a theme in this section must immediately update the active theme of the Component Gallery itself in real time, so developers can inspect how every gallery component renders under that exact palette.
- The gallery must visibly indicate whether dynamic color is actively applied or falling back to baseline tokens.
- Provide an in-gallery interactive section showcasing all supported color themes: System, Light, Dark, and Material You Expressive Design Dynamic Colour (
- Interactive Component State Controls:
- Provide state toggles for Default, Loading, Disabled, Error, and Long-Text Overflow so developers and the Coordinator can inspect tokens and states on a live device.
- Gesture-Driven Animations:
- Any gallery demo involving gesture-driven interactions (collapsing headers, bottom sheets, carousels, swipe actions, pull-to-refresh) must follow interaction-driven-animation (1:1 finger tracking, momentum fling on release, zero jump on touch interrupt).
- Register New Shared Components Immediately: Whenever a sub-agent creates or updates a shared component in
core:designsystemorcore:ui, it must add a showcase card for that component to the Component Gallery before marking its task done. - See
./assets/ComponentGalleryTemplate.ktfor a ready-to-adapt Compose implementation.
3. Deterministic Dummy & Seed Data for Development
Never leave development builds dependent on empty databases or unavailable live backends:
- Data Abstraction First, Development Fixtures via DI:
- Define a production-facing repository, use-case, or gallery data-source interface. Keep deterministic fixtures in
debug,core:testing, or preview source sets, and inject that implementation in development builds through the project's DI mechanism (Hilt/Koin/manual composition root). Do not make an example fixture object the production data contract. - Keep the fixture catalog realistic and deterministic: standard items, long CJK/RTL/emoji text, multiline descriptions, numeric boundaries, timestamps, and user states.
- Define a production-facing repository, use-case, or gallery data-source interface. Keep deterministic fixtures in
- Debug Seed / Scenario Switcher:
- Provide a debug toggle or automatic seed initializer on fresh debug installs so launching the app immediately populates lists, detail views, and widgets with realistic data for interactive play-testing on device.
- Support switching between Populated, Empty State, Loading, and Error / Offline scenarios during live device testing.
4. Signing Key Conventions (debug vs. release)
Run ./scripts/check-signing-safety.sh to audit keystore configuration and Git hygiene.
4.1 Consistent Shared Debug Keystore
- Unless the user specifies a custom debug keystore, all debug builds across the main repo and all sub-agent git worktrees must use the same shared debug keystore (stored in
shared_debug_keystorein~/.config/android-skill-derek/config.json, defaulting to~/.android/debug.keystore). - Why this matters: Using a single consistent debug key guarantees that installing debug APKs from different branches or worktrees onto a test device (
./gradlew installDebugoradb install -r) upgrades cleanly in place without throwingINSTALL_FAILED_UPDATE_INCOMPATIBLE. - If a repository defines a custom debug keystore path that does not exist on the machine, fall back automatically to
~/.android/debug.keystoreso builds never break on clean environments.
4.2 Production Signing Keys via Environment Variables Only
- Never commit production signing keys (
*.jks,*.keystore,*.p12, or plaintext passwords) to Git. Ensure.gitignoreblocks all production keystore files. - Configure the
releasesigning config inbuild.gradle.kts(see./assets/signing-config.gradle.kts) to read credentials strictly from environment variables:ANDROID_KEYSTORE_PATH: Absolute path to the production.jksor.keystorefileANDROID_KEYSTORE_PASSWORD: Keystore passwordANDROID_KEY_ALIAS: Signing key aliasANDROID_KEY_PASSWORD: Signing key password
- Guard the
releasesigning block so that whenANDROID_KEYSTORE_PATHis not set locally,./gradlew assembleDebugand unit tests still configure and run cleanly without error.
Directory Layout
SKILL.md: Design language, inset rules, Component Gallery requirements, dummy data conventions, and signing key rulesscripts/check-signing-safety.sh: Audits.gitignore, git-tracked files, shared debug keystore consistency, and release env varsassets/signing-config.gradle.kts: Drop-in Gradle Kotlin DSL signing configuration (shared debug key + env-var release signing)assets/ComponentGalleryTemplate.kt: Adaptable Jetpack Compose example showing theme configuration and an injected gallery data source; it is not a required production schema
