Clear the search when the launcher is left, end keyboard search on dismiss
Some checks failed
Trigger F-Droid repository rebuild / trigger (release) Has been cancelled
Some checks failed
Trigger F-Droid repository rebuild / trigger (release) Has been cancelled
Two fixes on top of the type-to-search feature: - The search no longer survives leaving the launcher. Upstream only resets the search when the launcher was in the background for more than five seconds, so a quick app switch or a fast return from a launched app left the old query on screen. The search page is now always reset, whatever the pause was. - Dismissing the search page ends the keyboard driven search. Without that the flag stayed set, so opening the search later (gesture or search bar) did not focus the text field and the soft keyboard stayed away. Version 1.40.2-typing.2.
This commit is contained in:
@@ -34,8 +34,8 @@ android {
|
||||
applicationId = "de.mm20.launcher2"
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||
versionCode = System.getenv("VERSION_CODE_OVERRIDE")?.toIntOrNull() ?: 2026091000
|
||||
versionName = "1.40.2-typing.1"
|
||||
versionCode = System.getenv("VERSION_CODE_OVERRIDE")?.toIntOrNull() ?: 2026091001
|
||||
versionName = "1.40.2-typing.2"
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
|
||||
|
||||
@@ -1132,7 +1132,9 @@ internal fun LauncherScaffold(
|
||||
} else {
|
||||
activity.onBackPressedDispatcher.onBackPressed()
|
||||
}
|
||||
} else if (activity.pauseTime > 0L && System.currentTimeMillis() - activity.pauseTime > 5000L) {
|
||||
} else if (activity.pauseTime > 0L && (System.currentTimeMillis() - activity.pauseTime > 5000L || state.currentComponent is SearchComponent)) {
|
||||
// The search does not survive leaving the launcher, not even for a short app
|
||||
// switch: coming back should always show a fresh search.
|
||||
if (!state.isLocked) {
|
||||
if (state.currentComponent?.survivesPause != true) {
|
||||
state.reset()
|
||||
|
||||
@@ -115,5 +115,8 @@ internal class SearchComponent(
|
||||
override fun onPreDismiss(state: LauncherScaffoldState) {
|
||||
super.onPreDismiss(state)
|
||||
state.isSearchBarFocused = false
|
||||
// Leaving the search page ends the keyboard driven search, so that opening the search
|
||||
// again focuses the text field as usual.
|
||||
state.isTypingSearch = false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user