Speed up controller fade and tab expansion animations

(cherry picked from commit 4809d06d042f0f7758b801deed0d077f820f119c)
This commit is contained in:
arkon 2020-07-11 23:08:39 -04:00 committed by Jobobby04
parent 7fb197a752
commit 8ab2a823b5
3 changed files with 5 additions and 5 deletions

View File

@ -28,8 +28,8 @@ fun Controller.requestPermissionsSafe(permissions: Array<String>, requestCode: I
} }
} }
fun Controller.withFadeTransaction(): RouterTransaction { fun Controller.withFadeTransaction(duration: Long = 150L): RouterTransaction {
return RouterTransaction.with(this) return RouterTransaction.with(this)
.pushChangeHandler(FadeChangeHandler()) .pushChangeHandler(FadeChangeHandler(duration))
.popChangeHandler(FadeChangeHandler()) .popChangeHandler(FadeChangeHandler(duration))
} }

View File

@ -404,7 +404,7 @@ class MainActivity : BaseActivity<MainActivityBinding>() {
} }
private fun setRoot(controller: Controller, id: Int) { 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) { private fun syncActivityViewWithController(to: Controller?, from: Controller? = null) {

View File

@ -23,7 +23,7 @@ class ViewHeightAnimator(val view: View) {
*/ */
private val animation by lazy { private val animation by lazy {
ObjectAnimator.ofInt(this, "height", height).apply { ObjectAnimator.ofInt(this, "height", height).apply {
duration = 300L duration = 250L
interpolator = DecelerateInterpolator() interpolator = DecelerateInterpolator()
} }
} }