Trouble to animate button with IME on API 29-
Hi folks !
I tried to achieve the same thing that is applied in the ConversationFragment, but unfortunately without success.
For now, I start to integrate the samples Callback as they are. Calling them like that into my fragment :
private fun setupInsetsListeners() {
val deferringInsetsListener = RootViewDeferringInsetsCallback(
persistentInsetTypes = WindowInsetsCompat.Type.navigationBars(),
deferredInsetTypes = WindowInsetsCompat.Type.ime()
)
ViewCompat.setWindowInsetsAnimationCallback(vb.root, deferringInsetsListener)
ViewCompat.setOnApplyWindowInsetsListener(vb.root, deferringInsetsListener)
ViewCompat.setWindowInsetsAnimationCallback(
vb.nextStepButton,
TranslateDeferringInsetsAnimationCallback(
view = vb.nextStepButton,
persistentInsetTypes = WindowInsetsCompat.Type.navigationBars(),
deferredInsetTypes = WindowInsetsCompat.Type.ime(),
dispatchMode = WindowInsetsAnimationCompat.Callback.DISPATCH_MODE_CONTINUE_ON_SUBTREE
)
)
}
The nextStepButton is well animated on API 30 but not on API 29 or 28.
Some debugging let me know that the Impl21OnApplyWindowInsetsListener.onApplyWindowInsets() methods is only called on the root layout thanks to setOnApplyWindowInsetsListener.
Have you an idea on the mis-implementation I've made here ?
Regards, Pierre
Hi @prouland, I have the same problem, do you have the solution? I changed the example moving the editText from the bottom to the top and adding another view to have the animation (a button). Obviously I did setWindowInsetsAnimationCallback for the button, but even if I used the example that didn't work. Maybe I am missing something, but I couldn't find the solution.
Have the same problem. Do you have any suggestions on how to fix it? Or this is a library bug?
Hi @prouland do you have any updates ? Maybe someone know how to fix this problem ?