Clean out search intents from main activity

This commit is contained in:
Jay 2020-04-27 23:15:24 -04:00
parent fb5b14dd8a
commit 7e32428dcc

View file

@ -414,34 +414,6 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
controller?.showSheet() 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 else -> return false
} }
return true return true