mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 21:59:15 +01:00
Use single task activity
This commit is contained in:
parent
0a988d1c69
commit
3533359fae
@ -23,7 +23,7 @@
|
|||||||
android:theme="@style/Theme.Tachiyomi">
|
android:theme="@style/Theme.Tachiyomi">
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.main.MainActivity"
|
android:name=".ui.main.MainActivity"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
@ -167,7 +167,9 @@ class MainActivity : BaseActivity() {
|
|||||||
//Get the search query provided in extras, and if not null, perform a global search with it.
|
//Get the search query provided in extras, and if not null, perform a global search with it.
|
||||||
val query = intent.getStringExtra(SearchManager.QUERY)
|
val query = intent.getStringExtra(SearchManager.QUERY)
|
||||||
if (query != null && !query.isEmpty()) {
|
if (query != null && !query.isEmpty()) {
|
||||||
setSelectedDrawerItem(R.id.nav_drawer_catalogues)
|
if (router.backstackSize > 1) {
|
||||||
|
router.popToRoot()
|
||||||
|
}
|
||||||
router.pushController(CatalogueSearchController(query).withFadeTransaction())
|
router.pushController(CatalogueSearchController(query).withFadeTransaction())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,7 +177,9 @@ class MainActivity : BaseActivity() {
|
|||||||
val query = intent.getStringExtra(INTENT_SEARCH_QUERY)
|
val query = intent.getStringExtra(INTENT_SEARCH_QUERY)
|
||||||
val filter = intent.getStringExtra(INTENT_SEARCH_FILTER)
|
val filter = intent.getStringExtra(INTENT_SEARCH_FILTER)
|
||||||
if (query != null && !query.isEmpty()) {
|
if (query != null && !query.isEmpty()) {
|
||||||
setSelectedDrawerItem(R.id.nav_drawer_catalogues)
|
if (router.backstackSize > 1) {
|
||||||
|
router.popToRoot()
|
||||||
|
}
|
||||||
router.pushController(CatalogueSearchController(query, filter).withFadeTransaction())
|
router.pushController(CatalogueSearchController(query, filter).withFadeTransaction())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user