diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt index b6a94347a1..aa081c4c26 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.ui.source.browse +import android.app.Activity import android.os.Build import android.os.Bundle import android.view.LayoutInflater @@ -392,6 +393,17 @@ open class BrowseSourceController(bundle: Bundle) : adapter.onLoadMoreComplete(mangas) } + override fun onActivityResumed(activity: Activity) { + super.onActivityResumed(activity) + + val searchItem = (activity as? MainActivity)?.binding?.cardToolbar?.menu?.findItem(R.id.action_search) + val searchView = searchItem?.actionView as? SearchView ?: return + setOnQueryTextChangeListener(searchView, onlyOnSubmit = true, hideKbOnSubmit = false) { + searchWithQuery(it ?: "") + true + } + } + /** * Called from the presenter when the network request fails. *