From 2f2f59279d828ee689a477104079618d6436827e Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 14 Dec 2022 22:54:51 -0500 Subject: [PATCH] Fix crash if tapping title when opening reader directly --- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 12 ++++++------ .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 7 ------- 2 files changed, 6 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 3323ce4e8b..02a5c57003 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 @@ -114,12 +114,6 @@ class MainActivity : BaseActivity() { private lateinit var navigator: Navigator override fun onCreate(savedInstanceState: Bundle?) { - // Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079 - if (!isTaskRoot) { - finish() - return - } - // Prevent splash screen showing up on configuration changes val splashScreen = if (savedInstanceState == null) installSplashScreen() else null @@ -142,6 +136,12 @@ class MainActivity : BaseActivity() { false } + // Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079 + if (!isTaskRoot) { + finish() + return + } + // Draw edge-to-edge WindowCompat.setDecorFitsSystemWindows(window, false) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index e05f024a8d..4c3aa75507 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -377,13 +377,6 @@ class ReaderActivity : BaseActivity() { return handled || super.dispatchGenericMotionEvent(event) } - private fun buildContainerTransform(entering: Boolean): MaterialContainerTransform { - return MaterialContainerTransform(this, entering).apply { - duration = 350 // ms - addTarget(android.R.id.content) - } - } - /** * Initializes the reader menu. It sets up click listeners and the initial visibility. */