mapbox / mapbox/mapbox-maps-android

Add Support for MapWithContentTemplate for Android Auto

Open
#2,426 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

android auto auto-triaged feature :green_apple:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## New Feature

Google has introduced a new type of template to use with Android Auto starting with [1.7.0-alpha01](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0-alpha01) of `androidx.car.app` called `MapWithContentTemplate`.
This is a replacement for `RoutePreviewTemplate`, `PlaceListNavigationTemplate`, and `MapTemplate`.
This template allows a Map to be shown with either a `ListTemplate`, `GridTemplate`, `PaneTemplate`, or `MessageTemplate` at the same time, allowing for tasks to be done with fewer steps inside of an Android Auto app.

The `mapboxMapInstaller` does run, and I can see the map when I launch my app, and I can control aspects of the map with code (e.g. flyTo Point I give it), but I am unable to receive any events from the `DefaultMapboxCarMapGestureHandler`. I even tried taking the approach used in [this PR](https://github.com/mapbox/mapbox-maps-android/pull/1682/files#diff-81dd41cd71d9cb9955cef4b62440a599f1f2acf910211d65856acdb7d0ba326e) of overriding the `SurfaceCallback` passed to the Map, and I assume there's probably something that needs to be added for supporting this template since it is brand new.
Currently the `MapboxCarMap` supports `NavigationTemplate`, `RoutePreviewNavigationTemplate`, and `PlaceListNavigationTemplate`, and I think adding support for this type of template would be valuable for apps that aren't specifically Navigation based.

## Why
Since this is a new template being introduced, and it is meant to be a replacement for one of the currently supported templates, I think it would be useful to add support for so Navigation apps update the version of the Car App library they're using, they can make use of this template. Supporting this template would also allow Point of Interest apps to make use of `MapWithContentTemplate` which will allow for different types of Android Auto apps to be built that aren't focused solely on Navigation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining MapboxCarMap support for NavigationTemplate, RoutePreviewNavigationTemplate, and PlaceListNavigationTemplate, then compare the SurfaceCallback approach in the linked PR. Investigate how MapWithContentTemplate affects DefaultMapboxCarMapGestureHandler and the mapboxMapInstaller. Done means the new template displays the map and delivers map gesture events.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.