Loading packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java +0 −9 Original line number Diff line number Diff line Loading @@ -87,15 +87,6 @@ public class Utilities { (1f - overlayAlpha) * Color.blue(overlayColor))); } /** * Cancels an animation. */ public static void cancelAnimation(Animator animator) { if (animator != null) { animator.cancel(); } } /** * Cancels an animation ensuring that if it has listeners, onCancel and onEnd * are not called. Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +9 −14 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, mThumbnailView.onTaskViewSizeChanged(w, h); } @Override public boolean hasOverlappingRendering() { return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { Loading Loading @@ -244,12 +249,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, void updateViewPropertiesToTaskTransform(TaskViewTransform toTransform, TaskViewAnimation toAnimation, ValueAnimator.AnimatorUpdateListener updateCallback) { RecentsConfiguration config = Recents.getConfiguration(); Utilities.cancelAnimation(mTransformAnimation); Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation); // Compose the animations for the transform mTmpAnimators.clear(); boolean requiresHwLayers = toTransform.applyToTaskView(this, mTmpAnimators, toAnimation, !config.fakeShadows); toTransform.applyToTaskView(this, mTmpAnimators, toAnimation, !config.fakeShadows); if (toAnimation.isImmediate()) { setTaskProgress(toTransform.p); if (toAnimation.listener != null) { Loading @@ -266,22 +270,13 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, // Create the animator mTransformAnimation = toAnimation.createAnimator(mTmpAnimators); if (requiresHwLayers) { setLayerType(View.LAYER_TYPE_HARDWARE, null); mTransformAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { setLayerType(View.LAYER_TYPE_NONE, null); } }); } mTransformAnimation.start(); } } /** Resets this view's properties */ void resetViewProperties() { Utilities.cancelAnimation(mTransformAnimation); Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation); setDim(0); setVisibility(View.VISIBLE); getViewBounds().reset(); Loading @@ -297,7 +292,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, * Cancels any current transform animations. */ public void cancelTransformAnimation() { Utilities.cancelAnimation(mTransformAnimation); Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation); } /** Enables/disables handling touch on this task view. */ Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskViewTransform.java +2 −7 Original line number Diff line number Diff line Loading @@ -125,15 +125,12 @@ public class TaskViewTransform { /** * Applies this transform to a view. * * @return whether hardware layers are required for this animation. */ public boolean applyToTaskView(TaskView v, ArrayList<Animator> animators, public void applyToTaskView(TaskView v, ArrayList<Animator> animators, TaskViewAnimation taskAnimation, boolean allowShadows) { // Return early if not visible boolean requiresHwLayers = false; if (!visible) { return requiresHwLayers; return; } if (taskAnimation.isImmediate()) { Loading Loading @@ -163,7 +160,6 @@ public class TaskViewTransform { } if (hasAlphaChangedFrom(v.getAlpha())) { animators.add(ObjectAnimator.ofFloat(v, View.ALPHA, v.getAlpha(), alpha)); requiresHwLayers = true; } if (hasRectChangedFrom(v)) { animators.add(ObjectAnimator.ofPropertyValuesHolder(v, Loading @@ -173,7 +169,6 @@ public class TaskViewTransform { PropertyValuesHolder.ofInt(BOTTOM, v.getBottom(), (int) rect.bottom))); } } return requiresHwLayers; } /** Reset the transform on a view. */ Loading Loading
packages/SystemUI/src/com/android/systemui/recents/misc/Utilities.java +0 −9 Original line number Diff line number Diff line Loading @@ -87,15 +87,6 @@ public class Utilities { (1f - overlayAlpha) * Color.blue(overlayColor))); } /** * Cancels an animation. */ public static void cancelAnimation(Animator animator) { if (animator != null) { animator.cancel(); } } /** * Cancels an animation ensuring that if it has listeners, onCancel and onEnd * are not called. Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +9 −14 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, mThumbnailView.onTaskViewSizeChanged(w, h); } @Override public boolean hasOverlappingRendering() { return false; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { Loading Loading @@ -244,12 +249,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, void updateViewPropertiesToTaskTransform(TaskViewTransform toTransform, TaskViewAnimation toAnimation, ValueAnimator.AnimatorUpdateListener updateCallback) { RecentsConfiguration config = Recents.getConfiguration(); Utilities.cancelAnimation(mTransformAnimation); Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation); // Compose the animations for the transform mTmpAnimators.clear(); boolean requiresHwLayers = toTransform.applyToTaskView(this, mTmpAnimators, toAnimation, !config.fakeShadows); toTransform.applyToTaskView(this, mTmpAnimators, toAnimation, !config.fakeShadows); if (toAnimation.isImmediate()) { setTaskProgress(toTransform.p); if (toAnimation.listener != null) { Loading @@ -266,22 +270,13 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, // Create the animator mTransformAnimation = toAnimation.createAnimator(mTmpAnimators); if (requiresHwLayers) { setLayerType(View.LAYER_TYPE_HARDWARE, null); mTransformAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { setLayerType(View.LAYER_TYPE_NONE, null); } }); } mTransformAnimation.start(); } } /** Resets this view's properties */ void resetViewProperties() { Utilities.cancelAnimation(mTransformAnimation); Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation); setDim(0); setVisibility(View.VISIBLE); getViewBounds().reset(); Loading @@ -297,7 +292,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, * Cancels any current transform animations. */ public void cancelTransformAnimation() { Utilities.cancelAnimation(mTransformAnimation); Utilities.cancelAnimationWithoutCallbacks(mTransformAnimation); } /** Enables/disables handling touch on this task view. */ Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskViewTransform.java +2 −7 Original line number Diff line number Diff line Loading @@ -125,15 +125,12 @@ public class TaskViewTransform { /** * Applies this transform to a view. * * @return whether hardware layers are required for this animation. */ public boolean applyToTaskView(TaskView v, ArrayList<Animator> animators, public void applyToTaskView(TaskView v, ArrayList<Animator> animators, TaskViewAnimation taskAnimation, boolean allowShadows) { // Return early if not visible boolean requiresHwLayers = false; if (!visible) { return requiresHwLayers; return; } if (taskAnimation.isImmediate()) { Loading Loading @@ -163,7 +160,6 @@ public class TaskViewTransform { } if (hasAlphaChangedFrom(v.getAlpha())) { animators.add(ObjectAnimator.ofFloat(v, View.ALPHA, v.getAlpha(), alpha)); requiresHwLayers = true; } if (hasRectChangedFrom(v)) { animators.add(ObjectAnimator.ofPropertyValuesHolder(v, Loading @@ -173,7 +169,6 @@ public class TaskViewTransform { PropertyValuesHolder.ofInt(BOTTOM, v.getBottom(), (int) rect.bottom))); } } return requiresHwLayers; } /** Reset the transform on a view. */ Loading