Merge "Animate out toast elevation" into sc-dev am: f7720a31c3 am: 2f7256dc40
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14687222 Change-Id: I283b989b1fca9e9dde9c4d5245f65c15dbf11c76
This commit is contained in:
@@ -76,29 +76,41 @@ class ToastDefaultAnimation {
|
|||||||
}
|
}
|
||||||
val linearInterp = LinearInterpolator()
|
val linearInterp = LinearInterpolator()
|
||||||
val scaleInterp = PathInterpolator(0.3f, 0f, 1f, 1f)
|
val scaleInterp = PathInterpolator(0.3f, 0f, 1f, 1f)
|
||||||
val sX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.9f).apply {
|
val viewScaleX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.9f).apply {
|
||||||
interpolator = scaleInterp
|
interpolator = scaleInterp
|
||||||
duration = 250
|
duration = 250
|
||||||
}
|
}
|
||||||
val sY = ObjectAnimator.ofFloat(view, "scaleY", 1f, 0.9f).apply {
|
val viewScaleY = ObjectAnimator.ofFloat(view, "scaleY", 1f, 0.9f).apply {
|
||||||
interpolator = scaleInterp
|
interpolator = scaleInterp
|
||||||
duration = 250
|
duration = 250
|
||||||
}
|
}
|
||||||
val vA = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f).apply {
|
val viewElevation = ObjectAnimator.ofFloat(view, "elevation",
|
||||||
|
view.elevation, 0f).apply {
|
||||||
|
interpolator = linearInterp
|
||||||
|
duration = 40
|
||||||
|
startDelay = 150
|
||||||
|
}
|
||||||
|
val viewAlpha = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f).apply {
|
||||||
interpolator = linearInterp
|
interpolator = linearInterp
|
||||||
duration = 100
|
duration = 100
|
||||||
startDelay = 150
|
startDelay = 150
|
||||||
}
|
}
|
||||||
val tA = ObjectAnimator.ofFloat(text, "alpha", 1f, 0f).apply {
|
val textAlpha = ObjectAnimator.ofFloat(text, "alpha", 1f, 0f).apply {
|
||||||
interpolator = linearInterp
|
interpolator = linearInterp
|
||||||
duration = 166
|
duration = 166
|
||||||
}
|
}
|
||||||
val iA = ObjectAnimator.ofFloat(icon, "alpha", 1f, 0f).apply {
|
val iconAlpha = ObjectAnimator.ofFloat(icon, "alpha", 1f, 0f).apply {
|
||||||
interpolator = linearInterp
|
interpolator = linearInterp
|
||||||
duration = 166
|
duration = 166
|
||||||
}
|
}
|
||||||
return AnimatorSet().apply {
|
return AnimatorSet().apply {
|
||||||
playTogether(sX, sY, vA, tA, iA)
|
playTogether(
|
||||||
|
viewScaleX,
|
||||||
|
viewScaleY,
|
||||||
|
viewElevation,
|
||||||
|
viewAlpha,
|
||||||
|
textAlpha,
|
||||||
|
iconAlpha)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user