Change DialogLaunchAnimator X-axis interpolator

This dialog changes the interpolator used to animate the X-axis position
of dialogs during the launch animation. This avoid animating the dialog
out of the screen bounds (see b/208241926#comment1).

Bug: 208241926
Test: Manual
Change-Id: Ia5accb747615fcc8410b5c488ff13617556305be
This commit is contained in:
Jordan Demeulenaere
2021-12-02 13:07:43 +01:00
parent 401bc29fac
commit 8c68088b67
2 changed files with 8 additions and 2 deletions

View File

@@ -49,7 +49,13 @@ class DialogLaunchAnimator @JvmOverloads constructor(
) {
private companion object {
private val TIMINGS = ActivityLaunchAnimator.TIMINGS
private val INTERPOLATORS = ActivityLaunchAnimator.INTERPOLATORS
// We use the same interpolator for X and Y axis to make sure the dialog does not move out
// of the screen bounds during the animation.
private val INTERPOLATORS = ActivityLaunchAnimator.INTERPOLATORS.copy(
positionXInterpolator = ActivityLaunchAnimator.INTERPOLATORS.positionInterpolator
)
private val TAG_LAUNCH_ANIMATION_RUNNING = R.id.launch_animation_running
}

View File

@@ -172,7 +172,7 @@ class LaunchAnimator(
)
/** The interpolators used by this animator. */
class Interpolators(
data class Interpolators(
/** The interpolator used for the Y position, width, height and corner radius. */
val positionInterpolator: Interpolator,