summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-10-26 18:32:38 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-10-26 18:34:21 -0700
commitb5e65c8bd3785409d4aeda21f2c88e75c9e22c9f (patch)
tree96f15cf9ce4f1312514959ae39cbcb1191076cf3 /src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
parent9ccafbff26f5835ab9725d876d1bf7ccd08ccf84 (diff)
downloadandroid_packages_apps_Trebuchet-b5e65c8bd3785409d4aeda21f2c88e75c9e22c9f.tar.gz
android_packages_apps_Trebuchet-b5e65c8bd3785409d4aeda21f2c88e75c9e22c9f.tar.bz2
android_packages_apps_Trebuchet-b5e65c8bd3785409d4aeda21f2c88e75c9e22c9f.zip
Calling buildLayer only on views which are actually visible
> Creating a common listener for handling buildLayer logic Bug: 30138067 Change-Id: I803ef78b48e07e5ae5922e0392d390f274a87d75
Diffstat (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java')
-rw-r--r--src/com/android/launcher3/WorkspaceStateTransitionAnimation.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index 598ba741a..1cf4b39f5 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -30,12 +30,11 @@ import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.DecelerateInterpolator;
+import com.android.launcher3.anim.AnimationLayerSet;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.util.Thunk;
-import java.util.HashMap;
-
/**
* A convenience class to update a view's visibility state after an alpha animation.
*/
@@ -226,7 +225,7 @@ public class WorkspaceStateTransitionAnimation {
}
public AnimatorSet getAnimationToState(Workspace.State fromState, Workspace.State toState,
- boolean animated, HashMap<View, Integer> layerViews) {
+ boolean animated, AnimationLayerSet layerViews) {
AccessibilityManager am = (AccessibilityManager)
mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE);
final boolean accessibilityEnabled = am.isEnabled();
@@ -262,8 +261,7 @@ public class WorkspaceStateTransitionAnimation {
* Starts a transition animation for the workspace.
*/
private void animateWorkspace(final TransitionStates states, final boolean animated,
- final int duration, final HashMap<View, Integer> layerViews,
- final boolean accessibilityEnabled) {
+ final int duration, AnimationLayerSet layerViews, final boolean accessibilityEnabled) {
// Cancel existing workspace animations and create a new animator set if requested
cancelAnimation();
if (animated) {
@@ -396,12 +394,10 @@ public class WorkspaceStateTransitionAnimation {
// For animation optimization, we may need to provide the Launcher transition
// with a set of views on which to force build and manage layers in certain scenarios.
- layerViews.put(overviewPanel, LauncherStateTransitionAnimation.BUILD_AND_SET_LAYER);
- layerViews.put(qsbContainer, LauncherStateTransitionAnimation.BUILD_AND_SET_LAYER);
- layerViews.put(mLauncher.getHotseat(),
- LauncherStateTransitionAnimation.BUILD_AND_SET_LAYER);
- layerViews.put(mWorkspace.getPageIndicator(),
- LauncherStateTransitionAnimation.BUILD_AND_SET_LAYER);
+ layerViews.addView(overviewPanel);
+ layerViews.addView(qsbContainer);
+ layerViews.addView(mLauncher.getHotseat());
+ layerViews.addView(mWorkspace.getPageIndicator());
if (states.workspaceToOverview) {
hotseatAlpha.setInterpolator(new DecelerateInterpolator(2));