mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 14:40:06 +08:00
chore: cancel search when return (#465)
Signed-off-by: HystericalDragon <HystericalDragons@proton.me>
This commit is contained in:
parent
857dcaf0d8
commit
bca302de5e
@ -147,6 +147,12 @@ class ConfigurationFragment @JvmOverloads constructor(
|
|||||||
if (searchView != null) {
|
if (searchView != null) {
|
||||||
searchView.setOnQueryTextListener(this)
|
searchView.setOnQueryTextListener(this)
|
||||||
searchView.maxWidth = Int.MAX_VALUE
|
searchView.maxWidth = Int.MAX_VALUE
|
||||||
|
|
||||||
|
searchView.setOnQueryTextFocusChangeListener { _, hasFocus ->
|
||||||
|
if (!hasFocus) {
|
||||||
|
cancelSearch(searchView)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
groupPager = view.findViewById(R.id.group_pager)
|
groupPager = view.findViewById(R.id.group_pager)
|
||||||
@ -1701,4 +1707,9 @@ class ConfigurationFragment @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
private fun cancelSearch(searchView: SearchView) {
|
||||||
|
searchView.onActionViewCollapsed()
|
||||||
|
searchView.clearFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user