From b88eebe09bbe4e988d70fdfa8c47c72206448a07 Mon Sep 17 00:00:00 2001 From: FX192 <120828496+FX192@users.noreply.github.com> Date: Fri, 23 Oct 2026 16:29:04 +0300 Subject: [PATCH] Inner Gamer: let Compose apply the animator scale once --- app/src/main/java/com/droiddeck/launcher/ui/Theme.kt | 2 +- docs/development/themes.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/Theme.kt b/app/src/main/java/com/droiddeck/launcher/ui/Theme.kt index 24f01b6115..14527f5949 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/Theme.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/Theme.kt @@ -179,7 +179,7 @@ private fun InnerGamerHue(speed: Int) { private fun InnerGamerCycle(speed: Int) { val start = remember { Themes.rgbHue } val hue by rememberInfiniteTransition(label = "innerGamer").animateFloat( - start, start + 360f, infiniteRepeatable(tween(Motion.ms(Themes.rgbCycleMillis(speed)).coerceAtLeast(1), easing = LinearEasing), RepeatMode.Restart), label = "hue", + start, start + 360f, infiniteRepeatable(tween(Themes.rgbCycleMillis(speed).coerceAtLeast(1), easing = LinearEasing), RepeatMode.Restart), label = "hue", ) val stepped = ((hue % 360f) / Themes.RGB_HUE_STEP).toInt() * Themes.RGB_HUE_STEP SideEffect { Themes.moveRgbHue(stepped) } diff --git a/docs/development/themes.md b/docs/development/themes.md index e7855c43f3..4bb122c6f3 100644 --- a/docs/development/themes.md +++ b/docs/development/themes.md @@ -33,7 +33,7 @@ theme while it is chosen. `Themes.innerGamer(hue)` builds the palette for one hue through `ThemeColors.palette`, so button text keeps the same contrast along the gradient at every hue. `DroidDeckTheme` runs one `rememberInfiniteTransition` while Inner Gamer is chosen, so the system's animation clock drives it. -The duration goes through `Motion.ms`, so the colour holds still when animations are off in the app -or in Android's own settings. The hue is written to `Themes.rgbHue` in 3° steps, which restyles the +Compose applies Android's animator scale to it, and the colour holds still when animations are off +in the app (`Motion.scale`) or in Android's own settings. The hue is written to `Themes.rgbHue` in 3° steps, which restyles the app only when the colour visibly moves; a slow cycle costs few recompositions.