Improve keyboard hiding animation
This commit is contained in:
@@ -38,7 +38,7 @@ class SearchBarInsetsHandler(private val shiftRange: Float) : WindowInsetsAnimat
|
||||
)
|
||||
}
|
||||
|
||||
fun onAnimationEnd(isSuccess: Boolean) {
|
||||
animationController?.finish(!isSuccess)
|
||||
fun onAnimationEnd() {
|
||||
animationController?.finish(progress.value < 0.5f)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,10 @@ class SearchBarStateHandler(private val launcher: LawnchairLauncher) : StateMana
|
||||
)
|
||||
animation.setFloat(handler.progress, AnimatedFloat.VALUE, 1f, Interpolators.LINEAR)
|
||||
animation.runOnEnd { isSuccess ->
|
||||
handler.onAnimationEnd(isSuccess)
|
||||
cancellationSignal.cancel()
|
||||
if (isSuccess) {
|
||||
handler.onAnimationEnd()
|
||||
cancellationSignal.cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (launcher.isInState(LauncherState.NORMAL) && toState == LauncherState.ALL_APPS) {
|
||||
|
||||
Reference in New Issue
Block a user