From b7d538f7a68075e2ec8ed89e4a51f0b6c3b6e243 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 21 Jan 2020 18:18:33 -0800 Subject: [PATCH] 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 --- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 4 ++-- .../eu/kanade/tachiyomi/ui/main/SearchActivity.kt | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index e1f3a1076f..b2a016c528 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -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) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt index 2fd5019a2b..4edaac16ca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt @@ -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()