Replace global search context menu option with share target

(cherry picked from commit d11c72fd48)

# Conflicts:
#	app/src/main/res/values/strings.xml
This commit is contained in:
arkon
2021-01-03 11:08:23 -05:00
committed by Jobobby04
parent 74dc7a645d
commit 68f209b91b
3 changed files with 4 additions and 7 deletions
@@ -306,12 +306,12 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
setSelectedNavItem(R.id.nav_more)
router.pushController(RouterTransaction.with(DownloadController()))
}
Intent.ACTION_SEARCH, Intent.ACTION_PROCESS_TEXT, "com.google.android.gms.actions.SEARCH_ACTION" -> {
Intent.ACTION_SEARCH, Intent.ACTION_SEND, "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) ?: intent.getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT)?.toString()
val query = intent.getStringExtra(SearchManager.QUERY) ?: intent.getStringExtra(Intent.EXTRA_TEXT)
if (query != null && query.isNotEmpty()) {
if (router.backstackSize > 1) {
router.popToRoot()