package defpackage;

import android.content.Context;
import android.graphics.Color;
import android.util.TypedValue;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.upstream.CmcdData;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.strmr.ps.R;
import com.strmr.ps.data.local.entity.PlaybackProgress;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.trakt.TraktMediaList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\bÆ\u0002\u0018\u00002\u00020\u0001:\u0002\u0002\u0003¨\u0006\u0004"}, d2 = {"Li56;", "", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "b", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public final class i56 {

    @Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b6\u0018\u00002\u00020\u0001:\t\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u0082\u0001\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013¨\u0006\u0014"}, d2 = {"Li56$a;", "", "b", "e", "g", "c", "d", "f", CmcdData.OBJECT_TYPE_INIT_SEGMENT, CmcdData.OBJECT_TYPE_AUDIO_ONLY, CmcdData.STREAMING_FORMAT_HLS, "Li56$a$a;", "Li56$a$b;", "Li56$a$c;", "Li56$a$d;", "Li56$a$e;", "Li56$a$f;", "Li56$a$g;", "Li56$a$h;", "Li56$a$i;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static abstract class a {

        /* JADX INFO: renamed from: i56$a$a, reason: collision with other inner class name */
        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$a;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class C0146a extends a {
            public final ContentItem a;

            public C0146a(ContentItem contentItem) {
                cr4.g(contentItem, "item");
                this.a = contentItem;
            }

            public final boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                return (obj instanceof C0146a) && cr4.b(this.a, ((C0146a) obj).a);
            }

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

            public final String toString() {
                return "CalendarDay(item=" + this.a + ")";
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$b;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class b extends a {
            public final ContentItem a;
            public final int b;
            public final String c;

            public b(ContentItem contentItem, String str, int i) {
                cr4.g(contentItem, "item");
                this.a = contentItem;
                this.b = i;
                this.c = str;
            }

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

            public final int hashCode() {
                return this.c.hashCode() + fi7.a(this.b, this.a.hashCode() * 31, 31);
            }

            public final String toString() {
                StringBuilder sb = new StringBuilder("Details(item=");
                sb.append(this.a);
                sb.append(", tmdbId=");
                sb.append(this.b);
                sb.append(", contentType=");
                return n41.s(sb, this.c, ")");
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$c;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class c extends a {
            public final String a;
            public final String b;

            public c(String str, String str2) {
                cr4.g(str2, "title");
                this.a = str;
                this.b = str2;
            }

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

            public final int hashCode() {
                return this.b.hashCode() + (this.a.hashCode() * 31);
            }

            public final String toString() {
                return n41.o("GenreGrid(genreSlug=", this.a, ", title=", this.b, ")");
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$d;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class d extends a {
            public final String a;
            public final String b;

            public d(String str, String str2) {
                cr4.g(str, "category");
                cr4.g(str2, "title");
                this.a = str;
                this.b = str2;
            }

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

            public final int hashCode() {
                return this.b.hashCode() + (this.a.hashCode() * 31);
            }

            public final String toString() {
                return n41.o("MyTraktGrid(category=", this.a, ", title=", this.b, ")");
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$e;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class e extends a {
            public final String a;
            public final String b;

            public e(String str, String str2) {
                cr4.g(str2, "title");
                this.a = str;
                this.b = str2;
            }

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

            public final int hashCode() {
                return this.b.hashCode() + (this.a.hashCode() * 31);
            }

            public final String toString() {
                return n41.o("NetworkGrid(networkId=", this.a, ", title=", this.b, ")");
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$f;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final class f extends a {
            public static final f a = new f();
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$g;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class g extends a {
            public final String a;
            public final String b;
            public final String c;
            public final String d;

            public g(String str, String str2, String str3, String str4) {
                cr4.g(str, "username");
                cr4.g(str2, "listId");
                cr4.g(str3, "title");
                this.a = str;
                this.b = str2;
                this.c = str3;
                this.d = str4;
            }

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

            public final int hashCode() {
                return this.d.hashCode() + vw2.b(vw2.b(this.a.hashCode() * 31, 31, this.b), 31, this.c);
            }

            public final String toString() {
                return n41.u(fi7.m("TraktListGrid(username=", this.a, ", listId=", this.b, ", title="), this.c, ", traktUrl=", this.d, ")");
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$h;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class h extends a {
            public final ContentItem a;

            public h(ContentItem contentItem) {
                cr4.g(contentItem, "item");
                this.a = contentItem;
            }

            public final boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                return (obj instanceof h) && cr4.b(this.a, ((h) obj).a);
            }

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

            public final String toString() {
                return "Unknown(item=" + this.a + ")";
            }
        }

        @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\b\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Li56$a$i;", "Li56$a;", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
        public static final /* data */ class i extends a {
            public final String a;
            public final String b;

            public i(String str, String str2) {
                cr4.g(str2, "title");
                this.a = str;
                this.b = str2;
            }

            public final boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof i)) {
                    return false;
                }
                i iVar = (i) obj;
                return cr4.b(this.a, iVar.a) && cr4.b(this.b, iVar.b);
            }

            public final int hashCode() {
                return this.b.hashCode() + (this.a.hashCode() * 31);
            }

            public final String toString() {
                return n41.o("UserCollectionContent(collectionItemJson=", this.a, ", title=", this.b, ")");
            }
        }
    }

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

        public b(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
            cr4.g(str, "title");
            cr4.g(str2, "rowType");
            this.a = str;
            this.b = str2;
            this.c = str3;
            this.d = str4;
            this.e = str5;
            this.f = str6;
            this.g = str7;
        }

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

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

        public final String toString() {
            StringBuilder sbM = fi7.m("RowGridTarget(title=", this.a, ", sourceType=row_content, rowType=", this.b, ", contentType=");
            vw2.aa(sbM, this.c, ", dataSourceUrl=", this.d, ", rowConfigId=");
            vw2.aa(sbM, this.e, ", sortBy=", this.f, ", sortHow=");
            return n41.s(sbM, this.g, ")");
        }
    }

    @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[ContentItem.ItemType.values().length];
            try {
                iArr[ContentItem.ItemType.MOVIE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[ContentItem.ItemType.TV_SHOW.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[ContentItem.ItemType.NETWORK.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[ContentItem.ItemType.USER_COLLECTION.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[ContentItem.ItemType.COLLECTION.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr[ContentItem.ItemType.DIRECTOR.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                iArr[ContentItem.ItemType.GENRE.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                iArr[ContentItem.ItemType.TRAKT_LIST.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                iArr[ContentItem.ItemType.PERSON.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                iArr[ContentItem.ItemType.CALENDAR_DAY.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
            a = iArr;
        }
    }

    public static int a(Context context, int i) {
        return (int) (i * context.getResources().getDisplayMetrics().density);
    }

    public static a b(ContentItem contentItem) {
        q07 q07VarD;
        cr4.g(contentItem, "item");
        if (contentItem.isPlaceholder()) {
            return a.f.a;
        }
        if (contentItem.isContent()) {
            int i = c.a[contentItem.getItemType().ordinal()];
            String str = PlaybackProgress.TYPE_MOVIE;
            if (i != 1 && i == 2) {
                str = "tv";
            }
            return new a.b(contentItem, str, contentItem.getTmdbId());
        }
        switch (c.a[contentItem.getItemType().ordinal()]) {
            case 3:
                String imdbId = contentItem.getImdbId();
                return new a.e(imdbId != null ? n89.ai(imdbId, "network:") : "", contentItem.getTitle());
            case 4:
                String extraData = contentItem.getExtraData();
                if (extraData != null) {
                    return new a.i(extraData, contentItem.getTitle());
                }
                String imdbId2 = contentItem.getImdbId();
                if (imdbId2 != null && (q07VarD = d(imdbId2)) != null) {
                    gVar = new a.g((String) q07VarD.a, (String) q07VarD.b, contentItem.getTitle(), imdbId2);
                }
                return gVar != null ? gVar : new a.h(contentItem);
            case 5:
            case 6:
                String imdbId3 = contentItem.getImdbId();
                if (imdbId3 != null) {
                    q07 q07VarD2 = d(imdbId3);
                    gVar = q07VarD2 != null ? new a.g((String) q07VarD2.a, (String) q07VarD2.b, contentItem.getTitle(), imdbId3) : null;
                    if (gVar != null) {
                        return gVar;
                    }
                }
                return new a.h(contentItem);
            case 7:
                String imdbId4 = contentItem.getImdbId();
                return new a.c(imdbId4 != null ? imdbId4 : "", contentItem.getTitle());
            case 8:
                TraktMediaList traktMediaListFromId = TraktMediaList.INSTANCE.fromId(contentItem.getImdbId());
                if (traktMediaListFromId != null) {
                    return new a.d(traktMediaListFromId.name(), contentItem.getTitle());
                }
                String imdbId5 = contentItem.getImdbId();
                if (imdbId5 != null) {
                    q07 q07VarD3 = d(imdbId5);
                    gVar = q07VarD3 != null ? new a.g((String) q07VarD3.a, (String) q07VarD3.b, contentItem.getTitle(), imdbId5) : null;
                    if (gVar != null) {
                        return gVar;
                    }
                }
                return new a.h(contentItem);
            case 9:
                return new a.h(contentItem);
            case 10:
                return new a.C0146a(contentItem);
            default:
                return new a.h(contentItem);
        }
    }

    public static b c(af1 af1Var, String str) {
        cr4.g(af1Var, "row");
        String str2 = af1Var.a;
        String str3 = af1Var.d;
        String str4 = af1Var.f;
        String str5 = str4 == null ? "" : str4;
        String str6 = af1Var.g;
        return new b(str2, str3, str, str5, str6 == null ? "" : str6, af1Var.h, af1Var.i);
    }

    public static q07 d(String str) {
        tp5 tp5VarB = new pw7("https://trakt\\.tv/users/([^/]+)/lists/([^/?]+)").b(str);
        if (tp5VarB != null) {
            return new q07(tp5VarB.b().get(1), tp5VarB.b().get(2));
        }
        return null;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v11, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r0v14, types: [android.view.View, android.view.ViewGroup, android.widget.LinearLayout] */
    /* JADX WARN: Type inference failed for: r10v0 */
    /* JADX WARN: Type inference failed for: r10v1, types: [boolean, int] */
    /* JADX WARN: Type inference failed for: r10v2 */
    /* JADX WARN: Type inference failed for: r15v2, types: [android.content.res.Resources$Theme] */
    /* JADX WARN: Type inference failed for: r1v1, types: [ik2] */
    /* JADX WARN: Type inference failed for: r1v2, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r1v31, types: [java.util.ArrayList] */
    /* JADX WARN: Type inference failed for: r2v0, types: [android.app.Dialog, com.google.android.material.bottomsheet.BottomSheetDialog] */
    /* JADX WARN: Type inference failed for: r4v12 */
    /* JADX WARN: Type inference failed for: r4v2 */
    /* JADX WARN: Type inference failed for: r4v3 */
    /* JADX WARN: Type inference failed for: r8v0, types: [android.view.View, android.widget.ScrollView] */
    /* JADX WARN: Type inference failed for: r9v0, types: [android.view.View, android.view.ViewGroup, android.widget.LinearLayout] */
    public static void e(final Context context, ContentItem contentItem, final sq3 sq3Var) {
        ?? arrayList;
        ?? r4;
        int i;
        Integer numBe;
        cr4.g(contentItem, "item");
        final ?? bottomSheetDialog = new BottomSheetDialog(context);
        ?? scrollView = new ScrollView(context);
        scrollView.setBackgroundColor(sf1.getColor(context, R.color.dialog_glass_bg));
        ?? linearLayout = new LinearLayout(context);
        ?? r10 = 1;
        linearLayout.setOrientation(1);
        linearLayout.setPadding(a(context, 20), a(context, 16), a(context, 20), a(context, 24));
        TextView textView = new TextView(context);
        String showTitle = contentItem.getShowTitle();
        if (showTitle == null && (showTitle = contentItem.getCalendarDayLabel()) == null) {
            showTitle = "Schedule";
        }
        textView.setText(showTitle);
        textView.setTextColor(-1);
        textView.setTextSize(18.0f);
        textView.setTypeface(textView.getTypeface(), 1);
        int i2 = 0;
        textView.setPadding(0, 0, 0, a(context, 12));
        linearLayout.addView(textView);
        String calendarEpisodes = contentItem.getCalendarEpisodes();
        int i3 = 6;
        if (calendarEpisodes != null) {
            List listAo = n89.ao(calendarEpisodes, new String[]{"\n"}, 6);
            arrayList = new ArrayList();
            for (Object obj : listAo) {
                if (!n89.ab((String) obj)) {
                    arrayList.add(obj);
                }
            }
        } else {
            arrayList = ik2.a;
        }
        if (arrayList.isEmpty()) {
            TextView textView2 = new TextView(context);
            textView2.setText("No episodes scheduled");
            textView2.setTextColor(Color.parseColor("#999999"));
            textView2.setTextSize(14.0f);
            linearLayout.addView(textView2);
        } else {
            Iterator it = ((Iterable) arrayList).iterator();
            while (it.hasNext()) {
                ?? Ao = n89.ao((String) it.next(), new String[]{"|"}, i3);
                if (Ao.size() >= 4) {
                    final String str = (String) Ao.get(i2);
                    String str2 = (String) Ao.get(r10);
                    String str3 = (String) Ao.get(2);
                    String str4 = (String) Ao.get(3);
                    String str5 = (String) y41.af(4, Ao);
                    int iIntValue = (str5 == null || (numBe = n89.be(str5)) == null) ? i2 : numBe.intValue();
                    String str6 = (String) y41.af(5, Ao);
                    String str7 = null;
                    if (str6 == null || n89.ab(str6)) {
                        str6 = null;
                    }
                    String str8 = (String) y41.af(i3, Ao);
                    if (str8 != null && !n89.ab(str8)) {
                        str7 = str8;
                    }
                    ?? linearLayout2 = new LinearLayout(context);
                    linearLayout2.setOrientation(r10);
                    linearLayout2.setPadding(i2, a(context, 8), i2, a(context, 8));
                    linearLayout2.setClickable(r10);
                    linearLayout2.setFocusable(r10);
                    TypedValue typedValue = new TypedValue();
                    context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, typedValue, r10);
                    linearLayout2.setBackgroundResource(typedValue.resourceId);
                    final String str9 = str6;
                    final int i4 = iIntValue;
                    final String str10 = str7;
                    linearLayout2.setOnClickListener(new View.OnClickListener() { // from class: h56
                        @Override // android.view.View.OnClickListener
                        public final void onClick(View view) {
                            int i5 = i4;
                            if (i5 <= 0) {
                                Toast.makeText(context, "Unable to open show details", 0).show();
                                return;
                            }
                            bottomSheetDialog.dismiss();
                            sq3Var.invoke(new ContentItem(i5, ContentItem.ItemType.TV_SHOW, i5, null, str, null, str10, str9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, -1048064, 2047, null));
                        }
                    });
                    TextView textView3 = new TextView(context);
                    textView3.setText(str4 + "  •  " + str);
                    textView3.setTextColor(-1);
                    textView3.setTextSize(15.0f);
                    textView3.setTypeface(textView3.getTypeface(), 1);
                    linearLayout2.addView(textView3);
                    TextView textView4 = new TextView(context);
                    textView4.setText(str2 + "  –  " + str3);
                    textView4.setTextColor(Color.parseColor("#AAAAAA"));
                    textView4.setTextSize(13.0f);
                    i = 0;
                    textView4.setPadding(0, a(context, 2), 0, 0);
                    linearLayout2.addView(textView4);
                    linearLayout.addView(linearLayout2);
                    View view = new View(context);
                    r4 = 1;
                    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, 1);
                    layoutParams.topMargin = a(context, 4);
                    view.setLayoutParams(layoutParams);
                    view.setBackgroundColor(Color.parseColor("#333333"));
                    linearLayout.addView(view);
                } else {
                    r4 = r10;
                    i = i2;
                }
                i2 = i;
                r10 = r4;
                i3 = 6;
            }
        }
        scrollView.addView(linearLayout);
        bottomSheetDialog.setContentView(scrollView);
        bottomSheetDialog.show();
    }
}
