what-the-bank/sources/androidx/appcompat/widget/ButtonBarLayout.java

181 lines
5.8 KiB
Java

package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import androidx.core.view.ViewCompat;
import o.SYO;
/* loaded from: classes.dex */
public class ButtonBarLayout extends LinearLayout {
private boolean c;
private int d;
private boolean e;
public ButtonBarLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.d = -1;
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, SYO.ZqN.ButtonBarLayout);
ViewCompat.sm_(this, context, SYO.ZqN.ButtonBarLayout, attributeSet, obtainStyledAttributes, 0, 0);
this.e = obtainStyledAttributes.getBoolean(SYO.ZqN.ButtonBarLayout_allowStacking, true);
obtainStyledAttributes.recycle();
if (getOrientation() == 1) {
d(this.e);
}
}
/* JADX WARN: Code restructure failed: missing block: B:55:0x0047, code lost:
if (r1 != false) goto L24;
*/
@Override // android.widget.LinearLayout, android.view.View
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
protected void onMeasure(int r7, int r8) {
/*
r6 = this;
int r0 = android.view.View.MeasureSpec.getSize(r7)
boolean r1 = r6.e
r2 = 0
if (r1 == 0) goto L16
int r1 = r6.d
if (r0 <= r1) goto L14
boolean r1 = r6.c
if (r1 == 0) goto L14
r6.d(r2)
L14:
r6.d = r0
L16:
boolean r1 = r6.c
r3 = 1
if (r1 != 0) goto L2b
int r1 = android.view.View.MeasureSpec.getMode(r7)
r4 = 1073741824(0x40000000, float:2.0)
if (r1 != r4) goto L2b
r1 = -2147483648(0xffffffff80000000, float:-0.0)
int r0 = android.view.View.MeasureSpec.makeMeasureSpec(r0, r1)
r1 = r3
goto L2d
L2b:
r0 = r7
r1 = r2
L2d:
super.onMeasure(r0, r8)
boolean r0 = r6.e
if (r0 == 0) goto L47
boolean r0 = r6.c
if (r0 != 0) goto L47
int r0 = r6.getMeasuredWidthAndState()
r4 = -16777216(0xffffffffff000000, float:-1.7014118E38)
r0 = r0 & r4
r4 = 16777216(0x1000000, float:2.3509887E-38)
if (r0 != r4) goto L47
r6.d(r3)
goto L49
L47:
if (r1 == 0) goto L4c
L49:
super.onMeasure(r7, r8)
L4c:
int r0 = r6.getChildCount()
r1 = r2
L51:
r4 = -1
if (r1 >= r0) goto L62
android.view.View r5 = r6.getChildAt(r1)
int r5 = r5.getVisibility()
if (r5 != 0) goto L5f
goto L63
L5f:
int r1 = r1 + 1
goto L51
L62:
r1 = r4
L63:
if (r1 < 0) goto Lba
android.view.View r0 = r6.getChildAt(r1)
android.view.ViewGroup$LayoutParams r2 = r0.getLayoutParams()
android.widget.LinearLayout$LayoutParams r2 = (android.widget.LinearLayout.LayoutParams) r2
int r5 = r6.getPaddingTop()
int r0 = r0.getMeasuredHeight()
int r5 = r5 + r0
int r0 = r2.topMargin
int r5 = r5 + r0
int r0 = r2.bottomMargin
int r5 = r5 + r0
boolean r0 = r6.c
if (r0 == 0) goto Lb4
int r1 = r1 + r3
int r0 = r6.getChildCount()
L87:
if (r1 >= r0) goto L98
android.view.View r2 = r6.getChildAt(r1)
int r2 = r2.getVisibility()
if (r2 != 0) goto L95
r4 = r1
goto L98
L95:
int r1 = r1 + 1
goto L87
L98:
if (r4 < 0) goto Lb2
android.view.View r0 = r6.getChildAt(r4)
int r0 = r0.getPaddingTop()
android.content.res.Resources r1 = r6.getResources()
android.util.DisplayMetrics r1 = r1.getDisplayMetrics()
float r1 = r1.density
r2 = 1098907648(0x41800000, float:16.0)
float r1 = r1 * r2
int r1 = (int) r1
int r0 = r0 + r1
int r5 = r5 + r0
Lb2:
r2 = r5
goto Lba
Lb4:
int r0 = r6.getPaddingBottom()
int r2 = r5 + r0
Lba:
int r0 = androidx.core.view.ViewCompat.o(r6)
if (r0 == r2) goto Lc8
r6.setMinimumHeight(r2)
if (r8 != 0) goto Lc8
super.onMeasure(r7, r8)
Lc8:
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.ButtonBarLayout.onMeasure(int, int):void");
}
private void d(boolean z) {
if (this.c != z) {
if (!z || this.e) {
this.c = z;
setOrientation(z ? 1 : 0);
setGravity(z ? 8388613 : 80);
View findViewById = findViewById(SYO.saX.spacer);
if (findViewById != null) {
findViewById.setVisibility(z ? 8 : 4);
}
for (int childCount = getChildCount() - 2; childCount >= 0; childCount--) {
bringChildToFront(getChildAt(childCount));
}
}
}
}
public void setAllowStacking(boolean z) {
if (this.e != z) {
this.e = z;
if (!z && this.c) {
d(false);
}
requestLayout();
}
}
}