From 4809d06d042f0f7758b801deed0d077f820f119c Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 11 Jul 2020 23:08:39 -0400 Subject: [PATCH] Speed up controller fade and tab expansion animations --- .../tachiyomi/ui/base/controller/ConductorExtensions.kt | 6 +++--- .../main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/main/ViewHeightAnimator.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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 ef42399129..7efc823b5c 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(): RouterTransaction { +fun Controller.withFadeTransaction(duration: Long = 150L): RouterTransaction { return RouterTransaction.with(this) - .pushChangeHandler(FadeChangeHandler()) - .popChangeHandler(FadeChangeHandler()) + .pushChangeHandler(FadeChangeHandler(duration)) + .popChangeHandler(FadeChangeHandler(duration)) } 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 40bfc48875..05eae5e0a9 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 @@ -315,7 +315,7 @@ class MainActivity : BaseActivity() { } private fun setRoot(controller: Controller, id: Int) { - router.setRoot(controller.withFadeTransaction().tag(id.toString())) + router.setRoot(RouterTransaction.with(controller).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 1b12429e34..e765878899 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 @@ -23,7 +23,7 @@ class ViewHeightAnimator(val view: View) { */ private val animation by lazy { ObjectAnimator.ofInt(this, "height", height).apply { - duration = 300L + duration = 250L interpolator = DecelerateInterpolator() } }