package androidx.leanback.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import java.util.ArrayList;

/* loaded from: classes3.dex */
public class NonOverlappingLinearLayout extends LinearLayout {

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

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

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final ArrayList f470;

    public NonOverlappingLinearLayout(Context context) {
        this(context, null);
    }

    public NonOverlappingLinearLayout(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public NonOverlappingLinearLayout(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f469 = false;
        this.f470 = new ArrayList();
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void focusableViewAvailable(View view) {
        int iIndexOfChild;
        if (!this.f468) {
            super.focusableViewAvailable(view);
            return;
        }
        for (View view2 = view; view2 != this && view2 != null; view2 = (View) view2.getParent()) {
            if (view2.getParent() == this) {
                iIndexOfChild = indexOfChild(view2);
                break;
            }
        }
        iIndexOfChild = -1;
        if (iIndexOfChild != -1) {
            ((ArrayList) this.f470.get(iIndexOfChild)).add(view);
        }
    }

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

    /* JADX WARN: Removed duplicated region for block: B:13:0x001b  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x009f  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x00b3  */
    @Override // android.widget.LinearLayout, android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void onLayout(boolean r10, int r11, int r12, int r13, int r14) throws java.lang.Throwable {
        /*
            r9 = this;
            java.util.ArrayList r1 = r9.f470
            r2 = 0
            boolean r0 = r9.f469     // Catch: java.lang.Throwable -> L98
            r3 = 1
            if (r0 == 0) goto L1b
            int r0 = r9.getOrientation()     // Catch: java.lang.Throwable -> L16
            if (r0 != 0) goto L1b
            int r0 = r9.getLayoutDirection()     // Catch: java.lang.Throwable -> L16
            if (r0 != r3) goto L1b
            r0 = r3
            goto L1c
        L16:
            r0 = move-exception
            r10 = r0
            r3 = r9
            goto L9b
        L1b:
            r0 = r2
        L1c:
            r9.f468 = r0     // Catch: java.lang.Throwable -> L98
            if (r0 == 0) goto L46
        L20:
            int r0 = r1.size()     // Catch: java.lang.Throwable -> L16
            int r4 = r9.getChildCount()     // Catch: java.lang.Throwable -> L16
            if (r0 <= r4) goto L33
            int r0 = r1.size()     // Catch: java.lang.Throwable -> L16
            int r0 = r0 - r3
            r1.remove(r0)     // Catch: java.lang.Throwable -> L16
            goto L20
        L33:
            int r0 = r1.size()     // Catch: java.lang.Throwable -> L16
            int r3 = r9.getChildCount()     // Catch: java.lang.Throwable -> L16
            if (r0 >= r3) goto L46
            java.util.ArrayList r0 = new java.util.ArrayList     // Catch: java.lang.Throwable -> L16
            r0.<init>()     // Catch: java.lang.Throwable -> L16
            r1.add(r0)     // Catch: java.lang.Throwable -> L16
            goto L33
        L46:
            r3 = r9
            r4 = r10
            r5 = r11
            r6 = r12
            r7 = r13
            r8 = r14
            super.onLayout(r4, r5, r6, r7, r8)     // Catch: java.lang.Throwable -> L79
            boolean r9 = r3.f468     // Catch: java.lang.Throwable -> L79
            if (r9 == 0) goto L7f
            r9 = r2
        L54:
            int r10 = r1.size()     // Catch: java.lang.Throwable -> L79
            if (r9 >= r10) goto L7f
            r10 = r2
        L5b:
            java.lang.Object r11 = r1.get(r9)     // Catch: java.lang.Throwable -> L79
            java.util.ArrayList r11 = (java.util.ArrayList) r11     // Catch: java.lang.Throwable -> L79
            int r11 = r11.size()     // Catch: java.lang.Throwable -> L79
            if (r10 >= r11) goto L7c
            java.lang.Object r11 = r1.get(r9)     // Catch: java.lang.Throwable -> L79
            java.util.ArrayList r11 = (java.util.ArrayList) r11     // Catch: java.lang.Throwable -> L79
            java.lang.Object r11 = r11.get(r10)     // Catch: java.lang.Throwable -> L79
            android.view.View r11 = (android.view.View) r11     // Catch: java.lang.Throwable -> L79
            super.focusableViewAvailable(r11)     // Catch: java.lang.Throwable -> L79
            int r10 = r10 + 1
            goto L5b
        L79:
            r0 = move-exception
        L7a:
            r10 = r0
            goto L9b
        L7c:
            int r9 = r9 + 1
            goto L54
        L7f:
            boolean r9 = r3.f468
            if (r9 == 0) goto L97
            r3.f468 = r2
        L85:
            int r9 = r1.size()
            if (r2 >= r9) goto L97
            java.lang.Object r9 = r1.get(r2)
            java.util.ArrayList r9 = (java.util.ArrayList) r9
            r9.clear()
            int r2 = r2 + 1
            goto L85
        L97:
            return
        L98:
            r0 = move-exception
            r3 = r9
            goto L7a
        L9b:
            boolean r9 = r3.f468
            if (r9 == 0) goto Lb3
            r3.f468 = r2
        La1:
            int r9 = r1.size()
            if (r2 >= r9) goto Lb3
            java.lang.Object r9 = r1.get(r2)
            java.util.ArrayList r9 = (java.util.ArrayList) r9
            r9.clear()
            int r2 = r2 + 1
            goto La1
        Lb3:
            throw r10
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.leanback.widget.NonOverlappingLinearLayout.onLayout(boolean, int, int, int, int):void");
    }

    public void setFocusableViewAvailableFixEnabled(boolean z) {
        this.f469 = z;
    }
}
