Эх сурвалжийг харах

Fix keyboard inadvertently opening when returning to app (#128)

Co-authored-by: Joshua Kuestersteffen <jkuester@kuester7.com>
Hayri Bakici 2 жил өмнө
parent
commit
73ad9b23a1

+ 7 - 6
app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt

@@ -197,12 +197,13 @@ class HomeFragment : BaseFragment(), OnLaunchAppListener {
 
                     motionLayout?.endState -> {
                         // Check for preferences to open the keyboard
-                        unlauncherDataSource.corePreferencesRepo.liveData().observe(viewLifecycleOwner) {
-                            if (it.activateKeyboardInDrawer) {
-                                // show the keyboard and set focus to the EditText when swiping down
-                                inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0)
-                                app_drawer_edit_text.requestFocus()
-                            }
+                        if (unlauncherDataSource.corePreferencesRepo.get().activateKeyboardInDrawer) {
+                            app_drawer_edit_text.requestFocus()
+                            // show the keyboard and set focus to the EditText when swiping down
+                            inputMethodManager.showSoftInput(
+                                app_drawer_edit_text,
+                                InputMethodManager.SHOW_IMPLICIT
+                            )
                         }
                     }
                 }