am 77b2a861: Merge "Fix padding resolution" into klp-dev
* commit '77b2a86144365ce3dee557b5c444075c0e0a4033': Fix padding resolution
This commit is contained in:
@@ -12076,12 +12076,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void resolvePadding() {
|
public void resolvePadding() {
|
||||||
|
final int resolvedLayoutDirection = getLayoutDirection();
|
||||||
|
|
||||||
if (!isRtlCompatibilityMode()) {
|
if (!isRtlCompatibilityMode()) {
|
||||||
// Post Jelly Bean MR1 case: we need to take the resolved layout direction into account.
|
// Post Jelly Bean MR1 case: we need to take the resolved layout direction into account.
|
||||||
// If start / end padding are defined, they will be resolved (hence overriding) to
|
// If start / end padding are defined, they will be resolved (hence overriding) to
|
||||||
// left / right or right / left depending on the resolved layout direction.
|
// left / right or right / left depending on the resolved layout direction.
|
||||||
// If start / end padding are not defined, use the left / right ones.
|
// If start / end padding are not defined, use the left / right ones.
|
||||||
int resolvedLayoutDirection = getLayoutDirection();
|
|
||||||
switch (resolvedLayoutDirection) {
|
switch (resolvedLayoutDirection) {
|
||||||
case LAYOUT_DIRECTION_RTL:
|
case LAYOUT_DIRECTION_RTL:
|
||||||
if (mUserPaddingStart != UNDEFINED_PADDING) {
|
if (mUserPaddingStart != UNDEFINED_PADDING) {
|
||||||
@@ -12110,11 +12111,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mUserPaddingBottom = (mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
|
mUserPaddingBottom = (mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
|
||||||
|
|
||||||
onRtlPropertiesChanged(resolvedLayoutDirection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internalSetPadding(mUserPaddingLeft, mPaddingTop, mUserPaddingRight, mUserPaddingBottom);
|
internalSetPadding(mUserPaddingLeft, mPaddingTop, mUserPaddingRight, mUserPaddingBottom);
|
||||||
|
onRtlPropertiesChanged(resolvedLayoutDirection);
|
||||||
|
|
||||||
mPrivateFlags2 |= PFLAG2_PADDING_RESOLVED;
|
mPrivateFlags2 |= PFLAG2_PADDING_RESOLVED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user