package xyz.netfly.ui.live.tv;

import ag.c;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.x;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.exoplayer.rtsp.SessionDescription;
import com.google.android.gms.internal.ads.p80;
import com.google.android.gms.measurement.internal.u1;
import com.pichillilorenzo.flutter_inappwebview_android.credential_database.URLProtectionSpaceContract;
import ie.i3;
import ie.j;
import ie.j3;
import ie.k;
import ie.n4;
import ie.o4;
import ie.p4;
import ie.q4;
import java.lang.ref.WeakReference;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import kotlinx.coroutines.y;
import org.drive_hunter.R;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import rf.w;
import tv.danmaku.ijk.media.player.IMediaPlayer;
import tv.danmaku.ijk.media.player.MediaSource;
import tv.danmaku.ijk.media.player.misc.ITrackInfo;
import tv.danmaku.ijk.media.player.ui.IjkPlayerRuntime;
import tv.danmaku.ijk.media.player.ui.IjkVideoView;
import tv.danmaku.ijk.media.player.ui.abr.AbrController;
import uf.r;
import ve.d;
import ve.e0;
import ve.g;
import ve.p;
import ve.v;
import xe.a;
import xe.b;
import xyz.netfly.ui.live.epg.i;
import xyz.netfly.ui.live.tablet.LivePlayActivity;
import xyz.netfly.ui.live.tv.LiveActivity;
import xyz.netfly.ui.login.LoginActivity;
import xyz.stream.api.a0;
import xyz.stream.api.entity.LiveCategoryEntity;
import xyz.stream.api.entity.LiveChannelEntity;
import xyz.stream.api.entity.LiveEpgEntity;
import xyz.stream.api.f;
import xyz.stream.api.o;
import xyz.stream.api.q;
import xyz.stream.api.viewmodel.LiveViewModel;
import xyz.stream.utils.e;
import xyz.stream.utils.entity.CheckResultEntity;
import xyz.stream.utils.event.LogoutEvent;
import xyz.stream.utils.f0;
import xyz.stream.utils.h;
import xyz.stream.utils.j0;
import xyz.stream.utils.l;
import xyz.stream.view.BaseActivity;
import xyz.stream.view.SelectDialogController;
import xyz.stream.view.SpacesItemVerDecoration;
import xyz.stream.view.UiUtils;
import xyz.stream.view.listener.OnDialogSelectListener;
import xyz.stream.view.tvrecyclerview.TvRecyclerView;

/* JADX INFO: loaded from: classes3.dex */
public class LiveActivity extends BaseActivity<LiveViewModel, j> implements c, IMediaPlayer.Listener, View.OnKeyListener, a, b {

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    public static final /* synthetic */ int f35467o0 = 0;
    public ITrackInfo Q;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public LiveChannelEntity f35469b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public k f35471c;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public p80 f35477f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public IjkVideoView f35479g;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f35485j;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final v f35473d = new v();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final e0 f35475e = new e0();

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public String f35481h = "";

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public boolean f35483i = false;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final Handler f35487k = new Handler(Looper.getMainLooper());

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public boolean f35489l = false;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f35491m = false;
    public boolean R = false;
    public String S = "";
    public final ArrayDeque T = new ArrayDeque();
    public boolean U = false;
    public long V = 0;
    public int W = -4;
    public boolean X = false;
    public String Y = "";
    public boolean Z = false;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public long f35468a0 = 0;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public final ExecutorService f35470b0 = Executors.newSingleThreadExecutor();

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public int f35472c0 = 0;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public final g f35474d0 = new g(this, 0);

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    public final ve.a f35476e0 = new ve.a(this, 1);

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    public int f35478f0 = -1;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public final Handler f35480g0 = new Handler(Looper.getMainLooper());

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public final g f35482h0 = new g(this, 1);

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public int f35484i0 = -1;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public String f35486j0 = "";

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public String f35488k0 = "";

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    public final ve.a f35490l0 = new ve.a(this, 2);

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    public int f35492m0 = 0;

    /* JADX INFO: renamed from: n0, reason: collision with root package name */
    public long f35493n0 = 0;

    public static void S(Activity activity, LiveChannelEntity liveChannelEntity, int i10) {
        if (UiUtils.checkNoSpace(activity, null)) {
            return;
        }
        CheckResultEntity checkResultEntityC = e.d().c();
        if (!e.h()) {
            activity.startActivityForResult(new Intent(activity, (Class<?>) LoginActivity.class), 100);
            return;
        }
        if (checkResultEntityC == null || checkResultEntityC.getExpiredAt() == null || checkResultEntityC.getNowTs() == null || checkResultEntityC.getExpiredAt().intValue() <= checkResultEntityC.getNowTs().intValue()) {
            y.a0(activity);
            return;
        }
        if (liveChannelEntity != null && liveChannelEntity.getIsAdult() == 1 && f.b().a(e.d().f36123l) && checkResultEntityC.getIsPremium() != null && checkResultEntityC.getIsPremium().intValue() != 1) {
            y.a0(activity);
            return;
        }
        Intent intent = e.d().f36119h ? new Intent(activity, (Class<?>) LivePlayActivity.class) : new Intent(activity, (Class<?>) LiveActivity.class);
        intent.putExtra("channel", liveChannelEntity);
        intent.putExtra("groupId", i10);
        intent.putExtra("unique_key", System.currentTimeMillis());
        activity.startActivity(intent);
    }

    public static void T(Activity activity) {
        List listN = re.a.u().n();
        LiveChannelEntity liveChannelEntity = null;
        liveChannelEntity = null;
        if (listN != null && !listN.isEmpty()) {
            CheckResultEntity checkResultEntityC = e.d().c();
            if (checkResultEntityC == null || checkResultEntityC.getIsPremium().intValue() != 1) {
                Object obj = t4.f.x(listN).e(new xyz.netfly.viewmodel.a(10)).g().f32947a;
                liveChannelEntity = (LiveChannelEntity) (obj != null ? obj : null);
            } else {
                liveChannelEntity = (LiveChannelEntity) listN.get(0);
            }
        }
        S(activity, liveChannelEntity, liveChannelEntity != null ? -2 : -4);
    }

