mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Merge pull request #2619 from gouri-panda/bug/gouri-panda/#2607_search_menu_items_recreates_mulitple_times
#2607 search menu items recreates multiple times
This commit is contained in:
commit
2f6d397e5c
@ -755,8 +755,9 @@ public abstract class CoreReaderFragment extends BaseFragment
|
||||
}
|
||||
return webView;
|
||||
}
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull protected ToolbarScrollingKiwixWebView createWebView(AttributeSet attrs) {
|
||||
if (activityMainRoot != null) {
|
||||
return new ToolbarScrollingKiwixWebView(
|
||||
@ -1228,6 +1229,7 @@ public abstract class CoreReaderFragment extends BaseFragment
|
||||
switch (intent.getAction()) {
|
||||
case Intent.ACTION_PROCESS_TEXT: {
|
||||
goToSearchWithText(intent);
|
||||
intent.setAction(null); // see https://github.com/kiwix/kiwix-android/issues/2607
|
||||
break;
|
||||
}
|
||||
case CoreSearchWidget.TEXT_CLICKED:
|
||||
|
@ -150,7 +150,9 @@ class SearchFragment : BaseFragment() {
|
||||
searchMenuItem.expandActionView()
|
||||
searchView = searchMenuItem.actionView as SearchView
|
||||
searchView.setOnQueryTextListener(SimpleTextListener {
|
||||
searchViewModel.actions.offer(Filter(it))
|
||||
if (it.isNotEmpty()) {
|
||||
searchViewModel.actions.offer(Filter(it))
|
||||
}
|
||||
})
|
||||
searchMenuItem.setOnActionExpandListener(object : OnActionExpandListener {
|
||||
override fun onMenuItemActionExpand(item: MenuItem) = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user