Created
March 17, 2022 07:25
-
-
Save hiking93/3a138f360a9d137b0bea7279a365347b to your computer and use it in GitHub Desktop.
Return consumed insets in OnApplyWindowInsetsListener#onApplyWindowInsets.
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 systemBarInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) | |
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime()) | |
WindowInsetsCompat.Builder(insets) | |
.setInsets( | |
WindowInsetsCompat.Type.systemBars(), | |
Insets.of(0, 0, 0, systemBarInsets.bottom) | |
) | |
.setInsets( | |
WindowInsetsCompat.Type.ime(), | |
Insets.of(0, 0, 0, imeInsets.bottom) | |
) | |
.build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment