am 7c669f45: Merge "Revert "Work around inconsistent views in RelativeLayout.onMeasure()"" into mnc-dev
* commit '7c669f4547d459d64ac403647e177b9953dfe60a': Revert "Work around inconsistent views in RelativeLayout.onMeasure()"
This commit is contained in:
@@ -522,7 +522,7 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
View baselineView = null;
|
View baselineView = null;
|
||||||
LayoutParams baselineParams = null;
|
LayoutParams baselineParams = null;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final View child = views[i];
|
final View child = getChildAt(i);
|
||||||
if (child.getVisibility() != GONE) {
|
if (child.getVisibility() != GONE) {
|
||||||
final LayoutParams childParams = (LayoutParams) child.getLayoutParams();
|
final LayoutParams childParams = (LayoutParams) child.getLayoutParams();
|
||||||
if (baselineView == null || baselineParams == null
|
if (baselineView == null || baselineParams == null
|
||||||
@@ -548,9 +548,9 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
|
|
||||||
if (offsetHorizontalAxis) {
|
if (offsetHorizontalAxis) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final View child = views[i];
|
View child = getChildAt(i);
|
||||||
if (child.getVisibility() != GONE) {
|
if (child.getVisibility() != GONE) {
|
||||||
final LayoutParams params = (LayoutParams) child.getLayoutParams();
|
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
||||||
final int[] rules = params.getRules(layoutDirection);
|
final int[] rules = params.getRules(layoutDirection);
|
||||||
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_HORIZONTAL] != 0) {
|
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_HORIZONTAL] != 0) {
|
||||||
centerHorizontal(child, params, width);
|
centerHorizontal(child, params, width);
|
||||||
@@ -578,9 +578,9 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
|
|
||||||
if (offsetVerticalAxis) {
|
if (offsetVerticalAxis) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final View child = views[i];
|
View child = getChildAt(i);
|
||||||
if (child.getVisibility() != GONE) {
|
if (child.getVisibility() != GONE) {
|
||||||
final LayoutParams params = (LayoutParams) child.getLayoutParams();
|
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
||||||
final int[] rules = params.getRules(layoutDirection);
|
final int[] rules = params.getRules(layoutDirection);
|
||||||
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_VERTICAL] != 0) {
|
if (rules[CENTER_IN_PARENT] != 0 || rules[CENTER_VERTICAL] != 0) {
|
||||||
centerVertical(child, params, height);
|
centerVertical(child, params, height);
|
||||||
@@ -607,9 +607,9 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
final int verticalOffset = contentBounds.top - top;
|
final int verticalOffset = contentBounds.top - top;
|
||||||
if (horizontalOffset != 0 || verticalOffset != 0) {
|
if (horizontalOffset != 0 || verticalOffset != 0) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final View child = views[i];
|
View child = getChildAt(i);
|
||||||
if (child.getVisibility() != GONE && child != ignore) {
|
if (child.getVisibility() != GONE && child != ignore) {
|
||||||
final LayoutParams params = (LayoutParams) child.getLayoutParams();
|
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
||||||
if (horizontalGravity) {
|
if (horizontalGravity) {
|
||||||
params.mLeft += horizontalOffset;
|
params.mLeft += horizontalOffset;
|
||||||
params.mRight += horizontalOffset;
|
params.mRight += horizontalOffset;
|
||||||
@@ -626,9 +626,9 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
if (isLayoutRtl()) {
|
if (isLayoutRtl()) {
|
||||||
final int offsetWidth = myWidth - width;
|
final int offsetWidth = myWidth - width;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final View child = views[i];
|
View child = getChildAt(i);
|
||||||
if (child.getVisibility() != GONE) {
|
if (child.getVisibility() != GONE) {
|
||||||
final LayoutParams params = (LayoutParams) child.getLayoutParams();
|
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
||||||
params.mLeft -= offsetWidth;
|
params.mLeft -= offsetWidth;
|
||||||
params.mRight -= offsetWidth;
|
params.mRight -= offsetWidth;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user