Skip to content

Commit

Permalink
Nullify keyboardAnimationListener
Browse files Browse the repository at this point in the history
  • Loading branch information
ASalavei committed Apr 15, 2024
1 parent 41f058d commit 2f9fdde
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ internal class ComposeSceneKeyboardOffsetManager(
keyboardOverlapHeightState.value = currentOverlapHeight.dp
}

fun completeAnimation() {
animationView.removeFromSuperview()
updateAnimationValues(1.0)
}

//attach to root view if needed
if (animationView.superview == null) {
view.addSubview(animationView)
Expand All @@ -205,6 +200,15 @@ internal class ComposeSceneKeyboardOffsetManager(
selector = sel_registerName("animationDidUpdate")
)
keyboardAnimationListener = keyboardDisplayLink

fun completeAnimation() {
animationView.removeFromSuperview()
if (keyboardAnimationListener == keyboardDisplayLink) {
keyboardAnimationListener = null
}
updateAnimationValues(1.0)
}

UIView.animateWithDuration(
duration = duration,
delay = 0.0,
Expand Down

0 comments on commit 2f9fdde

Please sign in to comment.