Move window setSoftInputMode for older devices to change completed instead of started

This commit is contained in:
Jays2Kings 2021-07-05 13:30:16 -04:00
parent 11f05133af
commit 664f487cd1

View File

@ -340,6 +340,15 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
binding.appBar.y = 0f binding.appBar.y = 0f
nav.translationY = 0f nav.translationY = 0f
showDLQueueTutorial() showDLQueueTutorial()
if (router.backstackSize == 1) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && !isPush) {
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
}
} else {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}
}
} }
} }
) )
@ -774,15 +783,9 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
setFloatingToolbar(canShowFloatingToolbar(to)) setFloatingToolbar(canShowFloatingToolbar(to))
val onRoot = router.backstackSize == 1 val onRoot = router.backstackSize == 1
if (onRoot) { if (onRoot) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && !isPush) {
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
}
binding.toolbar.navigationIcon = searchDrawable binding.toolbar.navigationIcon = searchDrawable
binding.cardToolbar.navigationIcon = searchDrawable binding.cardToolbar.navigationIcon = searchDrawable
} else { } else {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}
binding.toolbar.navigationIcon = drawerArrow binding.toolbar.navigationIcon = drawerArrow
binding.cardToolbar.navigationIcon = drawerArrow binding.cardToolbar.navigationIcon = drawerArrow
} }