package xyz.netfly.ui.main;

import android.animation.ValueAnimator;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
import androidx.activity.result.d;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.fragment.app.a;
import androidx.fragment.app.d1;
import androidx.fragment.app.e0;
import androidx.media3.exoplayer.ExoPlayer;
import cf.c;
import ef.e;
import ff.f;
import ie.h;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;
import kotlinx.coroutines.y;
import lf.s;
import nf.b;
import org.drive_hunter.R;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import pe.g;
import te.l;
import uf.r;
import xyz.netfly.ui.login.LoginActivity;
import xyz.netfly.ui.search.SearchTabletActivity;
import xyz.netfly.ui.search.SearchTvActivity;
import xyz.netfly.viewmodel.HomeViewModel;
import xyz.stream.api.entity.CategoryEntity;
import xyz.stream.api.o;
import xyz.stream.utils.NativeSecurity;
import xyz.stream.utils.entity.InstallEntity;
import xyz.stream.utils.event.CheckEvent;
import xyz.stream.utils.event.LogoutEvent;
import xyz.stream.utils.event.ShowFragmentEvent;
import xyz.stream.utils.f0;
import xyz.stream.view.BaseActivity;
import xyz.stream.view.BaseFragment;
import xyz.stream.view.UiUtils;
import xyz.stream.view.listener.OnFragmentSendDataListener;

/* JADX INFO: loaded from: classes3.dex */
public class HomeActivity extends BaseActivity<HomeViewModel, h> implements View.OnKeyListener, View.OnClickListener, View.OnFocusChangeListener, OnFragmentSendDataListener {

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public static final /* synthetic */ int f35516i = 0;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public String f35518c = "menu_home";

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public View f35520e;

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

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public float f35523h;

