Fixed browse source search not working the first time

no idea how it broke but this should fix it all the same
This commit is contained in:
Jays2Kings 2021-07-20 15:22:48 -04:00
parent dd877edb49
commit 2c3a5de679

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.ui.source.browse package eu.kanade.tachiyomi.ui.source.browse
import android.app.Activity
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
@ -392,6 +393,17 @@ open class BrowseSourceController(bundle: Bundle) :
adapter.onLoadMoreComplete(mangas) 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. * Called from the presenter when the network request fails.
* *