feat(widget): Migrate from RemoteViews to Jetpack Glance

Replace the legacy AppWidgetProvider/RemoteViews implementation with Glance AppWidget for reactive updates, proper centering, and a unified render state model.

- Add BatteryGlanceWidget with collectAsState for live device/profile/upgrade data

- Add WidgetRenderState sealed class and WidgetRenderStateMapper

- Add GlanceWidgetContent (Glance composables) and ComposeWidgetPreview (config preview)

- Fix centering by passing spacing via modifier param (no trailing padding on last item)

- Remove old XML widget layouts and RemoteViews rendering code
This commit is contained in:
darken
2026-03-01 15:56:43 +01:00
committed by Matthias Urhahn
parent 4db2edd29a
commit c103c6adc9
23 changed files with 1063 additions and 1175 deletions
+5
View File
@@ -130,6 +130,11 @@ fun DependencyHandlerScope.addSerialization() {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.Serialization.core}")
}
fun DependencyHandlerScope.addGlance() {
implementation("androidx.glance:glance-appwidget:${Versions.Glance.core}")
implementation("androidx.glance:glance-material3:${Versions.Glance.core}")
}
fun DependencyHandlerScope.addTesting() {
testImplementation("junit:junit:4.13.2")
+4
View File
@@ -22,6 +22,10 @@ object Versions {
const val core = "1.0.0"
}
object Glance {
const val core = "1.2.0-rc01"
}
object Serialization {
const val core = "1.9.0"
}