Only apply insets when using gesture navigation
This commit is contained in:
parent
11f9bfd8b4
commit
c187d247e7
1 changed files with 5 additions and 4 deletions
|
@ -158,6 +158,7 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
|
||||||
hideKeyboard()
|
hideKeyboard()
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> return super.onOptionsItemSelected(item)
|
else -> return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
@ -228,14 +229,14 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
|
||||||
if (navigationBarHeight > 0 || isUsingGestureNavigation()) {
|
if (navigationBarHeight > 0 || isUsingGestureNavigation()) {
|
||||||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.addBit(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.addBit(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
||||||
updateTopBottomInsets(statusBarHeight, navigationBarHeight)
|
updateTopBottomInsets(statusBarHeight, navigationBarHeight)
|
||||||
|
onApplyWindowInsets {
|
||||||
|
val insets = it.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.ime())
|
||||||
|
updateTopBottomInsets(insets.top, insets.bottom)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.removeBit(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.removeBit(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
|
||||||
updateTopBottomInsets(0, 0)
|
updateTopBottomInsets(0, 0)
|
||||||
}
|
}
|
||||||
onApplyWindowInsets {
|
|
||||||
val insets = it.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.ime())
|
|
||||||
updateTopBottomInsets(insets.top, insets.bottom)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue