mobileui-os 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -0
- package/CHANGELOG.md +30 -17
- package/LICENSE +21 -0
- package/README.md +63 -18
- package/bin/cli.mjs +157 -211
- package/bin/generate.mjs +216 -0
- package/knowledge/INDEX.md +118 -0
- package/knowledge/android/00-android-reading-protocol.md +48 -0
- package/knowledge/android/01-android-decision-framework.md +58 -0
- package/knowledge/android/02-android-information-architecture.md +76 -0
- package/knowledge/android/03-android-interaction-and-state-engineering.md +87 -0
- package/knowledge/android/04-android-visual-system-and-theming.md +77 -0
- package/knowledge/android/05-android-implementation-and-refactoring.md +80 -0
- package/knowledge/android/06-android-qa-and-audit-loop.md +82 -0
- package/knowledge/android/adaptive-and-tablets.md +83 -0
- package/knowledge/android/forms-and-input.md +91 -0
- package/knowledge/android/gestures.md +81 -0
- package/knowledge/android/lists-and-data-heavy.md +88 -0
- package/knowledge/android/motion.md +71 -0
- package/knowledge/android/notifications-and-permissions.md +89 -0
- package/knowledge/android/performance.md +93 -0
- package/knowledge/android/search-and-discovery.md +84 -0
- package/knowledge/android/sheets-dialogs-and-menus.md +94 -0
- package/knowledge/android/states-and-recovery.md +85 -0
- package/knowledge/android/typography.md +74 -0
- package/knowledge/android/visual-qa.md +93 -0
- package/knowledge/android/worked-examples-lists-and-navigation.md +143 -0
- package/knowledge/android/worked-examples-permissions-and-adaptive.md +133 -0
- package/knowledge/android/worked-examples-state-and-forms.md +156 -0
- package/package.json +7 -4
- package/principles/platform-principles.md +3 -3
- package/scripts/sync-platform-adapters.mjs +23 -0
- package/scripts/sync-platform-adapters.ps1 +30 -0
- package/skills/accessibility-engineer/SKILL.md +5 -0
- package/skills/analytics-engineer/SKILL.md +5 -0
- package/skills/animation-engineer/SKILL.md +5 -0
- package/skills/component-designer/SKILL.md +5 -0
- package/skills/component-library-engineer/SKILL.md +8 -1
- package/skills/component-library-ops/SKILL.md +9 -2
- package/skills/design-system/SKILL.md +5 -0
- package/skills/design-token-engineer/SKILL.md +7 -0
- package/skills/design-token-pipeline/SKILL.md +7 -0
- package/skills/device-lab-engineer/SKILL.md +5 -0
- package/skills/forms-engineer/SKILL.md +5 -0
- package/skills/internationalization-engineer/SKILL.md +5 -0
- package/skills/motion-designer/SKILL.md +5 -0
- package/skills/native-data-fetching/SKILL.md +5 -0
- package/skills/navigation-architect/SKILL.md +5 -0
- package/skills/performance-engineer/SKILL.md +5 -0
- package/skills/platform-specialist/SKILL.md +5 -0
- package/skills/pre-release-gate/SKILL.md +5 -0
- package/skills/screen-designer/SKILL.md +5 -0
- package/skills/security-engineer/SKILL.md +5 -0
- package/skills/skill-router/SKILL.md +82 -0
- package/skills/skills.json +139 -134
- package/skills/testing-auditor/SKILL.md +5 -0
- package/skills/ui-architect/SKILL.md +5 -0
- package/skills/ui-implementer/SKILL.md +5 -0
- package/skills/ux-architect/SKILL.md +5 -0
- package/skills/ux-auditor/SKILL.md +5 -0
- package/skills/visual-auditor/SKILL.md +5 -0
- package/workflows/new-screen.md +2 -0
- package/workflows/pre-release.md +2 -0
- package/workflows/redesign.md +2 -0
- package/workflows/ui-audit.md +2 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Android Implementation and Refactoring
|
|
2
|
+
|
|
3
|
+
Implementation order is a quality tool: tokens → primitives → structure → interaction → states → motion → accessibility → platform → polish. Skipping a step creates rework.
|
|
4
|
+
|
|
5
|
+
## Implementation order
|
|
6
|
+
|
|
7
|
+
1. **Tokens** — confirm semantic roles exist for every color, spacing, type and motion need.
|
|
8
|
+
2. **Primitives** — text, surface, button, field and icon — with all interaction states before composing screens.
|
|
9
|
+
3. **Structure** — regions, hierarchy and responsive behavior from the screen spec.
|
|
10
|
+
4. **Interaction** — navigation, actions and gestures, including back semantics.
|
|
11
|
+
5. **States** — loading, empty, content, error, offline, permission, partial, success.
|
|
12
|
+
6. **Motion** — only transitions that communicate the state changes already defined.
|
|
13
|
+
7. **Accessibility** — labels, roles, focus order, live regions, touch targets.
|
|
14
|
+
8. **Platform** — Android-specific behavior (back, insets, IME, permissions, hardware).
|
|
15
|
+
9. **Polish** — spacing rhythm, typography details, haptics, edge cases.
|
|
16
|
+
|
|
17
|
+
## Component contract
|
|
18
|
+
|
|
19
|
+
Every reusable component ships with:
|
|
20
|
+
- stable name and single purpose,
|
|
21
|
+
- explicit props for variant, size, state, disabled and loading,
|
|
22
|
+
- documented content limits and overflow behavior,
|
|
23
|
+
- all interaction states (rest, pressed, focused, disabled, loading, selected, error),
|
|
24
|
+
- accessibility semantics and labels,
|
|
25
|
+
- platform notes where iOS and Android differ,
|
|
26
|
+
- golden tests for key states.
|
|
27
|
+
|
|
28
|
+
## State management
|
|
29
|
+
|
|
30
|
+
- Keep state local until a second screen needs it; then lift it deliberately.
|
|
31
|
+
- Use ViewModel/state holders for screen state and survive process death.
|
|
32
|
+
- Model state as an explicit sealed set (Loading / Content / Error / Empty / Offline) rather than booleans that can contradict each other.
|
|
33
|
+
- Derive UI from one source of truth; avoid duplicated flags for the same condition.
|
|
34
|
+
|
|
35
|
+
## Refactoring triggers
|
|
36
|
+
|
|
37
|
+
Refactor when:
|
|
38
|
+
- the same visual structure appears three times with minor differences,
|
|
39
|
+
- a state is handled differently across screens,
|
|
40
|
+
- a component has more than one reason to change,
|
|
41
|
+
- a fix requires editing the same logic in several files,
|
|
42
|
+
- accessibility or platform behavior is duplicated.
|
|
43
|
+
|
|
44
|
+
Do not refactor to introduce abstraction before the repetition is real.
|
|
45
|
+
|
|
46
|
+
## Code review checklist
|
|
47
|
+
|
|
48
|
+
- [ ] No raw color/dimension/typography values in components
|
|
49
|
+
- [ ] All states implemented and reachable in tests
|
|
50
|
+
- [ ] Back and insets handled
|
|
51
|
+
- [ ] IME action and autofill hints set on fields
|
|
52
|
+
- [ ] TalkBack labels and traversal order verified
|
|
53
|
+
- [ ] 200% font scale and RTL verified
|
|
54
|
+
- [ ] Lists use stable keys and lazy loading
|
|
55
|
+
- [ ] No main-thread blocking work
|
|
56
|
+
- [ ] Motion respects reduced-motion setting
|
|
57
|
+
|
|
58
|
+
## Platform notes (iOS → Android)
|
|
59
|
+
|
|
60
|
+
| iOS | Android |
|
|
61
|
+
|-----|---------|
|
|
62
|
+
| SwiftUI view modifiers | Compose modifiers / styles |
|
|
63
|
+
| `@State` / `@Environment` | `remember` / state holders / CompositionLocal |
|
|
64
|
+
| Safe area | WindowInsets |
|
|
65
|
+
| UIViewController lifecycle | Activity/destination lifecycle + ViewModel |
|
|
66
|
+
| Preview | Compose preview + preview parameters |
|
|
67
|
+
|
|
68
|
+
## Anti-patterns
|
|
69
|
+
|
|
70
|
+
- Styling before hierarchy is defined.
|
|
71
|
+
- Boolean flag soup for screen state.
|
|
72
|
+
- Custom component for a one-off visual tweak.
|
|
73
|
+
- Copy-pasting a screen to make a variant.
|
|
74
|
+
- Auditing only after the whole feature is built.
|
|
75
|
+
|
|
76
|
+
## Related
|
|
77
|
+
|
|
78
|
+
- `skills/ui-implementer/SKILL.md`
|
|
79
|
+
- `skills/component-designer/SKILL.md`
|
|
80
|
+
- `knowledge/android/visual-qa.md`
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Android QA and Audit Loop
|
|
2
|
+
|
|
3
|
+
Quality is a loop, not a final step: define → implement → inspect → audit → fix → re-audit → ship. A finding without a re-audit is not closed.
|
|
4
|
+
|
|
5
|
+
## Loop stages
|
|
6
|
+
|
|
7
|
+
| Stage | Evidence |
|
|
8
|
+
|-------|----------|
|
|
9
|
+
| Define | Screen spec with hierarchy, actions and state matrix |
|
|
10
|
+
| Implement | Components with all states and a11y semantics |
|
|
11
|
+
| Inspect | Visual review on the device matrix, light/dark, RTL, 200% text |
|
|
12
|
+
| Audit | Scorecard using `templates/audit-report.md` |
|
|
13
|
+
| Fix | One owner and one concrete change per issue |
|
|
14
|
+
| Re-audit | Same scenario, same device, before/after evidence |
|
|
15
|
+
| Ship | Critical and high issues closed; medium/low tracked |
|
|
16
|
+
|
|
17
|
+
## Severity model
|
|
18
|
+
|
|
19
|
+
| Severity | Definition | Gate |
|
|
20
|
+
|----------|-----------|------|
|
|
21
|
+
| Critical | Blocks the primary goal, loses user data, or violates a11y | Blocks ship |
|
|
22
|
+
| High | Major friction or a missing required state | Blocks ship |
|
|
23
|
+
| Medium | Noticeable inconsistency or polish gap | Tracked with owner |
|
|
24
|
+
| Low | Minor refinement | Backlog |
|
|
25
|
+
|
|
26
|
+
Escalate when the same medium issue appears on multiple core screens.
|
|
27
|
+
|
|
28
|
+
## Audit dimensions
|
|
29
|
+
|
|
30
|
+
1. **Goal and hierarchy** — one primary action, correct first-read order.
|
|
31
|
+
2. **States** — every state in `states-and-recovery.md` present and reachable.
|
|
32
|
+
3. **Platform fit** — back, insets, IME, permissions, Material conventions.
|
|
33
|
+
4. **Accessibility** — TalkBack, focus, labels, 200% text, contrast, reduced motion.
|
|
34
|
+
5. **Performance** — no jank on scroll or navigation; budgets from `performance.md`.
|
|
35
|
+
6. **Visual craft** — spacing rhythm, typography, elevation, no card soup.
|
|
36
|
+
7. **Recovery** — retry, undo, offline and permission paths work.
|
|
37
|
+
|
|
38
|
+
## Test layers
|
|
39
|
+
|
|
40
|
+
| Layer | Tooling | Gate |
|
|
41
|
+
|-------|---------|------|
|
|
42
|
+
| Unit | State logic, formatters, validators | CI |
|
|
43
|
+
| Component | Compose/Espresso assertions with semantics | CI |
|
|
44
|
+
| Golden | Paparazzi / Roborazzi on controlled config | CI |
|
|
45
|
+
| Critical flows | Maestro / Espresso on device lab | Pre-release |
|
|
46
|
+
| Performance | Macrobenchmark on reference device | Pre-release |
|
|
47
|
+
| Manual a11y | TalkBack, font scale, RTL, contrast | Pre-release |
|
|
48
|
+
|
|
49
|
+
## Reporting rules
|
|
50
|
+
|
|
51
|
+
Every finding includes:
|
|
52
|
+
- screen and state,
|
|
53
|
+
- device/configuration (width, font scale, theme, locale),
|
|
54
|
+
- expected vs actual behavior,
|
|
55
|
+
- severity and owner,
|
|
56
|
+
- screenshot or recording,
|
|
57
|
+
- re-audit result.
|
|
58
|
+
|
|
59
|
+
"Looks fine" is not a finding. "Empty state hides the retry action at 200% text on 360dp" is.
|
|
60
|
+
|
|
61
|
+
## Continuous improvement
|
|
62
|
+
|
|
63
|
+
After each release:
|
|
64
|
+
- review crashes, ANRs and support tickets for states that were never designed,
|
|
65
|
+
- add the missing state to the matrix and the audit checklist,
|
|
66
|
+
- convert repeated manual checks into golden or semantic tests,
|
|
67
|
+
- update this corpus when a platform convention changes.
|
|
68
|
+
|
|
69
|
+
## Anti-patterns
|
|
70
|
+
|
|
71
|
+
- Auditing only the happy path.
|
|
72
|
+
- Closing a finding without re-testing.
|
|
73
|
+
- Treating low-severity polish as a ship blocker while ignoring missing error states.
|
|
74
|
+
- Goldens captured on a different device than the review.
|
|
75
|
+
- Skipping RTL and dark theme because "it looked fine in light mode".
|
|
76
|
+
|
|
77
|
+
## Related
|
|
78
|
+
|
|
79
|
+
- `skills/visual-auditor/SKILL.md`
|
|
80
|
+
- `skills/ux-auditor/SKILL.md`
|
|
81
|
+
- `skills/testing-auditor/SKILL.md`
|
|
82
|
+
- `knowledge/android/visual-qa.md`
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Android Adaptive Layouts, Tablets and Foldables
|
|
2
|
+
|
|
3
|
+
Android runs on compact phones, large tablets, ChromeOS and foldables. Share intent and tokens; adapt structure to available space.
|
|
4
|
+
|
|
5
|
+
## Window size classes
|
|
6
|
+
|
|
7
|
+
| Class | Width | Typical layout |
|
|
8
|
+
|-------|-------|----------------|
|
|
9
|
+
| Compact | < 600dp | Phone portrait, single pane, bottom navigation |
|
|
10
|
+
| Medium | 600–840dp | Tablet portrait / large phone landscape, list + detail or rail |
|
|
11
|
+
| Expanded | ≥ 840dp | Tablet landscape, multi-pane with permanent navigation |
|
|
12
|
+
|
|
13
|
+
Use `WindowSizeClass` (width and height independently) rather than device type. A foldable in a folded state is compact; the same device unfolded may be expanded.
|
|
14
|
+
|
|
15
|
+
## Layout adaptations
|
|
16
|
+
|
|
17
|
+
| Change | Guidance |
|
|
18
|
+
|--------|----------|
|
|
19
|
+
| Compact → Medium | Move bottom nav to a rail; show list + detail side by side |
|
|
20
|
+
| Medium → Expanded | Permanent navigation pane; detail keeps its own back stack |
|
|
21
|
+
| Landscape compact | Preserve vertical scrolling; avoid stretching rows full width |
|
|
22
|
+
| Fold / hinge | Keep interactive controls off the hinge area; test both postures |
|
|
23
|
+
| Multi-window | Reflow to available width; never assume full-screen |
|
|
24
|
+
|
|
25
|
+
Structural rules:
|
|
26
|
+
- Define regions (navigation, context header, primary content, persistent actions, overlays) before pixels.
|
|
27
|
+
- Preserve user context across size changes — selection, scroll position and in-progress input survive rotation and folding.
|
|
28
|
+
- A detail pane in two-pane layout still supports a back action for the compact case.
|
|
29
|
+
- Do not simply scale a phone layout up; add columns and reduce vertical repetition.
|
|
30
|
+
|
|
31
|
+
## Navigation by size
|
|
32
|
+
|
|
33
|
+
| Class | Navigation |
|
|
34
|
+
|-------|------------|
|
|
35
|
+
| Compact | Bottom navigation (3–5 destinations), drawers for deeper structure |
|
|
36
|
+
| Medium | Navigation rail or drawer |
|
|
37
|
+
| Expanded | Permanent navigation drawer / rail with labeled destinations |
|
|
38
|
+
|
|
39
|
+
Keep destination order stable across sizes so muscle memory transfers.
|
|
40
|
+
|
|
41
|
+
## Content density
|
|
42
|
+
|
|
43
|
+
- Increase column count before increasing font size.
|
|
44
|
+
- Cap content width for readability on expanded screens.
|
|
45
|
+
- Use whitespace to group related regions; do not fill every available pixel.
|
|
46
|
+
- Sheets on expanded screens may become side panels; preserve dismiss behavior and focus handling.
|
|
47
|
+
|
|
48
|
+
## State continuity
|
|
49
|
+
|
|
50
|
+
- Save scroll position, selection and form drafts across configuration changes (`rememberSaveable`, ViewModel).
|
|
51
|
+
- Re-evaluate window size on rotation, folding and multi-window resize.
|
|
52
|
+
- If a pane disappears, move its content to the next logical surface rather than dropping it.
|
|
53
|
+
|
|
54
|
+
## Platform notes (iOS → Android)
|
|
55
|
+
|
|
56
|
+
| iOS | Android |
|
|
57
|
+
|-----|---------|
|
|
58
|
+
| Regular/compact size classes | WindowSizeClass (compact/medium/expanded) |
|
|
59
|
+
| Split view | List-detail scaffold / two-pane layout |
|
|
60
|
+
| Tab bar | Bottom navigation → rail → drawer |
|
|
61
|
+
| iPad slide-over | Multi-window / activity embedding |
|
|
62
|
+
| Safe area insets | WindowInsets for system bars and cutouts |
|
|
63
|
+
|
|
64
|
+
## Accessibility and testing
|
|
65
|
+
|
|
66
|
+
- Test at 200% font scaling on compact width — the most constrained combination.
|
|
67
|
+
- Verify TalkBack traversal with two panes; focus order must be predictable.
|
|
68
|
+
- Test fold/unfold, rotation, and split-screen with an in-progress form.
|
|
69
|
+
- Check that no control is obscured by system bars, cutouts or the hinge.
|
|
70
|
+
|
|
71
|
+
## Anti-patterns
|
|
72
|
+
|
|
73
|
+
- Phone layout stretched to tablet width.
|
|
74
|
+
- Different destination ordering by window size.
|
|
75
|
+
- Losing input on rotation.
|
|
76
|
+
- Hinge area containing the primary action.
|
|
77
|
+
- Treating all tablets as expanded.
|
|
78
|
+
|
|
79
|
+
## Related skills
|
|
80
|
+
|
|
81
|
+
- `skills/ui-architect/SKILL.md`
|
|
82
|
+
- `skills/screen-designer/SKILL.md`
|
|
83
|
+
- `skills/platform-specialist/SKILL.md`
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Android Forms and Input
|
|
2
|
+
|
|
3
|
+
Forms on Android must work with the system keyboard, autofill, IME actions and TalkBack. Design for error recovery, not just data entry.
|
|
4
|
+
|
|
5
|
+
## Field anatomy
|
|
6
|
+
|
|
7
|
+
| Element | Requirement |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| Label | Visible (floating or persistent); never placeholder-only |
|
|
10
|
+
| Input | 48dp minimum height, 16sp text to avoid zoom on focus |
|
|
11
|
+
| Helper text | Persistent, 12sp, below field |
|
|
12
|
+
| Error | Inline below field + accessible announcement; never color-only |
|
|
13
|
+
| Counter | Right-aligned when a limit exists |
|
|
14
|
+
| Leading/trailing icon | Decorative unless it has a defined action |
|
|
15
|
+
|
|
16
|
+
Text fields in Material 3: filled and outlined. Choose one style per form; do not mix.
|
|
17
|
+
|
|
18
|
+
## Keyboard and IME
|
|
19
|
+
|
|
20
|
+
| Field type | Keyboard | IME action |
|
|
21
|
+
|------------|----------|------------|
|
|
22
|
+
| Name | Text | Next |
|
|
23
|
+
| Email | Email | Next |
|
|
24
|
+
| Password | Text (password) | Done / Next |
|
|
25
|
+
| Search | Search | Search |
|
|
26
|
+
| Number | Numeric | Done |
|
|
27
|
+
| Phone | Phone | Done |
|
|
28
|
+
| Multiline note | Text | Newline |
|
|
29
|
+
|
|
30
|
+
- Set `imeAction` and `keyboardType` explicitly; never rely on the default.
|
|
31
|
+
- Set `autofill` hints (`username`, `newPassword`, `emailAddress`, `postalAddress`) so Autofill and password managers work.
|
|
32
|
+
- Respect `imePadding` / `imeVisible` so fields are never hidden behind the keyboard.
|
|
33
|
+
- Scroll the focused field into view; preserve focus across recomposition and rotation.
|
|
34
|
+
|
|
35
|
+
## Validation strategy
|
|
36
|
+
|
|
37
|
+
| When | Behavior |
|
|
38
|
+
|------|----------|
|
|
39
|
+
| While typing | No hard error; update helper text only if it helps |
|
|
40
|
+
| On blur / IME Next | Validate that field; show inline error |
|
|
41
|
+
| On submit | Validate all; announce count and move focus to first error |
|
|
42
|
+
| After correction | Clear error as soon as it is valid; announce resolution |
|
|
43
|
+
|
|
44
|
+
Rules:
|
|
45
|
+
- Error text says **what is wrong and how to fix it** ("Enter an email in the format name@example.com").
|
|
46
|
+
- Keep entered text on failure; never clear the form.
|
|
47
|
+
- Disable submit only when the form is undeniably invalid; prefer letting the user submit and receive clear guidance.
|
|
48
|
+
- For server errors, map field-level errors back to the exact fields and keep non-failing fields intact.
|
|
49
|
+
|
|
50
|
+
## Required states
|
|
51
|
+
|
|
52
|
+
| State | Visual | Recovery |
|
|
53
|
+
|-------|--------|----------|
|
|
54
|
+
| Idle | Label + helper | — |
|
|
55
|
+
| Focused | Indicator emphasis, keyboard | — |
|
|
56
|
+
| Error | Error indicator + text + icon | Fix inline |
|
|
57
|
+
| Disabled | Reduced opacity, no focus | Explain why nearby |
|
|
58
|
+
| Loading (submit) | Button spinner, fields immutable | Wait or cancel |
|
|
59
|
+
| Success | Confirmation / navigation | Snackbar with undo where possible |
|
|
60
|
+
| Offline | Banner, queued draft | Retry when connected |
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
|
|
64
|
+
- Every field has an associated label; TalkBack announces label, type, value and error.
|
|
65
|
+
- Announce validation results with `liveRegion` / `announceForAccessibility`, not with color alone.
|
|
66
|
+
- Touch targets ≥ 48dp; error icon has no conflicting click action.
|
|
67
|
+
- Password visibility toggle has an explicit label ("Show password" / "Hide password").
|
|
68
|
+
- Test with TalkBack, 200% font scaling and external keyboard.
|
|
69
|
+
|
|
70
|
+
## Platform notes (iOS → Android)
|
|
71
|
+
|
|
72
|
+
| iOS | Android |
|
|
73
|
+
|-----|---------|
|
|
74
|
+
| Return key customization | IME action (`Next`, `Done`, `Search`) |
|
|
75
|
+
| Text field borders | Underline indicator or outlined box |
|
|
76
|
+
| Secure entry toggle | Password visual transformation + explicit toggle |
|
|
77
|
+
| Input accessory view | IME action bar / keyboard toolbar |
|
|
78
|
+
| Keyboard dismiss on scroll | `imePadding`, focus manager `clearFocus` |
|
|
79
|
+
|
|
80
|
+
## Anti-patterns
|
|
81
|
+
|
|
82
|
+
- Placeholder-only labels.
|
|
83
|
+
- Numeric keyboard for non-numeric content.
|
|
84
|
+
- Errors shown only as a red border.
|
|
85
|
+
- Blocking the whole form for one invalid field.
|
|
86
|
+
- Losing draft text on rotation or backgrounding.
|
|
87
|
+
|
|
88
|
+
## Related skills
|
|
89
|
+
|
|
90
|
+
- `skills/forms-engineer/SKILL.md`
|
|
91
|
+
- `skills/accessibility-engineer/SKILL.md`
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Android Gestures and System Navigation
|
|
2
|
+
|
|
3
|
+
Android gestures are owned jointly by the system and the app. System navigation always wins; app gestures must stay out of its reserved edges.
|
|
4
|
+
|
|
5
|
+
## System navigation
|
|
6
|
+
|
|
7
|
+
| Behavior | Requirement |
|
|
8
|
+
|----------|-------------|
|
|
9
|
+
| Back | Follows the task stack; never intercept without a clear reason |
|
|
10
|
+
| Predictive back | Show the system-driven preview; app-specific animations must be compatible |
|
|
11
|
+
| Home / Recents | Never intercepted |
|
|
12
|
+
| Edge-to-edge | Draw behind system bars; use `WindowInsets` to pad interactive content |
|
|
13
|
+
| Gesture nav bar | Respect the bottom inset; never place fixed actions under it |
|
|
14
|
+
|
|
15
|
+
Intercept back only for in-app navigation that has a meaningful intermediate state:
|
|
16
|
+
- collapse a sheet before closing it
|
|
17
|
+
- exit selection mode before leaving the screen
|
|
18
|
+
- leave a search in active state before returning to the list
|
|
19
|
+
|
|
20
|
+
Never use back to close a dialog the system already dismissed, and never trap the user on a screen.
|
|
21
|
+
|
|
22
|
+
## Common app gestures
|
|
23
|
+
|
|
24
|
+
| Gesture | Use | Alternative affordance |
|
|
25
|
+
|---------|-----|------------------------|
|
|
26
|
+
| Swipe down | Dismiss sheet, refresh list | Close button, refresh action |
|
|
27
|
+
| Swipe left/right on row | Safe action + destructive action | Overflow menu |
|
|
28
|
+
| Long press | Selection or context | Context menu / accessibility action |
|
|
29
|
+
| Pinch zoom | Media and maps | Zoom controls |
|
|
30
|
+
| Drag | Reorder, move | Move up/down accessibility actions |
|
|
31
|
+
| Horizontal swipe between tabs | Adjacent sibling pages only | Tabs remain tappable |
|
|
32
|
+
|
|
33
|
+
Rules:
|
|
34
|
+
- One gesture per direction per surface; no conflicting handlers.
|
|
35
|
+
- A gesture must never be the only way to reach a destructive action.
|
|
36
|
+
- Show a visual affordance (handle, hint, partial reveal) on first use.
|
|
37
|
+
- Cancel cleanly when the gesture is interrupted by scrolling or system UI.
|
|
38
|
+
|
|
39
|
+
## Haptics and feedback
|
|
40
|
+
|
|
41
|
+
- Use short, subtle haptics for confirmations of direct manipulation (toggle, completed drag).
|
|
42
|
+
- Do not vibrate on every tap, scroll tick or error.
|
|
43
|
+
- Pair gesture completion with a visible state change; haptics alone are not feedback.
|
|
44
|
+
- Respect device settings and avoid repeated patterns that drain battery.
|
|
45
|
+
|
|
46
|
+
## Touch targets
|
|
47
|
+
|
|
48
|
+
- Minimum **48dp × 48dp** for interactive elements with at least 8dp spacing.
|
|
49
|
+
- Icon buttons smaller than 48dp must have an expanded touch area.
|
|
50
|
+
- Draggable handles need a larger target than visually depicted.
|
|
51
|
+
|
|
52
|
+
## Platform notes (iOS → Android)
|
|
53
|
+
|
|
54
|
+
| iOS | Android |
|
|
55
|
+
|-----|---------|
|
|
56
|
+
| Edge swipe back | Predictive back (system-owned) |
|
|
57
|
+
| Large titles and nav bar | Top app bar + collapsing behavior |
|
|
58
|
+
| Swipe-to-delete | Swipe action + overflow menu |
|
|
59
|
+
| 3D Touch / context menus | Long press + accessibility actions |
|
|
60
|
+
| Home indicator inset | Gesture navigation inset via `WindowInsets` |
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
|
|
64
|
+
- Expose every gesture through an explicit control or custom accessibility action.
|
|
65
|
+
- TalkBack traversal must follow visual reading order, unaffected by gesture handlers.
|
|
66
|
+
- Respect **Remove animations** and reduced-motion settings for gesture-driven transitions.
|
|
67
|
+
- Test with one hand, on a small device, and with TalkBack enabled.
|
|
68
|
+
|
|
69
|
+
## Anti-patterns
|
|
70
|
+
|
|
71
|
+
- Custom back handling that traps navigation.
|
|
72
|
+
- Swipe-only delete or archive.
|
|
73
|
+
- Gestures starting inside the system edge area.
|
|
74
|
+
- Multiple handlers competing on the same axis.
|
|
75
|
+
- No visible result after a completed gesture.
|
|
76
|
+
|
|
77
|
+
## Related skills
|
|
78
|
+
|
|
79
|
+
- `skills/platform-specialist/SKILL.md`
|
|
80
|
+
- `skills/motion-designer/SKILL.md`
|
|
81
|
+
- `skills/accessibility-engineer/SKILL.md`
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Android Lists and Data-Heavy Interfaces
|
|
2
|
+
|
|
3
|
+
Lists must remain smooth, scannable and recoverable at any size. Treat performance and state coverage as part of the layout, not a later optimization.
|
|
4
|
+
|
|
5
|
+
## Choosing the component
|
|
6
|
+
|
|
7
|
+
| Need | Use |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| Simple static list | `LazyColumn` / `LazyRow` (Compose) |
|
|
10
|
+
| Large, paged dataset | Paging 3 with `LazyPagingItems` |
|
|
11
|
+
| Complex recycling / many view types | RecyclerView with ViewHolder |
|
|
12
|
+
| Grouped settings | `LazyColumn` with sticky headers |
|
|
13
|
+
| Two-pane detail | List-detail scaffold on large windows |
|
|
14
|
+
|
|
15
|
+
Never eagerly build all rows into a `Column` for unbounded data.
|
|
16
|
+
|
|
17
|
+
## Row design
|
|
18
|
+
|
|
19
|
+
- Provide a **stable, unique key** (`key = { it.id }`) so scroll position and animations survive updates.
|
|
20
|
+
- Use `contentType` for heterogeneous rows so recycling reuses the right layout.
|
|
21
|
+
- Keep row height predictable; prefer 72dp for two-line rows, 56dp for single-line, 88dp+ for media.
|
|
22
|
+
- Primary content left-aligned, trailing affordances right-aligned; no more than one primary action per row.
|
|
23
|
+
- Reserve space for badges/indicators to avoid layout shifts when data arrives.
|
|
24
|
+
- Use `derivedStateOf` for scroll-derived UI so small scroll deltas do not recompose the whole screen.
|
|
25
|
+
|
|
26
|
+
## Loading patterns
|
|
27
|
+
|
|
28
|
+
| Situation | Pattern |
|
|
29
|
+
|-----------|---------|
|
|
30
|
+
| Initial load | Skeletons matching final row layout and count |
|
|
31
|
+
| Pagination | Footer loading row, never a full-screen blocker |
|
|
32
|
+
| Refresh | Pull-to-refresh with preserved scroll position |
|
|
33
|
+
| Empty | Illustration + explanation + primary action |
|
|
34
|
+
| Error | Inline banner with Retry; keep previously loaded rows |
|
|
35
|
+
| Offline | Cached rows + offline banner + sync indicator |
|
|
36
|
+
| No more data | Quiet end-of-list marker, not a spinner |
|
|
37
|
+
|
|
38
|
+
## Data-heavy affordances
|
|
39
|
+
|
|
40
|
+
| Feature | Guidance |
|
|
41
|
+
|---------|----------|
|
|
42
|
+
| Search | Persistent search field in top bar; keep results filterable |
|
|
43
|
+
| Filters | Chips row or bottom sheet; show active count, allow clear-all |
|
|
44
|
+
| Sorting | Exposed in top bar menu or sheet, never hidden in a long-press |
|
|
45
|
+
| Selection | Enter selection mode with contextual top bar; exit with back |
|
|
46
|
+
| Swipe actions | At most one destructive and one safe action; always offer an accessible alternative |
|
|
47
|
+
| Drag reorder | Provide move-up/move-down accessibility actions |
|
|
48
|
+
| Sticky headers | Use for alphabetical or date grouping; keep one header visible |
|
|
49
|
+
|
|
50
|
+
## Performance budget
|
|
51
|
+
|
|
52
|
+
- First scroll frame < 16.67ms; no jank on fling.
|
|
53
|
+
- Avoid `items` with unstable keys, expensive `measured` work in composition, or image decoding on the main thread.
|
|
54
|
+
- Load images with a caching library and correct `contentScale`; specify aspect ratio to prevent shifts.
|
|
55
|
+
- Prefetch next page before the user reaches the end.
|
|
56
|
+
- Profile with **System Trace / Android Studio Profiler (CPU, frames)** and Compose Recomposition counts.
|
|
57
|
+
|
|
58
|
+
## Accessibility
|
|
59
|
+
|
|
60
|
+
- Each row has one clear label describing its purpose; interactive children have distinct labels.
|
|
61
|
+
- Row content order follows visual order for TalkBack traversal.
|
|
62
|
+
- Swipe actions are also available via a menu or long-press actions.
|
|
63
|
+
- Selected/filtered state is announced, not only colored.
|
|
64
|
+
- Respect 200% text scaling: rows grow and text wraps rather than truncating to nothing.
|
|
65
|
+
|
|
66
|
+
## Platform notes (iOS → Android)
|
|
67
|
+
|
|
68
|
+
| iOS | Android |
|
|
69
|
+
|-----|---------|
|
|
70
|
+
| `UITableView` / `LazyVStack` | `LazyColumn` / RecyclerView |
|
|
71
|
+
| Swipe-to-delete row actions | `SwipeToDismissBox` / `ItemTouchHelper` + menu fallback |
|
|
72
|
+
| Large title collapse | Top app bar scroll behavior |
|
|
73
|
+
| Pull-to-refresh | `PullToRefreshBox` / SwipeRefreshLayout |
|
|
74
|
+
| Indexed list (section index) | Fast scroller with `LazyColumn` |
|
|
75
|
+
|
|
76
|
+
## Anti-patterns
|
|
77
|
+
|
|
78
|
+
- Building all rows eagerly.
|
|
79
|
+
- Spinner replacing the entire list on refresh.
|
|
80
|
+
- Clearing loaded data on error.
|
|
81
|
+
- Multiple competing primary actions in a row.
|
|
82
|
+
- Swipe-only destructive actions.
|
|
83
|
+
|
|
84
|
+
## Related skills
|
|
85
|
+
|
|
86
|
+
- `skills/native-data-fetching/SKILL.md`
|
|
87
|
+
- `skills/performance-engineer/SKILL.md`
|
|
88
|
+
- `skills/accessibility-engineer/SKILL.md`
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Android Motion and Interaction Feedback
|
|
2
|
+
|
|
3
|
+
Motion on Android should explain state change and preserve continuity. Use it for feedback, spatial transitions and hierarchy — never as decoration.
|
|
4
|
+
|
|
5
|
+
## Durations and easing
|
|
6
|
+
|
|
7
|
+
| Purpose | Duration | Easing |
|
|
8
|
+
|---------|----------|--------|
|
|
9
|
+
| Micro feedback (tap, toggle) | 100–150ms | Standard |
|
|
10
|
+
| Local state change (expand, snackbar) | 200–250ms | Standard / Decelerate |
|
|
11
|
+
| Screen transition | 250–300ms | Decelerate (enter), Accelerate (exit) |
|
|
12
|
+
| Shared / container transform | 350–400ms | Emphasized |
|
|
13
|
+
|
|
14
|
+
Material 3 curves:
|
|
15
|
+
- **Standard** `cubic-bezier(0.2, 0, 0, 1)` — most changes
|
|
16
|
+
- **Emphasized** — attention and container transforms; avoid on large or frequent motion
|
|
17
|
+
- **Decelerate** `cubic-bezier(0, 0, 0.2, 1)` — entering
|
|
18
|
+
- **Accelerate** `cubic-bezier(0.4, 0, 1, 1)` — exiting
|
|
19
|
+
|
|
20
|
+
Map durations to `motion.fast`, `motion.standard`, `motion.expressive` tokens. Do not hard-code per screen.
|
|
21
|
+
|
|
22
|
+
## Transition patterns
|
|
23
|
+
|
|
24
|
+
| Situation | Android pattern |
|
|
25
|
+
|-----------|-----------------|
|
|
26
|
+
| Push to detail | Shared axis (Z), slide from end |
|
|
27
|
+
| List → detail | Container transform / shared element |
|
|
28
|
+
| Open filter or short task | Modal bottom sheet slide |
|
|
29
|
+
| Confirm destructive action | Dialog fade + scale, no bounce |
|
|
30
|
+
| Return | Reverse the entry, or system back (predictive back) |
|
|
31
|
+
| Persistent success/failure | Snackbar slide from bottom |
|
|
32
|
+
|
|
33
|
+
Keep direction consistent with navigation meaning: forward moves toward the top/end, back reverses it. Never use the same animation for unrelated state changes.
|
|
34
|
+
|
|
35
|
+
## Reduced motion
|
|
36
|
+
|
|
37
|
+
- Honor `Settings.Global.ANIMATOR_DURATION_SCALE` (Compose: `LocalMotion()` / `MotionDurationScale`).
|
|
38
|
+
- When reduced, replace spatial motion with a crossfade or instant state change; keep the state change perceivable.
|
|
39
|
+
- Never remove feedback entirely — preserve a subtle opacity or color change.
|
|
40
|
+
- Test with **Settings → Accessibility → Remove animations** enabled.
|
|
41
|
+
|
|
42
|
+
## Performance budget
|
|
43
|
+
|
|
44
|
+
- Target **16.67ms per frame** at 60Hz; 8.3ms at 120Hz displays.
|
|
45
|
+
- Animate `translationX/Y`, `scale`, `alpha` and `transform` — avoid animating layout-affecting properties (`width`, `height`, `top`).
|
|
46
|
+
- In Compose, prefer `derivedStateOf` and stable keys in lists; avoid allocations inside recomposition-heavy lambdas.
|
|
47
|
+
- Pause or simplify motion on low-end devices and during battery saver where appropriate.
|
|
48
|
+
|
|
49
|
+
## Platform notes (iOS → Android)
|
|
50
|
+
|
|
51
|
+
| iOS | Android |
|
|
52
|
+
|-----|---------|
|
|
53
|
+
| Spring-based UIKit springs | Physics springs in Compose (`spring()`), standard/interpolated easing for views |
|
|
54
|
+
| Large title collapse on scroll | Collapsing toolbar / top app bar scroll behavior |
|
|
55
|
+
| Sheet detents | Modal bottom sheet with `SkipPartiallyExpanded` where appropriate |
|
|
56
|
+
| Edge swipe back | Predictive back gesture with system-owned progress |
|
|
57
|
+
| Haptic via `UIFeedbackGenerator` | `Vibrator` / `HapticFeedback` — subtle, not repetitive |
|
|
58
|
+
|
|
59
|
+
## Anti-patterns
|
|
60
|
+
|
|
61
|
+
- Bouncing or overshoot on serious confirmations.
|
|
62
|
+
- Motion longer than 400ms for a routine transition.
|
|
63
|
+
- Animating a change the user did not request.
|
|
64
|
+
- Different direction semantics across screens.
|
|
65
|
+
- Ignoring reduced-motion settings.
|
|
66
|
+
|
|
67
|
+
## Related skills
|
|
68
|
+
|
|
69
|
+
- `skills/animation-engineer/SKILL.md`
|
|
70
|
+
- `skills/motion-designer/SKILL.md`
|
|
71
|
+
- `skills/performance-engineer/SKILL.md`
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Android Notifications and Permissions
|
|
2
|
+
|
|
3
|
+
Notifications and permissions are trust boundaries. Ask at the moment of need, explain the benefit, and make the consequence of denial clear.
|
|
4
|
+
|
|
5
|
+
## Runtime permissions
|
|
6
|
+
|
|
7
|
+
| Phase | Requirement |
|
|
8
|
+
|-------|-------------|
|
|
9
|
+
| Before | Explain why the feature needs it, in context |
|
|
10
|
+
| Request | Use the system dialog; one permission group at a time |
|
|
11
|
+
| Granted | Resume the interrupted task immediately |
|
|
12
|
+
| Denied | Explain what is unavailable; offer Open settings, do not re-prompt nagging |
|
|
13
|
+
| Denied permanently | Route to app settings with a short rationale |
|
|
14
|
+
|
|
15
|
+
Rules:
|
|
16
|
+
- Request only permissions the current feature actually uses.
|
|
17
|
+
- Prefer alternatives that avoid permissions (Android Photo Picker instead of storage access; foreground service only when truly needed).
|
|
18
|
+
- Check permission state every time the feature is entered — it can change while the app is backgrounded.
|
|
19
|
+
- Never block the entire app behind a permission that affects one feature.
|
|
20
|
+
- Handle the "Don't ask again" state explicitly.
|
|
21
|
+
|
|
22
|
+
## Notification channels
|
|
23
|
+
|
|
24
|
+
- Android 8+ requires a channel for every notification category.
|
|
25
|
+
- One channel per user-distinguishable category (messages, reminders, downloads) — not one channel for all, and not one per message.
|
|
26
|
+
- Channel name and description are user-facing: state what the notification is and how often it appears.
|
|
27
|
+
- Respect the user's channel settings; do not try to override importance programmatically after creation.
|
|
28
|
+
- Provide an in-app notification settings entry that deep-links to the system channel screen.
|
|
29
|
+
|
|
30
|
+
## Notification content
|
|
31
|
+
|
|
32
|
+
| Element | Guidance |
|
|
33
|
+
|---------|----------|
|
|
34
|
+
| Title | Source or action, not the app name |
|
|
35
|
+
| Text | The specific update; no generic "You have a notification" |
|
|
36
|
+
| Large icon | Sender/avatar where relevant |
|
|
37
|
+
| Actions | 1–3 verbs; use the same labels as in-app actions |
|
|
38
|
+
| Grouping | Stack related messages; provide a summary |
|
|
39
|
+
| Timing | Respect quiet hours / Do Not Disturb; use the correct category |
|
|
40
|
+
|
|
41
|
+
- Tapping a notification restores the exact relevant screen and state (deep link with clear back behavior).
|
|
42
|
+
- Dismissing a notification must not delete underlying data unless the action says so.
|
|
43
|
+
- Never use a notification to replace an in-app state the user will see anyway.
|
|
44
|
+
|
|
45
|
+
## Foreground services
|
|
46
|
+
|
|
47
|
+
- Use only for work the user explicitly started and expects to continue (navigation, active upload, media playback).
|
|
48
|
+
- Show a persistent, informative notification with a stop action.
|
|
49
|
+
- Stop the service when the task completes; never keep it for convenience.
|
|
50
|
+
|
|
51
|
+
## Required states
|
|
52
|
+
|
|
53
|
+
| State | Visual | Recovery |
|
|
54
|
+
|-------|--------|----------|
|
|
55
|
+
| Permission rationale | Inline explanation + Allow | Request system dialog |
|
|
56
|
+
| Denied | Disabled feature + reason | Open settings |
|
|
57
|
+
| Revoked while backgrounded | Banner on return | Re-request in context |
|
|
58
|
+
| Notifications off | In-app indicator where relevant | Open notification settings |
|
|
59
|
+
| Notification sent | System tray + in-app mirror if needed | Tap to deep link |
|
|
60
|
+
|
|
61
|
+
## Accessibility
|
|
62
|
+
|
|
63
|
+
- Permission rationale text must be available to TalkBack and not conveyed by icon alone.
|
|
64
|
+
- Notification actions need clear labels; avoid emoji-only content.
|
|
65
|
+
- Do not rely on sound or vibration as the only signal; support visual and accessibility feedback.
|
|
66
|
+
|
|
67
|
+
## Platform notes (iOS → Android)
|
|
68
|
+
|
|
69
|
+
| iOS | Android |
|
|
70
|
+
|-----|---------|
|
|
71
|
+
| Permission prompt strings | Runtime permission + rationale flow |
|
|
72
|
+
| Notification categories | Notification channels (immutable importance) |
|
|
73
|
+
| APNs payload | FCM data/notification payload |
|
|
74
|
+
| Settings deep link | `ACTION_APPLICATION_DETAILS_SETTINGS` / channel settings |
|
|
75
|
+
| Background modes | Foreground service with visible notification |
|
|
76
|
+
|
|
77
|
+
## Anti-patterns
|
|
78
|
+
|
|
79
|
+
- Requesting all permissions at first launch.
|
|
80
|
+
- One generic notification channel.
|
|
81
|
+
- Re-prompting immediately after denial.
|
|
82
|
+
- Notification that only says "Open the app".
|
|
83
|
+
- Foreground service without a visible, accurate notification.
|
|
84
|
+
|
|
85
|
+
## Related skills
|
|
86
|
+
|
|
87
|
+
- `skills/security-engineer/SKILL.md`
|
|
88
|
+
- `skills/accessibility-engineer/SKILL.md`
|
|
89
|
+
- `skills/platform-specialist/SKILL.md`
|