diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt index 7efc823b5c..ef42399129 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt @@ -28,8 +28,8 @@ fun Controller.requestPermissionsSafe(permissions: Array, requestCode: I } } -fun Controller.withFadeTransaction(duration: Long = 150L): RouterTransaction { +fun Controller.withFadeTransaction(): RouterTransaction { return RouterTransaction.with(this) - .pushChangeHandler(FadeChangeHandler(duration)) - .popChangeHandler(FadeChangeHandler(duration)) + .pushChangeHandler(FadeChangeHandler()) + .popChangeHandler(FadeChangeHandler()) } 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 1ce35ab00d..a5829b6a7c 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 @@ -86,7 +86,7 @@ class MainActivity : BaseActivity() { setSupportActionBar(binding.toolbar) - tabAnimator = ViewHeightAnimator(binding.tabs) + tabAnimator = ViewHeightAnimator(binding.tabs, 0L) bottomNavAnimator = ViewHeightAnimator(binding.bottomNav) // Set behavior of bottom nav @@ -312,7 +312,7 @@ class MainActivity : BaseActivity() { } private fun setRoot(controller: Controller, id: Int) { - router.setRoot(RouterTransaction.with(controller).tag(id.toString())) + router.setRoot(controller.withFadeTransaction().tag(id.toString())) } private fun syncActivityViewWithController(to: Controller?, from: Controller? = null) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/ViewHeightAnimator.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/ViewHeightAnimator.kt index e765878899..ce22a9219f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/ViewHeightAnimator.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/ViewHeightAnimator.kt @@ -6,7 +6,7 @@ import android.view.ViewTreeObserver import android.view.animation.DecelerateInterpolator import androidx.annotation.Keep -class ViewHeightAnimator(val view: View) { +class ViewHeightAnimator(val view: View, val duration: Long = 250L) { /** * The default height of the view. It's unknown until the view is layout. @@ -23,7 +23,7 @@ class ViewHeightAnimator(val view: View) { */ private val animation by lazy { ObjectAnimator.ofInt(this, "height", height).apply { - duration = 250L + duration = this@ViewHeightAnimator.duration interpolator = DecelerateInterpolator() } }