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

Commit 4610eeff authored by Chet Haase's avatar Chet Haase
Browse files

Revert "Add support for partial view layouts"

This reverts commit c55d5072.

There were several bugs related to incorrect handling of various
layout issues (layout not being run on containers/views that needed
it), reverting to take another run at it outside of master.

Issue #25980198  requestLayout() sometimes doesn't result in measure/layout for view

Change-Id: Ic0e159cbcf6171652d8fd1bee9ae44a3977cea04
parent f1b40f65
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -40524,7 +40524,6 @@ package android.view {
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
    method public void createContextMenu(android.view.ContextMenu);
    method public void destroyDrawingCache();
    method public final boolean didLayoutParamsChange();
    method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
    method public void dispatchConfigurationChanged(android.content.res.Configuration);
    method public void dispatchDisplayHint(int);
@@ -40750,7 +40749,6 @@ package android.view {
    method public boolean isOpaque();
    method protected boolean isPaddingOffsetRequired();
    method public boolean isPaddingRelative();
    method public final boolean isPartialLayoutRequested();
    method public boolean isPressed();
    method public boolean isSaveEnabled();
    method public boolean isSaveFromParentEnabled();
@@ -41362,7 +41360,6 @@ package android.view {
    method protected void dispatchThawSelfOnly(android.util.SparseArray<android.os.Parcelable>);
    method protected boolean drawChild(android.graphics.Canvas, android.view.View, long);
    method public void endViewTransition(android.view.View);
    method public int findDependentLayoutAxes(android.view.View, int);
    method public android.view.View focusSearch(android.view.View, int);
    method public void focusableViewAvailable(android.view.View);
    method public boolean gatherTransparentRegion(android.graphics.Region);
@@ -41429,8 +41426,6 @@ package android.view {
    method public void requestChildFocus(android.view.View, android.view.View);
    method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public void requestDisallowInterceptTouchEvent(boolean);
    method public void requestLayoutForChild(android.view.View);
    method public void requestPartialLayoutForChild(android.view.View);
    method public boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public void requestTransparentRegion(android.view.View);
    method public void scheduleLayoutAnimation();
@@ -41545,7 +41540,6 @@ package android.view {
    method public abstract void childHasTransientStateChanged(android.view.View, boolean);
    method public abstract void clearChildFocus(android.view.View);
    method public abstract void createContextMenu(android.view.ContextMenu);
    method public abstract int findDependentLayoutAxes(android.view.View, int);
    method public abstract android.view.View focusSearch(android.view.View, int);
    method public abstract void focusableViewAvailable(android.view.View);
    method public abstract boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
@@ -41575,16 +41569,12 @@ package android.view {
    method public abstract void requestDisallowInterceptTouchEvent(boolean);
    method public abstract void requestFitSystemWindows();
    method public abstract void requestLayout();
    method public abstract void requestLayoutForChild(android.view.View);
    method public abstract boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public abstract void requestTransparentRegion(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View, float, float);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback, int);
    field public static final int FLAG_LAYOUT_AXIS_ANY = 3; // 0x3
    field public static final int FLAG_LAYOUT_AXIS_HORIZONTAL = 1; // 0x1
    field public static final int FLAG_LAYOUT_AXIS_VERTICAL = 2; // 0x2
  }
  public class ViewPropertyAnimator {
@@ -64103,3 +64093,4 @@ package org.xmlpull.v1.sax2 {
  }
}
+0 −10
Original line number Diff line number Diff line
@@ -42860,7 +42860,6 @@ package android.view {
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
    method public void createContextMenu(android.view.ContextMenu);
    method public void destroyDrawingCache();
    method public final boolean didLayoutParamsChange();
    method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
    method public void dispatchConfigurationChanged(android.content.res.Configuration);
    method public void dispatchDisplayHint(int);
@@ -43086,7 +43085,6 @@ package android.view {
    method public boolean isOpaque();
    method protected boolean isPaddingOffsetRequired();
    method public boolean isPaddingRelative();
    method public final boolean isPartialLayoutRequested();
    method public boolean isPressed();
    method public boolean isSaveEnabled();
    method public boolean isSaveFromParentEnabled();
@@ -43698,7 +43696,6 @@ package android.view {
    method protected void dispatchThawSelfOnly(android.util.SparseArray<android.os.Parcelable>);
    method protected boolean drawChild(android.graphics.Canvas, android.view.View, long);
    method public void endViewTransition(android.view.View);
    method public int findDependentLayoutAxes(android.view.View, int);
    method public android.view.View focusSearch(android.view.View, int);
    method public void focusableViewAvailable(android.view.View);
    method public boolean gatherTransparentRegion(android.graphics.Region);
@@ -43765,8 +43762,6 @@ package android.view {
    method public void requestChildFocus(android.view.View, android.view.View);
    method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public void requestDisallowInterceptTouchEvent(boolean);
    method public void requestLayoutForChild(android.view.View);
    method public void requestPartialLayoutForChild(android.view.View);
    method public boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public void requestTransparentRegion(android.view.View);
    method public void scheduleLayoutAnimation();
@@ -43881,7 +43876,6 @@ package android.view {
    method public abstract void childHasTransientStateChanged(android.view.View, boolean);
    method public abstract void clearChildFocus(android.view.View);
    method public abstract void createContextMenu(android.view.ContextMenu);
    method public abstract int findDependentLayoutAxes(android.view.View, int);
    method public abstract android.view.View focusSearch(android.view.View, int);
    method public abstract void focusableViewAvailable(android.view.View);
    method public abstract boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
@@ -43911,16 +43905,12 @@ package android.view {
    method public abstract void requestDisallowInterceptTouchEvent(boolean);
    method public abstract void requestFitSystemWindows();
    method public abstract void requestLayout();
    method public abstract void requestLayoutForChild(android.view.View);
    method public abstract boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public abstract void requestTransparentRegion(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View, float, float);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback, int);
    field public static final int FLAG_LAYOUT_AXIS_ANY = 3; // 0x3
    field public static final int FLAG_LAYOUT_AXIS_HORIZONTAL = 1; // 0x1
    field public static final int FLAG_LAYOUT_AXIS_VERTICAL = 2; // 0x2
  }
  public class ViewPropertyAnimator {
+0 −10
Original line number Diff line number Diff line
@@ -40526,7 +40526,6 @@ package android.view {
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
    method public void createContextMenu(android.view.ContextMenu);
    method public void destroyDrawingCache();
    method public final boolean didLayoutParamsChange();
    method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
    method public void dispatchConfigurationChanged(android.content.res.Configuration);
    method public void dispatchDisplayHint(int);
@@ -40752,7 +40751,6 @@ package android.view {
    method public boolean isOpaque();
    method protected boolean isPaddingOffsetRequired();
    method public boolean isPaddingRelative();
    method public final boolean isPartialLayoutRequested();
    method public boolean isPressed();
    method public boolean isSaveEnabled();
    method public boolean isSaveFromParentEnabled();
@@ -41364,7 +41362,6 @@ package android.view {
    method protected void dispatchThawSelfOnly(android.util.SparseArray<android.os.Parcelable>);
    method protected boolean drawChild(android.graphics.Canvas, android.view.View, long);
    method public void endViewTransition(android.view.View);
    method public int findDependentLayoutAxes(android.view.View, int);
    method public android.view.View focusSearch(android.view.View, int);
    method public void focusableViewAvailable(android.view.View);
    method public boolean gatherTransparentRegion(android.graphics.Region);
@@ -41431,8 +41428,6 @@ package android.view {
    method public void requestChildFocus(android.view.View, android.view.View);
    method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public void requestDisallowInterceptTouchEvent(boolean);
    method public void requestLayoutForChild(android.view.View);
    method public void requestPartialLayoutForChild(android.view.View);
    method public boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public void requestTransparentRegion(android.view.View);
    method public void scheduleLayoutAnimation();
@@ -41547,7 +41542,6 @@ package android.view {
    method public abstract void childHasTransientStateChanged(android.view.View, boolean);
    method public abstract void clearChildFocus(android.view.View);
    method public abstract void createContextMenu(android.view.ContextMenu);
    method public abstract int findDependentLayoutAxes(android.view.View, int);
    method public abstract android.view.View focusSearch(android.view.View, int);
    method public abstract void focusableViewAvailable(android.view.View);
    method public abstract boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
@@ -41577,16 +41571,12 @@ package android.view {
    method public abstract void requestDisallowInterceptTouchEvent(boolean);
    method public abstract void requestFitSystemWindows();
    method public abstract void requestLayout();
    method public abstract void requestLayoutForChild(android.view.View);
    method public abstract boolean requestSendAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public abstract void requestTransparentRegion(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View);
    method public abstract boolean showContextMenuForChild(android.view.View, float, float);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback);
    method public abstract android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback, int);
    field public static final int FLAG_LAYOUT_AXIS_ANY = 3; // 0x3
    field public static final int FLAG_LAYOUT_AXIS_HORIZONTAL = 1; // 0x1
    field public static final int FLAG_LAYOUT_AXIS_VERTICAL = 2; // 0x2
  }
  public class ViewPropertyAnimator {
+5 −74
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ import android.view.AccessibilityIterators.TextSegmentIterator;
import android.view.AccessibilityIterators.CharacterTextSegmentIterator;
import android.view.AccessibilityIterators.WordTextSegmentIterator;
import android.view.AccessibilityIterators.ParagraphTextSegmentIterator;
import android.view.ViewGroup.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityEventSource;
import android.view.accessibility.AccessibilityManager;
@@ -2423,8 +2422,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *                    1              PFLAG3_SCROLL_INDICATOR_END
     *                   1               PFLAG3_ASSIST_BLOCKED
     *            1111111                PFLAG3_POINTER_ICON_MASK
     *           1                       PFLAG3_PARTIAL_LAYOUT_REQUESTED
     *          1                        PFLAG3_LAYOUT_PARAMS_CHANGED
     * |-------|-------|-------|-------|
     */
@@ -2513,7 +2510,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    static final int PFLAG3_SCROLL_INDICATOR_END = 0x2000;
    /* End of masks for mPrivateFlags3 */
    static final int DRAG_MASK = PFLAG2_DRAG_CAN_ACCEPT | PFLAG2_DRAG_HOVERED;
@@ -2651,19 +2647,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    private static final int PFLAG3_POINTER_ICON_VALUE_START = 3 << PFLAG3_POINTER_ICON_LSHIFT;
    /**
     * Flag indicating that this view has requested a partial layout and
     * is added to the AttachInfo's list of views that need a partial layout
     * request handled on the next traversal.
     */
    static final int PFLAG3_PARTIAL_LAYOUT_REQUESTED = 0x800000;
    /**
     * Flag indicating that this view's LayoutParams have been explicitly changed
     * since the last layout pass.
     */
    static final int PFLAG3_LAYOUT_PARAMS_CHANGED = 0x1000000;
    /**
     * Always allow a user to over-scroll this view, provided it is a
     * view that can scroll.
@@ -12671,14 +12654,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * ViewGroup.LayoutParams, and these correspond to the different subclasses
     * of ViewGroup that are responsible for arranging their children.
     *
     * <p>This method may return null if this View is not attached to a parent
     * This method may return null if this View is not attached to a parent
     * ViewGroup or {@link #setLayoutParams(android.view.ViewGroup.LayoutParams)}
     * was not invoked successfully. When a View is attached to a parent
     * ViewGroup, this method must not return null.</p>
     *
     * <p>Callers that modify the returned LayoutParams object should call
     * {@link #setLayoutParams(LayoutParams)} to explicitly inform the view that
     * LayoutParams have changed.</p>
     * ViewGroup, this method must not return null.
     *
     * @return The LayoutParams associated with this view, or null if no
     *         parameters have been set yet
@@ -12695,9 +12674,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * correspond to the different subclasses of ViewGroup that are responsible
     * for arranging their children.
     *
     * <p>If the View's existing LayoutParams object as obtained by {@link #getLayoutParams()} is
     * modified, you should call this method to inform the view that it has changed.</p>
     *
     * @param params The layout parameters for this view, cannot be null
     */
    public void setLayoutParams(ViewGroup.LayoutParams params) {
@@ -12705,7 +12681,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            throw new NullPointerException("Layout parameters cannot be null");
        }
        mLayoutParams = params;
        mPrivateFlags3 |= PFLAG3_LAYOUT_PARAMS_CHANGED;
        resolveLayoutParams();
        if (mParent instanceof ViewGroup) {
            ((ViewGroup) mParent).onSetLayoutParams(this, params);
@@ -14381,12 +14356,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            mParent.requestTransparentRegion(this);
        }
        if ((mPrivateFlags & PFLAG_AWAKEN_SCROLL_BARS_ON_ATTACH) != 0) {
            initialAwakenScrollBars();
            mPrivateFlags &= ~PFLAG_AWAKEN_SCROLL_BARS_ON_ATTACH;
        }
        mPrivateFlags3 &= ~(PFLAG3_IS_LAID_OUT | PFLAG3_PARTIAL_LAYOUT_REQUESTED);
        mPrivateFlags3 &= ~PFLAG3_IS_LAID_OUT;
        jumpDrawablesToCurrentState();
@@ -14724,13 +14694,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    @CallSuper
    protected void onDetachedFromWindowInternal() {
        if (mAttachInfo != null && isPartialLayoutRequested()) {
            mAttachInfo.mPartialLayoutViews.remove(this);
        }
        mPrivateFlags &= ~PFLAG_CANCEL_NEXT_UP_EVENT;
        mPrivateFlags3 &= ~(PFLAG3_IS_LAID_OUT | PFLAG3_PARTIAL_LAYOUT_REQUESTED
                | PFLAG3_LAYOUT_PARAMS_CHANGED);
        mPrivateFlags3 &= ~PFLAG3_IS_LAID_OUT;
        removeUnsetPressCallback();
        removeLongPressCallback();
@@ -16916,32 +16881,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        return (mPrivateFlags & PFLAG_FORCE_LAYOUT) == PFLAG_FORCE_LAYOUT;
    }
    /**
     * Indicates whether or not this view has requested a partial layout that
     * may not affect its size or position within its parent. This state will be reset
     * the next time this view is laid out.
     *
     * @return true if partial layout has been requested
     */
    public final boolean isPartialLayoutRequested() {
        return (mPrivateFlags3 & PFLAG3_PARTIAL_LAYOUT_REQUESTED)
                == PFLAG3_PARTIAL_LAYOUT_REQUESTED;
    }
    /**
     * Returns true if this view's {@link ViewGroup.LayoutParams LayoutParams} changed
     * since the last time this view was successfully laid out. Typically this happens as a
     * result of a call to {@link #setLayoutParams(LayoutParams)}.
     *
     * @return true if this view's LayoutParams changed since last layout.
     */
    public final boolean didLayoutParamsChange() {
        if (sLayoutParamsAlwaysChanged) {
            return true;
        }
        return (mPrivateFlags3 & PFLAG3_LAYOUT_PARAMS_CHANGED) == PFLAG3_LAYOUT_PARAMS_CHANGED;
    }
    /**
     * Return true if o is a ViewGroup that is laying out using optical bounds.
     * @hide
@@ -16999,7 +16938,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if (changed || (mPrivateFlags & PFLAG_LAYOUT_REQUIRED) == PFLAG_LAYOUT_REQUIRED) {
            onLayout(changed, l, t, r, b);
            mPrivateFlags &= ~PFLAG_LAYOUT_REQUIRED;
            mPrivateFlags3 &= ~PFLAG3_LAYOUT_PARAMS_CHANGED;
            ListenerInfo li = mListenerInfo;
            if (li != null && li.mOnLayoutChangeListeners != null) {
@@ -17013,7 +16951,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
        mPrivateFlags &= ~PFLAG_FORCE_LAYOUT;
        mPrivateFlags3 &= ~PFLAG3_PARTIAL_LAYOUT_REQUESTED;
        mPrivateFlags3 |= PFLAG3_IS_LAID_OUT;
    }
@@ -19111,7 +19048,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        mPrivateFlags |= PFLAG_INVALIDATED;
        if (mParent != null && !mParent.isLayoutRequested()) {
            mParent.requestLayoutForChild(this);
            mParent.requestLayout();
        }
        if (mAttachInfo != null && mAttachInfo.mViewRequestingLayout == this) {
            mAttachInfo.mViewRequestingLayout = null;
@@ -19130,11 +19067,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        mPrivateFlags |= PFLAG_INVALIDATED;
    }
    void forcePartialLayout() {
        forceLayout();
        mPrivateFlags3 |= PFLAG3_PARTIAL_LAYOUT_REQUESTED;
    }
    /**
     * <p>
     * This is called to find out how big a view should be. The parent
@@ -22021,7 +21953,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        interface Callbacks {
            void playSoundEffect(int effectId);
            boolean performHapticFeedback(int effectId, boolean always);
            void schedulePartialLayout();
        }
        /**
+1 −169

File changed.

Preview size limit exceeded, changes collapsed.

Loading