package com.strmr.ps.ui.mobile.settings;

import android.R;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.lifecycle.at;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.upstream.CmcdData;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.view.fragment.d;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.tabs.TabLayout;
import com.strmr.ps.data.remote.api.TraktApiService;
import com.strmr.ps.data.repository.ScreenConfigRepository;
import com.strmr.ps.data.repository.TraktAccountRepository;
import com.strmr.ps.ui.mobile.settings.MobileLayoutRowsFragment;
import com.strmr.ps.ui.settings.viewmodel.RowCustomizationViewModel;
import dagger.hilt.android.AndroidEntryPoint;
import defpackage.c46;
import defpackage.cr4;
import defpackage.d46;
import defpackage.d75;
import defpackage.dw7;
import defpackage.fi7;
import defpackage.fm3;
import defpackage.hn2;
import defpackage.i66;
import defpackage.ika;
import defpackage.iw7;
import defpackage.j65;
import defpackage.jka;
import defpackage.jn2;
import defpackage.l24;
import defpackage.lr3;
import defpackage.mia;
import defpackage.n41;
import defpackage.qb5;
import defpackage.qq3;
import defpackage.sf1;
import defpackage.sr3;
import defpackage.u54;
import defpackage.u55;
import defpackage.v65;
import defpackage.vw2;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.wm1;
import defpackage.y41;
import defpackage.z36;
import defpackage.zs6;
import java.util.List;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001:\u0002\u0004\u0005B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0006"}, d2 = {"Lcom/strmr/ps/ui/mobile/settings/MobileLayoutRowsFragment;", "Landroidx/fragment/app/o;", "<init>", "()V", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "b", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@AndroidEntryPoint
@vx8
public final class MobileLayoutRowsFragment extends u54 {
    public TraktAccountRepository f;
    public TraktApiService i;
    public fm3 j;
    public final androidx.lifecycle.as k;
    public i66 l;
    public androidx.recyclerview.widget.x m;
    public ScreenConfigRepository.ScreenType n;
    public final List o;
    public final List p;

    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\b\u0082\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcom/strmr/ps/ui/mobile/settings/MobileLayoutRowsFragment$a;", "", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final /* data */ class a {
        public final String a;
        public final String b;
        public final String c;
        public final String d;
        public final boolean e;
        public final String f;
        public final String g;

        public a(String str, String str2, String str3, String str4, boolean z, String str5, String str6, int i) {
            str4 = (i & 8) != 0 ? "portrait" : str4;
            z = (i & 16) != 0 ? true : z;
            str5 = (i & 32) != 0 ? "" : str5;
            str6 = (i & 64) != 0 ? null : str6;
            cr4.g(str, "rowType");
            cr4.g(str2, "title");
            cr4.g(str4, "presentation");
            this.a = str;
            this.b = str2;
            this.c = str3;
            this.d = str4;
            this.e = z;
            this.f = str5;
            this.g = str6;
        }

