mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
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:
@@ -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")
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user