package defpackage;

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 android.widget.LinearLayout;

/* renamed from: ᵹᵮᵴʦ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC5076 extends ViewGroup {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public float f18970;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public int[] f18971;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public int[] f18972;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public int f18973;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public boolean f18974;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public int f18975;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public int f18976;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public int f18977;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public int f18978;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public boolean f18979;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public Drawable f18980;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public int f18981;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public int f18982;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public int f18983;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public int f18984;

    public AbstractC5076(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0);
        this.f18979 = true;
        this.f18976 = -1;
        this.f18984 = 0;
        this.f18977 = 8388659;
        int[] iArr = AbstractC0542.f2819;
        C1570 c1570M4541 = C1570.m4541(context, attributeSet, iArr, 0);
        AbstractC2873.m7025(this, context, iArr, attributeSet, (TypedArray) c1570M4541.f6230, 0);
        TypedArray typedArray = (TypedArray) c1570M4541.f6230;
        int i = typedArray.getInt(1, -1);
        if (i >= 0) {
            setOrientation(i);
        }
        int i2 = typedArray.getInt(0, -1);
        if (i2 >= 0) {
            setGravity(i2);
        }
        boolean z = typedArray.getBoolean(2, true);
        if (!z) {
            setBaselineAligned(z);
        }
        this.f18970 = typedArray.getFloat(4, -1.0f);
        this.f18976 = typedArray.getInt(3, -1);
        this.f18974 = typedArray.getBoolean(7, false);
        setDividerDrawable(c1570M4541.m4550(5));
        this.f18973 = typedArray.getInt(8, 0);
        this.f18981 = typedArray.getDimensionPixelSize(6, 0);
        c1570M4541.m4542();
    }

    @Override // android.view.ViewGroup
    public boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof C1316;
    }

    @Override // android.view.View
    public int getBaseline() {
        int i;
        if (this.f18976 < 0) {
            return super.getBaseline();
        }
        int childCount = getChildCount();
        int i2 = this.f18976;
        if (childCount <= i2) {
            C1260.m3816("mBaselineAlignedChildIndex of LinearLayout set to an index that is out of bounds.");
            return 0;
        }
        View childAt = getChildAt(i2);
        int baseline = childAt.getBaseline();
        if (baseline == -1) {
            if (this.f18976 == 0) {
                return -1;
            }
            C1260.m3816("mBaselineAlignedChildIndex of LinearLayout points to a View that doesn't know how to get its baseline.");
            return 0;
        }
        int bottom = this.f18984;
        if (this.f18983 == 1 && (i = this.f18977 & 112) != 48) {
            if (i == 16) {
                bottom += ((((getBottom() - getTop()) - getPaddingTop()) - getPaddingBottom()) - this.f18975) / 2;
            } else if (i == 80) {
                bottom = ((getBottom() - getTop()) - getPaddingBottom()) - this.f18975;
            }
        }
        return bottom + ((LinearLayout.LayoutParams) ((C1316) childAt.getLayoutParams())).topMargin + baseline;
    }

    public int getBaselineAlignedChildIndex() {
        return this.f18976;
    }

    public Drawable getDividerDrawable() {
        return this.f18980;
    }

    public int getDividerPadding() {
        return this.f18981;
    }

    public int getDividerWidth() {
        return this.f18978;
    }

    public int getGravity() {
        return this.f18977;
    }

    public int getOrientation() {
        return this.f18983;
    }

    public int getShowDividers() {
        return this.f18973;
    }

    public int getVirtualChildCount() {
        return getChildCount();
    }

    public float getWeightSum() {
        return this.f18970;
    }

    @Override // android.view.View
    public final void onDraw(Canvas canvas) {
        int right;
        int left;
        int i;
        if (this.f18980 == null) {
            return;
        }
        int i2 = 0;
        if (this.f18983 == 1) {
            int virtualChildCount = getVirtualChildCount();
            while (i2 < virtualChildCount) {
                View childAt = getChildAt(i2);
                if (childAt != null && childAt.getVisibility() != 8 && m10542(i2)) {
                    m10541(canvas, (childAt.getTop() - ((LinearLayout.LayoutParams) ((C1316) childAt.getLayoutParams())).topMargin) - this.f18982);
                }
                i2++;
            }
            if (m10542(virtualChildCount)) {
                View childAt2 = getChildAt(virtualChildCount - 1);
                m10541(canvas, childAt2 == null ? (getHeight() - getPaddingBottom()) - this.f18982 : childAt2.getBottom() + ((LinearLayout.LayoutParams) ((C1316) childAt2.getLayoutParams())).bottomMargin);
                return;
            }
            return;
        }
        int virtualChildCount2 = getVirtualChildCount();
        boolean z = AbstractC2335.f9156;
        boolean z2 = getLayoutDirection() == 1;
        while (i2 < virtualChildCount2) {
            View childAt3 = getChildAt(i2);
            if (childAt3 != null && childAt3.getVisibility() != 8 && m10542(i2)) {
                C1316 c1316 = (C1316) childAt3.getLayoutParams();
                m10543(canvas, z2 ? childAt3.getRight() + ((LinearLayout.LayoutParams) c1316).rightMargin : (childAt3.getLeft() - ((LinearLayout.LayoutParams) c1316).leftMargin) - this.f18978);
            }
            i2++;
        }
        if (m10542(virtualChildCount2)) {
            View childAt4 = getChildAt(virtualChildCount2 - 1);
            if (childAt4 != null) {
                C1316 c13162 = (C1316) childAt4.getLayoutParams();
                if (z2) {
                    left = childAt4.getLeft() - ((LinearLayout.LayoutParams) c13162).leftMargin;
                    i = this.f18978;
                    right = left - i;
                } else {
                    right = childAt4.getRight() + ((LinearLayout.LayoutParams) c13162).rightMargin;
                }
            } else if (z2) {
                right = getPaddingLeft();
            } else {
                left = getWidth() - getPaddingRight();
                i = this.f18978;
                right = left - i;
            }
            m10543(canvas, right);
        }
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(accessibilityEvent);
        accessibilityEvent.setClassName("androidx.appcompat.widget.LinearLayoutCompat");
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName("androidx.appcompat.widget.LinearLayoutCompat");
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x009d  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x015a  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x0163  */
    /* JADX WARN: Removed duplicated region for block: B:77:0x0191  */
    /* JADX WARN: Removed duplicated region for block: B:80:0x01a4  */
    /* JADX WARN: Removed duplicated region for block: B:81:0x01a9  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void onLayout(boolean r23, int r24, int r25, int r26, int r27) {
        /*
            Method dump skipped, instructions count: 461
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5076.onLayout(boolean, int, int, int, int):void");
    }

    /* JADX WARN: Removed duplicated region for block: B:229:0x04dc  */
    /* JADX WARN: Removed duplicated region for block: B:232:0x04f1  */
    /* JADX WARN: Removed duplicated region for block: B:238:0x051f  */
    /* JADX WARN: Removed duplicated region for block: B:244:0x052f  */
    /* JADX WARN: Removed duplicated region for block: B:247:0x0536  */
    /* JADX WARN: Removed duplicated region for block: B:251:0x0540  */
    /* JADX WARN: Removed duplicated region for block: B:368:0x0791  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x013d  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x0146  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void onMeasure(int r39, int r40) {
        /*
            Method dump skipped, instructions count: 2139
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5076.onMeasure(int, int):void");
    }

    public void setBaselineAligned(boolean z) {
        this.f18979 = z;
    }

    public void setBaselineAlignedChildIndex(int i) {
        if (i < 0 || i >= getChildCount()) {
            ᵹˉᵞ.ᵯٴᵦ("base aligned child index out of range (0, ", getChildCount(), ")");
        } else {
            this.f18976 = i;
        }
    }

    public void setDividerDrawable(Drawable drawable) {
        if (drawable == this.f18980) {
            return;
        }
        this.f18980 = drawable;
        if (drawable != null) {
            this.f18978 = drawable.getIntrinsicWidth();
            this.f18982 = drawable.getIntrinsicHeight();
        } else {
            this.f18978 = 0;
            this.f18982 = 0;
        }
        setWillNotDraw(drawable == null);
        requestLayout();
    }

    public void setDividerPadding(int i) {
        this.f18981 = i;
    }

    public void setGravity(int i) {
        if (this.f18977 != i) {
            if ((8388615 & i) == 0) {
                i |= 8388611;
            }
            if ((i & 112) == 0) {
                i |= 48;
            }
            this.f18977 = i;
            requestLayout();
        }
    }

    public void setHorizontalGravity(int i) {
        int i2 = i & 8388615;
        int i3 = this.f18977;
        if ((8388615 & i3) != i2) {
            this.f18977 = i2 | ((-8388616) & i3);
            requestLayout();
        }
    }

    public void setMeasureWithLargestChildEnabled(boolean z) {
        this.f18974 = z;
    }

    public void setOrientation(int i) {
        if (this.f18983 != i) {
            this.f18983 = i;
            requestLayout();
        }
    }

    public void setShowDividers(int i) {
        if (i != this.f18973) {
            requestLayout();
        }
        this.f18973 = i;
    }

    public void setVerticalGravity(int i) {
        int i2 = i & 112;
        int i3 = this.f18977;
        if ((i3 & 112) != i2) {
            this.f18977 = i2 | (i3 & (-113));
            requestLayout();
        }
    }

    public void setWeightSum(float f) {
        this.f18970 = Math.max(0.0f, f);
    }

    @Override // android.view.ViewGroup
    public final boolean shouldDelayChildPressedState() {
        return false;
    }

    @Override // android.view.ViewGroup
    /* renamed from: ˇʼʤˎ, reason: merged with bridge method [inline-methods] */
    public C1316 generateDefaultLayoutParams() {
        int i = this.f18983;
        if (i == 0) {
            return new C1316(-2, -2);
        }
        if (i == 1) {
            return new C1316(-1, -2);
        }
        return null;
    }

    @Override // android.view.ViewGroup
    /* renamed from: ˎˏʜʾ, reason: merged with bridge method [inline-methods] */
    public C1316 generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof C1316 ? new C1316((C1316) layoutParams) : layoutParams instanceof ViewGroup.MarginLayoutParams ? new C1316((ViewGroup.MarginLayoutParams) layoutParams) : new C1316(layoutParams);
    }

    @Override // android.view.ViewGroup
    /* renamed from: ˏˋٴ, reason: merged with bridge method [inline-methods] */
    public C1316 generateLayoutParams(AttributeSet attributeSet) {
        return new C1316(getContext(), attributeSet);
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void m10541(Canvas canvas, int i) {
        this.f18980.setBounds(getPaddingLeft() + this.f18981, i, (getWidth() - getPaddingRight()) - this.f18981, this.f18982 + i);
        this.f18980.draw(canvas);
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final boolean m10542(int i) {
        if (i == 0) {
            return (this.f18973 & 1) != 0;
        }
        int childCount = getChildCount();
        int i2 = this.f18973;
        if (i == childCount) {
            return (i2 & 4) != 0;
        }
        if ((i2 & 2) != 0) {
            for (int i3 = i - 1; i3 >= 0; i3--) {
                if (getChildAt(i3).getVisibility() != 8) {
                    return true;
                }
            }
        }
        return false;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m10543(Canvas canvas, int i) {
        this.f18980.setBounds(i, getPaddingTop() + this.f18981, this.f18978 + i, (getHeight() - getPaddingBottom()) - this.f18981);
        this.f18980.draw(canvas);
    }
}
