Grid buttons and list rows on one CarPlay or Android Auto screen

2 hours ago

Version 0.9.0 of react-native-auto-play puts grid buttons and list rows on one CarPlay or Android Auto screen. Here it is on CarPlay: parking, food and chargers as a grid, with a list underneath. This release also fixes a CarPlay navigation crash, and it moves one map option.

Ask about this presentation

Chapters

  1. 0:00Grids and lists on one car screen
  2. 0:20SectionedItemTemplate
  3. 0:37How each car draws it
  4. 0:55CarPlay panel options
  5. 1:16CarPlay crash fix
  6. 1:39Maneuvers and map gestures
  7. 2:00Breaking: mapConfig.android.headerActions
  8. 2:20Other breaking changes
  9. 2:39Upgrading to 0.9.0
Show transcript
  1. Version 0.9.0 of react-native-auto-play puts grid buttons and list rows on one CarPlay or Android Auto screen. Here it is on CarPlay: parking, food and chargers as a grid, with a list underneath. This release also fixes a CarPlay navigation crash, and it moves one map option.

    Slide text
    @iternio/react-native-auto-play 0.8.1 → 0.9.0

    Grid buttons and list rows on one CarPlay or Android Auto screen

    New in 0.9.0: SectionedItemTemplate, a CarPlay crash fix, and one map option that moved.

    CarPlay screen with a grid of category buttons above a list section
  2. The new template is called SectionedItemTemplate. Each section is either a grid of buttons or a list of rows, in any order, and updateSections changes them later. On Android Auto with Car API 8 or newer, it becomes the native sectioned template.

    Slide text
    @iternio/react-native-auto-play added

    Mix grid and list sections in any order

    new SectionedItemTemplate({
      title: { text: 'sectioned items' },
      sections: [
        { type: 'grid',
          title: 'categories',
          buttons },
        { type: 'default',
          title: 'list',
          items },
      ],
    });
    
    template.updateSections(
      getSections(nextState));
    Android Auto desktop head unit showing a grid section and a list section in one template

    Android Auto, Car API 8+: the native sectioned template. Older hosts get a sectioned list.

    src/templates/SectionedItemTemplate.ts
  3. Each platform draws the grid its own way. Older Android hosts get one list row per button, and before iOS 26, CarPlay shows a single line of buttons and drops the rest. On the map, this template crashes Android Auto, so the library swaps in a grid or a list instead.

    Slide text
    @iternio/react-native-auto-play added

    Each car draws the grid section its own way

    HostGrid section becomes
    Android, Car API 8+a native grid section
    Android, below 8one list row per button
    iOS 26+an image row that wraps
    iOS below 26one line of images, extras dropped

    Radio sections are not supported in this template.

    Android Auto with mapConfig: the grid buttons shown as list rows on a panel over the map

    On the map, Android Auto gets a grid template for a single grid section, otherwise list rows.

    Android Auto crash on the map: issuetracker.google.com/issues/572287914
  4. On iOS 27, a template with a map config opens as a panel over the map. showCloseButton adds CarPlay's own close button to the first panel. primaryAction and secondaryAction add buttons along the bottom, though on the iOS 27 beta the icon-only button doesn't respond to taps.

    Slide text
    @iternio/react-native-auto-play added · iOS 27+
    CarPlay on iOS 27: the sectioned template as a panel over the map

    CarPlay panels can show a close button and bottom buttons

    mapConfig: {
      ios: {
        showCloseButton: true,
        primaryAction,   // TextButton
        secondaryAction, // ImageButton
      },
    }
    Close button: first panel only. Bottom buttons: list, grid, sectioned item templates.
  5. The biggest fix is a CarPlay crash. Two quick startNavigation calls finished the first session before CarPlay had confirmed it, and the app crashed. Now back-to-back starts collapse to the last trip, and a session lives at least 300 milliseconds. If CarPlay reconnects mid-session, the library ends that session without telling your JavaScript, so start navigation again after didConnect.

    Slide text
    @iternio/react-native-auto-play fixed · iOS

    Back-to-back navigation starts no longer crash CarPlay

    0.8.1
    startNavigation(A) → startNavigation(B) → “navigation session already active”
    0.9.0
    startNavigation(A) → startNavigation(B) → only B starts

    A session lives at least 300 ms before it is replaced.

    CarPlay reconnects with a session running: the library finishes it and JS is not told. Start navigation again after didConnect.

  6. Two more fixes, one on each platform. On CarPlay, the active maneuver stays on the card when only the secondary one changes, and the lane guidance sent to the vehicle follows the current maneuver. On Android Auto, the map behind a map config template now pans and zooms, as long as that template has its own pan button.

    Slide text
    @iternio/react-native-auto-play fixed

    Steadier maneuvers on CarPlay, map gestures behind Android Auto templates

    iOS
    The active maneuver stays put

    A change to only the secondary maneuver keeps the current one on the card.

    Lane guidance sent to the vehicle follows the current maneuver, and clears when it has none.

    Android
    The map behind a mapConfig template pans and zooms

    Gestures reach the root MapTemplate's onDidPan, onClick and zoom callbacks.

    The template needs its own pan button in mapConfig.mapButtons.

  7. Now the migration. In 0.8.1, Android header actions sat in the map config, wrapped in an android key. Now an android key holds the header actions, and the value is the button array itself. The old key is ignored, so without TypeScript the action strip silently disappears.

    Slide text
    @iternio/react-native-auto-play breaking

    Android header actions moved under mapConfig.android

    0.8.1mapConfig: { mapButtons, headerActions: { android: [button] } }
    0.9.0mapConfig: { mapButtons, android: { headerActions: [button] } }

    ListTemplate, GridTemplate, InformationTemplate, MessageTemplate. The old key is ignored: without TypeScript, the action strip silently disappears.

  8. The other breaking changes are smaller. The panel header actions type is gone, so type your map config with MapConfig instead. The panning interface callback lives on the map template only. And the Android car app library moves to 1.8.0-rc01, so align it if your app pins it.

    Slide text
    @iternio/react-native-auto-play breaking

    Two types changed, and Android needs a newer car library

    PanelHeaderActions is removed
    Type mapConfig with MapConfig<T>, or MapConfigWithoutActions<T> for InformationTemplate and MessageTemplate.
    onDidChangePanningInterface is on MapTemplate only
    Removed from NitroBaseMapTemplateConfig. Matters only if you use that exported type.
    androidx.car.app 1.7.0 → 1.8.0-rc01
    For app, app-projected and app-automotive. If your app pins it, align it.
  9. So before you upgrade, move the header actions, swap the removed type, align the car library, and start navigation again after CarPlay connects. That library is a release candidate, so test on the head units you support. Then you get grid buttons and list rows on one CarPlay or Android Auto screen.

    Slide text
    @iternio/react-native-auto-play 0.8.1 → 0.9.0

    Before you upgrade to 0.9.0

    1 Move header actions to mapConfig.android.headerActions
    2 Swap PanelHeaderActions for MapConfig<T>
    3 Align a pinned androidx.car.app with 1.8.0-rc01
    4 On CarPlay, start navigation again after didConnect
    github.com/Iternio-Planning-AB/react-native-auto-play/releases/tag/v0.9.0

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built in New York with ❤️