        public final boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof a)) {
                return false;
            }
            a aVar = (a) obj;
            return cr4.b(this.a, aVar.a) && cr4.b(this.b, aVar.b) && cr4.b(this.c, aVar.c) && cr4.b(this.d, aVar.d) && this.e == aVar.e && cr4.b(this.f, aVar.f) && cr4.b(this.g, aVar.g);
        }

        public final int hashCode() {
            int iB = vw2.b(this.a.hashCode() * 31, 31, this.b);
            String str = this.c;
            int iB2 = vw2.b(fi7.c(vw2.b((iB + (str == null ? 0 : str.hashCode())) * 31, 31, this.d), 31, this.e), 31, this.f);
            String str2 = this.g;
            return iB2 + (str2 != null ? str2.hashCode() : 0);
        }

        public final String toString() {
            StringBuilder sbM = fi7.m("CatalogItem(rowType=", this.a, ", title=", this.b, ", contentType=");
            vw2.aa(sbM, this.c, ", presentation=", this.d, ", requiresAuth=");
            sbM.append(this.e);
            sbM.append(", description=");
            sbM.append(this.f);
            sbM.append(", dataSourceUrl=");
            return n41.s(sbM, this.g, ")");
        }
    }

    /* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
    /* JADX WARN: Unknown enum class pattern. Please report as an issue! */
    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0000\b\u0082\u0081\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001¨\u0006\u0002"}, d2 = {"Lcom/strmr/ps/ui/mobile/settings/MobileLayoutRowsFragment$b;", "", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class b {
        public static final /* synthetic */ b[] b;
        public static final /* synthetic */ hn2 c;
        public final String a;

        static {
            b[] bVarArr = {new b("MY_LISTS", 0, "My Custom Lists"), new b("LIKED_LISTS", 1, "Add from Liked Lists"), new b("TRENDING_LISTS", 2, "Add from Trending Lists"), new b("POPULAR_LISTS", 3, "Add from Popular Lists")};
            b = bVarArr;
            c = jn2.a(bVarArr);
        }

        public b(String str, int i, String str2) {
            this.a = str2;
        }

        public static b valueOf(String str) {
            return (b) Enum.valueOf(b.class, str);
        }

        public static b[] values() {
            return (b[]) b.clone();
        }
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public /* synthetic */ class c {
        public static final /* synthetic */ int[] a;

        static {
            int[] iArr = new int[ScreenConfigRepository.ScreenType.values().length];
            try {
                iArr[ScreenConfigRepository.ScreenType.HOME.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[ScreenConfigRepository.ScreenType.MOVIES.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[ScreenConfigRepository.ScreenType.TV_SHOWS.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            a = iArr;
            int[] iArr2 = new int[b.values().length];
            try {
                iArr2[0] = 1;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                b[] bVarArr = b.b;
                iArr2[1] = 2;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                b[] bVarArr2 = b.b;
                iArr2[2] = 3;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                b[] bVarArr3 = b.b;
                iArr2[3] = 4;
            } catch (NoSuchFieldError unused7) {
            }
        }
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class d implements zs6, sr3 {
        public final /* synthetic */ z36 a;

        public d(z36 z36Var) {
            this.a = z36Var;
        }

        @Override // defpackage.zs6
        public final /* synthetic */ void a(Object obj) {
            this.a.invoke(obj);
        }

        @Override // defpackage.sr3
        public final lr3 b() {
            return this.a;
        }

        public final boolean equals(Object obj) {
            if (!(obj instanceof zs6) || !(obj instanceof sr3)) {
                return false;
            }
            return this.a.equals(((sr3) obj).b());
        }

        public final int hashCode() {
            return this.a.hashCode();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Landroidx/fragment/app/o;", "invoke", "()Landroidx/fragment/app/o;", "cp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class e extends u55 implements qq3<androidx.fragment.app.o> {
        public e() {
            super(0);
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            return MobileLayoutRowsFragment.this;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Ljka;", "invoke", "()Ljka;", "hp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class f extends u55 implements qq3<jka> {
        public final /* synthetic */ e a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public f(e eVar) {
            super(0);
            this.a = eVar;
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            return (jka) this.a.invoke();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Lika;", "invoke", "()Lika;", "dp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class g extends u55 implements qq3<ika> {
        public final /* synthetic */ Object a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public g(j65 j65Var) {
            super(0);
            this.a = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            return ((jka) this.a.getValue()).getViewModelStore();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Lwm1;", "invoke", "()Lwm1;", "ep3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class h extends u55 implements qq3<wm1> {
        public final /* synthetic */ Object a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public h(j65 j65Var) {
            super(0);
            this.a = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            jka jkaVar = (jka) this.a.getValue();
            androidx.lifecycle.h hVar = jkaVar instanceof androidx.lifecycle.h ? (androidx.lifecycle.h) jkaVar : null;
            return hVar != null ? hVar.getDefaultViewModelCreationExtras() : wm1.a.b;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Landroidx/lifecycle/at$c;", "invoke", "()Landroidx/lifecycle/at$c;", "fp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class i extends u55 implements qq3<at.c> {
        public final /* synthetic */ Object b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public i(j65 j65Var) {
            super(0);
            this.b = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            at.c defaultViewModelProviderFactory;
            jka jkaVar = (jka) this.b.getValue();
            androidx.lifecycle.h hVar = jkaVar instanceof androidx.lifecycle.h ? (androidx.lifecycle.h) jkaVar : null;
            return (hVar == null || (defaultViewModelProviderFactory = hVar.getDefaultViewModelProviderFactory()) == null) ? MobileLayoutRowsFragment.this.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    public MobileLayoutRowsFragment() {
        j65 j65VarB = v65.b(d75.b, new f(new e()));
        this.k = new androidx.lifecycle.as(iw7.a.getOrCreateKotlinClass(RowCustomizationViewModel.class), new g(j65VarB), new i(j65VarB), new h(j65VarB));
        this.n = ScreenConfigRepository.ScreenType.HOME;
        this.o = y41.an(new a("trakt_watchlist_movies", "Movie Watchlist", "movies", null, false, "Your Trakt movie watchlist", null, 88), new a("trakt_watchlist_shows", "Show Watchlist", "shows", null, false, "Your Trakt show watchlist", null, 88), new a("trakt_collection_movies", "Movie Collection", "movies", null, false, "Your Trakt movie collection", null, 88), new a("trakt_collection_shows", "Show Collection", "shows", null, false, "Your Trakt show collection", null, 88), new a("trakt_history", "Recently Watched", null, "landscape", false, "Your recent watch history", null, 80), new a("trakt_history_movies", "Recently Watched Movies", "movies", "landscape", false, "Recently watched movies", null, 80), new a("trakt_history_shows", "Recently Watched Shows", "shows", "landscape", false, "Recently watched shows", null, 80), new a("trakt_recommendations_movies", "Recommended Movies", "movies", null, false, "Personalized movie recommendations", null, 88), new a("trakt_recommendations_shows", "Recommended Shows", "shows", null, false, "Personalized show recommendations", null, 88), new a("trakt_calendar", "Upcoming This Week", "shows", "calendar", false, "TV episodes airing this week", null, 80));
        this.p = y41.an(new a("genres", "Movie Genres", "movies", "landscape", false, "Browse movies by genre", null, 64), new a("genres", "TV Show Genres", "shows", "landscape", false, "Browse TV shows by genre", null, 64));
    }

    public static final void l(final MobileLayoutRowsFragment mobileLayoutRowsFragment, LinearLayout linearLayout, final a aVar, boolean z, final BottomSheetDialog bottomSheetDialog) {
        final Context contextRequireContext = mobileLayoutRowsFragment.requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        LinearLayout linearLayout2 = new LinearLayout(contextRequireContext);
        linearLayout2.setOrientation(0);
        linearLayout2.setGravity(16);
        linearLayout2.setPadding(mobileLayoutRowsFragment.o(24), mobileLayoutRowsFragment.o(14), mobileLayoutRowsFragment.o(24), mobileLayoutRowsFragment.o(14));
        boolean z2 = !z;
        linearLayout2.setClickable(z2);
        linearLayout2.setFocusable(z2);
        if (!z) {
            TypedValue typedValue = new TypedValue();
            contextRequireContext.getTheme().resolveAttribute(R.attr.selectableItemBackground, typedValue, true);
            linearLayout2.setBackgroundResource(typedValue.resourceId);
            linearLayout2.setOnClickListener(new View.OnClickListener() { // from class: com.strmr.ps.ui.mobile.settings.aj
                @Override // android.view.View.OnClickListener
                public final void onClick(View view) {
                    MobileLayoutRowsFragment mobileLayoutRowsFragment2 = this.a;
                    RowCustomizationViewModel rowCustomizationViewModelP = mobileLayoutRowsFragment2.p();
                    MobileLayoutRowsFragment.a aVar2 = aVar;
                    rowCustomizationViewModelP.b(aVar2.a, aVar2.b, aVar2.c, aVar2.d, aVar2.e, mobileLayoutRowsFragment2.n, aVar2.g);
                    Toast.makeText(contextRequireContext, "Added \"" + aVar2.b + "\"", 0).show();
                    bottomSheetDialog.dismiss();
                }
            });
        }
        linearLayout2.setAlpha(z ? 0.5f : 1.0f);
        LinearLayout linearLayout3 = new LinearLayout(contextRequireContext);
        linearLayout3.setOrientation(1);
        linearLayout3.setLayoutParams(new LinearLayout.LayoutParams(0, -2, 1.0f));
        TextView textView = new TextView(contextRequireContext);
        String str = aVar.b;
        String str2 = aVar.f;
        textView.setText(str);
        textView.setTextColor(sf1.getColor(contextRequireContext, com.strmr.ps.R.color.mobile_on_surface));
        textView.setTextSize(15.0f);
        linearLayout3.addView(textView);
        if (str2.length() > 0) {
            TextView textView2 = new TextView(contextRequireContext);
            textView2.setText(str2);
            textView2.setTextColor(sf1.getColor(contextRequireContext, com.strmr.ps.R.color.mobile_on_surface_variant));
            textView2.setTextSize(12.0f);
            linearLayout3.addView(textView2);
        }
        linearLayout2.addView(linearLayout3);
        TypedValue typedValue2 = new TypedValue();
        contextRequireContext.getTheme().resolveAttribute(com.strmr.ps.R.attr.colorAccentPrimary, typedValue2, true);
        int color = typedValue2.data;
        TextView textView3 = new TextView(contextRequireContext);
        textView3.setText(z ? "Added" : "+ Add");
        if (z) {
            color = sf1.getColor(contextRequireContext, com.strmr.ps.R.color.mobile_on_surface_variant);
        }
        textView3.setTextColor(color);
        textView3.setTextSize(13.0f);
        textView3.setTypeface(Typeface.DEFAULT_BOLD);
        textView3.setPadding(mobileLayoutRowsFragment.o(12), 0, 0, 0);
        linearLayout2.addView(textView3);
        linearLayout.addView(linearLayout2);
    }

    public static final void m(MobileLayoutRowsFragment mobileLayoutRowsFragment, LinearLayout linearLayout, String str) {
        Context contextRequireContext = mobileLayoutRowsFragment.requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        TypedValue typedValue = new TypedValue();
        contextRequireContext.getTheme().resolveAttribute(com.strmr.ps.R.attr.colorAccentPrimary, typedValue, true);
        int i2 = typedValue.data;
        TextView textView = new TextView(contextRequireContext);
        textView.setText(str);
        textView.setTextColor(i2);
        textView.setTextSize(12.0f);
        textView.setTypeface(Typeface.DEFAULT_BOLD);
        textView.setLetterSpacing(0.1f);
        textView.setPadding(mobileLayoutRowsFragment.o(24), mobileLayoutRowsFragment.o(20), mobileLayoutRowsFragment.o(24), mobileLayoutRowsFragment.o(8));
        linearLayout.addView(textView);
    }

    public static final void n(MobileLayoutRowsFragment mobileLayoutRowsFragment, String str, List list) {
        int i2 = qb5.f;
        Context contextRequireContext = mobileLayoutRowsFragment.requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        qb5.a.a(contextRequireContext, str, list, new l24(18), new z36(mobileLayoutRowsFragment, 0));
    }

    public final int o(int i2) {
        return (int) (i2 * getResources().getDisplayMetrics().density);
    }

    @Override // androidx.fragment.app.o
    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        cr4.g(layoutInflater, "inflater");
        View viewInflate = layoutInflater.inflate(com.strmr.ps.R.layout.fragment_mobile_layout_rows, viewGroup, false);
        int i2 = com.strmr.ps.R.id.btn_add_trakt;
        MaterialButton materialButton = (MaterialButton) mia.a(com.strmr.ps.R.id.btn_add_trakt, viewInflate);
        if (materialButton != null) {
            i2 = com.strmr.ps.R.id.btn_reset;
            MaterialButton materialButton2 = (MaterialButton) mia.a(com.strmr.ps.R.id.btn_reset, viewInflate);
            if (materialButton2 != null) {
                i2 = com.strmr.ps.R.id.rows_recycler_view;
                RecyclerView recyclerView = (RecyclerView) mia.a(com.strmr.ps.R.id.rows_recycler_view, viewInflate);
                if (recyclerView != null) {
                    i2 = com.strmr.ps.R.id.tab_layout;
                    TabLayout tabLayout = (TabLayout) mia.a(com.strmr.ps.R.id.tab_layout, viewInflate);
                    if (tabLayout != null) {
                        i2 = com.strmr.ps.R.id.toolbar;
                        MaterialToolbar materialToolbar = (MaterialToolbar) mia.a(com.strmr.ps.R.id.toolbar, viewInflate);
                        if (materialToolbar != null) {
                            CoordinatorLayout coordinatorLayout = (CoordinatorLayout) viewInflate;
                            this.j = new fm3(coordinatorLayout, materialButton, materialButton2, recyclerView, tabLayout, materialToolbar);
                            cr4.f(coordinatorLayout, "getRoot(...)");
                            return coordinatorLayout;
                        }
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(viewInflate.getResources().getResourceName(i2)));
    }

    @Override // androidx.fragment.app.o
    public final void onDestroyView() {
        super.onDestroyView();
        this.j = null;
    }

    @Override // androidx.fragment.app.o
    public final void onViewCreated(View view, Bundle bundle) {
        cr4.g(view, "view");
        super.onViewCreated(view, bundle);
        fm3 fm3Var = this.j;
        cr4.d(fm3Var);
        final int i2 = 1;
        fm3Var.e.setNavigationOnClickListener(new View.OnClickListener(this) { // from class: b46
            public final /* synthetic */ MobileLayoutRowsFragment b;

            {
                this.b = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                switch (i2) {
                    case 0:
                        MobileLayoutRowsFragment mobileLayoutRowsFragment = this.b;
                        Context contextRequireContext = mobileLayoutRowsFragment.requireContext();
                        cr4.f(contextRequireContext, "requireContext(...)");
                        new gv3(contextRequireContext, com.strmr.ps.R.style.StrmrDialogTheme).setTitle((CharSequence) "Reset Rows").setMessage((CharSequence) "Reset all rows to default for this screen?").setPositiveButton((CharSequence) "Reset", (DialogInterface.OnClickListener) new rq(mobileLayoutRowsFragment, 1)).setNegativeButton((CharSequence) "Cancel", (DialogInterface.OnClickListener) null).show();
                        break;
                    default:
                        d.a(this.b).n();
                        break;
                }
            }
        });
        fm3 fm3Var2 = this.j;
        cr4.d(fm3Var2);
        TabLayout tabLayout = fm3Var2.d;
        fm3 fm3Var3 = this.j;
        cr4.d(fm3Var3);
        tabLayout.addTab(fm3Var3.d.newTab().setText("Home"));
        fm3 fm3Var4 = this.j;
        cr4.d(fm3Var4);
        TabLayout tabLayout2 = fm3Var4.d;
        fm3 fm3Var5 = this.j;
        cr4.d(fm3Var5);
        tabLayout2.addTab(fm3Var5.d.newTab().setText("Movies"));
        fm3 fm3Var6 = this.j;
        cr4.d(fm3Var6);
        TabLayout tabLayout3 = fm3Var6.d;
        fm3 fm3Var7 = this.j;
        cr4.d(fm3Var7);
        tabLayout3.addTab(fm3Var7.d.newTab().setText("TV Shows"));
        fm3 fm3Var8 = this.j;
        cr4.d(fm3Var8);
        fm3Var8.d.addOnTabSelectedListener((TabLayout.OnTabSelectedListener) new d46(this));
        this.l = new i66(new z36(this, 1), new z36(this, 2), new z36(this, 3), new z36(this, 4));
        fm3 fm3Var9 = this.j;
        cr4.d(fm3Var9);
        RecyclerView recyclerView = fm3Var9.c;
        requireContext();
        recyclerView.setLayoutManager(new LinearLayoutManager());
        i66 i66Var = this.l;
        if (i66Var == null) {
            cr4.n("rowAdapter");
            throw null;
        }
        recyclerView.setAdapter(i66Var);
        dw7.f fVar = new dw7.f();
        fVar.a = -1;
        androidx.recyclerview.widget.x xVar = new androidx.recyclerview.widget.x(new c46(this, fVar));
        this.m = xVar;
        fm3 fm3Var10 = this.j;
        cr4.d(fm3Var10);
        xVar.f(fm3Var10.c);
        fm3 fm3Var11 = this.j;
        cr4.d(fm3Var11);
        fm3Var11.a.setOnClickListener(new View.OnClickListener() { // from class: com.strmr.ps.ui.mobile.settings.ai
            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                MobileLayoutRowsFragment mobileLayoutRowsFragment = this.a;
                Context contextRequireContext = mobileLayoutRowsFragment.requireContext();
                cr4.f(contextRequireContext, "requireContext(...)");
                wj0.c(androidx.lifecycle.s.a(mobileLayoutRowsFragment), null, null, new ax(mobileLayoutRowsFragment, contextRequireContext, null), 3);
            }
        });
        fm3 fm3Var12 = this.j;
        cr4.d(fm3Var12);
        final int i3 = 0;
        fm3Var12.b.setOnClickListener(new View.OnClickListener(this) { // from class: b46
            public final /* synthetic */ MobileLayoutRowsFragment b;

            {
                this.b = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                switch (i3) {
                    case 0:
                        MobileLayoutRowsFragment mobileLayoutRowsFragment = this.b;
                        Context contextRequireContext = mobileLayoutRowsFragment.requireContext();
                        cr4.f(contextRequireContext, "requireContext(...)");
                        new gv3(contextRequireContext, com.strmr.ps.R.style.StrmrDialogTheme).setTitle((CharSequence) "Reset Rows").setMessage((CharSequence) "Reset all rows to default for this screen?").setPositiveButton((CharSequence) "Reset", (DialogInterface.OnClickListener) new rq(mobileLayoutRowsFragment, 1)).setNegativeButton((CharSequence) "Cancel", (DialogInterface.OnClickListener) null).show();
                        break;
                    default:
                        d.a(this.b).n();
                        break;
                }
            }
        });
        p().d.f(getViewLifecycleOwner(), new d(new z36(this, 5)));
        p().h(this.n);
    }

    public final RowCustomizationViewModel p() {
        return (RowCustomizationViewModel) this.k.getValue();
    }
}
