Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88719e80 authored by Nishizawa Nobuhiro's avatar Nishizawa Nobuhiro Committed by Michael Bestas
Browse files

Fix unnatural animation while move up "Swipe down to reject"

The animation of "Swipe down to reject" moves unnaturally from third
times at receiving screen. It moves upward suddenly when the third
bounce animation starts. This behavior occurs for "Swipe down to reject"
does not have animation which is moving up in bounce animation. So,
the start position of its animation is not initialized.

This patch adds the animation which is moving up to
"Swipe down to reject".

Test: manual - Check that "Swipe down to reject" moves like the
animation of the first time and second time, it looks naturally.
Bug: 110440654
Google: 707405
Change-Id: Id8eafa2daf1ebb5de10eb3bca42c5d311862558b
parent 89020a60
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -761,20 +761,30 @@ public class FlingUpDownMethod extends AnswerMethod implements OnProgressChanged
    rejectTextShow.setStartDelay(SWIPE_TO_DECLINE_FADE_IN_DELAY_MILLIS);

    // reject hint text translate in
    Animator rejectTextTranslate =
    Animator rejectTextTranslateIn =
        ObjectAnimator.ofFloat(
            swipeToRejectText,
            View.TRANSLATION_Y,
            DpUtil.dpToPx(getContext(), HINT_REJECT_FADE_TRANSLATION_Y_DP),
            0f);
    rejectTextTranslate.setInterpolator(new FastOutSlowInInterpolator());
    rejectTextTranslate.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    rejectTextTranslateIn.setInterpolator(new FastOutSlowInInterpolator());
    rejectTextTranslateIn.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);

    // reject hint text fade out
    Animator rejectTextHide = ObjectAnimator.ofFloat(swipeToRejectText, View.ALPHA, 0f);
    rejectTextHide.setInterpolator(new FastOutLinearInInterpolator());
    rejectTextHide.setDuration(ANIMATE_DURATION_SHORT_MILLIS);

    // reject hint text translate out
    Animator rejectTextTranslateOut =
        ObjectAnimator.ofFloat(
            swipeToRejectText,
            View.TRANSLATION_Y,
            0f,
            DpUtil.dpToPx(getContext(), HINT_REJECT_FADE_TRANSLATION_Y_DP));
    rejectTextTranslateOut.setInterpolator(new FastOutSlowInInterpolator());
    rejectTextTranslateOut.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);

    Interpolator curve =
        PathInterpolatorCompat.create(
            0.4f /* controlX1 */, 0 /* controlY1 */, 0 /* controlX2 */, 1 /* controlY2 */);
@@ -809,6 +819,7 @@ public class FlingUpDownMethod extends AnswerMethod implements OnProgressChanged
    breatheAnimation
        .play(textUp)
        .with(rejectTextHide)
        .with(rejectTextTranslateOut)
        .with(puckUp)
        .with(puckScaleUp)
        .after(167 /* delay */);
@@ -819,7 +830,7 @@ public class FlingUpDownMethod extends AnswerMethod implements OnProgressChanged
        .with(textDown)
        .with(puckScaleDown)
        .with(rejectTextShow)
        .with(rejectTextTranslate)
        .with(rejectTextTranslateIn)
        .after(puckUp);

    // Add vibration animation to the animator set.