From 7af8ea8a7cf18bdd84f51954aeb32ad442f85754 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 9 Nov 2015 15:28:34 +0100 Subject: [PATCH] When recent changes its layout, update contents When the window gets resized, we need to synchronize the views with the model. Bug: 25584567 Bug: 25584399 Change-Id: I27d6738cb4984ce91ce79671298bcdc0d317c6e1 --- .../recents/views/AnimateableViewBounds.java | 6 +++--- .../systemui/recents/views/TaskStackView.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java index 21b6bd88bcbf8..70370ecef9747 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java @@ -36,7 +36,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider { public AnimateableViewBounds(TaskView source, int cornerRadius) { mSourceView = source; mCornerRadius = cornerRadius; - setClipBottom(getClipBottom()); + setClipBottom(getClipBottom(), false /* force */); } @Override @@ -57,8 +57,8 @@ public class AnimateableViewBounds extends ViewOutlineProvider { } /** Sets the bottom clip. */ - public void setClipBottom(int bottom) { - if (bottom != mClipRect.bottom) { + public void setClipBottom(int bottom, boolean force) { + if (bottom != mClipRect.bottom || force) { mClipRect.bottom = bottom; mSourceView.invalidateOutline(); updateClipBounds(); 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 3ef597f7c849c..39c45ccbb1c58 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -538,7 +538,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal /** * Updates the clip for each of the task views from back to front. */ - void clipTaskViews() { + void clipTaskViews(boolean forceUpdate) { // Update the clip on each task child List taskViews = getTaskViews(); TaskView tmpTv = null; @@ -575,7 +575,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } } } - tv.getViewBounds().setClipBottom(clipBottom); + tv.getViewBounds().setClipBottom(clipBottom, forceUpdate); } mStackViewsClipDirty = false; } @@ -792,7 +792,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mStackScroller.computeScroll(); // Synchronize the views synchronizeStackViewsWithModel(); - clipTaskViews(); + clipTaskViews(false /* forceUpdate */); // Notify accessibility sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SCROLLED); } @@ -896,6 +896,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal mAwaitingFirstLayout = false; onFirstLayout(); } + + if (changed) { + requestSynchronizeStackViewsWithModel(); + synchronizeStackViewsWithModel(); + clipTaskViews(true /* forceUpdate */); + } } /** Handler for the first layout. */