Slide 28
Slide 28 text
修正内容(AndroidViewでの対応)
ViewCompat.setOnApplyWindowInsetsListener(binding.bottomContainer) { view, windowInsets ->
// ナビゲーションバーに取られる高さ
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars())
// IMEに取られる高さ
val ime = windowInsets.getInsets(WindowInsetsCompat.Type.ime())
view.setPadding(
insets.left,
insets.top,
insets.right,
maxOf(insets.bottom, ime.bottom), // どっちかデカい方
)
WindowInsetsCompat.CONSUMED
}