From 664f487cd140d567285c479b0c69b084a4c6f2e4 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 5 Jul 2021 13:30:16 -0400 Subject: [PATCH] Move window setSoftInputMode for older devices to change completed instead of started --- .../eu/kanade/tachiyomi/ui/main/MainActivity.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 1dc0e3d35a..f5d82f27b2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -340,6 +340,15 @@ open class MainActivity : BaseActivity(), DownloadServiceLi binding.appBar.y = 0f nav.translationY = 0f 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(), DownloadServiceLi setFloatingToolbar(canShowFloatingToolbar(to)) val onRoot = router.backstackSize == 1 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.cardToolbar.navigationIcon = searchDrawable } else { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { - window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) - } binding.toolbar.navigationIcon = drawerArrow binding.cardToolbar.navigationIcon = drawerArrow }