Change how the bottom navigation is hidden (#5823)

* Change how the bottom navigation is hidden

Modifies the translationY instead of the height.

* Cleanups
This commit is contained in:
Ivan Iskandar
2021-09-17 04:37:17 +07:00
committed by GitHub
parent be001d090c
commit f125ab01ee
7 changed files with 193 additions and 150 deletions

View File

@@ -1,6 +1,7 @@
package eu.kanade.tachiyomi.util.system
import android.content.Context
import android.view.ViewPropertyAnimator
import android.view.animation.Animation
import androidx.constraintlayout.motion.widget.MotionScene.Transition
@@ -14,3 +15,8 @@ fun Transition.applySystemAnimatorScale(context: Context) {
// End layout of cover expanding animation tends to break when the transition is less than ~25ms
this.duration = (this.duration * context.animatorDurationScale).toInt().coerceAtLeast(25)
}
/** Scale the duration of this [ViewPropertyAnimator] by [Context.animatorDurationScale] */
fun ViewPropertyAnimator.applySystemAnimatorScale(context: Context): ViewPropertyAnimator = apply {
this.duration = (this.duration * context.animatorDurationScale).toLong()
}