    public static void R(AppCompatImageView appCompatImageView, String str) {
        str.getClass();
        switch (str) {
            case "menu_history":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_history, Integer.valueOf(R.color.main_color));
                break;
            case "menu_download":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_download, Integer.valueOf(R.color.main_color));
                break;
            case "menu_help":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_help, Integer.valueOf(R.color.main_color));
                break;
            case "menu_home":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_home, Integer.valueOf(R.color.main_color));
                break;
            case "menu_iptv":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.ic_main_iptv, Integer.valueOf(R.color.main_color));
                break;
            case "menu_setting":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_setting, Integer.valueOf(R.color.main_color));
                break;
            case "menu_subscription":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_subscrip, Integer.valueOf(R.color.main_color));
                break;
            case "menu_search":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_search, Integer.valueOf(R.color.main_color));
                break;
            case "menu_favorite":
                UiUtils.setSvgPicture(appCompatImageView, R.drawable.main_my_list, Integer.valueOf(R.color.main_color));
                break;
        }
    }

    public final void K() {
        if (this.f35519d.equals(this.f35518c) || isFinishing() || isDestroyed()) {
            return;
        }
        boolean zA = NativeSecurity.a(this, getPackageName(), new String[0]);
        boolean zK = y.K(this);
        if (!zA || !zK) {
            System.exit(0);
            return;
        }
        d1 supportFragmentManager = getSupportFragmentManager();
        supportFragmentManager.getClass();
        a aVar = new a(supportFragmentManager);
        for (e0 e0Var : supportFragmentManager.f2368c.d()) {
            if (e0Var != null && e0Var.isAdded()) {
                aVar.k(e0Var);
            }
        }
        e0 e0VarFindFragmentByTag = supportFragmentManager.findFragmentByTag(this.f35518c);
        boolean zI = supportFragmentManager.I();
        if (Objects.equals(this.f35518c, "menu_favorite")) {
            ((h) this.binding).f26911b.setPadding(0, 80, 0, 0);
        } else {
            ((h) this.binding).f26911b.setPadding(0, 0, 0, 0);
        }
        int i10 = R.color.bg_color;
        if (e0VarFindFragmentByTag != null) {
            aVar.l(e0VarFindFragmentByTag);
            if (zI) {
                aVar.i(true);
            } else {
                aVar.i(false);
            }
            if (Objects.equals(this.f35518c, "menu_home")) {
                f fVar = (f) e0VarFindFragmentByTag;
                ArrayList arrayList = fVar.G0;
                if (arrayList.isEmpty()) {
                    fVar.initData();
                } else {
                    if (((CategoryEntity) arrayList.get(fVar.E0)).getSourceType().intValue() == 5) {
                        i10 = R.drawable.shadow_kid;
                    }
                    onBgChange(i10);
                }
            } else {
                onBgChange(R.color.bg_color);
                BaseFragment baseFragment = (BaseFragment) e0VarFindFragmentByTag;
                if (Objects.equals(this.f35518c, "menu_favorite") || Objects.equals(this.f35518c, "menu_subscription") || Objects.equals(this.f35518c, "menu_download") || Objects.equals(this.f35518c, "menu_iptv") || Objects.equals(this.f35518c, "menu_history") || Objects.equals(this.f35518c, "menu_setting")) {
                    baseFragment.initData();
                }
            }
        } else {
            String str = this.f35518c;
            str.getClass();
            switch (str) {
                case "menu_history":
                    e0VarFindFragmentByTag = new e();
                    break;
                case "menu_download":
                    e0VarFindFragmentByTag = new bf.d();
                    break;
                case "menu_help":
                    e0VarFindFragmentByTag = new df.a();
                    break;
                case "menu_home":
                    e0VarFindFragmentByTag = new f();
                    Bundle bundle = new Bundle();
                    bundle.putInt("categoryType", getIntent().getIntExtra("categoryType", 1));
                    e0VarFindFragmentByTag.setArguments(bundle);
                    break;
                case "menu_iptv":
                    e0VarFindFragmentByTag = new g();
                    break;
                case "menu_user":
                    e0VarFindFragmentByTag = new b();
                    break;
                case "menu_setting":
                    e0VarFindFragmentByTag = new s();
                    break;
                case "menu_favorite":
                    e0VarFindFragmentByTag = new c();
                    break;
            }
            if (e0VarFindFragmentByTag == null) {
                return;
            }
            onBgChange(R.color.bg_color);
            aVar.add(R.id.container, e0VarFindFragmentByTag, this.f35518c);
            if (zI) {
                aVar.i(true);
            } else {
                aVar.i(false);
            }
        }
        this.f35519d = this.f35518c;
    }

    public final void L() {
        if (this.f35517b) {
            ValueAnimator valueAnimatorOfInt = ValueAnimator.ofInt(345, 135);
            valueAnimatorOfInt.setDuration(300L);
            valueAnimatorOfInt.addUpdateListener(new af.a(this, 0));
            valueAnimatorOfInt.addListener(new af.c(this, 1));
            valueAnimatorOfInt.start();
        }
    }

    public final void M() {
        if (this.f35517b) {
            return;
        }
        ValueAnimator valueAnimatorOfInt = ValueAnimator.ofInt(135, 345);
        valueAnimatorOfInt.setDuration(300L);
        valueAnimatorOfInt.addUpdateListener(new af.a(this, 1));
        valueAnimatorOfInt.addListener(new af.c(this, 0));
        valueAnimatorOfInt.start();
    }

    public final void N() {
        View view = this.f35520e;
        if (view == null) {
        }
        switch (view.getId()) {
            case R.id.ll_download /* 2131362496 */:
                T(((h) this.binding).A, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26912c, R.drawable.main_download);
                break;
            case R.id.ll_help /* 2131362506 */:
                T(((h) this.binding).B, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26914e, R.drawable.main_help);
                break;
            case R.id.ll_history /* 2131362507 */:
                T(((h) this.binding).C, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26915f, R.drawable.main_history);
                break;
            case R.id.ll_home /* 2131362509 */:
                T(((h) this.binding).D, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26916g, R.drawable.main_home);
                break;
            case R.id.ll_iptv /* 2131362515 */:
                T(((h) this.binding).E, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26917h, R.drawable.ic_main_iptv);
                break;
            case R.id.ll_my_list /* 2131362520 */:
                T(((h) this.binding).F, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26919j, R.drawable.main_my_list);
                break;
            case R.id.ll_search /* 2131362537 */:
                T(((h) this.binding).G, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26920k, R.drawable.main_search);
                break;
            case R.id.ll_setting /* 2131362543 */:
                T(((h) this.binding).H, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26921l, R.drawable.main_setting);
                break;
            case R.id.ll_subscription /* 2131362546 */:
                T(((h) this.binding).I, R.color.main_tag_text, 0);
                UiUtils.setSvgPicture(((h) this.binding).f26922m, R.drawable.main_subscrip);
                break;
            case R.id.ll_user /* 2131362554 */:
                T(((h) this.binding).J, R.color.main_tag_text, 0);
                break;
        }
    }

    public final void O(View view) {
        View view2 = this.f35520e;
        if (view2 == null || view2.getId() == view.getId()) {
            return;
        }
        boolean zH = xyz.stream.utils.e.h();
        switch (view.getId()) {
            case R.id.ll_download /* 2131362496 */:
                this.f35518c = "menu_download";
                K();
                T(((h) this.binding).A, R.color.main_color, 1);
                R(((h) this.binding).f26912c, this.f35518c);
                break;
            case R.id.ll_help /* 2131362506 */:
                this.f35518c = "menu_help";
                K();
                T(((h) this.binding).B, R.color.main_color, 1);
                R(((h) this.binding).f26914e, this.f35518c);
                break;
            case R.id.ll_history /* 2131362507 */:
                this.f35518c = "menu_history";
                K();
                T(((h) this.binding).C, R.color.main_color, 1);
                R(((h) this.binding).f26915f, this.f35518c);
                break;
            case R.id.ll_home /* 2131362509 */:
                this.f35518c = "menu_home";
                K();
                T(((h) this.binding).D, R.color.main_color, 1);
                R(((h) this.binding).f26916g, this.f35518c);
                break;
            case R.id.ll_iptv /* 2131362515 */:
                this.f35518c = "menu_iptv";
                K();
                T(((h) this.binding).E, R.color.main_color, 1);
                R(((h) this.binding).f26917h, this.f35518c);
                break;
            case R.id.ll_my_list /* 2131362520 */:
                this.f35518c = "menu_favorite";
                K();
                T(((h) this.binding).F, R.color.main_color, 1);
                R(((h) this.binding).f26919j, this.f35518c);
                break;
            case R.id.ll_search /* 2131362537 */:
                if (xyz.stream.utils.e.d().f36118g) {
                    Intent intent = new Intent(this, (Class<?>) SearchTvActivity.class);
                    intent.addFlags(268435456);
                    startActivity(intent);
                    return;
                } else {
                    Intent intent2 = new Intent(this, (Class<?>) SearchTabletActivity.class);
                    intent2.addFlags(268435456);
                    startActivity(intent2);
                    return;
                }
            case R.id.ll_setting /* 2131362543 */:
                this.f35518c = "menu_setting";
                K();
                T(((h) this.binding).H, R.color.main_color, 1);
                R(((h) this.binding).f26921l, this.f35518c);
                break;
            case R.id.ll_subscription /* 2131362546 */:
                if (zH) {
                    y.a0(this);
                    return;
                } else {
                    this.f35521f.launch(new Intent(this, (Class<?>) LoginActivity.class), null);
                    return;
                }
            case R.id.ll_user /* 2131362554 */:
                if (!zH) {
                    this.f35521f.launch(new Intent(this, (Class<?>) LoginActivity.class), null);
                    return;
                }
                this.f35518c = "menu_user";
                T(((h) this.binding).J, R.color.main_color, 1);
                K();
                break;
                break;
        }
        N();
        this.f35520e = view;
    }

    public final void P(boolean z10) {
        if (z10 && xyz.stream.utils.e.d().f36119h) {
            return;
        }
        ((h) this.binding).f26935z.setFocusable(z10);
        ((h) this.binding).f26927r.setFocusable(z10);
        ((h) this.binding).f26932w.setFocusable(z10);
        ((h) this.binding).f26928s.setFocusable(z10);
        ((h) this.binding).f26934y.setFocusable(z10);
        ((h) this.binding).f26931v.setFocusable(z10);
        ((h) this.binding).f26933x.setFocusable(z10);
        ((h) this.binding).f26926q.setFocusable(z10);
        ((h) this.binding).f26925p.setFocusable(z10);
        ((h) this.binding).f26929t.setFocusable(z10);
        ((h) this.binding).f26935z.setFocusableInTouchMode(z10);
        ((h) this.binding).f26927r.setFocusableInTouchMode(z10);
        ((h) this.binding).f26932w.setFocusableInTouchMode(z10);
        ((h) this.binding).f26928s.setFocusableInTouchMode(z10);
        ((h) this.binding).f26934y.setFocusableInTouchMode(z10);
        ((h) this.binding).f26931v.setFocusableInTouchMode(z10);
        ((h) this.binding).f26933x.setFocusableInTouchMode(z10);
        ((h) this.binding).f26926q.setFocusableInTouchMode(z10);
        ((h) this.binding).f26925p.setFocusableInTouchMode(z10);
        ((h) this.binding).f26929t.setFocusableInTouchMode(z10);
    }

    public final void Q() {
        BaseFragment baseFragment = (BaseFragment) getSupportFragmentManager().findFragmentByTag(this.f35518c);
        if (baseFragment == null) {
            return;
        }
        if (this.f35517b) {
            L();
        }
        new Handler(Looper.getMainLooper()).postDelayed(new xyz.netfly.ads.h(baseFragment, 22), 300L);
    }

    public final void S() {
        int i10;
        int i11;
        int i12;
        int i13;
        int i14;
        int i15;
        int i16;
        int i17;
        int i18;
        String str = this.f35518c;
        str.getClass();
        i10 = 9;
        i11 = 8;
        i12 = 7;
        i13 = 6;
        i14 = 5;
        i15 = 4;
        i16 = 3;
        i17 = 2;
        i18 = 1;
        switch (str) {
            case "menu_history":
                ((h) this.binding).f26927r.post(new af.b(this, i17));
                break;
            case "menu_download":
                ((h) this.binding).f26925p.post(new af.b(this, i12));
                break;
            case "menu_help":
                ((h) this.binding).f26926q.post(new af.b(this, 10));
                break;
            case "menu_home":
                ((h) this.binding).f26928s.post(new af.b(this, i15));
                break;
            case "menu_iptv":
                ((h) this.binding).f26929t.post(new af.b(this, i11));
                break;
            case "menu_user":
                ((h) this.binding).f26935z.post(new af.b(this, i18));
                break;
            case "menu_setting":
                ((h) this.binding).f26933x.post(new af.b(this, i10));
                break;
            case "menu_subscription":
                ((h) this.binding).f26934y.post(new af.b(this, i14));
                break;
            case "menu_search":
                ((h) this.binding).f26932w.post(new af.b(this, i16));
                break;
            case "menu_favorite":
                ((h) this.binding).f26931v.post(new af.b(this, i13));
                break;
        }
    }

    public final void T(TextView textView, int i10, int i11) {
        Object obj = g0.d.f26125a;
        textView.setTextColor(getColor(i10));
        textView.setTypeface(Typeface.DEFAULT, i11);
    }

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

    @Override // xyz.stream.view.BaseActivity
    public final void initData() {
        super.initData();
        P(false);
        ((HomeViewModel) this.viewModel).handleIntent(this);
        N();
        this.f35520e = ((h) this.binding).f26928s;
        this.f35518c = "menu_home";
        K();
        Q();
        T(((h) this.binding).D, R.color.main_color, 1);
        R(((h) this.binding).f26916g, this.f35518c);
        new Handler().postDelayed(new af.b(this, 11), ExoPlayer.DEFAULT_DETACH_SURFACE_TIMEOUT_MS);
        new Thread(new af.b(this, 0)).start();
    }

    @Override // xyz.stream.view.BaseActivity
    public final void initListener() {
        super.initListener();
        ((h) this.binding).f26930u.setOnTouchListener(new s9.g(this, 2));
        ((h) this.binding).f26918i.setOnClickListener(new com.google.android.material.textfield.b(this, 18));
        ((h) this.binding).f26935z.setOnKeyListener(this);
        ((h) this.binding).f26927r.setOnKeyListener(this);
        ((h) this.binding).f26932w.setOnKeyListener(this);
        ((h) this.binding).f26928s.setOnKeyListener(this);
        ((h) this.binding).f26934y.setOnKeyListener(this);
        ((h) this.binding).f26931v.setOnKeyListener(this);
        ((h) this.binding).f26933x.setOnKeyListener(this);
        ((h) this.binding).f26926q.setOnKeyListener(this);
        ((h) this.binding).f26925p.setOnKeyListener(this);
        ((h) this.binding).f26929t.setOnKeyListener(this);
        ((h) this.binding).f26935z.setOnClickListener(this);
        ((h) this.binding).f26927r.setOnClickListener(this);
        ((h) this.binding).f26932w.setOnClickListener(this);
        ((h) this.binding).f26928s.setOnClickListener(this);
        ((h) this.binding).f26934y.setOnClickListener(this);
        ((h) this.binding).f26931v.setOnClickListener(this);
        ((h) this.binding).f26933x.setOnClickListener(this);
        ((h) this.binding).f26926q.setOnClickListener(this);
        ((h) this.binding).f26925p.setOnClickListener(this);
        ((h) this.binding).f26929t.setOnClickListener(this);
        ((h) this.binding).f26935z.setOnFocusChangeListener(this);
        ((h) this.binding).f26927r.setOnFocusChangeListener(this);
        ((h) this.binding).f26932w.setOnFocusChangeListener(this);
        ((h) this.binding).f26928s.setOnFocusChangeListener(this);
        ((h) this.binding).f26934y.setOnFocusChangeListener(this);
        ((h) this.binding).f26931v.setOnFocusChangeListener(this);
        ((h) this.binding).f26933x.setOnFocusChangeListener(this);
        ((h) this.binding).f26926q.setOnFocusChangeListener(this);
        ((h) this.binding).f26925p.setOnFocusChangeListener(this);
        ((h) this.binding).f26929t.setOnFocusChangeListener(this);
    }

    @Override // xyz.stream.view.BaseActivity
    public final void initView() {
        y.R("open_app", new HashMap());
        ((h) this.binding).f26918i.setImageResource(R.mipmap.main_logo_close);
        boolean zA = NativeSecurity.a(this, getPackageName(), new String[0]);
        boolean zK = y.K(this);
        if (!zA || !zK) {
            System.exit(0);
            return;
        }
        this.f35521f = registerForActivityResult(new b.c(), new com.google.gson.internal.a(this, 19));
        HomeViewModel homeViewModel = (HomeViewModel) this.viewModel;
        h hVar = (h) this.binding;
        homeViewModel.setUserInfo(this, hVar.J, hVar.f26913d);
        ((h) this.binding).f26925p.setVisibility(0);
    }

    @Override // xyz.stream.view.listener.OnFragmentSendDataListener
    public final void onActivityFocus() {
        S();
        M();
    }

    @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, android.app.Activity
    public void onActivityResult(int i10, int i11, @Nullable Intent intent) {
        InstallEntity installEntity;
        InstallEntity installEntity2;
        super.onActivityResult(i10, i11, intent);
        if (i10 == 100 && i11 == -1) {
            UiUtils.showProgressDialog(this);
            o.f().c();
            return;
        }
        if (i10 != 65793) {
            if (i10 == 65794 && (installEntity = (InstallEntity) f0.o().k(InstallEntity.class, "sp_install_entity")) != null && installEntity.isForceUpdate()) {
                xyz.stream.utils.e.a(this);
                return;
            }
            return;
        }
        if (Build.VERSION.SDK_INT < 26 || (installEntity2 = (InstallEntity) f0.o().k(InstallEntity.class, "sp_install_entity")) == null) {
            return;
        }
        if (getPackageManager().canRequestPackageInstalls()) {
            xyz.stream.utils.h.e(this, installEntity2.getInstallPath());
        } else if (installEntity2.isForceUpdate()) {
            xyz.stream.utils.e.a(this);
        }
    }

    @Override // xyz.stream.view.listener.OnFragmentSendDataListener
    public final void onBgChange(int i10) {
        ((h) this.binding).f26910a.setBackgroundResource(i10);
    }

    @Override // android.view.View.OnClickListener
    public void onClick(View view) {
        if (this.f35520e == view) {
            if (this.f35517b) {
                L();
            } else {
                M();
            }
        }
        O(view);
    }

    @Override // xyz.stream.view.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public final void onDestroy() {
        super.onDestroy();
        fe.d.b().m(this);
    }

    @Override // android.view.View.OnFocusChangeListener
    public final void onFocusChange(View view, boolean z10) {
        if (z10) {
            M();
        }
    }

    @Override // android.view.View.OnKeyListener
    public final boolean onKey(View view, int i10, KeyEvent keyEvent) {
        if (i10 == 19 && keyEvent.getAction() == 0 && view.getId() == ((h) this.binding).f26935z.getId()) {
            return true;
        }
        if (i10 == 20 && keyEvent.getAction() == 0 && view.getId() == ((h) this.binding).f26926q.getId()) {
            return true;
        }
        if (i10 == 23 && keyEvent.getAction() == 0) {
            O(view);
            return true;
        }
        if (UiUtils.isDpadLeft(i10) && keyEvent.getAction() == 1) {
            if (!this.f35517b) {
                S();
            }
            return true;
        }
        if (!UiUtils.isDpadRight(i10) || keyEvent.getAction() != 0) {
            return false;
        }
        Q();
        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) {
            return super.onKeyDown(i10, keyEvent);
        }
        e0 e0VarFindFragmentByTag = getSupportFragmentManager().findFragmentByTag(this.f35518c);
        if ((e0VarFindFragmentByTag instanceof f) && ((f) e0VarFindFragmentByTag).scrollToTop()) {
            return true;
        }
        if (Objects.equals(this.f35518c, "menu_home")) {
            r.g(this, new l(4));
        } else {
            N();
            this.f35518c = "menu_home";
            h hVar = (h) this.binding;
            this.f35520e = hVar.f26928s;
            T(hVar.D, R.color.main_color, 1);
            R(((h) this.binding).f26916g, this.f35518c);
            K();
            Q();
        }
        return true;
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onMessageEvent(CheckEvent checkEvent) {
        UiUtils.dismissProgressDialog();
        HomeViewModel homeViewModel = (HomeViewModel) this.viewModel;
        VB vb2 = this.binding;
        homeViewModel.setUserInfo(this, ((h) vb2).J, ((h) vb2).f26913d);
    }

    @Override // xyz.stream.view.BaseActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public final void onResume() {
        super.onResume();
        if (this.binding == 0) {
            this.binding = h.inflate(getLayoutInflater(), null, false);
        }
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onMessageEvent(LogoutEvent logoutEvent) {
        fe.d.b().k(logoutEvent);
        ((h) this.binding).J.setText(getString(R.string.login));
        this.f35518c = "menu_home";
        K();
        T(((h) this.binding).D, R.color.main_color, 1);
        N();
        R(((h) this.binding).f26916g, this.f35518c);
        this.f35520e = ((h) this.binding).f26928s;
        S();
        this.f35521f.launch(new Intent(this, (Class<?>) LoginActivity.class), null);
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onMessageEvent(ShowFragmentEvent showFragmentEvent) {
        fe.d.b().k(showFragmentEvent);
        String str = showFragmentEvent.fragmentConstant;
        N();
        str.getClass();
        switch (str) {
            case "menu_history":
                this.f35518c = "menu_history";
                K();
                T(((h) this.binding).C, R.color.main_color, 1);
                R(((h) this.binding).f26915f, this.f35518c);
                this.f35520e = ((h) this.binding).f26927r;
                break;
            case "menu_download":
                this.f35518c = "menu_download";
                K();
                T(((h) this.binding).A, R.color.main_color, 1);
                R(((h) this.binding).f26912c, this.f35518c);
                this.f35520e = ((h) this.binding).f26925p;
                break;
            case "menu_help":
                this.f35518c = "menu_help";
                K();
                T(((h) this.binding).B, R.color.main_color, 1);
                R(((h) this.binding).f26914e, this.f35518c);
                this.f35520e = ((h) this.binding).f26926q;
                break;
            case "menu_home":
                this.f35518c = "menu_home";
                K();
                T(((h) this.binding).D, R.color.main_color, 1);
                R(((h) this.binding).f26916g, this.f35518c);
                this.f35520e = ((h) this.binding).f26928s;
                break;
            case "menu_iptv":
                this.f35518c = "menu_iptv";
                K();
                T(((h) this.binding).E, R.color.main_color, 1);
                R(((h) this.binding).f26917h, this.f35518c);
                this.f35520e = ((h) this.binding).f26929t;
                break;
            case "menu_user":
                this.f35518c = "menu_user";
                T(((h) this.binding).J, R.color.main_color, 1);
                K();
                this.f35520e = ((h) this.binding).f26935z;
                break;
            case "menu_setting":
                this.f35518c = "menu_setting";
                K();
                T(((h) this.binding).H, R.color.main_color, 1);
                R(((h) this.binding).f26921l, this.f35518c);
                this.f35520e = ((h) this.binding).f26933x;
                break;
            case "menu_subscription":
                this.f35518c = "menu_subscription";
                T(((h) this.binding).I, R.color.main_color, 1);
                K();
                R(((h) this.binding).f26922m, this.f35518c);
                this.f35520e = ((h) this.binding).f26934y;
                break;
            case "menu_search":
                this.f35518c = "menu_search";
                K();
                T(((h) this.binding).G, R.color.main_color, 1);
                R(((h) this.binding).f26920k, this.f35518c);
                this.f35520e = ((h) this.binding).f26932w;
                break;
            case "menu_favorite":
                this.f35518c = "menu_favorite";
                K();
                T(((h) this.binding).F, R.color.main_color, 1);
                R(((h) this.binding).f26919j, this.f35518c);
                this.f35520e = ((h) this.binding).f26931v;
                break;
        }
        S();
    }
}
