package p000.p001.p002.p008.p009;

import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import androidx.leanback.widget.VerticalGridView;
import java.util.concurrent.CancellationException;
import kotlin.jvm.internal.DefaultConstructorMarker;
import p025.p026.AbstractC1376;
import p025.p026.C1340;
import p025.p026.InterfaceC1327;
import p025.p026.InterfaceC1363;
import p037.p065.p066.C1825;
import p037.p065.p066.C1829;
import p037.p089.p090.ActivityC1999;
import p037.p091.p092.C2084;
import p037.p091.p095.C2136;
import p037.p091.p095.C2138;
import p037.p091.p095.C2141;
import p037.p091.p095.C2155;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.InterfaceC6540;
import p402.p405.InterfaceC6578;
import p402.p411.p413.C6635;
import p402.p420.C6703;

/* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public abstract class AbstractC0736 extends C2084 implements InterfaceC1327 {

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public C1829 f3209;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public InterfaceC1363 f3210;

    /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏$֏, reason: contains not printable characters */
    @InterfaceC6540
    public static final class C0737 extends C2155 {

        /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏$֏$֏, reason: contains not printable characters */
        /* JADX INFO: compiled from: java-style lambda group */
        public static final class ViewOnFocusChangeListenerC0738 implements View.OnFocusChangeListener {

            /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
            public final /* synthetic */ int f3212;

            /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
            public final /* synthetic */ Object f3213;

            public ViewOnFocusChangeListenerC0738(int i, Object obj) {
                this.f3212 = i;
                this.f3213 = obj;
            }

            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z) {
                int i = this.f3212;
                if (i == 0) {
                    if (z) {
                        return;
                    }
                    C2155.C2160 c2160 = (C2155.C2160) this.f3213;
                    C6635.m9823((Object) c2160, "vh");
                    C2138 c2138 = c2160.f7050;
                    C6635.m9823((Object) c2138, "vh.action");
                    if (c2138.m4179()) {
                        C2155.C2160 c21602 = (C2155.C2160) this.f3213;
                        C6635.m9823((Object) c21602, "vh");
                        C2138 c21382 = c21602.f7050;
                        C6635.m9823((Object) c21382, "vh.action");
                        C2155.C2160 c21603 = (C2155.C2160) this.f3213;
                        C6635.m9823((Object) c21603, "vh");
                        EditText editTextM4223 = c21603.m4223();
                        C6635.m9823((Object) editTextM4223, "vh.editableTitleView");
                        c21382.f6869 = editTextM4223.getText();
                        return;
                    }
                    return;
                }
                if (i != 1) {
                    throw null;
                }
                if (z) {
                    return;
                }
                C2155.C2160 c21604 = (C2155.C2160) this.f3213;
                C6635.m9823((Object) c21604, "vh");
                C2138 c21383 = c21604.f7050;
                C6635.m9823((Object) c21383, "vh.action");
                if (c21383.m4178()) {
                    C2155.C2160 c21605 = (C2155.C2160) this.f3213;
                    C6635.m9823((Object) c21605, "vh");
                    C2138 c21384 = c21605.f7050;
                    C6635.m9823((Object) c21384, "vh.action");
                    C2155.C2160 c21606 = (C2155.C2160) this.f3213;
                    C6635.m9823((Object) c21606, "vh");
                    EditText editTextM4222 = c21606.m4222();
                    C6635.m9823((Object) editTextM4222, "vh.editableDescriptionView");
                    c21384.f6870 = editTextM4222.getText();
                }
            }
        }

        /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏$֏$ؠ, reason: contains not printable characters */
        public static final class C0739 implements TextWatcher {

            /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
            public final /* synthetic */ C2155.C2160 f3215;

            public C0739(C2155.C2160 c2160) {
                this.f3215 = c2160;
            }

            @Override // android.text.TextWatcher
            public void afterTextChanged(Editable editable) {
                C2155.C2160 c2160 = this.f3215;
                C6635.m9823((Object) c2160, "vh");
                C2138 c2138 = c2160.f7050;
                C6635.m9823((Object) c2138, "vh.action");
                if (c2138.m4179()) {
                    C2155.C2160 c21602 = this.f3215;
                    C6635.m9823((Object) c21602, "vh");
                    C2138 c21382 = c21602.f7050;
                    C6635.m9823((Object) c21382, "vh.action");
                    if (c21382.m4180()) {
                        C2155.C2160 c21603 = this.f3215;
                        C6635.m9823((Object) c21603, "vh");
                        C2138 c21383 = c21603.f7050;
                        C6635.m9823((Object) c21383, "vh.action");
                        long j = c21383.f6867;
                        Long lMo2040 = AbstractC0736.this.mo2040();
                        if (lMo2040 != null && j == lMo2040.longValue()) {
                            AbstractC0736.m2029(AbstractC0736.this, editable);
                        }
                        AbstractC0736 abstractC0736 = AbstractC0736.this;
                        C2155.C2160 c21604 = this.f3215;
                        C6635.m9823((Object) c21604, "vh");
                        C6635.m9823((Object) c21604.f7050, "vh.action");
                        if (abstractC0736 == null) {
                            throw null;
                        }
                    }
                }
            }

            @Override // android.text.TextWatcher
            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override // android.text.TextWatcher
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }
        }

        /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏$֏$ހ, reason: contains not printable characters */
        public static final class C0740 implements TextWatcher {

            /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
            public final /* synthetic */ C2155.C2160 f3217;

            public C0740(C2155.C2160 c2160) {
                this.f3217 = c2160;
            }

            @Override // android.text.TextWatcher
            public void afterTextChanged(Editable editable) {
                C2155.C2160 c2160 = this.f3217;
                C6635.m9823((Object) c2160, "vh");
                C2138 c2138 = c2160.f7050;
                C6635.m9823((Object) c2138, "vh.action");
                if (c2138.m4178()) {
                    C2155.C2160 c21602 = this.f3217;
                    C6635.m9823((Object) c21602, "vh");
                    C2138 c21382 = c21602.f7050;
                    C6635.m9823((Object) c21382, "vh.action");
                    if (c21382.m4180()) {
                        C2155.C2160 c21603 = this.f3217;
                        C6635.m9823((Object) c21603, "vh");
                        C2138 c21383 = c21603.f7050;
                        C6635.m9823((Object) c21383, "vh.action");
                        long j = c21383.f6867;
                        Long lMo2040 = AbstractC0736.this.mo2040();
                        if (lMo2040 != null && j == lMo2040.longValue()) {
                            AbstractC0736.m2029(AbstractC0736.this, editable);
                        }
                        AbstractC0736 abstractC0736 = AbstractC0736.this;
                        C2155.C2160 c21604 = this.f3217;
                        C6635.m9823((Object) c21604, "vh");
                        C2138 c21384 = c21604.f7050;
                        C6635.m9823((Object) c21384, "vh.action");
                        abstractC0736.m2035(c21384.f6867);
                    }
                }
            }

            @Override // android.text.TextWatcher
            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override // android.text.TextWatcher
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }
        }

        public C0737() {
        }

        @Override // p037.p091.p095.C2155
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public C2155.C2160 mo2043(ViewGroup viewGroup) {
            C2155.C2160 c2160Mo2043 = super.mo2043(viewGroup);
            C6635.m9823((Object) c2160Mo2043, "vh");
            EditText editTextM4223 = c2160Mo2043.m4223();
            C6635.m9823((Object) editTextM4223, "vh.editableTitleView");
            editTextM4223.addTextChangedListener(new C0739(c2160Mo2043));
            c2160Mo2043.m4223().setOnFocusChangeListener(new ViewOnFocusChangeListenerC0738(0, c2160Mo2043));
            EditText editTextM4222 = c2160Mo2043.m4222();
            C6635.m9823((Object) editTextM4222, "vh.editableDescriptionView");
            editTextM4222.addTextChangedListener(new C0740(c2160Mo2043));
            c2160Mo2043.m4222().setOnFocusChangeListener(new ViewOnFocusChangeListenerC0738(1, c2160Mo2043));
            return c2160Mo2043;
        }
    }

    /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏$ؠ, reason: contains not printable characters */
    public static final class C0741 {
        public C0741() {
        }

        public /* synthetic */ C0741(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.֏$ހ, reason: contains not printable characters */
    public static final class RunnableC0742 implements Runnable {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final /* synthetic */ C2155 f3218;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final /* synthetic */ int f3219;

        public RunnableC0742(C2155 c2155, int i) {
            this.f3218 = c2155;
            this.f3219 = i;
        }

        @Override // java.lang.Runnable
        public final void run() {
            VerticalGridView verticalGridView = this.f3218.f7022;
            if (verticalGridView != null) {
                verticalGridView.requestFocus();
            }
            VerticalGridView verticalGridView2 = this.f3218.f7022;
            if (verticalGridView2 != null) {
                verticalGridView2.setSelectedPosition(this.f3219);
            }
        }
    }

    static {
        new C0741(null);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final /* synthetic */ void m2029(AbstractC0736 abstractC0736, Editable editable) {
        CharSequence charSequenceM9900;
        if (abstractC0736 == null) {
            throw null;
        }
        boolean z = false;
        if (editable != null && (charSequenceM9900 = C6703.m9900(editable)) != null) {
            if (charSequenceM9900.length() > 0) {
                z = true;
            }
        }
        abstractC0736.m2032(abstractC0736.m2039(), z);
    }

    @Override // p037.p091.p092.C2084, androidx.fragment.app.Fragment
    public void onDestroyView() {
        super.onDestroyView();
        InterfaceC1363 interfaceC1363 = this.f3210;
        if (interfaceC1363 == null) {
            C6635.m9826("job");
            throw null;
        }
        C4303.m7098(interfaceC1363, (CancellationException) null, 1, (Object) null);
        mo2037();
    }

    @Override // androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        if (view == null) {
            C6635.m9824("view");
            throw null;
        }
        this.f3210 = C4303.m7047((InterfaceC1363) null, 1);
        C2136 c2136 = this.f6809;
        C6635.m9823((Object) c2136, "guidanceStylist");
        ImageView imageView = c2136.f6966;
        C6635.m9823((Object) imageView, "guidanceStylist.iconView");
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m2030(long j, boolean z) {
        int iM4059 = m4059(j);
        if (iM4059 != -1) {
            C2138 c2138 = this.f6816.get(iM4059);
            C6635.m9823((Object) c2138, "actions[position]");
            c2138.m4171(z ? 16 : 0, 16);
            m4057(iM4059);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m2031(C2155 c2155, int i) {
        if (c2155 == null) {
            C6635.m9824("$this$setSelectedPositionWithDelay");
            throw null;
        }
        View view = this.mView;
        if (view != null) {
            view.postDelayed(new RunnableC0742(c2155, i), 100L);
        }
    }

    @Override // p025.p026.InterfaceC1327
    /* JADX INFO: renamed from: ؠ */
    public InterfaceC6578 mo337() {
        AbstractC1376 abstractC1376M2665 = C1340.m2665();
        InterfaceC1363 interfaceC1363 = this.f3210;
        if (interfaceC1363 != null) {
            return abstractC1376M2665.plus(interfaceC1363);
        }
        C6635.m9826("job");
        throw null;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m2032(long j, boolean z) {
        int iM4062 = m4062(j);
        if (iM4062 != -1) {
            C2138 c2138 = this.f6817.get(iM4062);
            C6635.m9823((Object) c2138, "buttonActions[position]");
            c2138.m4171(z ? 16 : 0, 16);
            C2141 c2141 = this.f6814;
            if (c2141 != null) {
                c2141.f1232.m601(iM4062, 1, null);
            }
        }
    }

    @Override // p037.p091.p092.C2084
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public void mo2033(C2138 c2138) {
        if (c2138 == null) {
            C6635.m9824("action");
            throw null;
        }
        long j = c2138.f6867;
        if (j == 2) {
            C2084.m4053(getParentFragmentManager(), m2038());
            return;
        }
        if (j != 0 && j != 1 && j != 4) {
            if (j == 3) {
                getParentFragmentManager().m3957();
            }
        } else {
            ActivityC1999 activity = getActivity();
            if (activity != null) {
                activity.finish();
            }
        }
    }

    @Override // p037.p091.p092.C2084
    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public long mo2034(C2138 c2138) {
        CharSequence charSequenceM9900;
        if (c2138 == null) {
            C6635.m9824("action");
            throw null;
        }
        long j = c2138.f6867;
        Long lMo2040 = mo2040();
        if (lMo2040 == null || j != lMo2040.longValue()) {
            return -2L;
        }
        if (c2138.m4179()) {
            CharSequence charSequence = c2138.f6869;
            C6635.m9823((Object) charSequence, "action.title");
            charSequenceM9900 = C6703.m9900(charSequence);
        } else {
            CharSequence charSequence2 = c2138.f6870;
            C6635.m9823((Object) charSequence2, "action.description");
            charSequenceM9900 = C6703.m9900(charSequence2);
        }
        if (charSequenceM9900.length() == 0) {
            return -3L;
        }
        return m2039();
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public void m2035(long j) {
    }

    @Override // p037.p091.p092.C2084
    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public C2155 mo2036() {
        return new C0737();
    }

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public void mo2037() {
    }

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public C2084 m2038() {
        return null;
    }

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final long m2039() {
        int iM4062 = m4062(2L);
        if ((iM4062 >= 0 ? this.f6817.get(iM4062) : null) != null) {
            return 2L;
        }
        int iM40622 = m4062(4L);
        return (iM40622 >= 0 ? this.f6817.get(iM40622) : null) != null ? 4L : 0L;
    }

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public Long mo2040() {
        return null;
    }

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public final void m2041() {
        if (this.f3209 == null) {
            C2136 c2136 = this.f6809;
            C6635.m9823((Object) c2136, "guidanceStylist");
            C1825 c1825M3601 = C1825.m3601(c2136.f6966, View.ALPHA, 0.2f);
            c1825M3601.f6139 = 2;
            c1825M3601.f6138 = -1;
            c1825M3601.mo3562(1000L);
            c1825M3601.mo3569();
            this.f3209 = c1825M3601;
        }
    }

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public final void m2042() {
        C1829 c1829 = this.f3209;
        if (c1829 != null) {
            if (c1829 != null) {
                c1829.cancel();
            }
            this.f3209 = null;
            C2136 c2136 = this.f6809;
            C6635.m9823((Object) c2136, "guidanceStylist");
            c2136.f6966.animate().alpha(1.0f);
        }
    }
}
