package defpackage;

import android.animation.AnimatorSet;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.transition.Fade;
import android.transition.TransitionSet;
import android.util.Pair;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.leanback.app.GuidedStepRootLayout;
import androidx.leanback.widget.NonOverlappingLinearLayout;
import androidx.leanback.widget.VerticalGridView;
import ar.tvplayer.tv.R;
import java.util.ArrayList;
import java.util.WeakHashMap;

/* renamed from: ᵯˇ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C4263 extends AbstractComponentCallbacksC3693 {

    /* renamed from: ˆʕ, reason: contains not printable characters */
    public C5195 f15975;

    /* renamed from: ˉᵴﹶ, reason: contains not printable characters */
    public ContextThemeWrapper f15977;

    /* renamed from: ˎᵶᵹ, reason: contains not printable characters */
    public C5195 f15978;

    /* renamed from: ᵦᵳˎ, reason: contains not printable characters */
    public C1041 f15979;

    /* renamed from: ᵪᵛʿ, reason: contains not printable characters */
    public C1041 f15980;

    /* renamed from: ᵯᵽ, reason: contains not printable characters */
    public C4118 f15982;

    /* renamed from: ᵳᵮᵸ, reason: contains not printable characters */
    public C5195 f15983;

    /* renamed from: ᵴᵯᵴⁱ, reason: contains not printable characters */
    public ʽˋːᵜ f15984;

    /* renamed from: ᵮᴵˊ, reason: contains not printable characters */
    public ArrayList f15981 = new ArrayList();

    /* renamed from: ˆᵪᵵ, reason: contains not printable characters */
    public ArrayList f15976 = new ArrayList();

    public C4263() {
        m9231();
    }

    /* renamed from: ˆʜٴᵿ, reason: contains not printable characters */
    public static boolean m9220(C2718 c2718) {
        return (c2718.f10533 & 64) == 64 && c2718.f10539 != -1;
    }

    /* renamed from: ˈᵫˊˉ, reason: contains not printable characters */
    public static void m9221(AbstractC4731 abstractC4731, C4263 c4263) {
        AbstractComponentCallbacksC3693 abstractComponentCallbacksC3693M9965 = abstractC4731.m9965("leanBackGuidedStepSupportFragment");
        C4263 c42632 = abstractComponentCallbacksC3693M9965 instanceof C4263 ? (C4263) abstractComponentCallbacksC3693M9965 : null;
        int i = c42632 != null ? 1 : 0;
        C4877 c4877 = new C4877(abstractC4731);
        c4263.m9233(i ^ 1);
        Bundle bundle = c4263.f13769;
        int i2 = bundle == null ? 1 : bundle.getInt("uiStyle", 1);
        Class<?> cls = c4263.getClass();
        c4877.m10315(i2 != 0 ? i2 != 1 ? "" : "GuidedStepEntrance".concat(cls.getName()) : "GuidedStepDefault".concat(cls.getName()));
        if (c42632 != null) {
            View view = c42632.f13752;
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b0047), "action_fragment_root");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b0046), "action_fragment_background");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b0045), "action_fragment");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b01d1), "guidedactions_root");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b01c5), "guidedactions_content");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b01cf), "guidedactions_list_background");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b01d2), "guidedactions_root2");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b01c6), "guidedactions_content2");
            m9223(c4877, view.findViewById(R.id._11_res_0x7f0b01d0), "guidedactions_list_background2");
        }
        c4877.m10305(android.R.id.content, c4263, "leanBackGuidedStepSupportFragment");
        c4877.m10303(false, true);
    }

    /* renamed from: ˉʾˈˊ, reason: contains not printable characters */
    public static boolean m9222(Context context) {
        TypedValue typedValue = new TypedValue();
        return context.getTheme().resolveAttribute(R.attr._11_res_0x7f040304, typedValue, true) && typedValue.type == 18 && typedValue.data != 0;
    }

    /* renamed from: ᵖᵖˊ, reason: contains not printable characters */
    public static void m9223(C4877 c4877, View view, String str) {
        if (view != null) {
            C1159 c1159 = AbstractC1415.f5790;
            WeakHashMap weakHashMap = AbstractC2873.f11133;
            String transitionName = view.getTransitionName();
            if (transitionName == null) {
                ᵹˉᵞ.ˌᵜᵹᵩ("Unique transitionNames are required for all sharedElements");
                return;
            }
            if (c4877.f18156 == null) {
                c4877.f18156 = new ArrayList();
                c4877.f18158 = new ArrayList();
            } else if (c4877.f18158.contains(str)) {
                ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC4486.m9550("A shared element with the target name '", str, "' has already been added to the transaction."));
                return;
            } else if (c4877.f18156.contains(transitionName)) {
                ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC4486.m9550("A shared element with the source name '", transitionName, "' has already been added to the transaction."));
                return;
            }
            c4877.f18156.add(transitionName);
            c4877.f18158.add(str);
        }
    }

    /* renamed from: ᵳᵮ, reason: contains not printable characters */
    public static void m9224(AbstractActivityC3177 abstractActivityC3177, ˈˋⁱː r3) {
        abstractActivityC3177.getWindow().getDecorView();
        C3319 c3319M7536 = abstractActivityC3177.m7536();
        if (c3319M7536.m9965("leanBackGuidedStepSupportFragment") != null) {
            return;
        }
        C4877 c4877 = new C4877(c3319M7536);
        r3.m9233(2);
        c4877.m10305(android.R.id.content, r3, "leanBackGuidedStepSupportFragment");
        c4877.m10303(false, true);
    }

    /* renamed from: ʾᵵᵯ, reason: contains not printable characters */
    public final int m9225(long j) {
        if (this.f15976 == null) {
            return -1;
        }
        for (int i = 0; i < this.f15976.size(); i++) {
            if (((C2718) this.f15976.get(i)).f10539 == j) {
                return i;
            }
        }
        return -1;
    }

    /* renamed from: ˀʾʽʤ, reason: contains not printable characters */
    public long m9226(C2718 c2718) {
        return -2L;
    }

    /* renamed from: ˁˊᵞ, reason: contains not printable characters */
    public void m9227(C2718 c2718) {
    }

    @Override // defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ˆʕ */
    public final void mo4386() {
        this.f13788 = true;
        this.f13752.findViewById(R.id._11_res_0x7f0b0045).requestFocus();
    }

    /* renamed from: ˇᵶᵰʟ, reason: contains not printable characters */
    public final void m9228(boolean z) {
        ArrayList arrayList = new ArrayList();
        ʽˋːᵜ r1 = this.f15984;
        if (z) {
            r1.getClass();
            this.f15980.getClass();
            this.f15979.getClass();
        } else {
            r1.getClass();
            this.f15980.getClass();
            this.f15979.getClass();
        }
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(arrayList);
        animatorSet.start();
    }

    /* renamed from: ˈᵕ, reason: contains not printable characters */
    public C1041 m9229() {
        C1041 c1041 = new C1041();
        if (c1041.f4533 == null) {
            c1041.f4528 = true;
            return c1041;
        }
        ᵹˉᵞ.ᵳٴᵶ("setAsButtonActions() must be called before creating views");
        return null;
    }

    /* renamed from: ˉʽʾ, reason: contains not printable characters */
    public final C2718 m9230(long j) {
        int iM9234 = m9234(j);
        if (iM9234 >= 0) {
            return (C2718) this.f15981.get(iM9234);
        }
        return null;
    }

    /* renamed from: ˉˉᵕᵽ, reason: contains not printable characters */
    public void m9231() {
        Bundle bundle = this.f13769;
        int i = bundle == null ? 1 : bundle.getInt("uiStyle", 1);
        if (i == 0) {
            C2494 c2494 = new C2494(8388613);
            c2494.excludeTarget(R.id._11_res_0x7f0b01d5, true);
            c2494.excludeTarget(R.id._11_res_0x7f0b01d4, true);
            m8286(c2494);
            Fade fade = new Fade(3);
            fade.addTarget(R.id._11_res_0x7f0b01d4);
            C0784 c0784 = new C0784();
            c0784.setReparent(false);
            TransitionSet transitionSet = new TransitionSet();
            transitionSet.setOrdering(0);
            transitionSet.addTransition(fade);
            transitionSet.addTransition(c0784);
            m8304().f12606 = transitionSet;
        } else if (i == 1) {
            Fade fade2 = new Fade(3);
            fade2.addTarget(R.id._11_res_0x7f0b01d5);
            C2494 c24942 = new C2494(8388615);
            c24942.addTarget(R.id._11_res_0x7f0b00fb);
            c24942.addTarget(R.id._11_res_0x7f0b0047);
            TransitionSet transitionSet2 = new TransitionSet();
            transitionSet2.setOrdering(0);
            transitionSet2.addTransition(fade2);
            transitionSet2.addTransition(c24942);
            m8286(transitionSet2);
            m8304().f12606 = null;
        } else if (i == 2) {
            m8286(null);
            m8304().f12606 = null;
        }
        C2494 c24943 = new C2494(8388611);
        c24943.excludeTarget(R.id._11_res_0x7f0b01d5, true);
        c24943.excludeTarget(R.id._11_res_0x7f0b01d4, true);
        m8302(c24943);
    }

    /* renamed from: ˉᵚʓ, reason: contains not printable characters */
    public final void m9232(C2718 c2718) {
        C1041 c1041 = this.f15980;
        C5195 c5195 = (C5195) c1041.f4538.getAdapter();
        c5195.getClass();
        int iIndexOf = new ArrayList(c5195.f19392).indexOf(c2718);
        if (iIndexOf < 0 || !c2718.m6726()) {
            return;
        }
        c1041.f4538.m2340(iIndexOf, new C2931(c5195));
    }

    @Override // defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ˉᵴﹶ */
    public void mo1063() {
        ʽˋːᵜ r0 = this.f15984;
        r0.ᵤᵙᵷ = null;
        r0.ᵾᵬ = null;
        r0.ᵡⁱᵥ = null;
        r0.ᵢˇᵭ = null;
        r0.ᵿʗᵝʽ = null;
        C1041 c1041 = this.f15980;
        c1041.f4540 = null;
        c1041.f4531 = null;
        c1041.f4538 = null;
        c1041.f4529 = null;
        c1041.f4543 = null;
        c1041.f4524 = null;
        c1041.f4533 = null;
        C1041 c10412 = this.f15979;
        c10412.f4540 = null;
        c10412.f4531 = null;
        c10412.f4538 = null;
        c10412.f4529 = null;
        c10412.f4543 = null;
        c10412.f4524 = null;
        c10412.f4533 = null;
        this.f15983 = null;
        this.f15975 = null;
        this.f15978 = null;
        this.f15982 = null;
        this.f13788 = true;
    }

    @Override // defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ˎᵶᵹ */
    public void mo1064(Bundle bundle) {
        ArrayList arrayList = this.f15981;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            C2718 c2718 = (C2718) arrayList.get(i);
            if (m9220(c2718)) {
                c2718.m6719("action_" + c2718.f10539, bundle);
            }
        }
        ArrayList arrayList2 = this.f15976;
        int size2 = arrayList2.size();
        for (int i2 = 0; i2 < size2; i2++) {
            C2718 c27182 = (C2718) arrayList2.get(i2);
            if (m9220(c27182)) {
                c27182.m6719("buttonaction_" + c27182.f10539, bundle);
            }
        }
    }

    /* renamed from: ˑᵩᵗ, reason: contains not printable characters */
    public final void m9233(int i) {
        Bundle bundle = this.f13769;
        boolean z = true;
        int i2 = bundle == null ? 1 : bundle.getInt("uiStyle", 1);
        Bundle bundle2 = this.f13769;
        if (bundle2 == null) {
            bundle2 = new Bundle();
        } else {
            z = false;
        }
        bundle2.putInt("uiStyle", i);
        if (z) {
            m8306(bundle2);
        }
        if (i != i2) {
            m9231();
        }
    }

    /* renamed from: ᐧʼ, reason: contains not printable characters */
    public final int m9234(long j) {
        if (this.f15981 == null) {
            return -1;
        }
        for (int i = 0; i < this.f15981.size(); i++) {
            if (((C2718) this.f15981.get(i)).f10539 == j) {
                return i;
            }
        }
        return -1;
    }

    @Override // defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ᵎʾ */
    public final View mo1066(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) throws Resources.NotFoundException {
        Context contextMo4691 = mo4691();
        if (!m9222(contextMo4691)) {
            TypedValue typedValue = new TypedValue();
            if (contextMo4691.getTheme().resolveAttribute(R.attr._11_res_0x7f040303, typedValue, true)) {
                ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(contextMo4691, typedValue.resourceId);
                if (m9222(contextThemeWrapper)) {
                    this.f15977 = contextThemeWrapper;
                } else {
                    this.f15977 = null;
                }
            }
        }
        ContextThemeWrapper contextThemeWrapper2 = this.f15977;
        LayoutInflater layoutInflaterCloneInContext = contextThemeWrapper2 == null ? layoutInflater : layoutInflater.cloneInContext(contextThemeWrapper2);
        boolean z = false;
        GuidedStepRootLayout guidedStepRootLayout = (GuidedStepRootLayout) layoutInflaterCloneInContext.inflate(R.layout._11_res_0x7f0e00ac, viewGroup, false);
        guidedStepRootLayout.getClass();
        ViewGroup viewGroup2 = (ViewGroup) guidedStepRootLayout.findViewById(R.id._11_res_0x7f0b00fb);
        ViewGroup viewGroup3 = (ViewGroup) guidedStepRootLayout.findViewById(R.id._11_res_0x7f0b0045);
        ((NonOverlappingLinearLayout) viewGroup3).setFocusableViewAvailableFixEnabled(true);
        ᵮᵥٴ r2 = m9236();
        String str = (String) r2.ᵿʗᵝʽ;
        String str2 = (String) r2.ᵢˇᵭ;
        String str3 = (String) r2.ᵾᵬ;
        ʽˋːᵜ r12 = this.f15984;
        r12.getClass();
        View viewInflate = layoutInflaterCloneInContext.inflate(R.layout._11_res_0x7f0e00a6, viewGroup2, false);
        r12.ᵢˇᵭ = (TextView) viewInflate.findViewById(R.id._11_res_0x7f0b01c3);
        r12.ᵤᵙᵷ = (TextView) viewInflate.findViewById(R.id._11_res_0x7f0b01bf);
        r12.ᵾᵬ = (TextView) viewInflate.findViewById(R.id._11_res_0x7f0b01c1);
        r12.ᵡⁱᵥ = (ImageView) viewInflate.findViewById(R.id._11_res_0x7f0b01c2);
        r12.ᵿʗᵝʽ = viewInflate.findViewById(R.id._11_res_0x7f0b01c0);
        TextView textView = (TextView) r12.ᵢˇᵭ;
        if (textView != null) {
            textView.setText(str2);
        }
        TextView textView2 = (TextView) r12.ᵤᵙᵷ;
        if (textView2 != null) {
            textView2.setText(str3);
        }
        TextView textView3 = (TextView) r12.ᵾᵬ;
        if (textView3 != null) {
            textView3.setText(str);
        }
        ImageView imageView = (ImageView) r12.ᵡⁱᵥ;
        if (imageView != null) {
            Drawable drawable = (Drawable) r2.ᵤᵙᵷ;
            if (drawable != null) {
                imageView.setImageDrawable(drawable);
            } else {
                imageView.setVisibility(8);
            }
        }
        View view = (View) r12.ᵿʗᵝʽ;
        if (view != null && TextUtils.isEmpty(view.getContentDescription())) {
            StringBuilder sb = new StringBuilder();
            if (!TextUtils.isEmpty(str3)) {
                sb.append(str3);
                sb.append('\n');
            }
            if (!TextUtils.isEmpty(str2)) {
                sb.append(str2);
                sb.append('\n');
            }
            if (!TextUtils.isEmpty(str)) {
                sb.append(str);
                sb.append('\n');
            }
            ((View) r12.ᵿʗᵝʽ).setContentDescription(sb);
        }
        viewGroup2.addView(viewInflate);
        viewGroup3.addView(this.f15980.m3409(layoutInflaterCloneInContext, viewGroup3));
        ViewGroup viewGroupM3409 = this.f15979.m3409(layoutInflaterCloneInContext, viewGroup3);
        viewGroup3.addView(viewGroupM3409);
        C1356 c1356 = new C1356(this);
        this.f15983 = new C5195(this.f15981, new C3718(this), this, this.f15980, false);
        this.f15978 = new C5195(this.f15976, new ˊᵘʛ(29, this), this, this.f15979, false);
        this.f15975 = new C5195(null, new C1356(this), this, this.f15980, true);
        C4118 c4118 = new C4118(4, z);
        ArrayList arrayList = new ArrayList();
        c4118.f15384 = arrayList;
        this.f15982 = c4118;
        C5195 c5195 = this.f15983;
        C5195 c51952 = this.f15978;
        arrayList.add(new Pair(c5195, c51952));
        if (c5195 != null) {
            c5195.f19390 = c4118;
        }
        if (c51952 != null) {
            c51952.f19390 = c4118;
        }
        C4118 c41182 = this.f15982;
        C5195 c51953 = this.f15975;
        ((ArrayList) c41182.f15384).add(new Pair(c51953, null));
        if (c51953 != null) {
            c51953.f19390 = c41182;
        }
        this.f15982.f15383 = c1356;
        C1041 c1041 = this.f15980;
        c1041.getClass();
        c1041.f4538.setAdapter(this.f15983);
        VerticalGridView verticalGridView = this.f15980.f4529;
        if (verticalGridView != null) {
            verticalGridView.setAdapter(this.f15975);
        }
        this.f15979.f4538.setAdapter(this.f15978);
        if (this.f15976.size() == 0) {
            LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) viewGroupM3409.getLayoutParams();
            layoutParams.weight = 0.0f;
            viewGroupM3409.setLayoutParams(layoutParams);
        } else {
            Context contextMo46912 = this.f15977;
            if (contextMo46912 == null) {
                contextMo46912 = mo4691();
            }
            TypedValue typedValue2 = new TypedValue();
            if (contextMo46912.getTheme().resolveAttribute(R.attr._11_res_0x7f0402dc, typedValue2, true)) {
                View viewFindViewById = guidedStepRootLayout.findViewById(R.id._11_res_0x7f0b0047);
                float f = typedValue2.getFloat();
                LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) viewFindViewById.getLayoutParams();
                layoutParams2.weight = f;
                viewFindViewById.setLayoutParams(layoutParams2);
            }
        }
        View viewInflate2 = layoutInflaterCloneInContext.inflate(R.layout.lb_guidedstep_background, (ViewGroup) guidedStepRootLayout, false);
        if (viewInflate2 != null) {
            ((FrameLayout) guidedStepRootLayout.findViewById(R.id._11_res_0x7f0b01d6)).addView(viewInflate2, 0);
        }
        return guidedStepRootLayout;
    }

    /* renamed from: ᵖⁱʣʘ, reason: contains not printable characters */
    public void m9235(ArrayList arrayList) {
    }

    /* renamed from: ᵞː, reason: contains not printable characters */
    public ᵮᵥٴ m9236() {
        return new ᵮᵥٴ("", "", "", (Object) null, 13);
    }

    /* renamed from: ᵤʢ, reason: contains not printable characters */
    public final void m9237(int i) {
        C5195 c5195 = this.f15983;
        if (c5195 != null) {
            c5195.f5396.m7666(i, 1, null);
        }
    }

    /* renamed from: ᵤˉᵩ, reason: contains not printable characters */
    public void m9238(ArrayList arrayList) {
    }

    /* renamed from: ᵫʽ, reason: contains not printable characters */
    public final void m9239(ArrayList arrayList) {
        this.f15981 = arrayList;
        C5195 c5195 = this.f15983;
        if (c5195 != null) {
            c5195.m10748(arrayList);
        }
    }

    /* renamed from: ᵶᵘː, reason: contains not printable characters */
    public C1041 m9240() {
        return new C1041();
    }

    @Override // defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ᵺᵜᵰ */
    public void mo1071(Bundle bundle) {
        super.mo1071(bundle);
        this.f15984 = new ʽˋːᵜ(3);
        this.f15980 = m9240();
        this.f15979 = m9229();
        m9231();
        ArrayList arrayList = new ArrayList();
        m9235(arrayList);
        if (bundle != null) {
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                C2718 c2718 = (C2718) arrayList.get(i);
                if (m9220(c2718)) {
                    c2718.m6720("action_" + c2718.f10539, bundle);
                }
            }
        }
        m9239(arrayList);
        ArrayList arrayList2 = new ArrayList();
        m9238(arrayList2);
        if (bundle != null) {
            int size2 = arrayList2.size();
            for (int i2 = 0; i2 < size2; i2++) {
                C2718 c27182 = (C2718) arrayList2.get(i2);
                if (m9220(c27182)) {
                    c27182.m6720("buttonaction_" + c27182.f10539, bundle);
                }
            }
        }
        this.f15976 = arrayList2;
        C5195 c5195 = this.f15978;
        if (c5195 != null) {
            c5195.m10748(arrayList2);
        }
    }
}
