Updating the all-apps discovery bounce animation
> Animation plays on every onResume > Updating animation to loop continuously on v23+ > Updating animation spec Bug: 64331951 Change-Id: Ic6fb8d6975b37f5b010fc585329cba615296f5c7
This commit is contained in:
1 parent
ff58fe239a
commit
e18d3f537f
9 files changed
+61
-91
No files matched your search
@@ -272,7 +272,6 @@ public class Launcher extends BaseActivity
|
||||
private IconCache mIconCache;
|
||||
private LauncherAccessibilityDelegate mAccessibilityDelegate;
|
||||
private final Handler mHandler = new Handler();
|
||||
private boolean mIsResumeFromActionScreenOff;
|
||||
private boolean mHasFocus = false;
|
||||
|
||||
private ObjectAnimator mScrimAnimator;
|
||||
@@ -1046,7 +1045,6 @@ public class Launcher extends BaseActivity
|
||||
if (shouldShowDiscoveryBounce()) {
|
||||
mAllAppsController.showDiscoveryBounce();
|
||||
}
|
||||
mIsResumeFromActionScreenOff = false;
|
||||
if (mLauncherCallbacks != null) {
|
||||
mLauncherCallbacks.onResume();
|
||||
}
|
||||
@@ -1548,7 +1546,6 @@ public class Launcher extends BaseActivity
|
||||
mAppsView.reset();
|
||||
}
|
||||
}
|
||||
mIsResumeFromActionScreenOff = true;
|
||||
mShouldFadeInScrim = true;
|
||||
} else if (Intent.ACTION_USER_PRESENT.equals(action)) {
|
||||
// ACTION_USER_PRESENT is sent after onStart/onResume. This covers the case where
|
||||
@@ -3910,16 +3907,7 @@ public class Launcher extends BaseActivity
|
||||
}
|
||||
|
||||
private boolean shouldShowDiscoveryBounce() {
|
||||
if (mState != State.WORKSPACE) {
|
||||
return false;
|
||||
}
|
||||
if (mLauncherCallbacks != null && mLauncherCallbacks.shouldShowDiscoveryBounce()) {
|
||||
return true;
|
||||
}
|
||||
if (!mIsResumeFromActionScreenOff) {
|
||||
return false;
|
||||
}
|
||||
return !mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false);
|
||||
return mState == State.WORKSPACE && !mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false);
|
||||
}
|
||||
|
||||
protected void moveWorkspaceToDefaultScreen() {
|
||||
|
||||
@@ -95,6 +95,4 @@ public interface LauncherCallbacks {
|
||||
int SEARCH_BAR_HEIGHT_NORMAL = 0, SEARCH_BAR_HEIGHT_TALL = 1;
|
||||
/** Must return one of {@link #SEARCH_BAR_HEIGHT_NORMAL} or {@link #SEARCH_BAR_HEIGHT_TALL} */
|
||||
int getSearchBarHeight();
|
||||
|
||||
boolean shouldShowDiscoveryBounce();
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
|
||||
|
||||
// Used in discovery bounce animation to provide the transition without workspace changing.
|
||||
private boolean mIsTranslateWithoutWorkspace = false;
|
||||
private AnimatorSet mDiscoBounceAnimation;
|
||||
private Animator mDiscoBounceAnimation;
|
||||
private GradientView mGradientView;
|
||||
|
||||
private SpringAnimation mSearchSpring;
|
||||
@@ -421,8 +421,8 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
|
||||
cancelDiscoveryAnimation();
|
||||
|
||||
// assumption is that this variable is always null
|
||||
mDiscoBounceAnimation = (AnimatorSet) AnimatorInflater.loadAnimator(mLauncher,
|
||||
R.anim.discovery_bounce);
|
||||
mDiscoBounceAnimation = AnimatorInflater.loadAnimator(mLauncher,
|
||||
R.animator.discovery_bounce);
|
||||
mDiscoBounceAnimation.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animator) {
|
||||
|
||||
@@ -215,10 +215,5 @@ public class LauncherExtension extends Launcher {
|
||||
@Override
|
||||
public void onDetachedFromWindow() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldShowDiscoveryBounce() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user