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

Commit e8af49bc authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 8aa7f9ad: am 96f1ee98: Merge "Fix a padding resolution bug for...

am 8aa7f9ad: am 96f1ee98: Merge "Fix a padding resolution bug for adapter-based views" into jb-mr1-dev

* commit '8aa7f9ad':
  Fix a padding resolution bug for adapter-based views
parents 172aa0c9 8aa7f9ad
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2076,6 +2076,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    static final int VIEW_QUICK_REJECTED = 0x10000000;
    /**
     * Flag indicating that start/end padding has been resolved into left/right padding
     * for use in measurement, layout, drawing, etc. This is set by {@link #resolvePadding()}
     * and checked by {@link #measure(int, int)} to determine if padding needs to be resolved
     * during measurement. In some special cases this is required such as when an adapter-based
     * view measures prospective children without attaching them to a window.
     */
    static final int PADDING_RESOLVED = 0x20000000;
    // There are a couple of flags left in mPrivateFlags2
    /* End of masks for mPrivateFlags2 */
@@ -11335,6 +11344,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        internalSetPadding(mUserPaddingLeft, mPaddingTop, mUserPaddingRight, mUserPaddingBottom);
        onPaddingChanged(resolvedLayoutDirection);
        mPrivateFlags2 |= PADDING_RESOLVED;
    }
    /**
@@ -11430,6 +11440,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        resetResolvedLayoutDirection();
        resetResolvedTextAlignment();
        resetAccessibilityStateChanged();
        mPrivateFlags2 &= ~PADDING_RESOLVED;
    }
    /**
@@ -14949,6 +14960,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            // first clears the measured dimension flag
            mPrivateFlags &= ~MEASURED_DIMENSION_SET;
            if ((mPrivateFlags2 & PADDING_RESOLVED) == 0) {
                resolvePadding();
            }
            // measure ourselves, this should set the measured dimension flag back
            onMeasure(widthMeasureSpec, heightMeasureSpec);