Override INTERPOLATOR_WITHIN_ALL_APPS when app restarts.
Bug: 225185551 Test: manual. See video https://drive.google.com/corp/drive/u/0/folders/1g-YlbzdHh49SH0f4xLli4BmVqPCP6K49 Flag: the flash issue is only for QS Tile under ENABLE_QS_TILES(OFF) Change-Id: Ib282148bc0a4943c91b5ebd3c78b7128d5d66c9d
This commit is contained in:
@@ -28,6 +28,7 @@ import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
import static com.android.launcher3.anim.Interpolators.clampToProgress;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.FloatProperty;
|
||||
import android.util.Log;
|
||||
@@ -79,6 +80,7 @@ public class SearchTransitionController {
|
||||
|
||||
private ObjectAnimator mSearchToAzAnimator = null;
|
||||
private float mSearchToAzProgress = 1f;
|
||||
private boolean mSkipNextAnimationWithinAllApps;
|
||||
|
||||
public SearchTransitionController(ActivityAllAppsContainerView<?> allAppsContainerView) {
|
||||
mAllAppsContainerView = allAppsContainerView;
|
||||
@@ -108,11 +110,16 @@ public class SearchTransitionController {
|
||||
|
||||
mSearchToAzAnimator = ObjectAnimator.ofFloat(this, SEARCH_TO_AZ_PROGRESS, targetProgress);
|
||||
boolean inAllApps = mAllAppsContainerView.isInAllApps();
|
||||
if (!inAllApps) {
|
||||
TimeInterpolator timeInterpolator =
|
||||
inAllApps ? INTERPOLATOR_WITHIN_ALL_APPS : INTERPOLATOR_TRANSITIONING_TO_ALL_APPS;
|
||||
if (mSkipNextAnimationWithinAllApps) {
|
||||
timeInterpolator = INSTANT;
|
||||
mSkipNextAnimationWithinAllApps = false;
|
||||
}
|
||||
if (timeInterpolator == INSTANT) {
|
||||
duration = 0; // Don't want to animate when coming from QSB.
|
||||
}
|
||||
mSearchToAzAnimator.setDuration(duration).setInterpolator(
|
||||
inAllApps ? INTERPOLATOR_WITHIN_ALL_APPS : INTERPOLATOR_TRANSITIONING_TO_ALL_APPS);
|
||||
mSearchToAzAnimator.setDuration(duration).setInterpolator(timeInterpolator);
|
||||
mSearchToAzAnimator.addListener(forEndCallback(() -> mSearchToAzAnimator = null));
|
||||
if (!goingToSearch) {
|
||||
mSearchToAzAnimator.addListener(forSuccessCallback(() -> {
|
||||
@@ -337,4 +344,12 @@ public class SearchTransitionController {
|
||||
private float getSearchToAzProgress() {
|
||||
return mSearchToAzProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
* This should only be called from {@code LauncherSearchSessionManager} when app restarts due to
|
||||
* theme changes.
|
||||
*/
|
||||
public void setSkipAnimationWithinAllApps(boolean skip) {
|
||||
mSkipNextAnimationWithinAllApps = skip;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user