diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt index 4853bb8fe..00679ca68 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt @@ -158,6 +158,7 @@ abstract class BaseSimpleActivity : AppCompatActivity() { hideKeyboard() finish() } + else -> return super.onOptionsItemSelected(item) } return true @@ -228,14 +229,14 @@ abstract class BaseSimpleActivity : AppCompatActivity() { if (navigationBarHeight > 0 || isUsingGestureNavigation()) { window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.addBit(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) updateTopBottomInsets(statusBarHeight, navigationBarHeight) + onApplyWindowInsets { + val insets = it.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.ime()) + updateTopBottomInsets(insets.top, insets.bottom) + } } else { window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.removeBit(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) updateTopBottomInsets(0, 0) } - onApplyWindowInsets { - val insets = it.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.ime()) - updateTopBottomInsets(insets.top, insets.bottom) - } } }