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​

Cabin does not replace car-ui-lib. Adopt beside it (ADR 0005).

LegacyCabin
Vendor status layoutsStatus bars
car-ui-lib ToolbarCabin TopBar / System Bar slots (Views subset); keep Toolbar where GAS apps require it
CarUiRecyclerView + CarUiListItemCabin PagedList / ListItem scaffolds; keep car-ui-lib lists until craft lands
PreferenceFragment / Car UI preferencesCabin Preference / PreferenceScaffold (Views subset for Settings)
FocusParkingView / FocusAreaKeep car-ui-lib rotary host; Cabin FocusArea is a thin chrome helper
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