diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-08-24 13:33:47 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-08-29 10:17:51 -0700 |
commit | e18d3f537f0d63ccaed33d83491c227caa87a9db (patch) | |
tree | 7a1b784dd66027b8f7861e44e63dd8a07e670701 | |
parent | ff58fe239ab70de53e8e2c473a1e2458800e69f7 (diff) | |
download | android_packages_apps_Trebuchet-e18d3f537f0d63ccaed33d83491c227caa87a9db.tar.gz android_packages_apps_Trebuchet-e18d3f537f0d63ccaed33d83491c227caa87a9db.tar.bz2 android_packages_apps_Trebuchet-e18d3f537f0d63ccaed33d83491c227caa87a9db.zip |
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
-rw-r--r-- | res/animator-v23/discovery_bounce.xml | 43 | ||||
-rw-r--r-- | res/animator/discovery_bounce.xml (renamed from res/anim/discovery_bounce.xml) | 30 | ||||
-rw-r--r-- | res/interpolator/disco_bounce.xml (renamed from res/interpolator/disco_bounce_section1.xml) | 8 | ||||
-rw-r--r-- | res/interpolator/disco_bounce_section2.xml | 22 | ||||
-rw-r--r-- | res/interpolator/disco_bounce_section3.xml | 22 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 14 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherCallbacks.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/testing/LauncherExtension.java | 5 |
9 files changed, 61 insertions, 91 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2017, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="2166" + android:repeatCount="5"> + <propertyValuesHolder + android:propertyName="progress" + android:valueType="floatType"> + <keyframe + android:fraction="0" + android:value="1f" /> + <keyframe + android:fraction="0.346" + android:value="1f" /> + <keyframe + android:fraction=".423" + android:interpolator="@interpolator/disco_bounce" + android:value="0.9438f" /> + <keyframe + android:fraction="0.654" + android:interpolator="@interpolator/disco_bounce" + android:value="1f" /> + <keyframe + android:fraction="1" + android:value="1f" /> + </propertyValuesHolder> +</objectAnimator> diff --git a/res/anim/discovery_bounce.xml b/res/animator/discovery_bounce.xml index 1f7d46618..f02ebdbac 100644 --- a/res/anim/discovery_bounce.xml +++ b/res/animator/discovery_bounce.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- /* -** Copyright 2016, The Android Open Source Project +** Copyright 2017, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -16,30 +16,20 @@ ** limitations under the License. */ --> - <set xmlns:android="http://schemas.android.com/apk/res/android" - android:ordering="sequentially" - android:startOffset="200"> - + android:ordering="sequentially"> <objectAnimator + android:duration="166" + android:interpolator="@interpolator/disco_bounce" android:propertyName="progress" - android:duration="250" - android:interpolator="@interpolator/disco_bounce_section1" + android:startOffset="750" android:valueFrom="1f" - android:valueTo=".94f" - android:valueType="floatType"/> + android:valueTo="0.9438f" + android:valueType="floatType" /> <objectAnimator + android:duration="500" + android:interpolator="@interpolator/disco_bounce" android:propertyName="progress" - android:duration="216" - android:interpolator="@interpolator/disco_bounce_section2" - android:valueFrom=".94f" - android:valueTo="1.012f" - android:valueType="floatType"/> - <objectAnimator - android:propertyName="progress" - android:duration="234" - android:interpolator="@interpolator/disco_bounce_section3" - android:valueFrom="1.012f" android:valueTo="1f" - android:valueType="floatType"/> + android:valueType="floatType" /> </set> diff --git a/res/interpolator/disco_bounce_section1.xml b/res/interpolator/disco_bounce.xml index 21562165c..6ec339ea1 100644 --- a/res/interpolator/disco_bounce_section1.xml +++ b/res/interpolator/disco_bounce.xml @@ -16,7 +16,7 @@ --> <pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android" - android:controlX1="0.9" - android:controlY1="0" - android:controlX2="0.5" - android:controlY2="1"/> + android:controlX1="0.35" + android:controlY1="0" + android:controlX2="0.5" + android:controlY2="1" /> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2016 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> - -<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android" - android:controlX1="0.9" - android:controlY1="0" - android:controlX2="0.6" - android:controlY2="1"/> 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2016 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> - -<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android" - android:controlX1="0.1" - android:controlY1="0" - android:controlX2="0.7" - android:controlY2="1"/> 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; - } } } |