Hide hidden navigation entities in android auto (#4249)

This commit is contained in:
Daniel Shokouhi 2024-03-11 15:22:03 -07:00 committed by GitHub
parent 0e280d727b
commit 3d8bd0151a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -80,7 +80,8 @@ fun getNavigationGridItem(
carContext: CarContext,
screenManager: ScreenManager,
integrationRepository: IntegrationRepository,
allEntities: Flow<Map<String, Entity<*>>>
allEntities: Flow<Map<String, Entity<*>>>,
entityRegistry: List<EntityRegistryResponse>?
): GridItem.Builder {
return GridItem.Builder().apply {
setTitle(carContext.getString(R.string.aa_navigation))
@ -102,7 +103,15 @@ fun getNavigationGridItem(
MapVehicleScreen(
carContext,
integrationRepository,
allEntities.map { it.values.filter { entity -> entity.domain in MAP_DOMAINS } }
allEntities.map {
it.values.filter { entity ->
entity.domain in MAP_DOMAINS &&
RegistriesDataHandler.getHiddenByForEntity(
entity.entityId,
entityRegistry
) == null
}
}
)
)
}

View file

@ -107,7 +107,8 @@ class EntityGridVehicleScreen(
carContext,
screenManager,
integrationRepository,
allEntities
allEntities,
entityRegistry
).build()
)
if (domains.isNotEmpty()) {

View file

@ -157,7 +157,8 @@ class MainVehicleScreen(
carContext,
screenManager,
serverManager.integrationRepository(serverId.value),
allEntities
allEntities,
entityRegistry
).build()
)