mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-10 20:23:18 +02:00
Pressing the nav bar's up button in Search Activity now puts you where you were last in tachi
Or creates a new main activity if it doesnt exist
This commit is contained in:
parent
343fad39b6
commit
b7d538f7a6
@ -139,10 +139,10 @@ open class MainActivity : BaseActivity() {
|
||||
if (trulyGoBack) return
|
||||
|
||||
// Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079
|
||||
/* if (!isTaskRoot) {
|
||||
if (!isTaskRoot) {
|
||||
finish()
|
||||
return
|
||||
}*/
|
||||
}
|
||||
|
||||
setContentView(R.layout.main_activity)
|
||||
|
||||
|
@ -70,9 +70,6 @@ class SearchActivity: MainActivity() {
|
||||
|
||||
tabAnimator = TabsAnimator(sTabs)
|
||||
|
||||
// Set behavior of Navigation drawer
|
||||
//router.setRoot(controller.withFadeTransaction().tag(id.toString()))
|
||||
|
||||
val container: ViewGroup = findViewById(R.id.controller_container)
|
||||
|
||||
val content: LinearLayout = findViewById(R.id.main_content)
|
||||
@ -171,14 +168,7 @@ class SearchActivity: MainActivity() {
|
||||
|
||||
private fun Context.popToRoot() {
|
||||
val intent = Intent(this, MainActivity::class.java).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK or Intent
|
||||
.FLAG_ACTIVITY_REORDER_TO_FRONT
|
||||
|
||||
action = when (preferences.startScreen()) {
|
||||
2 -> SHORTCUT_RECENTLY_READ
|
||||
3 -> SHORTCUT_RECENTLY_UPDATED
|
||||
else -> SHORTCUT_LIBRARY
|
||||
}
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
startActivity(intent)
|
||||
finishAfterTransition()
|
||||
|
Loading…
Reference in New Issue
Block a user