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
This commit is contained in:
Jorim Jaggi
2015-11-09 15:28:34 +01:00
parent a08a48cb98
commit 7af8ea8a7c
2 changed files with 12 additions and 6 deletions

View File

@@ -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();

View File

@@ -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<TaskView> 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. */