Merge "Play icon alignment animation in live tile mode" into tm-dev am: b5d7744c1b

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

Change-Id: Ie22712fb2fa1f5c3c3c71cd6b25c522d43088fa3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Tracy Zhou
2022-04-12 01:00:52 +00:00
committed by Automerger Merge Worker
@@ -26,6 +26,7 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseQuickstepLauncher;
@@ -74,6 +75,8 @@ import java.util.function.Supplier;
private int mState;
private LauncherState mLauncherState = LauncherState.NORMAL;
private @Nullable TaskBarRecentsAnimationListener mTaskBarRecentsAnimationListener;
private boolean mIsAnimatingToLauncherViaGesture;
private boolean mIsAnimatingToLauncherViaResume;
@@ -163,12 +166,11 @@ import java.util.function.Supplier;
animatorSet.play(stashController.applyStateWithoutStart(duration));
animatorSet.play(applyState(duration, false));
TaskBarRecentsAnimationListener listener = new TaskBarRecentsAnimationListener(callbacks);
callbacks.addListener(listener);
mTaskBarRecentsAnimationListener = new TaskBarRecentsAnimationListener(callbacks);
callbacks.addListener(mTaskBarRecentsAnimationListener);
RecentsView recentsView = mLauncher.getOverviewPanel();
recentsView.setTaskLaunchListener(() -> {
listener.endGestureStateOverride(true);
callbacks.removeListener(listener);
mTaskBarRecentsAnimationListener.endGestureStateOverride(true);
});
return animatorSet;
}
@@ -382,7 +384,7 @@ import java.util.function.Supplier;
}
private void onIconAlignmentRatioChangedForStateTransition() {
if (!isResumed()) {
if (!isResumed() && mTaskBarRecentsAnimationListener == null) {
return;
}
onIconAlignmentRatioChanged(this::getCurrentIconAlignmentRatioForLauncherState);
@@ -458,6 +460,7 @@ import java.util.function.Supplier;
private void endGestureStateOverride(boolean finishedToApp) {
mCallbacks.removeListener(this);
mTaskBarRecentsAnimationListener = null;
// Update the resumed state immediately to ensure a seamless handoff
boolean launcherResumed = !finishedToApp;