mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 12:47:26 +01:00
Speed up controller fade and tab expansion animations
This commit is contained in:
parent
9f7fda0bc5
commit
4809d06d04
@ -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)
|
||||
.pushChangeHandler(FadeChangeHandler())
|
||||
.popChangeHandler(FadeChangeHandler())
|
||||
.pushChangeHandler(FadeChangeHandler(duration))
|
||||
.popChangeHandler(FadeChangeHandler(duration))
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ class MainActivity : BaseActivity<MainActivityBinding>() {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user