From 26578052f1b501eef70919b0b4479306d59cfab3 Mon Sep 17 00:00:00 2001
From: cddu33 <59371705+cddu33@users.noreply.github.com>
Date: Thu, 16 Apr 2026 00:05:20 +0200
Subject: [PATCH 01/49] Add Favorite on android automotive (#1)
---
.idea/markdown.xml | 8 +
.../util/vehicle/TemplateComponents.kt | 30 +++
.../android/vehicle/DomainListScreen.kt | 17 +-
.../android/vehicle/MainVehicleScreen.kt | 17 +-
.../vehicle/ManageFavoritesVehicleScreen.kt | 193 ++++++++++++++++++
common/src/main/res/values/strings.xml | 5 +
6 files changed, 266 insertions(+), 4 deletions(-)
create mode 100644 .idea/markdown.xml
create mode 100644 app/src/main/kotlin/io/homeassistant/companion/android/vehicle/ManageFavoritesVehicleScreen.kt
diff --git a/.idea/markdown.xml b/.idea/markdown.xml
new file mode 100644
index 00000000000..c61ea3346e8
--- /dev/null
+++ b/.idea/markdown.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/TemplateComponents.kt b/app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/TemplateComponents.kt
index 19bbc15b345..6ceb8c7716f 100755
--- a/app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/TemplateComponents.kt
+++ b/app/src/main/kotlin/io/homeassistant/companion/android/util/vehicle/TemplateComponents.kt
@@ -28,6 +28,7 @@ import io.homeassistant.companion.android.util.RegistriesDataHandler
import io.homeassistant.companion.android.vehicle.ChangeServerScreen
import io.homeassistant.companion.android.vehicle.DomainListScreen
import io.homeassistant.companion.android.vehicle.EntityGridVehicleScreen
+import io.homeassistant.companion.android.vehicle.ManageFavoritesVehicleScreen
import io.homeassistant.companion.android.vehicle.MapVehicleScreen
import java.time.LocalDateTime
import java.util.Locale
@@ -256,3 +257,32 @@ fun getDomainsGridItem(
}
}
}
+
+/**
+ * Creates a header [Action] that opens the [ManageFavoritesVehicleScreen], allowing the user
+ * to add or remove entities from the automotive favorites list. Intended for use in the header
+ * of automotive screens when the vehicle is parked.
+ */
+@RequiresApi(Build.VERSION_CODES.O)
+fun getManageFavoritesAction(
+ carContext: CarContext,
+ screenManager: ScreenManager,
+ serverId: StateFlow,
+ allEntities: Flow