Clean out search intents from main activity

pull/3117/head
Jay 4 years ago
parent fb5b14dd8a
commit 7e32428dcc

@ -414,34 +414,6 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
controller?.showSheet()
}
}
Intent.ACTION_SEARCH, "com.google.android.gms.actions.SEARCH_ACTION" -> {
// If the intent match the "standard" Android search intent
// or the Google-specific search intent (triggered by saying or typing "search *query* on *Tachiyomi*" in Google Search/Google Assistant)
// Get the search query provided in extras, and if not null, perform a global search with it.
val query = intent.getStringExtra(SearchManager.QUERY)
if (query != null && query.isNotEmpty()) {
if (router.backstackSize > 1) {
router.popToRoot()
}
router.pushController(SourceSearchController(query).withFadeTransaction())
}
}
INTENT_SEARCH -> {
val query = intent.getStringExtra(INTENT_SEARCH_QUERY)
val filter = intent.getStringExtra(INTENT_SEARCH_FILTER)
if (query != null && query.isNotEmpty()) {
if (router.backstackSize > 1) {
router.popToRoot()
}
router.pushController(
SourceSearchController(
query,
filter
).withFadeTransaction()
)
}
}
else -> return false
}
return true

Loading…
Cancel
Save