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

Commit 2f457a6b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix velocity in StaggeredWorkspaceAnimation." into ub-launcher3-rvc-qpr-dev am: add69c70

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12142607

Change-Id: I6d2e67478dc5a98395aa8f25fe98b206c4fcba75
parents 149758da add69c70
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -205,13 +205,15 @@ public class StaggeredWorkspaceAnim {
        ResourceProvider rp = DynamicResource.provider(v.getContext());
        float stiffness = rp.getFloat(R.dimen.staggered_stiffness);
        float damping = rp.getFloat(R.dimen.staggered_damping_ratio);
        float endTransY = 0;
        float springVelocity = Math.abs(mVelocity) * Math.signum(endTransY - mSpringTransY);
        ValueAnimator springTransY = new SpringAnimationBuilder(v.getContext())
                .setStiffness(stiffness)
                .setDampingRatio(damping)
                .setMinimumVisibleChange(1f)
                .setStartValue(mSpringTransY)
                .setEndValue(0)
                .setStartVelocity(mVelocity)
                .setEndValue(endTransY)
                .setStartVelocity(springVelocity)
                .build(v, VIEW_TRANSLATE_Y);
        springTransY.setStartDelay(startDelay);
        springTransY.addListener(new AnimatorListenerAdapter() {
+1 −6
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.launcher3;

import static android.util.TypedValue.COMPLEX_UNIT_DIP;

import static com.android.launcher3.BaseActivity.INVISIBLE_ALL;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_APP_TRANSITIONS;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS;
@@ -62,7 +60,6 @@ import android.os.CancellationSignal;
import android.os.Handler;
import android.os.Looper;
import android.util.Pair;
import android.util.TypedValue;
import android.view.View;

import androidx.annotation.NonNull;
@@ -875,10 +872,8 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
                            }
                        });
                    } else {
                        float velocityDpPerS = DynamicResource.provider(mLauncher)
                        float velocityPxPerS = DynamicResource.provider(mLauncher)
                                .getDimension(R.dimen.unlock_staggered_velocity_dp_per_s);
                        float velocityPxPerS = TypedValue.applyDimension(COMPLEX_UNIT_DIP,
                                velocityDpPerS, mLauncher.getResources().getDisplayMetrics());
                        anim.play(new StaggeredWorkspaceAnim(mLauncher, velocityPxPerS, false)
                                .getAnimators());
                    }
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@

    <item name="staggered_damping_ratio" type="dimen" format="float">0.7</item>
    <item name="staggered_stiffness" type="dimen" format="float">150</item>
    <dimen name="unlock_staggered_velocity_dp_per_s">3dp</dimen>
    <dimen name="unlock_staggered_velocity_dp_per_s">4dp</dimen>

    <item name="hint_scale_damping_ratio" type="dimen" format="float">0.7</item>
    <item name="hint_scale_stiffness" type="dimen" format="float">200</item>