diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-02-14 15:24:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-02-14 15:24:45 +0000 |
commit | f47658f1206c35face246193a425fc23765031f3 (patch) | |
tree | 31b2cfe632c94deb042daef30d1d55e0c6138735 | |
parent | dee514fae3c75f823c9b92a855efdd176c103601 (diff) | |
parent | 551e80c34fc3dc7154a9637cf0cbe38017ebfa3a (diff) | |
download | base-f47658f1206c35face246193a425fc23765031f3.tar.gz |
Merge "2D Recents: Fix a glitch during task relayout after a dismiss" into nyc-mr2-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java | 18 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java | 1 |
2 files changed, 13 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 9bc1ca56a513..3c5a14149d65 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -20,6 +20,8 @@ import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.annotation.IntDef; @@ -1496,11 +1498,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Remove the task from the ignored set removeIgnoreTask(removedTask); - // Resize the grid layout task view focus frame - if (mTaskViewFocusFrame != null) { - mTaskViewFocusFrame.resize(); - } - // If requested, relayout with the given animation if (animation != null) { updateLayoutAlgorithm(true /* boundScroll */); @@ -1838,6 +1835,17 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal announceForAccessibility(getContext().getString( R.string.accessibility_recents_item_dismissed, event.task.title)); + if (useGridLayout() && event.animation != null) { + event.animation.setListener(new AnimatorListenerAdapter() { + public void onAnimationEnd(Animator animator) { + if (mTaskViewFocusFrame != null) { + // Resize the grid layout task view focus frame + mTaskViewFocusFrame.resize(); + } + } + }); + } + // Remove the task from the stack mStack.removeTask(event.task, event.animation, false /* fromDockGesture */); EventBus.getDefault().send(new DeleteTaskDataEvent(event.task)); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java index 315c31448deb..94e9df0f453b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java @@ -269,7 +269,6 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks return super.onInterceptTouchEvent(ev); } - @Override protected void measureContents(int width, int height) { int widthWithoutPadding = width - mPaddingLeft - mPaddingRight; |