1301 lines
59 KiB
Java
1301 lines
59 KiB
Java
package androidx.appcompat.widget;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.util.AttributeSet;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.accessibility.AccessibilityEvent;
|
|
import android.view.accessibility.AccessibilityNodeInfo;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.appcompat.R;
|
|
import androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure;
|
|
import androidx.core.view.GravityCompat;
|
|
import androidx.core.view.InputDeviceCompat;
|
|
import androidx.core.view.ViewCompat;
|
|
import b.d.b.a.a;
|
|
import com.google.android.material.badge.BadgeDrawable;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
/* loaded from: classes.dex */
|
|
public class LinearLayoutCompat extends ViewGroup {
|
|
private static final String ACCESSIBILITY_CLASS_NAME = "androidx.appcompat.widget.LinearLayoutCompat";
|
|
public static final int HORIZONTAL = 0;
|
|
private static final int INDEX_BOTTOM = 2;
|
|
private static final int INDEX_CENTER_VERTICAL = 0;
|
|
private static final int INDEX_FILL = 3;
|
|
private static final int INDEX_TOP = 1;
|
|
public static final int SHOW_DIVIDER_BEGINNING = 1;
|
|
public static final int SHOW_DIVIDER_END = 4;
|
|
public static final int SHOW_DIVIDER_MIDDLE = 2;
|
|
public static final int SHOW_DIVIDER_NONE = 0;
|
|
public static final int VERTICAL = 1;
|
|
private static final int VERTICAL_GRAVITY_COUNT = 4;
|
|
private boolean mBaselineAligned;
|
|
private int mBaselineAlignedChildIndex;
|
|
private int mBaselineChildTop;
|
|
private Drawable mDivider;
|
|
private int mDividerHeight;
|
|
private int mDividerPadding;
|
|
private int mDividerWidth;
|
|
private int mGravity;
|
|
private int[] mMaxAscent;
|
|
private int[] mMaxDescent;
|
|
private int mOrientation;
|
|
private int mShowDividers;
|
|
private int mTotalLength;
|
|
private boolean mUseLargestChild;
|
|
private float mWeightSum;
|
|
|
|
@Retention(RetentionPolicy.SOURCE)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
|
/* loaded from: classes.dex */
|
|
public @interface DividerMode {
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
|
public int gravity;
|
|
public float weight;
|
|
|
|
public LayoutParams(int i, int i2) {
|
|
super(i, i2);
|
|
this.gravity = -1;
|
|
this.weight = 0.0f;
|
|
}
|
|
|
|
public LayoutParams(int i, int i2, float f) {
|
|
super(i, i2);
|
|
this.gravity = -1;
|
|
this.weight = f;
|
|
}
|
|
|
|
public LayoutParams(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.gravity = -1;
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R.styleable.LinearLayoutCompat_Layout);
|
|
this.weight = obtainStyledAttributes.getFloat(R.styleable.LinearLayoutCompat_Layout_android_layout_weight, 0.0f);
|
|
this.gravity = obtainStyledAttributes.getInt(R.styleable.LinearLayoutCompat_Layout_android_layout_gravity, -1);
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
|
|
public LayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
super(layoutParams);
|
|
this.gravity = -1;
|
|
}
|
|
|
|
public LayoutParams(ViewGroup.MarginLayoutParams marginLayoutParams) {
|
|
super(marginLayoutParams);
|
|
this.gravity = -1;
|
|
}
|
|
|
|
public LayoutParams(LayoutParams layoutParams) {
|
|
super((ViewGroup.MarginLayoutParams) layoutParams);
|
|
this.gravity = -1;
|
|
this.weight = layoutParams.weight;
|
|
this.gravity = layoutParams.gravity;
|
|
}
|
|
}
|
|
|
|
@Retention(RetentionPolicy.SOURCE)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
|
/* loaded from: classes.dex */
|
|
public @interface OrientationMode {
|
|
}
|
|
|
|
public LinearLayoutCompat(@NonNull Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
public LinearLayoutCompat(@NonNull Context context, @Nullable AttributeSet attributeSet) {
|
|
this(context, attributeSet, 0);
|
|
}
|
|
|
|
public LinearLayoutCompat(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
this.mBaselineAligned = true;
|
|
this.mBaselineAlignedChildIndex = -1;
|
|
this.mBaselineChildTop = 0;
|
|
this.mGravity = BadgeDrawable.TOP_START;
|
|
int[] iArr = R.styleable.LinearLayoutCompat;
|
|
TintTypedArray obtainStyledAttributes = TintTypedArray.obtainStyledAttributes(context, attributeSet, iArr, i, 0);
|
|
ViewCompat.saveAttributeDataForStyleable(this, context, iArr, attributeSet, obtainStyledAttributes.getWrappedTypeArray(), i, 0);
|
|
int i2 = obtainStyledAttributes.getInt(R.styleable.LinearLayoutCompat_android_orientation, -1);
|
|
if (i2 >= 0) {
|
|
setOrientation(i2);
|
|
}
|
|
int i3 = obtainStyledAttributes.getInt(R.styleable.LinearLayoutCompat_android_gravity, -1);
|
|
if (i3 >= 0) {
|
|
setGravity(i3);
|
|
}
|
|
boolean z2 = obtainStyledAttributes.getBoolean(R.styleable.LinearLayoutCompat_android_baselineAligned, true);
|
|
if (!z2) {
|
|
setBaselineAligned(z2);
|
|
}
|
|
this.mWeightSum = obtainStyledAttributes.getFloat(R.styleable.LinearLayoutCompat_android_weightSum, -1.0f);
|
|
this.mBaselineAlignedChildIndex = obtainStyledAttributes.getInt(R.styleable.LinearLayoutCompat_android_baselineAlignedChildIndex, -1);
|
|
this.mUseLargestChild = obtainStyledAttributes.getBoolean(R.styleable.LinearLayoutCompat_measureWithLargestChild, false);
|
|
setDividerDrawable(obtainStyledAttributes.getDrawable(R.styleable.LinearLayoutCompat_divider));
|
|
this.mShowDividers = obtainStyledAttributes.getInt(R.styleable.LinearLayoutCompat_showDividers, 0);
|
|
this.mDividerPadding = obtainStyledAttributes.getDimensionPixelSize(R.styleable.LinearLayoutCompat_dividerPadding, 0);
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
|
|
private void forceUniformHeight(int i, int i2) {
|
|
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), BasicMeasure.EXACTLY);
|
|
for (int i3 = 0; i3 < i; i3++) {
|
|
View virtualChildAt = getVirtualChildAt(i3);
|
|
if (virtualChildAt.getVisibility() != 8) {
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams).height == -1) {
|
|
int i4 = ((ViewGroup.MarginLayoutParams) layoutParams).width;
|
|
((ViewGroup.MarginLayoutParams) layoutParams).width = virtualChildAt.getMeasuredWidth();
|
|
measureChildWithMargins(virtualChildAt, i2, 0, makeMeasureSpec, 0);
|
|
((ViewGroup.MarginLayoutParams) layoutParams).width = i4;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void forceUniformWidth(int i, int i2) {
|
|
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), BasicMeasure.EXACTLY);
|
|
for (int i3 = 0; i3 < i; i3++) {
|
|
View virtualChildAt = getVirtualChildAt(i3);
|
|
if (virtualChildAt.getVisibility() != 8) {
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams).width == -1) {
|
|
int i4 = ((ViewGroup.MarginLayoutParams) layoutParams).height;
|
|
((ViewGroup.MarginLayoutParams) layoutParams).height = virtualChildAt.getMeasuredHeight();
|
|
measureChildWithMargins(virtualChildAt, makeMeasureSpec, 0, i2, 0);
|
|
((ViewGroup.MarginLayoutParams) layoutParams).height = i4;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void setChildFrame(View view, int i, int i2, int i3, int i4) {
|
|
view.layout(i, i2, i3 + i, i4 + i2);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
return layoutParams instanceof LayoutParams;
|
|
}
|
|
|
|
public void drawDividersHorizontal(Canvas canvas) {
|
|
int i;
|
|
int i2;
|
|
int i3;
|
|
int virtualChildCount = getVirtualChildCount();
|
|
boolean isLayoutRtl = ViewUtils.isLayoutRtl(this);
|
|
for (int i4 = 0; i4 < virtualChildCount; i4++) {
|
|
View virtualChildAt = getVirtualChildAt(i4);
|
|
if (!(virtualChildAt == null || virtualChildAt.getVisibility() == 8 || !hasDividerBeforeChildAt(i4))) {
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
drawVerticalDivider(canvas, isLayoutRtl ? virtualChildAt.getRight() + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin : (virtualChildAt.getLeft() - ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin) - this.mDividerWidth);
|
|
}
|
|
}
|
|
if (hasDividerBeforeChildAt(virtualChildCount)) {
|
|
View virtualChildAt2 = getVirtualChildAt(virtualChildCount - 1);
|
|
if (virtualChildAt2 != null) {
|
|
LayoutParams layoutParams2 = (LayoutParams) virtualChildAt2.getLayoutParams();
|
|
if (isLayoutRtl) {
|
|
i3 = virtualChildAt2.getLeft() - ((ViewGroup.MarginLayoutParams) layoutParams2).leftMargin;
|
|
i2 = this.mDividerWidth;
|
|
i = i3 - i2;
|
|
drawVerticalDivider(canvas, i);
|
|
}
|
|
i = virtualChildAt2.getRight() + ((ViewGroup.MarginLayoutParams) layoutParams2).rightMargin;
|
|
drawVerticalDivider(canvas, i);
|
|
} else if (isLayoutRtl) {
|
|
i = getPaddingLeft();
|
|
drawVerticalDivider(canvas, i);
|
|
} else {
|
|
i3 = getWidth() - getPaddingRight();
|
|
i2 = this.mDividerWidth;
|
|
i = i3 - i2;
|
|
drawVerticalDivider(canvas, i);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void drawDividersVertical(Canvas canvas) {
|
|
int virtualChildCount = getVirtualChildCount();
|
|
for (int i = 0; i < virtualChildCount; i++) {
|
|
View virtualChildAt = getVirtualChildAt(i);
|
|
if (!(virtualChildAt == null || virtualChildAt.getVisibility() == 8 || !hasDividerBeforeChildAt(i))) {
|
|
drawHorizontalDivider(canvas, (virtualChildAt.getTop() - ((ViewGroup.MarginLayoutParams) ((LayoutParams) virtualChildAt.getLayoutParams())).topMargin) - this.mDividerHeight);
|
|
}
|
|
}
|
|
if (hasDividerBeforeChildAt(virtualChildCount)) {
|
|
View virtualChildAt2 = getVirtualChildAt(virtualChildCount - 1);
|
|
drawHorizontalDivider(canvas, virtualChildAt2 == null ? (getHeight() - getPaddingBottom()) - this.mDividerHeight : virtualChildAt2.getBottom() + ((ViewGroup.MarginLayoutParams) ((LayoutParams) virtualChildAt2.getLayoutParams())).bottomMargin);
|
|
}
|
|
}
|
|
|
|
public void drawHorizontalDivider(Canvas canvas, int i) {
|
|
this.mDivider.setBounds(getPaddingLeft() + this.mDividerPadding, i, (getWidth() - getPaddingRight()) - this.mDividerPadding, this.mDividerHeight + i);
|
|
this.mDivider.draw(canvas);
|
|
}
|
|
|
|
public void drawVerticalDivider(Canvas canvas, int i) {
|
|
this.mDivider.setBounds(i, getPaddingTop() + this.mDividerPadding, this.mDividerWidth + i, (getHeight() - getPaddingBottom()) - this.mDividerPadding);
|
|
this.mDivider.draw(canvas);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public LayoutParams generateDefaultLayoutParams() {
|
|
int i = this.mOrientation;
|
|
if (i == 0) {
|
|
return new LayoutParams(-2, -2);
|
|
}
|
|
if (i == 1) {
|
|
return new LayoutParams(-1, -2);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public LayoutParams generateLayoutParams(AttributeSet attributeSet) {
|
|
return new LayoutParams(getContext(), attributeSet);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
return new LayoutParams(layoutParams);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int getBaseline() {
|
|
int i;
|
|
if (this.mBaselineAlignedChildIndex < 0) {
|
|
return super.getBaseline();
|
|
}
|
|
int childCount = getChildCount();
|
|
int i2 = this.mBaselineAlignedChildIndex;
|
|
if (childCount > i2) {
|
|
View childAt = getChildAt(i2);
|
|
int baseline = childAt.getBaseline();
|
|
if (baseline != -1) {
|
|
int i3 = this.mBaselineChildTop;
|
|
if (this.mOrientation == 1 && (i = this.mGravity & 112) != 48) {
|
|
if (i == 16) {
|
|
i3 += ((((getBottom() - getTop()) - getPaddingTop()) - getPaddingBottom()) - this.mTotalLength) / 2;
|
|
} else if (i == 80) {
|
|
i3 = ((getBottom() - getTop()) - getPaddingBottom()) - this.mTotalLength;
|
|
}
|
|
}
|
|
return i3 + ((ViewGroup.MarginLayoutParams) ((LayoutParams) childAt.getLayoutParams())).topMargin + baseline;
|
|
} else if (this.mBaselineAlignedChildIndex == 0) {
|
|
return -1;
|
|
} else {
|
|
throw new RuntimeException("mBaselineAlignedChildIndex of LinearLayout points to a View that doesn't know how to get its baseline.");
|
|
}
|
|
} else {
|
|
throw new RuntimeException("mBaselineAlignedChildIndex of LinearLayout set to an index that is out of bounds.");
|
|
}
|
|
}
|
|
|
|
public int getBaselineAlignedChildIndex() {
|
|
return this.mBaselineAlignedChildIndex;
|
|
}
|
|
|
|
public int getChildrenSkipCount(View view, int i) {
|
|
return 0;
|
|
}
|
|
|
|
public Drawable getDividerDrawable() {
|
|
return this.mDivider;
|
|
}
|
|
|
|
public int getDividerPadding() {
|
|
return this.mDividerPadding;
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
|
|
public int getDividerWidth() {
|
|
return this.mDividerWidth;
|
|
}
|
|
|
|
public int getGravity() {
|
|
return this.mGravity;
|
|
}
|
|
|
|
public int getLocationOffset(View view) {
|
|
return 0;
|
|
}
|
|
|
|
public int getNextLocationOffset(View view) {
|
|
return 0;
|
|
}
|
|
|
|
public int getOrientation() {
|
|
return this.mOrientation;
|
|
}
|
|
|
|
public int getShowDividers() {
|
|
return this.mShowDividers;
|
|
}
|
|
|
|
public View getVirtualChildAt(int i) {
|
|
return getChildAt(i);
|
|
}
|
|
|
|
public int getVirtualChildCount() {
|
|
return getChildCount();
|
|
}
|
|
|
|
public float getWeightSum() {
|
|
return this.mWeightSum;
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public boolean hasDividerBeforeChildAt(int i) {
|
|
if (i == 0) {
|
|
return (this.mShowDividers & 1) != 0;
|
|
}
|
|
if (i == getChildCount()) {
|
|
return (this.mShowDividers & 4) != 0;
|
|
}
|
|
if ((this.mShowDividers & 2) == 0) {
|
|
return false;
|
|
}
|
|
for (int i2 = i - 1; i2 >= 0; i2--) {
|
|
if (getChildAt(i2).getVisibility() != 8) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public boolean isBaselineAligned() {
|
|
return this.mBaselineAligned;
|
|
}
|
|
|
|
public boolean isMeasureWithLargestChildEnabled() {
|
|
return this.mUseLargestChild;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:29:0x00a8 */
|
|
/* JADX WARN: Removed duplicated region for block: B:32:0x00b1 */
|
|
/* JADX WARN: Removed duplicated region for block: B:44:0x00e6 */
|
|
/* JADX WARN: Removed duplicated region for block: B:47:0x00fa */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void layoutHorizontal(int i, int i2, int i3, int i4) {
|
|
int i5;
|
|
int i6;
|
|
int i7;
|
|
int i8;
|
|
int i9;
|
|
int i10;
|
|
boolean isLayoutRtl = ViewUtils.isLayoutRtl(this);
|
|
int paddingTop = getPaddingTop();
|
|
int i11 = i4 - i2;
|
|
int paddingBottom = i11 - getPaddingBottom();
|
|
int paddingBottom2 = (i11 - paddingTop) - getPaddingBottom();
|
|
int virtualChildCount = getVirtualChildCount();
|
|
int i12 = this.mGravity;
|
|
int i13 = i12 & 112;
|
|
boolean z2 = this.mBaselineAligned;
|
|
int[] iArr = this.mMaxAscent;
|
|
int[] iArr2 = this.mMaxDescent;
|
|
int absoluteGravity = GravityCompat.getAbsoluteGravity(8388615 & i12, ViewCompat.getLayoutDirection(this));
|
|
int paddingLeft = absoluteGravity != 1 ? absoluteGravity != 5 ? getPaddingLeft() : ((getPaddingLeft() + i3) - i) - this.mTotalLength : getPaddingLeft() + (((i3 - i) - this.mTotalLength) / 2);
|
|
if (isLayoutRtl) {
|
|
i6 = virtualChildCount - 1;
|
|
i5 = -1;
|
|
} else {
|
|
i6 = 0;
|
|
i5 = 1;
|
|
}
|
|
int i14 = 0;
|
|
while (i14 < virtualChildCount) {
|
|
int i15 = (i5 * i14) + i6;
|
|
View virtualChildAt = getVirtualChildAt(i15);
|
|
if (virtualChildAt == null) {
|
|
paddingLeft = measureNullChild(i15) + paddingLeft;
|
|
} else if (virtualChildAt.getVisibility() != 8) {
|
|
int measuredWidth = virtualChildAt.getMeasuredWidth();
|
|
int measuredHeight = virtualChildAt.getMeasuredHeight();
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
if (z2) {
|
|
virtualChildCount = virtualChildCount;
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams).height != -1) {
|
|
i7 = virtualChildAt.getBaseline();
|
|
i8 = layoutParams.gravity;
|
|
if (i8 < 0) {
|
|
i8 = i13;
|
|
}
|
|
i9 = i8 & 112;
|
|
i13 = i13;
|
|
if (i9 != 16) {
|
|
i10 = ((((paddingBottom2 - measuredHeight) / 2) + paddingTop) + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin) - ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin;
|
|
} else if (i9 == 48) {
|
|
i10 = ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + paddingTop;
|
|
if (i7 != -1) {
|
|
i10 = (iArr[1] - i7) + i10;
|
|
}
|
|
} else if (i9 != 80) {
|
|
i10 = paddingTop;
|
|
} else {
|
|
i10 = (paddingBottom - measuredHeight) - ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin;
|
|
if (i7 != -1) {
|
|
i10 -= iArr2[2] - (virtualChildAt.getMeasuredHeight() - i7);
|
|
}
|
|
}
|
|
if (hasDividerBeforeChildAt(i15)) {
|
|
paddingLeft += this.mDividerWidth;
|
|
}
|
|
int i16 = ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + paddingLeft;
|
|
paddingTop = paddingTop;
|
|
setChildFrame(virtualChildAt, getLocationOffset(virtualChildAt) + i16, i10, measuredWidth, measuredHeight);
|
|
paddingLeft = getNextLocationOffset(virtualChildAt) + measuredWidth + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin + i16;
|
|
i14 = getChildrenSkipCount(virtualChildAt, i15) + i14;
|
|
i14++;
|
|
}
|
|
} else {
|
|
virtualChildCount = virtualChildCount;
|
|
}
|
|
i7 = -1;
|
|
i8 = layoutParams.gravity;
|
|
if (i8 < 0) {
|
|
}
|
|
i9 = i8 & 112;
|
|
i13 = i13;
|
|
if (i9 != 16) {
|
|
}
|
|
if (hasDividerBeforeChildAt(i15)) {
|
|
}
|
|
int i162 = ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + paddingLeft;
|
|
paddingTop = paddingTop;
|
|
setChildFrame(virtualChildAt, getLocationOffset(virtualChildAt) + i162, i10, measuredWidth, measuredHeight);
|
|
paddingLeft = getNextLocationOffset(virtualChildAt) + measuredWidth + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin + i162;
|
|
i14 = getChildrenSkipCount(virtualChildAt, i15) + i14;
|
|
i14++;
|
|
}
|
|
paddingTop = paddingTop;
|
|
virtualChildCount = virtualChildCount;
|
|
i13 = i13;
|
|
i14++;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:29:0x00a0 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void layoutVertical(int i, int i2, int i3, int i4) {
|
|
int i5;
|
|
int i6;
|
|
int i7;
|
|
int paddingLeft = getPaddingLeft();
|
|
int i8 = i3 - i;
|
|
int paddingRight = i8 - getPaddingRight();
|
|
int paddingRight2 = (i8 - paddingLeft) - getPaddingRight();
|
|
int virtualChildCount = getVirtualChildCount();
|
|
int i9 = this.mGravity;
|
|
int i10 = i9 & 112;
|
|
int i11 = i9 & GravityCompat.RELATIVE_HORIZONTAL_GRAVITY_MASK;
|
|
int paddingTop = i10 != 16 ? i10 != 80 ? getPaddingTop() : ((getPaddingTop() + i4) - i2) - this.mTotalLength : getPaddingTop() + (((i4 - i2) - this.mTotalLength) / 2);
|
|
int i12 = 0;
|
|
while (i12 < virtualChildCount) {
|
|
View virtualChildAt = getVirtualChildAt(i12);
|
|
if (virtualChildAt == null) {
|
|
paddingTop = measureNullChild(i12) + paddingTop;
|
|
} else if (virtualChildAt.getVisibility() != 8) {
|
|
int measuredWidth = virtualChildAt.getMeasuredWidth();
|
|
int measuredHeight = virtualChildAt.getMeasuredHeight();
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
i11 = layoutParams.gravity;
|
|
if (i11 < 0) {
|
|
}
|
|
int absoluteGravity = GravityCompat.getAbsoluteGravity(i11, ViewCompat.getLayoutDirection(this)) & 7;
|
|
if (absoluteGravity == 1) {
|
|
i7 = ((paddingRight2 - measuredWidth) / 2) + paddingLeft + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin;
|
|
i6 = ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin;
|
|
} else if (absoluteGravity != 5) {
|
|
i5 = ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + paddingLeft;
|
|
if (hasDividerBeforeChildAt(i12)) {
|
|
paddingTop += this.mDividerHeight;
|
|
}
|
|
int i13 = paddingTop + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin;
|
|
setChildFrame(virtualChildAt, i5, getLocationOffset(virtualChildAt) + i13, measuredWidth, measuredHeight);
|
|
paddingTop = getNextLocationOffset(virtualChildAt) + measuredHeight + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin + i13;
|
|
i12 += getChildrenSkipCount(virtualChildAt, i12);
|
|
} else {
|
|
i7 = paddingRight - measuredWidth;
|
|
i6 = ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin;
|
|
}
|
|
i5 = i7 - i6;
|
|
if (hasDividerBeforeChildAt(i12)) {
|
|
}
|
|
int i132 = paddingTop + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin;
|
|
setChildFrame(virtualChildAt, i5, getLocationOffset(virtualChildAt) + i132, measuredWidth, measuredHeight);
|
|
paddingTop = getNextLocationOffset(virtualChildAt) + measuredHeight + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin + i132;
|
|
i12 += getChildrenSkipCount(virtualChildAt, i12);
|
|
}
|
|
i12++;
|
|
}
|
|
}
|
|
|
|
public void measureChildBeforeLayout(View view, int i, int i2, int i3, int i4, int i5) {
|
|
measureChildWithMargins(view, i2, i3, i4, i5);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:188:0x044e */
|
|
/* JADX WARN: Removed duplicated region for block: B:67:0x0195 */
|
|
/* JADX WARN: Removed duplicated region for block: B:77:0x01c9 */
|
|
/* JADX WARN: Removed duplicated region for block: B:80:0x01d4 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void measureHorizontal(int i, int i2) {
|
|
int i3;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
int i7;
|
|
int baseline;
|
|
int i8;
|
|
int i9;
|
|
int i10;
|
|
View view;
|
|
int i11;
|
|
boolean z2;
|
|
int measuredHeight;
|
|
int baseline2;
|
|
int i12;
|
|
int i13;
|
|
this.mTotalLength = 0;
|
|
int virtualChildCount = getVirtualChildCount();
|
|
int mode = View.MeasureSpec.getMode(i);
|
|
int mode2 = View.MeasureSpec.getMode(i2);
|
|
if (this.mMaxAscent == null || this.mMaxDescent == null) {
|
|
this.mMaxAscent = new int[4];
|
|
this.mMaxDescent = new int[4];
|
|
}
|
|
int[] iArr = this.mMaxAscent;
|
|
int[] iArr2 = this.mMaxDescent;
|
|
iArr[3] = -1;
|
|
iArr[2] = -1;
|
|
iArr[1] = -1;
|
|
iArr[0] = -1;
|
|
iArr2[3] = -1;
|
|
iArr2[2] = -1;
|
|
iArr2[1] = -1;
|
|
iArr2[0] = -1;
|
|
boolean z3 = this.mBaselineAligned;
|
|
boolean z4 = this.mUseLargestChild;
|
|
int i14 = BasicMeasure.EXACTLY;
|
|
boolean z5 = mode == 1073741824;
|
|
float f = 0.0f;
|
|
int i15 = 0;
|
|
int i16 = 0;
|
|
int i17 = 0;
|
|
int i18 = 0;
|
|
int i19 = 0;
|
|
boolean z6 = false;
|
|
int i20 = 0;
|
|
boolean z7 = true;
|
|
boolean z8 = false;
|
|
while (i15 < virtualChildCount) {
|
|
View virtualChildAt = getVirtualChildAt(i15);
|
|
if (virtualChildAt == null) {
|
|
this.mTotalLength = measureNullChild(i15) + this.mTotalLength;
|
|
} else if (virtualChildAt.getVisibility() == 8) {
|
|
i15 += getChildrenSkipCount(virtualChildAt, i15);
|
|
} else {
|
|
if (hasDividerBeforeChildAt(i15)) {
|
|
this.mTotalLength += this.mDividerWidth;
|
|
}
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
float f2 = layoutParams.weight;
|
|
float f3 = f + f2;
|
|
if (mode == i14 && ((ViewGroup.MarginLayoutParams) layoutParams).width == 0 && f2 > 0.0f) {
|
|
if (z5) {
|
|
this.mTotalLength = ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin + this.mTotalLength;
|
|
} else {
|
|
int i21 = this.mTotalLength;
|
|
this.mTotalLength = Math.max(i21, ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + i21 + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin);
|
|
}
|
|
if (z3) {
|
|
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, 0);
|
|
virtualChildAt.measure(makeMeasureSpec, makeMeasureSpec);
|
|
i10 = i15;
|
|
z4 = z4;
|
|
z3 = z3;
|
|
view = virtualChildAt;
|
|
} else {
|
|
i10 = i15;
|
|
z4 = z4;
|
|
z3 = z3;
|
|
view = virtualChildAt;
|
|
i11 = BasicMeasure.EXACTLY;
|
|
z6 = true;
|
|
if (mode2 == i11 && ((ViewGroup.MarginLayoutParams) layoutParams).height == -1) {
|
|
z2 = true;
|
|
z8 = true;
|
|
} else {
|
|
z2 = false;
|
|
}
|
|
int i22 = ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin;
|
|
measuredHeight = view.getMeasuredHeight() + i22;
|
|
i20 = View.combineMeasuredStates(i20, view.getMeasuredState());
|
|
if (z3 && (baseline2 = view.getBaseline()) != -1) {
|
|
i12 = layoutParams.gravity;
|
|
if (i12 < 0) {
|
|
i12 = this.mGravity;
|
|
}
|
|
int i23 = (((i12 & 112) >> 4) & (-2)) >> 1;
|
|
iArr[i23] = Math.max(iArr[i23], baseline2);
|
|
iArr2[i23] = Math.max(iArr2[i23], measuredHeight - baseline2);
|
|
}
|
|
i17 = Math.max(i17, measuredHeight);
|
|
z7 = !z7 && ((ViewGroup.MarginLayoutParams) layoutParams).height == -1;
|
|
if (layoutParams.weight <= 0.0f) {
|
|
if (!z2) {
|
|
i22 = measuredHeight;
|
|
}
|
|
i19 = Math.max(i19, i22);
|
|
} else {
|
|
if (!z2) {
|
|
i22 = measuredHeight;
|
|
}
|
|
i18 = Math.max(i18, i22);
|
|
i19 = i19;
|
|
}
|
|
i15 = getChildrenSkipCount(view, i10) + i10;
|
|
f = f3;
|
|
i15++;
|
|
iArr2 = iArr2;
|
|
i14 = BasicMeasure.EXACTLY;
|
|
}
|
|
} else {
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams).width != 0 || f2 <= 0.0f) {
|
|
i13 = Integer.MIN_VALUE;
|
|
} else {
|
|
((ViewGroup.MarginLayoutParams) layoutParams).width = -2;
|
|
i13 = 0;
|
|
}
|
|
i10 = i15;
|
|
z4 = z4;
|
|
z3 = z3;
|
|
measureChildBeforeLayout(virtualChildAt, i10, i, f3 == 0.0f ? this.mTotalLength : 0, i2, 0);
|
|
if (i13 != Integer.MIN_VALUE) {
|
|
((ViewGroup.MarginLayoutParams) layoutParams).width = i13;
|
|
}
|
|
int measuredWidth = virtualChildAt.getMeasuredWidth();
|
|
if (z5) {
|
|
view = virtualChildAt;
|
|
this.mTotalLength = getNextLocationOffset(view) + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + measuredWidth + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin + this.mTotalLength;
|
|
} else {
|
|
view = virtualChildAt;
|
|
int i24 = this.mTotalLength;
|
|
this.mTotalLength = Math.max(i24, getNextLocationOffset(view) + i24 + measuredWidth + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin);
|
|
}
|
|
if (z4) {
|
|
i16 = Math.max(measuredWidth, i16);
|
|
}
|
|
}
|
|
i11 = BasicMeasure.EXACTLY;
|
|
if (mode2 == i11) {
|
|
}
|
|
z2 = false;
|
|
int i222 = ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin;
|
|
measuredHeight = view.getMeasuredHeight() + i222;
|
|
i20 = View.combineMeasuredStates(i20, view.getMeasuredState());
|
|
if (z3) {
|
|
i12 = layoutParams.gravity;
|
|
if (i12 < 0) {
|
|
}
|
|
int i232 = (((i12 & 112) >> 4) & (-2)) >> 1;
|
|
iArr[i232] = Math.max(iArr[i232], baseline2);
|
|
iArr2[i232] = Math.max(iArr2[i232], measuredHeight - baseline2);
|
|
}
|
|
i17 = Math.max(i17, measuredHeight);
|
|
if (!z7) {
|
|
}
|
|
if (layoutParams.weight <= 0.0f) {
|
|
}
|
|
i15 = getChildrenSkipCount(view, i10) + i10;
|
|
f = f3;
|
|
i15++;
|
|
iArr2 = iArr2;
|
|
i14 = BasicMeasure.EXACTLY;
|
|
}
|
|
z4 = z4;
|
|
z3 = z3;
|
|
i15++;
|
|
iArr2 = iArr2;
|
|
i14 = BasicMeasure.EXACTLY;
|
|
}
|
|
if (this.mTotalLength > 0 && hasDividerBeforeChildAt(virtualChildCount)) {
|
|
this.mTotalLength += this.mDividerWidth;
|
|
}
|
|
if (iArr[1] == -1 && iArr[0] == -1 && iArr[2] == -1 && iArr[3] == -1) {
|
|
i4 = i17;
|
|
i3 = i20;
|
|
} else {
|
|
i3 = i20;
|
|
i4 = Math.max(i17, Math.max(iArr2[3], Math.max(iArr2[0], Math.max(iArr2[1], iArr2[2]))) + Math.max(iArr[3], Math.max(iArr[0], Math.max(iArr[1], iArr[2]))));
|
|
}
|
|
if (z4 && (mode == Integer.MIN_VALUE || mode == 0)) {
|
|
this.mTotalLength = 0;
|
|
int i25 = 0;
|
|
while (i25 < virtualChildCount) {
|
|
View virtualChildAt2 = getVirtualChildAt(i25);
|
|
if (virtualChildAt2 == null) {
|
|
this.mTotalLength = measureNullChild(i25) + this.mTotalLength;
|
|
} else if (virtualChildAt2.getVisibility() == 8) {
|
|
i25 += getChildrenSkipCount(virtualChildAt2, i25);
|
|
} else {
|
|
LayoutParams layoutParams2 = (LayoutParams) virtualChildAt2.getLayoutParams();
|
|
if (z5) {
|
|
this.mTotalLength = getNextLocationOffset(virtualChildAt2) + ((ViewGroup.MarginLayoutParams) layoutParams2).leftMargin + i16 + ((ViewGroup.MarginLayoutParams) layoutParams2).rightMargin + this.mTotalLength;
|
|
} else {
|
|
int i26 = this.mTotalLength;
|
|
i4 = i4;
|
|
this.mTotalLength = Math.max(i26, getNextLocationOffset(virtualChildAt2) + i26 + i16 + ((ViewGroup.MarginLayoutParams) layoutParams2).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams2).rightMargin);
|
|
i25++;
|
|
}
|
|
}
|
|
i4 = i4;
|
|
i25++;
|
|
}
|
|
}
|
|
int paddingRight = getPaddingRight() + getPaddingLeft() + this.mTotalLength;
|
|
this.mTotalLength = paddingRight;
|
|
int resolveSizeAndState = View.resolveSizeAndState(Math.max(paddingRight, getSuggestedMinimumWidth()), i, 0);
|
|
int i27 = (16777215 & resolveSizeAndState) - this.mTotalLength;
|
|
if (z6 || (i27 != 0 && f > 0.0f)) {
|
|
float f4 = this.mWeightSum;
|
|
if (f4 > 0.0f) {
|
|
f = f4;
|
|
}
|
|
iArr[3] = -1;
|
|
iArr[2] = -1;
|
|
iArr[1] = -1;
|
|
iArr[0] = -1;
|
|
iArr2[3] = -1;
|
|
iArr2[2] = -1;
|
|
iArr2[1] = -1;
|
|
iArr2[0] = -1;
|
|
this.mTotalLength = 0;
|
|
int i28 = i18;
|
|
int i29 = i3;
|
|
int i30 = -1;
|
|
for (int i31 = 0; i31 < virtualChildCount; i31++) {
|
|
View virtualChildAt3 = getVirtualChildAt(i31);
|
|
if (virtualChildAt3 == null || virtualChildAt3.getVisibility() == 8) {
|
|
i27 = i27;
|
|
virtualChildCount = virtualChildCount;
|
|
} else {
|
|
LayoutParams layoutParams3 = (LayoutParams) virtualChildAt3.getLayoutParams();
|
|
float f5 = layoutParams3.weight;
|
|
if (f5 > 0.0f) {
|
|
int i32 = (int) ((i27 * f5) / f);
|
|
f -= f5;
|
|
i27 -= i32;
|
|
virtualChildCount = virtualChildCount;
|
|
int childMeasureSpec = ViewGroup.getChildMeasureSpec(i2, getPaddingBottom() + getPaddingTop() + ((ViewGroup.MarginLayoutParams) layoutParams3).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).bottomMargin, ((ViewGroup.MarginLayoutParams) layoutParams3).height);
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams3).width == 0) {
|
|
i9 = BasicMeasure.EXACTLY;
|
|
if (mode == 1073741824) {
|
|
if (i32 <= 0) {
|
|
i32 = 0;
|
|
}
|
|
virtualChildAt3.measure(View.MeasureSpec.makeMeasureSpec(i32, BasicMeasure.EXACTLY), childMeasureSpec);
|
|
i29 = View.combineMeasuredStates(i29, virtualChildAt3.getMeasuredState() & ViewCompat.MEASURED_STATE_MASK);
|
|
}
|
|
} else {
|
|
i9 = BasicMeasure.EXACTLY;
|
|
}
|
|
int measuredWidth2 = virtualChildAt3.getMeasuredWidth() + i32;
|
|
if (measuredWidth2 < 0) {
|
|
measuredWidth2 = 0;
|
|
}
|
|
virtualChildAt3.measure(View.MeasureSpec.makeMeasureSpec(measuredWidth2, i9), childMeasureSpec);
|
|
i29 = View.combineMeasuredStates(i29, virtualChildAt3.getMeasuredState() & ViewCompat.MEASURED_STATE_MASK);
|
|
} else {
|
|
i27 = i27;
|
|
virtualChildCount = virtualChildCount;
|
|
}
|
|
if (z5) {
|
|
this.mTotalLength = getNextLocationOffset(virtualChildAt3) + virtualChildAt3.getMeasuredWidth() + ((ViewGroup.MarginLayoutParams) layoutParams3).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).rightMargin + this.mTotalLength;
|
|
f = f;
|
|
} else {
|
|
int i33 = this.mTotalLength;
|
|
f = f;
|
|
this.mTotalLength = Math.max(i33, getNextLocationOffset(virtualChildAt3) + virtualChildAt3.getMeasuredWidth() + i33 + ((ViewGroup.MarginLayoutParams) layoutParams3).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).rightMargin);
|
|
}
|
|
boolean z9 = mode2 != 1073741824 && ((ViewGroup.MarginLayoutParams) layoutParams3).height == -1;
|
|
int i34 = ((ViewGroup.MarginLayoutParams) layoutParams3).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).bottomMargin;
|
|
int measuredHeight2 = virtualChildAt3.getMeasuredHeight() + i34;
|
|
i30 = Math.max(i30, measuredHeight2);
|
|
if (!z9) {
|
|
i34 = measuredHeight2;
|
|
}
|
|
i28 = Math.max(i28, i34);
|
|
if (z7) {
|
|
i7 = -1;
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams3).height == -1) {
|
|
z7 = true;
|
|
if (z3 && (baseline = virtualChildAt3.getBaseline()) != i7) {
|
|
i8 = layoutParams3.gravity;
|
|
if (i8 < 0) {
|
|
i8 = this.mGravity;
|
|
}
|
|
int i35 = (((i8 & 112) >> 4) & (-2)) >> 1;
|
|
iArr[i35] = Math.max(iArr[i35], baseline);
|
|
iArr2[i35] = Math.max(iArr2[i35], measuredHeight2 - baseline);
|
|
}
|
|
}
|
|
} else {
|
|
i7 = -1;
|
|
}
|
|
z7 = false;
|
|
if (z3) {
|
|
i8 = layoutParams3.gravity;
|
|
if (i8 < 0) {
|
|
}
|
|
int i352 = (((i8 & 112) >> 4) & (-2)) >> 1;
|
|
iArr[i352] = Math.max(iArr[i352], baseline);
|
|
iArr2[i352] = Math.max(iArr2[i352], measuredHeight2 - baseline);
|
|
}
|
|
}
|
|
}
|
|
i6 = i2;
|
|
i5 = virtualChildCount;
|
|
this.mTotalLength = getPaddingRight() + getPaddingLeft() + this.mTotalLength;
|
|
i4 = (iArr[1] == -1 && iArr[0] == -1 && iArr[2] == -1 && iArr[3] == -1) ? i30 : Math.max(i30, Math.max(iArr2[3], Math.max(iArr2[0], Math.max(iArr2[1], iArr2[2]))) + Math.max(iArr[3], Math.max(iArr[0], Math.max(iArr[1], iArr[2]))));
|
|
i4 = i28;
|
|
i3 = i29;
|
|
} else {
|
|
i4 = Math.max(i18, i19);
|
|
if (z4 && mode != 1073741824) {
|
|
for (int i36 = 0; i36 < virtualChildCount; i36++) {
|
|
View virtualChildAt4 = getVirtualChildAt(i36);
|
|
if (!(virtualChildAt4 == null || virtualChildAt4.getVisibility() == 8 || ((LayoutParams) virtualChildAt4.getLayoutParams()).weight <= 0.0f)) {
|
|
virtualChildAt4.measure(View.MeasureSpec.makeMeasureSpec(i16, BasicMeasure.EXACTLY), View.MeasureSpec.makeMeasureSpec(virtualChildAt4.getMeasuredHeight(), BasicMeasure.EXACTLY));
|
|
}
|
|
}
|
|
}
|
|
i6 = i2;
|
|
i5 = virtualChildCount;
|
|
}
|
|
if (z7 || mode2 == 1073741824) {
|
|
}
|
|
setMeasuredDimension(resolveSizeAndState | (i3 & ViewCompat.MEASURED_STATE_MASK), View.resolveSizeAndState(Math.max(getPaddingBottom() + getPaddingTop() + i4, getSuggestedMinimumHeight()), i6, i3 << 16));
|
|
if (z8) {
|
|
forceUniformHeight(i5, i);
|
|
}
|
|
}
|
|
|
|
public int measureNullChild(int i) {
|
|
return 0;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:142:0x0325 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void measureVertical(int i, int i2) {
|
|
int i3;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
boolean z2;
|
|
int i7;
|
|
int i8;
|
|
int i9;
|
|
int i10;
|
|
int i11;
|
|
int i12;
|
|
View view;
|
|
boolean z3;
|
|
int i13;
|
|
this.mTotalLength = 0;
|
|
int virtualChildCount = getVirtualChildCount();
|
|
int mode = View.MeasureSpec.getMode(i);
|
|
int mode2 = View.MeasureSpec.getMode(i2);
|
|
int i14 = this.mBaselineAlignedChildIndex;
|
|
boolean z4 = this.mUseLargestChild;
|
|
float f = 0.0f;
|
|
int i15 = 0;
|
|
int i16 = 0;
|
|
int i17 = 0;
|
|
int i18 = 0;
|
|
int i19 = 0;
|
|
int i20 = 0;
|
|
boolean z5 = false;
|
|
boolean z6 = true;
|
|
boolean z7 = false;
|
|
while (true) {
|
|
int i21 = 8;
|
|
if (i20 < virtualChildCount) {
|
|
View virtualChildAt = getVirtualChildAt(i20);
|
|
if (virtualChildAt == null) {
|
|
this.mTotalLength = measureNullChild(i20) + this.mTotalLength;
|
|
virtualChildCount = virtualChildCount;
|
|
mode2 = mode2;
|
|
i18 = i18;
|
|
} else if (virtualChildAt.getVisibility() == 8) {
|
|
i20 += getChildrenSkipCount(virtualChildAt, i20);
|
|
virtualChildCount = virtualChildCount;
|
|
i18 = i18;
|
|
i15 = i15;
|
|
mode2 = mode2;
|
|
} else {
|
|
if (hasDividerBeforeChildAt(i20)) {
|
|
this.mTotalLength += this.mDividerHeight;
|
|
}
|
|
LayoutParams layoutParams = (LayoutParams) virtualChildAt.getLayoutParams();
|
|
float f2 = layoutParams.weight;
|
|
float f3 = f + f2;
|
|
if (mode2 == 1073741824 && ((ViewGroup.MarginLayoutParams) layoutParams).height == 0 && f2 > 0.0f) {
|
|
int i22 = this.mTotalLength;
|
|
this.mTotalLength = Math.max(i22, ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + i22 + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin);
|
|
i17 = i17;
|
|
view = virtualChildAt;
|
|
i8 = i19;
|
|
i12 = i15;
|
|
i9 = i16;
|
|
z5 = true;
|
|
virtualChildCount = virtualChildCount;
|
|
mode2 = mode2;
|
|
i10 = i18;
|
|
i11 = i20;
|
|
} else {
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams).height != 0 || f2 <= 0.0f) {
|
|
i13 = Integer.MIN_VALUE;
|
|
} else {
|
|
((ViewGroup.MarginLayoutParams) layoutParams).height = -2;
|
|
i13 = 0;
|
|
}
|
|
i12 = i15;
|
|
i9 = i16;
|
|
virtualChildCount = virtualChildCount;
|
|
mode2 = mode2;
|
|
i10 = i18;
|
|
i8 = i19;
|
|
i11 = i20;
|
|
measureChildBeforeLayout(virtualChildAt, i20, i, 0, i2, f3 == 0.0f ? this.mTotalLength : 0);
|
|
if (i13 != Integer.MIN_VALUE) {
|
|
((ViewGroup.MarginLayoutParams) layoutParams).height = i13;
|
|
}
|
|
int measuredHeight = virtualChildAt.getMeasuredHeight();
|
|
int i23 = this.mTotalLength;
|
|
view = virtualChildAt;
|
|
this.mTotalLength = Math.max(i23, getNextLocationOffset(view) + i23 + measuredHeight + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin);
|
|
i17 = z4 ? Math.max(measuredHeight, i17) : i17;
|
|
}
|
|
if (i14 >= 0 && i14 == i11 + 1) {
|
|
this.mBaselineChildTop = this.mTotalLength;
|
|
}
|
|
if (i11 >= i14 || layoutParams.weight <= 0.0f) {
|
|
if (mode == 1073741824 || ((ViewGroup.MarginLayoutParams) layoutParams).width != -1) {
|
|
z3 = false;
|
|
} else {
|
|
z3 = true;
|
|
z7 = true;
|
|
}
|
|
int i24 = ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin;
|
|
int measuredWidth = view.getMeasuredWidth() + i24;
|
|
i16 = Math.max(i9, measuredWidth);
|
|
i15 = View.combineMeasuredStates(i12, view.getMeasuredState());
|
|
z6 = z6 && ((ViewGroup.MarginLayoutParams) layoutParams).width == -1;
|
|
if (layoutParams.weight > 0.0f) {
|
|
if (!z3) {
|
|
i24 = measuredWidth;
|
|
}
|
|
i18 = Math.max(i10, i24);
|
|
i19 = i8;
|
|
} else {
|
|
if (!z3) {
|
|
i24 = measuredWidth;
|
|
}
|
|
i19 = Math.max(i8, i24);
|
|
i18 = i10;
|
|
}
|
|
i20 = getChildrenSkipCount(view, i11) + i11;
|
|
f = f3;
|
|
} else {
|
|
throw new RuntimeException("A child of LinearLayout with index less than mBaselineAlignedChildIndex has weight > 0, which won't work. Either remove the weight, or don't set mBaselineAlignedChildIndex.");
|
|
}
|
|
}
|
|
i20++;
|
|
} else {
|
|
int i25 = i16;
|
|
if (this.mTotalLength > 0) {
|
|
i3 = virtualChildCount;
|
|
if (hasDividerBeforeChildAt(i3)) {
|
|
this.mTotalLength += this.mDividerHeight;
|
|
}
|
|
} else {
|
|
i3 = virtualChildCount;
|
|
}
|
|
if (z4 && (mode2 == Integer.MIN_VALUE || mode2 == 0)) {
|
|
this.mTotalLength = 0;
|
|
int i26 = 0;
|
|
while (i26 < i3) {
|
|
View virtualChildAt2 = getVirtualChildAt(i26);
|
|
if (virtualChildAt2 == null) {
|
|
this.mTotalLength = measureNullChild(i26) + this.mTotalLength;
|
|
} else if (virtualChildAt2.getVisibility() == i21) {
|
|
i26 += getChildrenSkipCount(virtualChildAt2, i26);
|
|
} else {
|
|
LayoutParams layoutParams2 = (LayoutParams) virtualChildAt2.getLayoutParams();
|
|
int i27 = this.mTotalLength;
|
|
this.mTotalLength = Math.max(i27, getNextLocationOffset(virtualChildAt2) + i27 + i17 + ((ViewGroup.MarginLayoutParams) layoutParams2).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams2).bottomMargin);
|
|
}
|
|
i26++;
|
|
i21 = 8;
|
|
}
|
|
}
|
|
int paddingBottom = getPaddingBottom() + getPaddingTop() + this.mTotalLength;
|
|
this.mTotalLength = paddingBottom;
|
|
int resolveSizeAndState = View.resolveSizeAndState(Math.max(paddingBottom, getSuggestedMinimumHeight()), i2, 0);
|
|
int i28 = (16777215 & resolveSizeAndState) - this.mTotalLength;
|
|
if (z5 || (i28 != 0 && f > 0.0f)) {
|
|
float f4 = this.mWeightSum;
|
|
if (f4 > 0.0f) {
|
|
f = f4;
|
|
}
|
|
this.mTotalLength = 0;
|
|
int i29 = i28;
|
|
int i30 = i19;
|
|
i5 = i15;
|
|
for (int i31 = 0; i31 < i3; i31++) {
|
|
View virtualChildAt3 = getVirtualChildAt(i31);
|
|
if (virtualChildAt3.getVisibility() == 8) {
|
|
i29 = i29;
|
|
} else {
|
|
LayoutParams layoutParams3 = (LayoutParams) virtualChildAt3.getLayoutParams();
|
|
float f5 = layoutParams3.weight;
|
|
if (f5 > 0.0f) {
|
|
int i32 = (int) ((i29 * f5) / f);
|
|
f -= f5;
|
|
i29 -= i32;
|
|
int childMeasureSpec = ViewGroup.getChildMeasureSpec(i, getPaddingRight() + getPaddingLeft() + ((ViewGroup.MarginLayoutParams) layoutParams3).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).rightMargin, ((ViewGroup.MarginLayoutParams) layoutParams3).width);
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams3).height == 0) {
|
|
i7 = BasicMeasure.EXACTLY;
|
|
if (mode2 == 1073741824) {
|
|
if (i32 <= 0) {
|
|
i32 = 0;
|
|
}
|
|
virtualChildAt3.measure(childMeasureSpec, View.MeasureSpec.makeMeasureSpec(i32, BasicMeasure.EXACTLY));
|
|
i5 = View.combineMeasuredStates(i5, virtualChildAt3.getMeasuredState() & InputDeviceCompat.SOURCE_ANY);
|
|
}
|
|
} else {
|
|
i7 = BasicMeasure.EXACTLY;
|
|
}
|
|
int measuredHeight2 = virtualChildAt3.getMeasuredHeight() + i32;
|
|
if (measuredHeight2 < 0) {
|
|
measuredHeight2 = 0;
|
|
}
|
|
virtualChildAt3.measure(childMeasureSpec, View.MeasureSpec.makeMeasureSpec(measuredHeight2, i7));
|
|
i5 = View.combineMeasuredStates(i5, virtualChildAt3.getMeasuredState() & InputDeviceCompat.SOURCE_ANY);
|
|
} else {
|
|
i29 = i29;
|
|
}
|
|
int i33 = ((ViewGroup.MarginLayoutParams) layoutParams3).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).rightMargin;
|
|
int measuredWidth2 = virtualChildAt3.getMeasuredWidth() + i33;
|
|
i25 = Math.max(i25, measuredWidth2);
|
|
if (mode != 1073741824) {
|
|
i5 = i5;
|
|
i6 = -1;
|
|
if (((ViewGroup.MarginLayoutParams) layoutParams3).width == -1) {
|
|
z2 = true;
|
|
if (!z2) {
|
|
i33 = measuredWidth2;
|
|
}
|
|
i30 = Math.max(i30, i33);
|
|
z6 = !z6 && ((ViewGroup.MarginLayoutParams) layoutParams3).width == i6;
|
|
int i34 = this.mTotalLength;
|
|
this.mTotalLength = Math.max(i34, getNextLocationOffset(virtualChildAt3) + virtualChildAt3.getMeasuredHeight() + i34 + ((ViewGroup.MarginLayoutParams) layoutParams3).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).bottomMargin);
|
|
}
|
|
} else {
|
|
i5 = i5;
|
|
i6 = -1;
|
|
}
|
|
z2 = false;
|
|
if (!z2) {
|
|
}
|
|
i30 = Math.max(i30, i33);
|
|
if (!z6) {
|
|
}
|
|
int i342 = this.mTotalLength;
|
|
this.mTotalLength = Math.max(i342, getNextLocationOffset(virtualChildAt3) + virtualChildAt3.getMeasuredHeight() + i342 + ((ViewGroup.MarginLayoutParams) layoutParams3).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams3).bottomMargin);
|
|
}
|
|
}
|
|
i4 = i;
|
|
this.mTotalLength = getPaddingBottom() + getPaddingTop() + this.mTotalLength;
|
|
i25 = i30;
|
|
} else {
|
|
i25 = Math.max(i19, i18);
|
|
if (z4 && mode2 != 1073741824) {
|
|
for (int i35 = 0; i35 < i3; i35++) {
|
|
View virtualChildAt4 = getVirtualChildAt(i35);
|
|
if (!(virtualChildAt4 == null || virtualChildAt4.getVisibility() == 8 || ((LayoutParams) virtualChildAt4.getLayoutParams()).weight <= 0.0f)) {
|
|
virtualChildAt4.measure(View.MeasureSpec.makeMeasureSpec(virtualChildAt4.getMeasuredWidth(), BasicMeasure.EXACTLY), View.MeasureSpec.makeMeasureSpec(i17, BasicMeasure.EXACTLY));
|
|
}
|
|
}
|
|
}
|
|
i4 = i;
|
|
i5 = i15;
|
|
}
|
|
if (z6 || mode == 1073741824) {
|
|
}
|
|
setMeasuredDimension(View.resolveSizeAndState(Math.max(getPaddingRight() + getPaddingLeft() + i25, getSuggestedMinimumWidth()), i4, i5), resolveSizeAndState);
|
|
if (z7) {
|
|
forceUniformWidth(i3, i2);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onDraw(Canvas canvas) {
|
|
if (this.mDivider != null) {
|
|
if (this.mOrientation == 1) {
|
|
drawDividersVertical(canvas);
|
|
} else {
|
|
drawDividersHorizontal(canvas);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
|
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
|
accessibilityEvent.setClassName(ACCESSIBILITY_CLASS_NAME);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
|
|
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
|
|
accessibilityNodeInfo.setClassName(ACCESSIBILITY_CLASS_NAME);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void onLayout(boolean z2, int i, int i2, int i3, int i4) {
|
|
if (this.mOrientation == 1) {
|
|
layoutVertical(i, i2, i3, i4);
|
|
} else {
|
|
layoutHorizontal(i, i2, i3, i4);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onMeasure(int i, int i2) {
|
|
if (this.mOrientation == 1) {
|
|
measureVertical(i, i2);
|
|
} else {
|
|
measureHorizontal(i, i2);
|
|
}
|
|
}
|
|
|
|
public void setBaselineAligned(boolean z2) {
|
|
this.mBaselineAligned = z2;
|
|
}
|
|
|
|
public void setBaselineAlignedChildIndex(int i) {
|
|
if (i < 0 || i >= getChildCount()) {
|
|
StringBuilder S = a.S("base aligned child index out of range (0, ");
|
|
S.append(getChildCount());
|
|
S.append(")");
|
|
throw new IllegalArgumentException(S.toString());
|
|
}
|
|
this.mBaselineAlignedChildIndex = i;
|
|
}
|
|
|
|
public void setDividerDrawable(Drawable drawable) {
|
|
if (drawable != this.mDivider) {
|
|
this.mDivider = drawable;
|
|
boolean z2 = false;
|
|
if (drawable != null) {
|
|
this.mDividerWidth = drawable.getIntrinsicWidth();
|
|
this.mDividerHeight = drawable.getIntrinsicHeight();
|
|
} else {
|
|
this.mDividerWidth = 0;
|
|
this.mDividerHeight = 0;
|
|
}
|
|
if (drawable == null) {
|
|
z2 = true;
|
|
}
|
|
setWillNotDraw(z2);
|
|
requestLayout();
|
|
}
|
|
}
|
|
|
|
public void setDividerPadding(int i) {
|
|
this.mDividerPadding = i;
|
|
}
|
|
|
|
public void setGravity(int i) {
|
|
if (this.mGravity != i) {
|
|
if ((8388615 & i) == 0) {
|
|
i |= GravityCompat.START;
|
|
}
|
|
if ((i & 112) == 0) {
|
|
i |= 48;
|
|
}
|
|
this.mGravity = i;
|
|
requestLayout();
|
|
}
|
|
}
|
|
|
|
public void setHorizontalGravity(int i) {
|
|
int i2 = i & GravityCompat.RELATIVE_HORIZONTAL_GRAVITY_MASK;
|
|
int i3 = this.mGravity;
|
|
if ((8388615 & i3) != i2) {
|
|
this.mGravity = i2 | ((-8388616) & i3);
|
|
requestLayout();
|
|
}
|
|
}
|
|
|
|
public void setMeasureWithLargestChildEnabled(boolean z2) {
|
|
this.mUseLargestChild = z2;
|
|
}
|
|
|
|
public void setOrientation(int i) {
|
|
if (this.mOrientation != i) {
|
|
this.mOrientation = i;
|
|
requestLayout();
|
|
}
|
|
}
|
|
|
|
public void setShowDividers(int i) {
|
|
if (i != this.mShowDividers) {
|
|
requestLayout();
|
|
}
|
|
this.mShowDividers = i;
|
|
}
|
|
|
|
public void setVerticalGravity(int i) {
|
|
int i2 = i & 112;
|
|
int i3 = this.mGravity;
|
|
if ((i3 & 112) != i2) {
|
|
this.mGravity = i2 | (i3 & (-113));
|
|
requestLayout();
|
|
}
|
|
}
|
|
|
|
public void setWeightSum(float f) {
|
|
this.mWeightSum = Math.max(0.0f, f);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public boolean shouldDelayChildPressedState() {
|
|
return false;
|
|
}
|
|
}
|