From 942ff82382688751ea90705ff6d140b431041dc5 Mon Sep 17 00:00:00 2001 From: Kavish Devar Date: Fri, 10 Oct 2025 20:44:42 +0530 Subject: [PATCH] android: update animation time on switch tap --- .../me/kavishdevar/librepods/composables/StyledSwitch.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/me/kavishdevar/librepods/composables/StyledSwitch.kt b/android/app/src/main/java/me/kavishdevar/librepods/composables/StyledSwitch.kt index 7250568..621a4d3 100644 --- a/android/app/src/main/java/me/kavishdevar/librepods/composables/StyledSwitch.kt +++ b/android/app/src/main/java/me/kavishdevar/librepods/composables/StyledSwitch.kt @@ -120,9 +120,10 @@ fun StyledSwitch( val targetFrac = if (checked) 1f else 0f animatedFraction.animateTo(targetFrac, progressAnimationSpec) } + if (progressAnimation.value > 0f) return@coroutineScope launch { - progressAnimation.animateTo(1f, tween(100, easing = FastOutSlowInEasing)) - progressAnimation.animateTo(0f, tween(100, easing = FastOutSlowInEasing)) + progressAnimation.animateTo(1f, tween(175, easing = FastOutSlowInEasing)) + progressAnimation.animateTo(0f, tween(175, easing = FastOutSlowInEasing)) } } }