Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7af8ea8a authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

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
parent a08a48cb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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();
+9 −3
Original line number Diff line number Diff line
@@ -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. */