Skip to main content

Migration

Guidance for migrating from stock Material Design components and default AAOS widgets to Cabin — without a big-bang rewrite.

Strategy

  1. Tokens first — introduce Cabin semantic colors/type beside existing themes; map gradually.
  2. Chrome or one domain — pick system/status or media/HVAC/EV as the pilot.
  3. Compliance wiring — replace ad-hoc UxRestrictions checks with Cabin policies as you touch screens.
  4. Second stack — if you piloted Compose, add Views for system UI (or reverse) using parity fixtures.

From Material (Compose Material3)

Material conceptCabin approach
MaterialThemeCabinTheme (planned)
Color schemeCabin semantic + domain accents
Buttons / listsCabin primitives sized for cabin
Navigation barsSystem bars slots

You may keep Material for non-cabin phone companion apps; do not assume Material sizes meet cabin touch minima.

Incremental pattern

// Planned hybrid during migration
CabinTheme {
// New Cabin media surface
MediaNowPlaying(/* … */)
// Legacy Material dialog still parked-only
}

Wrap edges carefully so compliance locals still apply to Cabin children.

From AAOS / Car UI lib / vendor Views

LegacyCabin
Vendor status layoutsStatus bars
Custom climate ViewGroupsHVAC
One-off touch target dimsToken cabin.size.touch.minimum

Migration tip: introduce CabinComplianceHost at activity/system root, then swap widgets leaf-first or branch-first depending on risk.

Mapping UX restrictions

Replace scattered:

if (uxRestrictions.isRequiresDistractionOptimization) { /* … */ }

with declared interactions and policy checks (driving restrictions). Behavior should become more consistent, not merely relocated.

Risk controls

RiskMitigation
Visual regressionScreenshot parity vs golden before/after
Missed gatingCompliance tests per interaction
APK growthDepend only on needed artifacts (packaging)
System UI crashPrefer Views path; staged rollout flags

Exit criteria for a migrated screen

  • Cabin theme/tokens only (no raw Material cabin sizing)
  • Compliance policy attached
  • Driving substitute verified
  • Day/night verified
  • Dual-stack plan documented if chrome is involved