    @Override // xe.b
    public final void B() {
        p pVar = this.f35475e.f33861u;
        pVar.getClass();
        pVar.f33904u = re.a.u().l();
        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-1, ((AppCompatActivity) pVar.f33886c.get()).getString(R.string.favorites), Integer.valueOf(pVar.f33904u.size()));
        ArrayList arrayList = pVar.f33890g;
        if (arrayList.isEmpty()) {
            return;
        }
        if (pVar.f33904u.isEmpty()) {
            if (((LiveCategoryEntity) ((List) arrayList.get(0)).get(2)).getCategoryId().intValue() == -1) {
                pVar.f33889f.remove(2);
                arrayList.clear();
                arrayList.addAll(p.h(pVar.f33889f, new int[0]));
            }
        } else if (((LiveCategoryEntity) ((List) arrayList.get(0)).get(2)).getCategoryId().intValue() != -1) {
            pVar.f33889f.add(2, liveCategoryEntity);
            arrayList.clear();
            arrayList.addAll(p.h(pVar.f33889f, new int[0]));
        } else {
            ((List) arrayList.get(0)).set(2, liveCategoryEntity);
        }
        if (pVar.f33892i == 0) {
            ArrayList arrayList2 = pVar.f33891h;
            arrayList2.clear();
            arrayList2.addAll((Collection) arrayList.get(0));
            pVar.f33893j.notifyDataSetChanged();
        }
        if (pVar.f33903t == -1) {
            pVar.c(-1, true);
        }
    }

    @Override // xe.b
    public final void D() {
        e0 e0Var = this.f35475e;
        LiveChannelEntity liveChannelEntityG = e0Var.f33861u.g();
        if (liveChannelEntityG != null) {
            re.a.u().getClass();
            if (re.a.t(liveChannelEntityG) > 1) {
                y.a0(this);
                return;
            }
            P();
            this.f35469b = liveChannelEntityG;
            xyz.netfly.api.c.b().c();
            Q();
            e0Var.e(this.f35469b);
        }
    }

    public final void K() {
        if (isFinishing() || isDestroyed() || this.binding == 0 || this.f35479g == null || this.f35469b == null) {
            return;
        }
        k kVar = this.f35471c;
        if (kVar != null) {
            kVar.f27110p.setVisibility(8);
        }
        if (System.currentTimeMillis() - this.V > 3600000 && this.f35479g.getPlaybackState() != -1) {
            this.f35479g.setVisibility(8);
            xyz.netfly.ads.f fVarA = xyz.netfly.ads.f.a();
            k kVar2 = this.f35471c;
            fVarA.d(kVar2.f27096b, kVar2.f27113s, new a0(this, 29));
        }
        if (this.f35479g.getPlaybackState() == -1 && xyz.netfly.ads.f.a().f34847j) {
            this.f35471c.f27113s.setVisibility(8);
        } else {
            this.f35471c.f27113s.setVisibility(0);
        }
        this.f35479g.setPlayer(this.f35469b.getProtocol() == 1 ? 1 : 2);
        this.f35479g.setSubtitleSizePx(UiUtils.playerSubtitleSizePx(this, f0.o().p(IjkPlayerRuntime.SP_SUBTITLE_SIZE, 50)));
        this.f35479g.decode(1);
        this.f35479g.setResizeMode(f0.o().p("sp_live_video_ratio", 4));
        this.T.clear();
        this.f35479g.setVolume(0.0f, 0.0f);
        String strH = this.U ? v.h(this.f35469b) : v.i(this.f35469b);
        this.S = strH;
        if (strH == null || strH.isEmpty()) {
            this.S = v.i(this.f35469b);
        }
        if (this.f35469b.getId() == null) {
            this.f35488k0 = "0-0";
            h.c("live channel id is null, url: " + this.S);
            R();
            return;
        }
        String string = UUID.randomUUID().toString();
        int i10 = this.f35472c0 + 1;
        this.f35472c0 = i10;
        int iIntValue = this.f35469b.getId().intValue();
        String str = this.S;
        if (e.g(str)) {
            this.f35470b0.execute(new i(this, iIntValue, str, string, i10, 2));
        } else {
            M(iIntValue, i10, str, str, string);
        }
    }

    public final void L(int i10, LiveChannelEntity liveChannelEntity) {
        LiveChannelEntity liveChannelEntity2 = this.f35469b;
        if (liveChannelEntity2 != null && Objects.equals(liveChannelEntity2.getId(), liveChannelEntity.getId())) {
            U(true);
            return;
        }
        if (this.f35469b == null) {
            this.f35471c.f27097c.requestFocus();
            ((j) this.binding).f27038c.setFocusable(true);
            ((j) this.binding).f27037b.setFocusable(true);
            ((j) this.binding).f27038c.setBackgroundResource(R.drawable.selector_live_tab);
            ((j) this.binding).f27037b.setBackgroundResource(R.drawable.selector_live_tab);
        } else {
            xyz.netfly.api.c.b().c();
        }
        this.W = i10;
        this.f35475e.c(new ArrayList(), this.f35489l);
        this.f35473d.r(new ArrayList());
        P();
        this.f35469b = liveChannelEntity;
        Q();
    }

    public final void M(int i10, int i11, String str, String str2, String str3) {
        LiveChannelEntity liveChannelEntity;
        if (isFinishing() || isDestroyed() || this.binding == 0 || this.f35479g == null || (liveChannelEntity = this.f35469b) == null || i11 != this.f35472c0 || !Objects.equals(liveChannelEntity.getId(), Integer.valueOf(i10))) {
            return;
        }
        this.Y = str;
        h.b("setPlayer: " + this.Y);
        String str4 = this.Y;
        if (str4 == null || str4.isEmpty()) {
            this.f35488k0 = "0-0";
            h.c("live play url is empty, channelId: " + i10 + " url: " + str2);
            R();
            return;
        }
        xyz.netfly.api.c.b().p(6, i10, str3, str2);
        HashMap map = new HashMap();
        map.put(URLProtectionSpaceContract.FeedEntry.COLUMN_NAME_PROTOCOL, String.valueOf(this.f35469b.getProtocol()));
        re.a aVarU = re.a.u();
        LiveChannelEntity liveChannelEntity2 = this.f35469b;
        aVarU.getClass();
        map.put("is_premium", re.a.t(liveChannelEntity2) > 0 ? "1" : SessionDescription.SUPPORTED_SDP_VERSION);
        map.put("channel_id", String.valueOf(this.f35469b.getId()));
        if (this.f35469b.getCategoryProperty() != null && this.f35469b.getCategoryProperty().equals("Sports")) {
            map.put("is_sports", "1");
        }
        this.f35479g.setMediaSourceLive(new MediaSource(map, Uri.parse(this.Y)));
        p80 p80Var = new p80(this, this.f35479g, this.Y);
        this.f35477f = p80Var;
        p80Var.d();
        this.f35477f.e();
        this.f35477f.f();
        this.f35477f.f15297e = this;
        this.f35479g.addListener(this);
        this.f35473d.f33928h = this;
        this.f35471c.f27097c.setOnKeyListener(this);
    }

    public final void N() {
        if (this.f35489l) {
            this.f35471c.f27097c.requestFocus();
            U(true);
        }
    }

    public final void O(boolean z10) {
        if (this.X || isFinishing() || isDestroyed() || this.binding == 0 || this.f35479g == null) {
            return;
        }
        this.X = true;
        try {
            P();
            xyz.netfly.api.c.b().c();
            if (z10) {
                this.U = true;
            }
            K();
            this.X = false;
        } catch (Throwable th) {
            this.X = false;
            throw th;
        }
    }

    public final void P() {
        this.f35472c0++;
        p80 p80Var = this.f35477f;
        if (p80Var != null) {
            p80Var.b();
            this.f35477f.f15297e = null;
        }
        IjkVideoView ijkVideoView = this.f35479g;
        if (ijkVideoView != null) {
            ijkVideoView.removeListener();
        }
        this.f35473d.f33928h = null;
        this.f35471c.f27097c.setOnKeyListener(null);
        this.f35480g0.removeCallbacksAndMessages(null);
        this.f35487k.removeCallbacksAndMessages(null);
        this.Z = false;
        LiveChannelEntity liveChannelEntity = this.f35469b;
        if (liveChannelEntity != null) {
            if (this.f35483i) {
                l.a(liveChannelEntity.getId().intValue(), this.f35469b.getName(), this.f35481h);
            }
            q.g().b(this.Y);
        }
        IjkVideoView ijkVideoView2 = this.f35479g;
        if (ijkVideoView2 != null) {
            try {
                ijkVideoView2.stop();
            } catch (Throwable unused) {
            }
            try {
                this.f35479g.release();
            } catch (Throwable unused2) {
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:13:0x0023  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void Q() {
        boolean z10;
        if (this.f35469b == null) {
            return;
        }
        k kVar = this.f35471c;
        if (kVar != null) {
            kVar.f27110p.setVisibility(8);
        }
        xyz.netfly.api.c cVarB = xyz.netfly.api.c.b();
        IjkVideoView ijkVideoView = this.f35479g;
        LiveChannelEntity liveChannelEntity = this.f35469b;
        if (liveChannelEntity != null) {
            z10 = liveChannelEntity.getIsIptv() == 1;
        }
        cVarB.getClass();
        cVarB.f34905f = new WeakReference(ijkVideoView);
        cVarB.f34904e = z10;
        xyz.netfly.ui.live.epg.q qVarO = xyz.netfly.ui.live.epg.q.o();
        int iIntValue = this.f35469b.getId().intValue();
        xyz.netfly.player.i iVar = new xyz.netfly.player.i(this, 2);
        qVarO.getClass();
        qVarO.l(iIntValue, kotlinx.coroutines.flow.h.y("yyyy-MM-dd"), iVar);
        this.f35481h = kotlinx.coroutines.flow.h.C();
        this.f35483i = false;
        this.f35485j = 10;
        this.f35488k0 = "";
        this.U = false;
        v vVar = this.f35473d;
        LiveViewModel liveViewModel = (LiveViewModel) this.viewModel;
        k kVar2 = this.f35471c;
        LiveChannelEntity liveChannelEntity2 = this.f35469b;
        j jVar = (j) this.binding;
        vVar.n(this, liveViewModel, kVar2, liveChannelEntity2, jVar.f27051p, jVar.f27055t, jVar.f27054s, this.W);
        if (!this.f35489l) {
            this.f35473d.t();
        }
        K();
    }

    public final void R() {
        k kVar = this.f35471c;
        if (kVar == null) {
            return;
        }
        kVar.f27113s.setVisibility(8);
        this.f35471c.f27112r.setText("Sorry, your current channel failed to load.");
        TextView textView = this.f35471c.f27111q;
        StringBuilder sb = new StringBuilder("Error code ");
        String str = this.f35488k0;
        sb.append((str == null || str.isEmpty()) ? String.valueOf(this.f35484i0) : this.f35488k0);
        sb.append(".");
        textView.setText(sb.toString());
        this.f35471c.f27110p.setVisibility(0);
        this.f35471c.f27097c.setOnKeyListener(this);
    }

    public final void U(boolean z10) {
        LiveEpgEntity liveEpgEntity;
        if (this.f35489l) {
            ((j) this.binding).f27037b.setFocusable(false);
            ((j) this.binding).f27038c.setFocusable(false);
            this.f35489l = false;
            this.f35471c.f27097c.requestFocus();
            ((j) this.binding).f27046k.setVisibility(8);
            ((j) this.binding).f27047l.setVisibility(8);
            ((j) this.binding).f27051p.setVisibility(8);
        } else {
            this.f35489l = true;
            ((j) this.binding).f27037b.setFocusable(true);
            ((j) this.binding).f27038c.setFocusable(true);
            this.f35471c.f27097c.clearFocus();
            ((j) this.binding).f27046k.setVisibility(0);
            ((j) this.binding).f27047l.setVisibility(0);
            ((j) this.binding).f27051p.setVisibility(0);
        }
        androidx.constraintlayout.widget.c cVar = (androidx.constraintlayout.widget.c) ((j) this.binding).f27041f.getLayoutParams();
        boolean z11 = this.f35489l;
        v vVar = this.f35473d;
        if (!z11) {
            ((j) this.binding).f27046k.setVisibility(8);
            ((j) this.binding).f27047l.setVisibility(8);
            ((j) this.binding).f27051p.setVisibility(8);
            this.f35471c.f27115u.setVisibility(this.f35491m ? 0 : 8);
            ((j) this.binding).f27053r.setVisibility(8);
            ((j) this.binding).f27051p.setVisibility(8);
            ((j) this.binding).f27037b.setFocusable(false);
            ((j) this.binding).f27038c.setFocusable(false);
            this.f35471c.f27097c.post(new ve.a(this, 5));
            ((ViewGroup.MarginLayoutParams) cVar).width = UiUtils.dp2px(1920.0f);
            ((ViewGroup.MarginLayoutParams) cVar).height = UiUtils.dp2px(1080.0f);
            cVar.f1325i = 0;
            cVar.f1331l = 0;
            cVar.f1345t = 0;
            cVar.f1347v = 0;
            cVar.setMargins(0, 0, 0, 0);
            cVar.setMarginEnd(0);
            ((j) this.binding).f27041f.setPadding(0, 0, 0, 0);
            ((j) this.binding).f27041f.setLayoutParams(cVar);
            ((j) this.binding).f27039d.setRadius(0.0f);
            ((j) this.binding).f27039d.setCardElevation(0.0f);
            ((j) this.binding).f27039d.setContentPadding(0, 0, 0, 0);
            getWindow().getDecorView().setSystemUiVisibility(5894);
            getWindow().addFlags(1024);
            vVar.u();
            return;
        }
        ((j) this.binding).f27046k.setVisibility(0);
        ((j) this.binding).f27047l.setVisibility(0);
        this.f35471c.f27115u.setVisibility(8);
        e0 e0Var = this.f35475e;
        if (e0Var.f33843c != null) {
            ArrayList arrayList = e0Var.f33845e;
            if (!arrayList.isEmpty()) {
                Iterator it = arrayList.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        liveEpgEntity = null;
                        break;
                    } else {
                        liveEpgEntity = (LiveEpgEntity) it.next();
                        if (y.J(liveEpgEntity.getStartTime(), liveEpgEntity.getEndTime())) {
                            break;
                        }
                    }
                }
                ArrayList arrayList2 = e0Var.f33844d;
                if (liveEpgEntity == null) {
                    arrayList2.clear();
                    e0Var.f33843c.notifyDataSetChanged();
                } else if (!arrayList2.isEmpty() && liveEpgEntity.getStartTime().equals(((LiveEpgEntity) arrayList2.get(0)).getStartTime()) && liveEpgEntity.getEndTime().equals(((LiveEpgEntity) arrayList2.get(0)).getEndTime()) && liveEpgEntity.getTitle().equals(((LiveEpgEntity) arrayList2.get(0)).getTitle())) {
                    e0Var.f33849i.setVisibility(arrayList2.isEmpty() ? 8 : 0);
                } else {
                    arrayList2.clear();
                    arrayList2.add(liveEpgEntity);
                    int iIndexOf = arrayList.indexOf(liveEpgEntity);
                    if (iIndexOf >= 0 && iIndexOf < arrayList.size() - 1) {
                        arrayList2.add((LiveEpgEntity) arrayList.get(iIndexOf + 1));
                    }
                    e0Var.f33843c.notifyDataSetChanged();
                    e0Var.f33849i.setVisibility(arrayList2.isEmpty() ? 8 : 0);
                }
            }
        }
        e0Var.f33861u.d();
        vVar.m();
        ((j) this.binding).f27051p.setVisibility(0);
        ((j) this.binding).f27037b.setFocusable(true);
        ((j) this.binding).f27038c.setFocusable(true);
        ((ViewGroup.MarginLayoutParams) cVar).width = UiUtils.dp2px(720.0f);
        ((ViewGroup.MarginLayoutParams) cVar).height = UiUtils.dp2px(405.0f);
        cVar.f1325i = 0;
        cVar.f1347v = 0;
        cVar.f1345t = -1;
        cVar.f1331l = -1;
        cVar.setMargins(0, UiUtils.dp2px(240.0f), 0, 0);
        cVar.setMarginEnd(UiUtils.dp2px(60.0f));
        int iDp2px = UiUtils.dp2px(4.0f);
        ((j) this.binding).f27041f.setPadding(iDp2px, iDp2px, iDp2px, iDp2px);
        ((j) this.binding).f27041f.setLayoutParams(cVar);
        ((j) this.binding).f27039d.setRadius(UiUtils.dp2px(24.0f));
        ((j) this.binding).f27039d.setCardElevation(UiUtils.dp2px(4.0f));
        if (z10) {
            ((j) this.binding).f27041f.post(new d(e0Var, 0));
        }
        getWindow().clearFlags(1024);
        getWindow().getDecorView().setSystemUiVisibility(0);
    }

    @Override // xyz.stream.view.BaseActivity
    public final v3.a getViewBinding() {
        return j.inflate(getLayoutInflater(), null, false);
    }

    @Override // xyz.stream.view.BaseActivity
    public final void initData() {
        super.initData();
        o.f().c();
        LiveChannelEntity liveChannelEntity = (LiveChannelEntity) getIntent().getParcelableExtra("channel");
        int intExtra = getIntent().getIntExtra("groupId", -4);
        LiveViewModel liveViewModel = (LiveViewModel) this.viewModel;
        j jVar = (j) this.binding;
        final int i10 = 0;
        boolean booleanExtra = getIntent().getBooleanExtra("categoryFocus", false);
        final e0 e0Var = this.f35475e;
        e0Var.getClass();
        e0Var.f33846f = new WeakReference(this);
        e0Var.f33847g = liveViewModel;
        e0Var.f33849i = jVar.f27053r;
        e0Var.f33851k = jVar;
        e0Var.f33860t = w.r(this);
        p pVar = e0Var.f33861u;
        pVar.getClass();
        pVar.f33886c = new WeakReference(this);
        pVar.A = e0Var;
        pVar.f33887d = liveViewModel;
        pVar.f33888e = jVar;
        pVar.f33909z = liveChannelEntity;
        pVar.C = booleanExtra;
        pVar.B = intExtra;
        pVar.f33899p = i3.inflate(getLayoutInflater(), null, false);
        j3 j3VarInflate = j3.inflate(getLayoutInflater(), null, false);
        pVar.f33900q = j3VarInflate;
        pVar.f33885b = pVar.f33899p.f27008b;
        pVar.f33884a = j3VarInflate.f27076c;
        SpacesItemVerDecoration spacesItemVerDecoration = new SpacesItemVerDecoration(UiUtils.dp2px(5.0f), 0, 0);
        pVar.f33885b.setAnimation(null);
        pVar.f33885b.addItemDecoration(spacesItemVerDecoration);
        we.b bVar = new we.b(pVar.f33891h, (Activity) pVar.f33886c.get());
        pVar.f33893j = bVar;
        pVar.f33885b.setAdapter(bVar);
        pVar.f33884a.setAnimation(null);
        pVar.f33884a.addItemDecoration(spacesItemVerDecoration);
        we.c cVar = new we.c(pVar.f33898o, (Activity) pVar.f33886c.get());
        pVar.f33895l = cVar;
        pVar.f33884a.setAdapter(cVar);
        final int i11 = 5;
        pVar.f33895l.setOnItemListener(new oe.g(pVar, i11));
        e0Var.f33854n = p4.inflate(getLayoutInflater(), null, false);
        e0Var.f33855o = n4.inflate(getLayoutInflater(), null, false);
        e0Var.f33856p = q4.inflate(getLayoutInflater(), null, false);
        e0Var.f33857q = o4.inflate(getLayoutInflater(), null, false);
        e0Var.f33854n.f27346g.setText(getString(R.string.version) + ": 3.0.3");
        e0Var.f33848h = e0Var.f33855o.f27263c;
        e0Var.f33857q.f27310b.setImageResource(R.mipmap.qr_help);
        final int i12 = 1;
        e0Var.f(1);
        SpacesItemVerDecoration spacesItemVerDecoration2 = new SpacesItemVerDecoration(UiUtils.dp2px(10.0f), 0, 0);
        SpacesItemVerDecoration spacesItemVerDecoration3 = new SpacesItemVerDecoration(UiUtils.dp2px(5.0f), 0, 0);
        e0Var.f33848h.setSelectedItemAtCentered(true);
        e0Var.f33848h.setAnimation(null);
        e0Var.f33848h.addItemDecoration(spacesItemVerDecoration3);
        we.d dVar = new we.d(e0Var.f33842b, (Activity) e0Var.f33846f.get());
        e0Var.f33841a = dVar;
        e0Var.f33848h.setAdapter(dVar);
        e0Var.f33849i.setSelectedItemAtCentered(true);
        e0Var.f33849i.setAnimation(null);
        e0Var.f33849i.addItemDecoration(spacesItemVerDecoration2);
        ue.d dVar2 = new ue.d(e0Var.f33844d, (Activity) e0Var.f33846f.get());
        e0Var.f33843c = dVar2;
        e0Var.f33849i.setAdapter(dVar2);
        e0Var.a(false);
        final int i13 = 8;
        e0Var.f33851k.f27038c.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i14 = i13;
                int i15 = R.color.black_9;
                int i16 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i14) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i17 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i17));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i15 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i15));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i15 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i15 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i15));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i15 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i15 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i15));
                        break;
                }
            }
        });
        final int i14 = 9;
        e0Var.f33851k.f27037b.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i14;
                int i15 = R.color.black_9;
                int i16 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i17 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i17));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i15 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i15));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i15 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i15 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i15));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i15 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i15 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i15));
                        break;
                }
            }
        });
        e0Var.f33851k.f27038c.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i15 = i13;
                final int i16 = 0;
                final int i17 = 1;
                final e0 e0Var2 = e0Var;
                switch (i15) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i16;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i17;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i17;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i16;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33851k.f27038c.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i15, KeyEvent keyEvent) {
                View viewD;
                int i16 = i11;
                e0 e0Var2 = e0Var;
                switch (i16) {
                    case 0:
                        e0Var2.getClass();
                        if (i15 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i15) || i15 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i15) || i15 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i15) || i15 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i15 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i15) || i15 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i15 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i15) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i15) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i15) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i15) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i15) || keyEvent.getAction() != 0) {
                            if (i15 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        e0Var.f33851k.f27037b.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i15 = i14;
                final int i16 = 0;
                final int i17 = 1;
                final e0 e0Var2 = e0Var;
                switch (i15) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i16;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i17;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i17;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i16;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        final int i15 = 6;
        e0Var.f33851k.f27037b.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i152, KeyEvent keyEvent) {
                View viewD;
                int i16 = i15;
                e0 e0Var2 = e0Var;
                switch (i16) {
                    case 0:
                        e0Var2.getClass();
                        if (i152 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i152 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i152 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i152) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i152) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i152) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0) {
                            if (i152 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        e0Var.f33841a.setOnItemListener(new oe.g(e0Var, i15));
        e0Var.f33854n.f27342c.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i10;
                int i152 = R.color.black_9;
                int i16 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i17 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i17));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i16 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i16));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        final int i16 = 4;
        e0Var.f33854n.f27342c.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i16;
                final int i162 = 0;
                final int i17 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i17;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i17;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33854n.f27345f.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i11;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i17 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i17));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33854n.f27345f.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i11;
                final int i162 = 0;
                final int i17 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i17;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i17;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33854n.f27343d.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i15;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i17 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i17));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33854n.f27343d.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i15;
                final int i162 = 0;
                final int i17 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i17;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i17;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33854n.f27343d.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i152, KeyEvent keyEvent) {
                View viewD;
                int i162 = i16;
                e0 e0Var2 = e0Var;
                switch (i162) {
                    case 0:
                        e0Var2.getClass();
                        if (i152 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i152 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i152 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i152) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i152) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i152) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0) {
                            if (i152 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        final int i17 = 7;
        e0Var.f33854n.f27341b.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i17;
                final int i162 = 0;
                final int i172 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i172;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i172;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33854n.f27341b.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i17;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i172 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i172));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33854n.f27341b.setOnKeyListener(new me.d(1));
        e0Var.f33856p.f27398i.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i152, KeyEvent keyEvent) {
                View viewD;
                int i162 = i10;
                e0 e0Var2 = e0Var;
                switch (i162) {
                    case 0:
                        e0Var2.getClass();
                        if (i152 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i152 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i152 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i152) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i152) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i152) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0) {
                            if (i152 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        e0Var.f33856p.f27398i.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i12;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i172 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i172));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i18 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i18));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33856p.f27398i.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i10;
                final int i162 = 0;
                final int i172 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i172;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i172;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33856p.f27397h.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i12;
                final int i162 = 0;
                final int i172 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i18) {
                                int i19 = i172;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i19) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i18 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i18));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i18));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i18].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i172;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i18 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i18) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33856p.f27397h.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i152, KeyEvent keyEvent) {
                View viewD;
                int i162 = i12;
                e0 e0Var2 = e0Var;
                switch (i162) {
                    case 0:
                        e0Var2.getClass();
                        if (i152 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i152 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i152 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i152) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i152) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i152) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0) {
                            if (i152 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        final int i18 = 2;
        e0Var.f33856p.f27397h.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i18;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i172 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i172));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i182 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i182));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i19 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i19));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33856p.f27395f.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i152, KeyEvent keyEvent) {
                View viewD;
                int i162 = i18;
                e0 e0Var2 = e0Var;
                switch (i162) {
                    case 0:
                        e0Var2.getClass();
                        if (i152 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i152 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i152 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i152) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i152) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i152) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0) {
                            if (i152 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        final int i19 = 3;
        e0Var.f33856p.f27395f.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i19;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i172 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i172));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i182 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i182));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i192 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i192));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33856p.f27395f.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i18;
                final int i162 = 0;
                final int i172 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i182) {
                                int i192 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i192) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i182 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i182));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i182));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i182) {
                                int i192 = i172;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i192) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i182 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i182));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i182));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i182 = i172;
                                e0 e0Var3 = e0Var2;
                                switch (i182) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i182 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i182) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33856p.f27396g.setOnClickListener(new View.OnClickListener() { // from class: ve.y
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                int i152 = i19;
                final int i162 = 0;
                final int i172 = 1;
                final e0 e0Var2 = e0Var;
                switch (i152) {
                    case 0:
                        e0Var2.getClass();
                        final ArrayList arrayList = new ArrayList();
                        String string = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string2 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        arrayList.add(string);
                        arrayList.add(string2);
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList, !f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) ? 1 : 0, new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i182) {
                                int i192 = i162;
                                List list = arrayList;
                                e0 e0Var3 = e0Var2;
                                switch (i192) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i182 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i182));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i182));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 1:
                        e0Var2.getClass();
                        final ArrayList arrayList2 = new ArrayList();
                        Iterator it = e0Var2.f33860t.entrySet().iterator();
                        while (it.hasNext()) {
                            arrayList2.add((String) ((Map.Entry) it.next()).getValue());
                        }
                        new SelectDialogController((Activity) e0Var2.f33846f.get(), arrayList2, arrayList2.indexOf(e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4)))), new OnDialogSelectListener() { // from class: ve.c0
                            @Override // xyz.stream.view.listener.OnDialogSelectListener
                            public final void onItemSelected(int i182) {
                                int i192 = i172;
                                List list = arrayList2;
                                e0 e0Var3 = e0Var2;
                                switch (i192) {
                                    case 0:
                                        e0Var3.getClass();
                                        f0.o().u(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.valueOf(i182 == 0));
                                        e0Var3.f33856p.f27403n.setText((CharSequence) list.get(i182));
                                        xe.a aVar = e0Var3.f33850j;
                                        if (aVar != null) {
                                            LiveActivity liveActivity = (LiveActivity) aVar;
                                            liveActivity.f35479g.setSubtitleEnable();
                                            v vVar = liveActivity.f35473d;
                                            vVar.getClass();
                                            if (f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE) && !vVar.f33934n.isEmpty()) {
                                                if (!xyz.stream.utils.e.d().f36119h) {
                                                    vVar.f33921a.getBtnSubtitle().setVisibility(0);
                                                } else {
                                                    vVar.f33922b.getBtnSubtitle().setVisibility(0);
                                                }
                                            } else if (!xyz.stream.utils.e.d().f36119h) {
                                                vVar.f33921a.getBtnSubtitle().setVisibility(8);
                                            } else {
                                                vVar.f33922b.getBtnSubtitle().setVisibility(8);
                                            }
                                        }
                                        break;
                                    default:
                                        f0.o().v(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue(), "sp_live_video_ratio");
                                        e0Var3.f33856p.f27401l.setText((CharSequence) list.get(i182));
                                        xe.a aVar2 = e0Var3.f33850j;
                                        if (aVar2 != null) {
                                            ((LiveActivity) aVar2).f35479g.setResizeMode(((Integer[]) e0Var3.f33860t.keySet().toArray(new Integer[0]))[i182].intValue());
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 2:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.clean_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i182 = i172;
                                e0 e0Var3 = e0Var2;
                                switch (i182) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 3:
                        uf.r.e((Activity) e0Var2.f33846f.get(), ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.refresh_channel_tip), new ag.b() { // from class: ve.b0
                            @Override // ag.b
                            public final void a() {
                                int i182 = i162;
                                e0 e0Var3 = e0Var2;
                                switch (i182) {
                                    case 0:
                                        UiUtils.showProgressDialog((Context) e0Var3.f33846f.get());
                                        re.a.u().f(true, new oe.f(e0Var3, 4));
                                        break;
                                    default:
                                        e0Var3.getClass();
                                        xyz.stream.api.database.l lVarA = xyz.stream.api.database.l.a();
                                        lVarA.getClass();
                                        lVarA.f35828a.execute(new xyz.stream.api.database.h(lVarA, 2));
                                        p pVar2 = e0Var3.f33861u;
                                        ArrayList arrayList3 = pVar2.f33905v;
                                        arrayList3.clear();
                                        LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar2.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList3.size()));
                                        ArrayList arrayList4 = pVar2.f33890g;
                                        if (!arrayList4.isEmpty()) {
                                            ((List) arrayList4.get(0)).set(1, liveCategoryEntity);
                                            if (pVar2.f33902s == 0) {
                                                ArrayList arrayList5 = pVar2.f33891h;
                                                arrayList5.clear();
                                                arrayList5.addAll((Collection) arrayList4.get(0));
                                                pVar2.f33893j.notifyDataSetChanged();
                                            }
                                            break;
                                        }
                                        break;
                                }
                            }
                        });
                        break;
                    case 4:
                        e0Var2.f33853m = 0;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        if (e0Var2.f33855o.f27261a.getParent() != null) {
                            ((ViewGroup) e0Var2.f33855o.f27261a.getParent()).removeView(e0Var2.f33855o.f27261a);
                        }
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33855o.f27261a);
                        e0Var2.f33841a.notifyDataSetChanged();
                        break;
                    case 5:
                        e0Var2.f33853m = 1;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33856p.f27390a);
                        String string3 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.enabled);
                        String string4 = ((AppCompatActivity) e0Var2.f33846f.get()).getString(R.string.disabled);
                        boolean zJ = f0.o().j(IjkPlayerRuntime.SP_LIVE_SUBTITLE_ENABLE, Boolean.TRUE);
                        TextView textView = e0Var2.f33856p.f27403n;
                        if (!zJ) {
                            string3 = string4;
                        }
                        textView.setText(string3);
                        e0Var2.f33856p.f27401l.setText((CharSequence) e0Var2.f33860t.get(Integer.valueOf(f0.o().p("sp_live_video_ratio", 4))));
                        xyz.stream.utils.e.d().getClass();
                        if (xyz.stream.utils.e.e().contains("ar")) {
                            e0Var2.f33856p.f27391b.setScaleX(-1.0f);
                            e0Var2.f33856p.f27392c.setScaleX(-1.0f);
                            e0Var2.f33856p.f27393d.setScaleX(-1.0f);
                            e0Var2.f33856p.f27394e.setScaleX(-1.0f);
                        }
                        break;
                    case 6:
                        e0Var2.f33853m = 2;
                        e0Var2.d();
                        e0Var2.f33851k.f27043h.removeAllViews();
                        e0Var2.f33851k.f27043h.addView(e0Var2.f33857q.f27309a);
                        break;
                    case 7:
                        ((AppCompatActivity) e0Var2.f33846f.get()).finish();
                        break;
                    case 8:
                        e0Var2.f(0);
                        break;
                    default:
                        e0Var2.f(1);
                        break;
                }
            }
        });
        e0Var.f33856p.f27396g.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: ve.w
            @Override // android.view.View.OnFocusChangeListener
            public final void onFocusChange(View view, boolean z10) {
                int i142 = i16;
                int i152 = R.color.black_9;
                int i162 = R.color.main_text;
                e0 e0Var2 = e0Var;
                switch (i142) {
                    case 0:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27342c.performClick();
                        }
                        break;
                    case 1:
                        TextView textView = e0Var2.f33856p.f27404o;
                        Context context = (Context) e0Var2.f33846f.get();
                        int i172 = z10 ? R.color.main_text : R.color.white;
                        Object obj = g0.d.f26125a;
                        textView.setTextColor(context.getColor(i172));
                        e0Var2.f33856p.f27403n.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView = e0Var2.f33856p.f27394e;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 2:
                        TextView textView2 = e0Var2.f33856p.f27402m;
                        Context context2 = (Context) e0Var2.f33846f.get();
                        int i182 = z10 ? R.color.main_text : R.color.white;
                        Object obj2 = g0.d.f26125a;
                        textView2.setTextColor(context2.getColor(i182));
                        e0Var2.f33856p.f27401l.setTextColor(((Context) e0Var2.f33846f.get()).getColor(z10 ? R.color.main_text : R.color.white));
                        ImageView imageView2 = e0Var2.f33856p.f27393d;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView2, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 3:
                        TextView textView3 = e0Var2.f33856p.f27399j;
                        Context context3 = (Context) e0Var2.f33846f.get();
                        int i192 = z10 ? R.color.main_text : R.color.white;
                        Object obj3 = g0.d.f26125a;
                        textView3.setTextColor(context3.getColor(i192));
                        ImageView imageView3 = e0Var2.f33856p.f27391b;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView3, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 4:
                        TextView textView4 = e0Var2.f33856p.f27400k;
                        Context context4 = (Context) e0Var2.f33846f.get();
                        int i20 = z10 ? R.color.main_text : R.color.white;
                        Object obj4 = g0.d.f26125a;
                        textView4.setTextColor(context4.getColor(i20));
                        ImageView imageView4 = e0Var2.f33856p.f27392c;
                        if (!z10) {
                            i162 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView4, R.drawable.arrow_right, Integer.valueOf(i162));
                        break;
                    case 5:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27345f.performClick();
                        }
                        break;
                    case 6:
                        if (!z10) {
                            e0Var2.d();
                        } else {
                            e0Var2.f33854n.f27343d.performClick();
                        }
                        break;
                    case 7:
                        TextView textView5 = e0Var2.f33854n.f27344e;
                        Context context5 = (Context) e0Var2.f33846f.get();
                        if (z10) {
                            i152 = R.color.white;
                        }
                        Object obj5 = g0.d.f26125a;
                        textView5.setTextColor(context5.getColor(i152));
                        break;
                    case 8:
                        TextView textView6 = e0Var2.f33851k.f27057v;
                        Context context6 = (Context) e0Var2.f33846f.get();
                        int i21 = z10 ? R.color.main_text : e0Var2.f33852l == 0 ? R.color.white : R.color.black_9;
                        Object obj6 = g0.d.f26125a;
                        textView6.setTextColor(context6.getColor(i21));
                        ImageView imageView5 = e0Var2.f33851k.f27045j;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 0) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView5, R.drawable.live_menu, Integer.valueOf(i152));
                        break;
                    default:
                        TextView textView7 = e0Var2.f33851k.f27056u;
                        Context context7 = (Context) e0Var2.f33846f.get();
                        int i22 = z10 ? R.color.main_text : e0Var2.f33852l == 1 ? R.color.white : R.color.black_9;
                        Object obj7 = g0.d.f26125a;
                        textView7.setTextColor(context7.getColor(i22));
                        ImageView imageView6 = e0Var2.f33851k.f27044i;
                        if (z10) {
                            i152 = R.color.main_text;
                        } else if (e0Var2.f33852l == 1) {
                            i152 = R.color.white;
                        }
                        UiUtils.setSvgPicture(imageView6, R.drawable.live_channels, Integer.valueOf(i152));
                        break;
                }
            }
        });
        e0Var.f33856p.f27396g.setOnKeyListener(new View.OnKeyListener() { // from class: ve.x
            @Override // android.view.View.OnKeyListener
            public final boolean onKey(View view, int i152, KeyEvent keyEvent) {
                View viewD;
                int i162 = i19;
                e0 e0Var2 = e0Var;
                switch (i162) {
                    case 0:
                        e0Var2.getClass();
                        if (i152 == 19 && keyEvent.getAction() == 0) {
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar = e0Var2.f33850j;
                            if (aVar != null) {
                                ((LiveActivity) aVar).N();
                            }
                        }
                        break;
                    case 1:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar2 = e0Var2.f33850j;
                            if (aVar2 != null) {
                                ((LiveActivity) aVar2).N();
                            }
                        }
                        break;
                    case 2:
                        e0Var2.getClass();
                        if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                            xe.a aVar3 = e0Var2.f33850j;
                            if (aVar3 != null) {
                                ((LiveActivity) aVar3).N();
                            }
                        }
                        break;
                    case 3:
                        e0Var2.getClass();
                        if (i152 != 20 || keyEvent.getAction() != 0) {
                            if ((UiUtils.isDpadRight(i152) || i152 == 4) && keyEvent.getAction() == 0) {
                                xe.a aVar4 = e0Var2.f33850j;
                                if (aVar4 != null) {
                                    ((LiveActivity) aVar4).N();
                                }
                            }
                        }
                        break;
                    case 4:
                        e0Var2.getClass();
                        if (i152 == 20 && keyEvent.getAction() == 0) {
                            e0Var2.f33854n.f27341b.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0 || e0Var2.f33853m != 2) {
                        }
                        break;
                    case 5:
                        e0Var2.getClass();
                        if (!UiUtils.isDpadLeft(i152) || keyEvent.getAction() != 0) {
                            if (UiUtils.isDpadRight(i152) && keyEvent.getAction() == 0) {
                                e0Var2.f(1);
                                e0Var2.f33851k.f27037b.requestFocus();
                            }
                        }
                        break;
                    default:
                        e0Var2.getClass();
                        if (UiUtils.isDpadLeft(i152) && keyEvent.getAction() == 0) {
                            e0Var2.f(0);
                            e0Var2.f33851k.f27038c.requestFocus();
                        } else if (!UiUtils.isDpadRight(i152) || keyEvent.getAction() != 0) {
                            if (i152 == 20 && keyEvent.getAction() == 0) {
                                p pVar2 = e0Var2.f33861u;
                                if (!pVar2.f33890g.isEmpty() && (viewD = u1.d(pVar2.f33885b, 0)) != null) {
                                    viewD.requestFocus();
                                }
                            }
                        }
                        break;
                }
                return true;
            }
        });
        e0Var.f33850j = this;
        pVar.f33908y = this;
    }

    @Override // xyz.stream.view.BaseActivity
    public final void initListener() {
        super.initListener();
        this.f35471c.f27097c.setVideoGestureListener(new ve.f(this));
        this.f35471c.f27103i.getChannelList().setOnClickListener(new com.google.android.material.textfield.b(this, 15));
    }

    @Override // xyz.stream.view.BaseActivity
    public final void initView() {
        getWindow().addFlags(128);
        this.f35491m = f0.o().j("flutter.spShowBitrate", Boolean.FALSE);
        this.W = getIntent().getIntExtra("groupId", -4);
        k kVar = ((j) this.binding).f27052q;
        this.f35471c = kVar;
        this.f35479g = kVar.f27118x;
        if (!this.R) {
            this.R = true;
        }
        kVar.f27097c.initView(this);
        this.f35471c.f27097c.post(new ve.a(this, 0));
    }

    @Override // xe.b
    public final void l() {
        e0 e0Var = this.f35475e;
        LiveChannelEntity liveChannelEntityF = e0Var.f33861u.f();
        if (liveChannelEntityF != null) {
            re.a.u().getClass();
            if (re.a.t(liveChannelEntityF) > 1) {
                y.a0(this);
                return;
            }
            P();
            this.f35469b = liveChannelEntityF;
            xyz.netfly.api.c.b().c();
            Q();
            e0Var.e(this.f35469b);
        }
    }

    @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, android.app.Activity
    public void onActivityResult(int i10, int i11, @Nullable Intent intent) {
        super.onActivityResult(i10, i11, intent);
        if (i10 == 100 && i11 == 100) {
            this.f35473d.p();
        }
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onAudioTrackSelect(ITrackInfo iTrackInfo) {
        super.onAudioTrackSelect(iTrackInfo);
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onBitrateChange(int i10, long j10, long j11) {
        if (isFinishing() || isDestroyed()) {
            return;
        }
        runOnUiThread(new androidx.media3.exoplayer.audio.g(this, i10, j10, j11, 3));
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onCompletion(IMediaPlayer iMediaPlayer) {
        if (isFinishing() || isDestroyed() || this.binding == 0) {
            return;
        }
        this.f35484i0 = 0;
        this.f35488k0 = "0-0";
        this.f35486j0 = "onCompletion";
        if (xyz.netfly.ads.f.a().f34847j) {
            return;
        }
        synchronized (this) {
            this.f35480g0.removeCallbacks(this.f35482h0);
            this.f35480g0.postDelayed(this.f35482h0, 1000L);
        }
    }

    @Override // xyz.stream.view.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public final void onDestroy() {
        x xVar;
        j0.k().p(this);
        this.f35487k.removeCallbacksAndMessages(null);
        xyz.netfly.ads.f.a().b();
        this.f35480g0.removeCallbacksAndMessages(null);
        getWindow().clearFlags(128);
        p80 p80Var = this.f35477f;
        if (p80Var != null) {
            p80Var.b();
        }
        xyz.netfly.ui.live.epg.q.o().c();
        xyz.netfly.api.c.b().f();
        xyz.netfly.api.c.b().s();
        e0 e0Var = this.f35475e;
        LiveViewModel liveViewModel = e0Var.f33847g;
        if (liveViewModel != null && (xVar = e0Var.f33863w) != null) {
            liveViewModel.liveCategory.g(xVar);
            e0Var.f33863w = null;
        }
        e0Var.f33862v.shutdownNow();
        p pVar = e0Var.f33861u;
        LiveViewModel liveViewModel2 = pVar.f33887d;
        if (liveViewModel2 != null) {
            ve.j jVar = pVar.F;
            if (jVar != null) {
                liveViewModel2.liveChannel.g(jVar);
                pVar.F = null;
            }
            x xVar2 = pVar.G;
            if (xVar2 != null) {
                pVar.f33887d.liveSearch.g(xVar2);
                pVar.G = null;
            }
        }
        pVar.f33901r.removeCallbacksAndMessages(null);
        WeakReference weakReference = pVar.f33886c;
        if (weakReference != null) {
            weakReference.clear();
        }
        pVar.f33891h.clear();
        pVar.f33890g.clear();
        pVar.f33898o.clear();
        pVar.f33896m.clear();
        pVar.f33897n.clear();
        pVar.f33905v.clear();
        pVar.f33906w.clear();
        pVar.E.clear();
        TvRecyclerView tvRecyclerView = pVar.f33885b;
        if (tvRecyclerView != null) {
            tvRecyclerView.setAdapter(null);
        }
        TvRecyclerView tvRecyclerView2 = pVar.f33884a;
        if (tvRecyclerView2 != null) {
            tvRecyclerView2.setAdapter(null);
        }
        pVar.H = Integer.MIN_VALUE;
        pVar.I = false;
        pVar.J = -1;
        pVar.f33904u = null;
        pVar.f33889f = null;
        e0Var.f33842b.clear();
        e0Var.f33844d.clear();
        e0Var.f33845e.clear();
        TvRecyclerView tvRecyclerView3 = e0Var.f33848h;
        if (tvRecyclerView3 != null) {
            tvRecyclerView3.setAdapter(null);
        }
        TvRecyclerView tvRecyclerView4 = e0Var.f33849i;
        if (tvRecyclerView4 != null) {
            tvRecyclerView4.setAdapter(null);
        }
        WeakReference weakReference2 = e0Var.f33846f;
        if (weakReference2 != null) {
            weakReference2.clear();
        }
        e0Var.f33851k = null;
        e0Var.f33847g = null;
        this.f35473d.b();
        this.f35472c0++;
        this.f35470b0.shutdownNow();
        IjkVideoView ijkVideoView = this.f35479g;
        if (ijkVideoView != null) {
            try {
                ViewParent parent = ijkVideoView.getParent();
                if (parent instanceof ViewGroup) {
                    ((ViewGroup) parent).removeView(this.f35479g);
                }
            } catch (Throwable unused) {
            }
            try {
                this.f35479g.removeListener();
            } catch (Throwable unused2) {
            }
            try {
                this.f35479g.stop();
            } catch (Throwable unused3) {
            }
            try {
                this.f35479g.release();
            } catch (Throwable unused4) {
            }
            this.f35479g = null;
        }
        super.onDestroy();
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final boolean onError(IMediaPlayer iMediaPlayer, int i10, int i11, String str) {
        StringBuilder sbR = defpackage.e.r("live play error:", i10, " extra:", i11, " url: ");
        sbR.append(this.S);
        h.c(sbR.toString());
        this.f35484i0 = i10;
        this.f35488k0 = i10 + "-" + i11;
        this.f35486j0 = str;
        if (xyz.netfly.ads.f.a().f34847j) {
            return true;
        }
        if (i10 == 100333 && i11 == 100333) {
            y.a0(this);
            return true;
        }
        synchronized (this) {
            this.f35480g0.removeCallbacks(this.f35482h0);
            this.f35480g0.postDelayed(this.f35482h0, 1000L);
        }
        return false;
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onInfo(IMediaPlayer iMediaPlayer, int i10, int i11) {
        if (isFinishing() || isDestroyed() || this.binding == 0) {
            return;
        }
        Handler handler = this.f35487k;
        g gVar = this.f35474d0;
        if (i10 == 701) {
            handler.removeCallbacks(gVar);
            handler.postDelayed(gVar, 200L);
            return;
        }
        if (i10 == 702 || i10 == 10008) {
            handler.removeCallbacks(gVar);
            handler.removeCallbacks(this.f35476e0);
            this.f35471c.f27113s.setVisibility(8);
            p80 p80Var = this.f35477f;
            if (p80Var != null) {
                p80Var.c();
            }
            if (this.f35478f0 == i10) {
                return;
            }
            this.f35478f0 = i10;
            xyz.netfly.api.c.b().j();
            return;
        }
        if (i10 == 3) {
            xyz.netfly.api.c.b().r();
            this.f35485j = 10;
            if (this.f35483i) {
                return;
            }
            this.f35483i = true;
            String strC = kotlinx.coroutines.flow.h.C();
            ITrackInfo selectVideoTrackInfo = this.f35479g.getSelectVideoTrackInfo();
            this.Q = selectVideoTrackInfo;
            if (selectVideoTrackInfo == null) {
                return;
            }
            l.f36161a.execute(new xyz.stream.utils.i(this.f35481h, strC, this.f35469b.getId().intValue(), this.f35469b.getName()));
        }
    }

    @Override // android.view.View.OnKeyListener
    public final boolean onKey(View view, int i10, KeyEvent keyEvent) {
        ve.a aVar = this.f35490l0;
        Handler handler = this.f35487k;
        if (this.f35471c == null) {
            return false;
        }
        e0 e0Var = this.f35475e;
        v vVar = this.f35473d;
        if ((i10 == 23 || i10 == 66) && keyEvent.getAction() == 0) {
            if (this.f35471c.f27103i.getVisibility() == 0) {
                vVar.u();
            }
            e0Var.f(1);
            U(true);
            return true;
        }
        if (i10 == 82 && keyEvent.getAction() == 0) {
            long jUptimeMillis = SystemClock.uptimeMillis();
            if (this.Z || jUptimeMillis - this.f35468a0 < 500) {
                return true;
            }
            this.f35468a0 = jUptimeMillis;
            this.Z = true;
            try {
                e0Var.f(0);
                U(true);
                return true;
            } finally {
                handler.removeCallbacks(aVar);
                handler.postDelayed(aVar, 350L);
            }
        }
        if (i10 == 4 && keyEvent.getAction() == 0 && this.f35471c.f27103i.getVisibility() == 0) {
            vVar.u();
            return true;
        }
        if (keyEvent.getAction() == 0 && this.f35489l) {
            return true;
        }
        if (UiUtils.isDpadRight(i10) && keyEvent.getAction() == 0) {
            if (this.f35471c.f27103i.getVisibility() == 0) {
                vVar.o();
                return true;
            }
            vVar.t();
            vVar.o();
            return true;
        }
        if (UiUtils.isDpadLeft(i10) && keyEvent.getAction() == 0) {
            if (this.f35471c.f27103i.getVisibility() == 0) {
                vVar.o();
                return true;
            }
            vVar.t();
            vVar.o();
            return true;
        }
        if (i10 == 19 && keyEvent.getAction() == 1 && !this.f35489l) {
            LiveChannelEntity liveChannelEntityF = e0Var.f33861u.f();
            if (liveChannelEntityF != null) {
                re.a.u().getClass();
                if (re.a.t(liveChannelEntityF) > 1) {
                    y.a0(this);
                    return true;
                }
                P();
                this.f35469b = liveChannelEntityF;
                xyz.netfly.api.c.b().c();
                Q();
                e0Var.e(this.f35469b);
            }
            return true;
        }
        if (i10 != 20 || keyEvent.getAction() != 1 || this.f35489l) {
            return false;
        }
        LiveChannelEntity liveChannelEntityG = e0Var.f33861u.g();
        if (liveChannelEntityG != null) {
            re.a.u().getClass();
            if (re.a.t(liveChannelEntityG) > 1) {
                y.a0(this);
                return true;
            }
            P();
            this.f35469b = liveChannelEntityG;
            xyz.netfly.api.c.b().c();
            Q();
            e0Var.e(this.f35469b);
        }
        return true;
    }

    @Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
    public final boolean onKeyDown(int i10, KeyEvent keyEvent) {
        if (i10 == 4 && keyEvent.getAction() == 0) {
            if (this.f35471c.f27103i.getVisibility() == 0) {
                this.f35473d.m();
                return true;
            }
            if (this.f35489l) {
                U(true);
                return true;
            }
            long jCurrentTimeMillis = System.currentTimeMillis();
            if (jCurrentTimeMillis - this.f35493n0 > ExoPlayer.DEFAULT_DETACH_SURFACE_TIMEOUT_MS) {
                this.f35492m0 = 1;
            } else {
                this.f35492m0++;
            }
            this.f35493n0 = jCurrentTimeMillis;
            int i11 = this.f35492m0;
            if (i11 > 1) {
                finish();
                this.f35492m0 = 0;
                return true;
            }
            if (i11 == 1) {
                ((j) this.binding).f27040e.f27504a.setVisibility(0);
                ((j) this.binding).f27040e.f27504a.postDelayed(new ve.a(this, 4), ExoPlayer.DEFAULT_DETACH_SURFACE_TIMEOUT_MS);
                return true;
            }
        }
        return super.onKeyDown(i10, keyEvent);
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onLoadedData(String str, long j10, int i10, int i11, int i12, String str2) {
        super.onLoadedData(str, j10, i10, i11, i12, str2);
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("width", Integer.valueOf(i11));
        linkedHashMap.put("height", Integer.valueOf(i12));
        linkedHashMap.put("bandwidth", Long.valueOf(j10));
        linkedHashMap.put("frameRate", Integer.valueOf(i10));
        linkedHashMap.put("codecs", str2);
        xyz.netfly.api.c.b().g(str, linkedHashMap);
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onLog(IMediaPlayer iMediaPlayer, String str) {
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onMessageEvent(LogoutEvent logoutEvent) {
        r.j(this, new ve.c(this));
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public final void onPause() {
        super.onPause();
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onPrepared(IMediaPlayer iMediaPlayer) {
        ArrayList arrayList;
        if (isFinishing() || isDestroyed() || this.binding == 0) {
            return;
        }
        this.f35471c.f27113s.setVisibility(8);
        if (!xyz.netfly.ads.f.a().f34847j) {
            this.f35479g.setVolume(1.0f, 1.0f);
        }
        v vVar = this.f35473d;
        if (vVar != null) {
            LiveChannelEntity liveChannelEntity = vVar.f33927g;
            int i10 = 1;
            if (liveChannelEntity != null && liveChannelEntity.getIsAdult() != 1) {
                new Thread(new te.e(vVar, i10)).start();
            }
            p pVar = this.f35475e.f33861u;
            if (pVar.f33909z == null || pVar.f33903t == -2) {
                return;
            }
            int i11 = 0;
            while (true) {
                arrayList = pVar.f33905v;
                if (i11 >= arrayList.size()) {
                    i11 = -1;
                    break;
                } else if (Objects.equals(((LiveChannelEntity) arrayList.get(i11)).getId(), pVar.f33909z.getId())) {
                    break;
                } else {
                    i11++;
                }
            }
            boolean z10 = i11 != 0;
            if (i11 == -1) {
                arrayList.add(0, pVar.f33909z);
            } else if (i11 > 0) {
                arrayList.add(0, (LiveChannelEntity) arrayList.remove(i11));
            }
            if (z10) {
                LiveCategoryEntity liveCategoryEntity = new LiveCategoryEntity(-2, ((AppCompatActivity) pVar.f33886c.get()).getString(R.string.recent), Integer.valueOf(arrayList.size()));
                ArrayList arrayList2 = pVar.f33890g;
                if (arrayList2.isEmpty()) {
                    return;
                }
                ((List) arrayList2.get(0)).set(1, liveCategoryEntity);
                if (pVar.f33892i == 0) {
                    pVar.f33891h.set(1, liveCategoryEntity);
                    pVar.f33893j.notifyItemChanged(1);
                }
            }
        }
    }

    @Override // android.app.Activity
    public final void onRestart() {
        super.onRestart();
        Q();
    }

    @Override // xyz.stream.view.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public final void onStart() {
        super.onStart();
        j0.k().o(this, new ve.c(this));
    }

    @Override // xyz.stream.view.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public final void onStop() {
        IjkVideoView ijkVideoView;
        super.onStop();
        xyz.stream.utils.f.p().x("Live page onStop");
        if (isFinishing() && (ijkVideoView = this.f35479g) != null && ijkVideoView.getPlaybackState() == 1) {
            xyz.netfly.api.c.b().i();
        }
        xyz.netfly.ads.f.a().b();
        P();
        xyz.netfly.api.c.b().c();
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onSubtitleTrackSelect(ITrackInfo iTrackInfo) {
        super.onSubtitleTrackSelect(iTrackInfo);
    }

    @Override // tv.danmaku.ijk.media.player.IMediaPlayer.Listener
    public final void onVideoTrackSelect(ITrackInfo iTrackInfo) {
        super.onVideoTrackSelect(iTrackInfo);
        if (isFinishing() || isDestroyed()) {
            return;
        }
        this.f35473d.s();
        if (iTrackInfo == null) {
            return;
        }
        if (this.Q == null) {
            this.Q = iTrackInfo;
        }
        if (this.Q.getBitrate() != iTrackInfo.getBitrate()) {
            int iP = f0.o().p(IjkPlayerRuntime.SP_LIVE_BITRATE, -100);
            if (iP != -100 && iP == iTrackInfo.getBitrate()) {
                runOnUiThread(new ve.a(this, 3));
            }
            this.Q = iTrackInfo;
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            linkedHashMap.put("width", Integer.valueOf(this.Q.getWidth()));
            linkedHashMap.put("height", Integer.valueOf(this.Q.getHeight()));
            linkedHashMap.put("bandwidth", Integer.valueOf(this.Q.getBitrate()));
            linkedHashMap.put("frameRate", Integer.valueOf(this.Q.getFrameRate()));
            linkedHashMap.put("codecs", this.Q.getCodecs());
            xyz.netfly.api.c.b().l(linkedHashMap);
        }
        runOnUiThread(new ve.b(this, iTrackInfo, 0));
    }

    @Override // xyz.stream.view.BaseActivity
    public final void playReminderLive(Object obj) {
        super.playReminderLive(obj);
        LiveChannelEntity liveChannelEntity = obj instanceof LiveChannelEntity ? (LiveChannelEntity) obj : null;
        if (liveChannelEntity != null) {
            P();
            this.f35469b = liveChannelEntity;
            Q();
            this.f35475e.e(this.f35469b);
        }
    }

    @Override // xe.b
    public final void q(LiveChannelEntity liveChannelEntity) {
        P();
        this.f35469b = liveChannelEntity;
        xyz.netfly.api.c.b().c();
        Q();
        this.f35475e.e(liveChannelEntity);
    }

    @Override // ag.c
    public final void u(String str) {
        this.f35471c.f27114t.setText(str);
    }

    @Override // ag.c
    public final void w() {
        long currentPosition = this.f35479g.getCurrentPosition();
        long bufferedPosition = this.f35479g.getBufferedPosition();
        this.f35471c.f27102h.setText(String.valueOf(currentPosition));
        this.f35471c.f27100f.setText(String.valueOf(bufferedPosition));
        TextView textView = this.f35471c.f27099e;
        StringBuilder sb = new StringBuilder();
        long j10 = bufferedPosition - currentPosition;
        sb.append(j10);
        sb.append("ms");
        textView.setText(sb.toString());
        String strQ = f0.o().q(IjkPlayerRuntime.SP_HISTORY_BITRATE, SessionDescription.SUPPORTED_SDP_VERSION);
        this.f35471c.f27117w.setText(String.valueOf(((int) j10) / 3000));
        this.f35471c.f27107m.setText(strQ);
        this.f35471c.f27109o.setText(AbrController.getInstance().getsGlobalSelectBitrateStr());
    }

    @Override // ag.c
    public final void z() {
        l.f36161a.execute(new xyz.stream.utils.j(this.f35481h, this.f35469b.getId().intValue(), this.f35469b.getName(), 1));
    }
}
