From e18d3f537f0d63ccaed33d83491c227caa87a9db Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 24 Aug 2017 13:33:47 -0700 Subject: 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 --- res/anim/discovery_bounce.xml | 45 ---------------------- res/animator-v23/discovery_bounce.xml | 43 +++++++++++++++++++++ res/animator/discovery_bounce.xml | 35 +++++++++++++++++ res/interpolator/disco_bounce.xml | 22 +++++++++++ res/interpolator/disco_bounce_section1.xml | 22 ----------- res/interpolator/disco_bounce_section2.xml | 22 ----------- res/interpolator/disco_bounce_section3.xml | 22 ----------- src/com/android/launcher3/Launcher.java | 14 +------ src/com/android/launcher3/LauncherCallbacks.java | 2 - .../allapps/AllAppsTransitionController.java | 6 +-- .../launcher3/testing/LauncherExtension.java | 5 --- 11 files changed, 104 insertions(+), 134 deletions(-) delete mode 100644 res/anim/discovery_bounce.xml create mode 100644 res/animator-v23/discovery_bounce.xml create mode 100644 res/animator/discovery_bounce.xml create mode 100644 res/interpolator/disco_bounce.xml delete mode 100644 res/interpolator/disco_bounce_section1.xml delete mode 100644 res/interpolator/disco_bounce_section2.xml delete mode 100644 res/interpolator/disco_bounce_section3.xml diff --git a/res/anim/discovery_bounce.xml b/res/anim/discovery_bounce.xml deleted file mode 100644 index 1f7d46618..000000000 --- a/res/anim/discovery_bounce.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - diff --git a/res/animator-v23/discovery_bounce.xml b/res/animator-v23/discovery_bounce.xml new file mode 100644 index 000000000..8d0e8fdfb --- /dev/null +++ b/res/animator-v23/discovery_bounce.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + diff --git a/res/animator/discovery_bounce.xml b/res/animator/discovery_bounce.xml new file mode 100644 index 000000000..f02ebdbac --- /dev/null +++ b/res/animator/discovery_bounce.xml @@ -0,0 +1,35 @@ + + + + + + diff --git a/res/interpolator/disco_bounce.xml b/res/interpolator/disco_bounce.xml new file mode 100644 index 000000000..6ec339ea1 --- /dev/null +++ b/res/interpolator/disco_bounce.xml @@ -0,0 +1,22 @@ + + + + diff --git a/res/interpolator/disco_bounce_section1.xml b/res/interpolator/disco_bounce_section1.xml deleted file mode 100644 index 21562165c..000000000 --- a/res/interpolator/disco_bounce_section1.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/res/interpolator/disco_bounce_section2.xml b/res/interpolator/disco_bounce_section2.xml deleted file mode 100644 index 86cc789fe..000000000 --- a/res/interpolator/disco_bounce_section2.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/res/interpolator/disco_bounce_section3.xml b/res/interpolator/disco_bounce_section3.xml deleted file mode 100644 index 1acef037c..000000000 --- a/res/interpolator/disco_bounce_section3.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 614d08669..60d2e81f3 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -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() { diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java index c900e533b..66da046ef 100644 --- a/src/com/android/launcher3/LauncherCallbacks.java +++ b/src/com/android/launcher3/LauncherCallbacks.java @@ -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(); } diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index a1f2dd7e3..743b16ef1 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -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) { diff --git a/src/com/android/launcher3/testing/LauncherExtension.java b/src/com/android/launcher3/testing/LauncherExtension.java index e5842fa0a..5cb8c4c7d 100644 --- a/src/com/android/launcher3/testing/LauncherExtension.java +++ b/src/com/android/launcher3/testing/LauncherExtension.java @@ -215,10 +215,5 @@ public class LauncherExtension extends Launcher { @Override public void onDetachedFromWindow() { } - - @Override - public boolean shouldShowDiscoveryBounce() { - return false; - } } } -- cgit v1.2.3