Last active
March 19, 2020 15:29
-
-
Save fercarcedo/ecef77624cdd3a8af286573e8b0deeaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val inputLayoutMarginBottom = inputLayout.marginBottom | |
val callback = object : WindowInsetsAnimation.Callback(DISPATCH_MODE_STOP) { | |
override fun onProgress(insets: WindowInsets, animations: MutableList<WindowInsetsAnimation>): WindowInsets { | |
inputLayout.updateLayoutParams<ViewGroup.MarginLayoutParams> { | |
updateMargins(bottom = inputLayoutMarginBottom + | |
insets.getInsets(WindowInsets.Type.ime()).bottom) | |
} | |
return insets | |
} | |
} | |
inputLayout.setWindowInsetsAnimationCallback(callback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment