Skip to content

Commit 942ff82

Browse files
committed
android: update animation time on switch tap
1 parent 4a135fa commit 942ff82

File tree

1 file changed

+3
-2
lines changed
  • android/app/src/main/java/me/kavishdevar/librepods/composables

1 file changed

+3
-2
lines changed

android/app/src/main/java/me/kavishdevar/librepods/composables/StyledSwitch.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ fun StyledSwitch(
120120
val targetFrac = if (checked) 1f else 0f
121121
animatedFraction.animateTo(targetFrac, progressAnimationSpec)
122122
}
123+
if (progressAnimation.value > 0f) return@coroutineScope
123124
launch {
124-
progressAnimation.animateTo(1f, tween(100, easing = FastOutSlowInEasing))
125-
progressAnimation.animateTo(0f, tween(100, easing = FastOutSlowInEasing))
125+
progressAnimation.animateTo(1f, tween(175, easing = FastOutSlowInEasing))
126+
progressAnimation.animateTo(0f, tween(175, easing = FastOutSlowInEasing))
126127
}
127128
}
128129
}

0 commit comments

Comments
 (0)