导航菜单

页面标题

页面副标题

24Six v66.1.24 - ActivityMain.java 源代码

正在查看: 24Six v66.1.24 应用的 ActivityMain.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package app.tfs.activity;

import L0.v;
import N.f;
import N.h;
import Y0.l;
import android.content.Intent;
import android.graphics.Insets;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowInsets;
import android.widget.LinearLayout;
import androidx.appcompat.widget.E;
import androidx.appcompat.widget.F;
import androidx.appcompat.widget.G;
import androidx.appcompat.widget.H;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.view.F0;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.p0;
import androidx.core.view.t0;
import androidx.core.view.v0;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Observer;
import androidx.viewpager.widget.ViewPager;
import app.tfs.R;
import app.tfs.activity.ActivityMain;
import app.tfs.fragment.FragmentNowPlaying;
import app.tfs.fragment.o;
import app.tfs.fragment.p;
import app.tfs.model.TfsProfile;
import b0.k;
import b0.n;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarView;
import g.AbstractC0461d;
import g.C0458a;
import j.C0532a;
import java.util.ArrayList;
import java.util.List;
import kotlin.jvm.internal.g;
import kotlin.jvm.internal.m;
import n.C0636p;
import n.r;

public final class ActivityMain extends app.tfs.activity.e implements h.b {

    public static final a f392x = new a(null);

    private C0532a f393v;

    private b f394w;

    public static final class a {
        public a(g gVar) {
            this();
        }

        private a() {
        }
    }

    final class b extends c0.h implements NavigationBarView.OnItemSelectedListener, ViewPager.OnPageChangeListener, NavigationBarView.OnItemReselectedListener {
        private final ArrayList b;

        public b(FragmentManager fragmentManager, TfsProfile tfsProfile) {
            super(fragmentManager);
            this.b = ActivityMain.this.j1(tfsProfile);
        }

        public static final void g(h hVar) {
            h.c N = hVar.N();
            if (N instanceof h.c) {
                N.i();
            }
        }

        public C0636p a(int i2) {
            return C0636p.f1462p.a(i2, i2 != this.b.indexOf(3), true);
        }

        public final ArrayList f() {
            return this.b;
        }

        public int getCount() {
            return this.b.size();
        }

        @Override
        public void onNavigationItemReselected(MenuItem menuItem) {
            m.e(menuItem, "item");
            C0532a c0532a = ActivityMain.this.f393v;
            C0532a c0532a2 = null;
            if (c0532a == null) {
                m.w("viewBinding");
                c0532a = null;
            }
            final h b = b(c0532a.f1187h.getCurrentItem());
            if (b != null) {
                b.O();
                C0532a c0532a3 = ActivityMain.this.f393v;
                if (c0532a3 == null) {
                    m.w("viewBinding");
                } else {
                    c0532a2 = c0532a3;
                }
                c0532a2.e.postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        ActivityMain.b.g(b);
                    }
                }, 200L);
            }
        }

        @Override
        public boolean onNavigationItemSelected(MenuItem menuItem) {
            m.e(menuItem, "item");
            int itemId = menuItem.getItemId();
            int indexOf = itemId == R.e.navigation_music ? this.b.indexOf(0) : itemId == R.e.navigation_video ? this.b.indexOf(1) : itemId == R.e.navigation_podcasts ? this.b.indexOf(2) : itemId == R.e.navigation_library ? this.b.indexOf(3) : -1;
            if (indexOf >= 0) {
                C0532a c0532a = ActivityMain.this.f393v;
                if (c0532a == null) {
                    m.w("viewBinding");
                    c0532a = null;
                }
                c0532a.f1187h.setCurrentItem(indexOf);
            }
            return false;
        }

        @Override
        public void onPageScrollStateChanged(int i2) {
        }

        @Override
        public void onPageScrolled(int i2, float f2, int i3) {
        }

        @Override
        public void onPageSelected(int i2) {
            C0532a c0532a = null;
            if (i2 == this.b.indexOf(0)) {
                C0532a c0532a2 = ActivityMain.this.f393v;
                if (c0532a2 == null) {
                    m.w("viewBinding");
                    c0532a2 = null;
                }
                c0532a2.e.getMenu().findItem(R.e.navigation_music).setChecked(true);
            } else if (i2 == this.b.indexOf(1)) {
                C0532a c0532a3 = ActivityMain.this.f393v;
                if (c0532a3 == null) {
                    m.w("viewBinding");
                    c0532a3 = null;
                }
                c0532a3.e.getMenu().findItem(R.e.navigation_video).setChecked(true);
            } else if (i2 == this.b.indexOf(2)) {
                C0532a c0532a4 = ActivityMain.this.f393v;
                if (c0532a4 == null) {
                    m.w("viewBinding");
                    c0532a4 = null;
                }
                c0532a4.e.getMenu().findItem(R.e.navigation_podcasts).setChecked(true);
            } else if (i2 == this.b.indexOf(3)) {
                C0532a c0532a5 = ActivityMain.this.f393v;
                if (c0532a5 == null) {
                    m.w("viewBinding");
                    c0532a5 = null;
                }
                c0532a5.e.getMenu().findItem(R.e.navigation_library).setChecked(true);
            }
            C0532a c0532a6 = ActivityMain.this.f393v;
            if (c0532a6 == null) {
                m.w("viewBinding");
            } else {
                c0532a = c0532a6;
            }
            h b = b(c0532a.f1187h.getCurrentItem());
            if (b != null) {
                b.i();
            }
        }
    }

    public static final class c implements View.OnApplyWindowInsetsListener {
        private Integer a;

        c() {
        }

        @Override
        public WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets) {
            int paddingBottom;
            Insets of;
            m.e(view, "v");
            m.e(windowInsets, "insets");
            Insets a = F0.a(windowInsets, WindowInsetsCompat.Type.systemBars());
            m.d(a, "getInsets(...)");
            Integer num = this.a;
            if (num != null) {
                paddingBottom = num.intValue();
            } else {
                paddingBottom = view.getPaddingBottom();
                this.a = Integer.valueOf(paddingBottom);
            }
            C0532a c0532a = ActivityMain.this.f393v;
            if (c0532a == null) {
                m.w("viewBinding");
                c0532a = null;
            }
            View view2 = c0532a.f1186g;
            m.d(view2, "systemNavBarBg");
            ViewGroup.LayoutParams layoutParams = view2.getLayoutParams();
            if (layoutParams == null) {
                throw new NullPointerException("null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
            }
            ConstraintLayout.LayoutParams layoutParams2 = (ConstraintLayout.LayoutParams) layoutParams;
            ((ViewGroup.MarginLayoutParams) layoutParams2).height = H.a(a);
            view2.setLayoutParams(layoutParams2);
            view.setPadding(view.getPaddingLeft(), view.getPaddingTop(), view.getPaddingRight(), paddingBottom + H.a(a));
            of = Insets.of(E.a(a), F.a(a), G.a(a), 0);
            m.d(of, "of(...)");
            WindowInsets a2 = p0.a(v0.a(t0.a(windowInsets), WindowInsetsCompat.Type.systemBars(), of));
            m.d(a2, "build(...)");
            return a2;
        }
    }

    public static final class d extends Z.a {
        d() {
        }

        public void onNext(TfsProfile tfsProfile) {
            m.e(tfsProfile, "tfsProfile");
            ArrayList j1 = ActivityMain.this.j1(tfsProfile);
            if (ActivityMain.this.f394w != null) {
                b bVar = ActivityMain.this.f394w;
                if (m.a(j1, bVar != null ? bVar.f() : null)) {
                    return;
                }
                ActivityMain.this.m1(true);
            }
        }

        public void onSubscribe(m0.c cVar) {
            m.e(cVar, "d");
            ActivityMain.this.l(cVar);
        }
    }

    static final class e implements Observer, kotlin.jvm.internal.h {
        private final l a;

        e(l lVar) {
            m.e(lVar, "function");
            this.a = lVar;
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof Observer) && (obj instanceof kotlin.jvm.internal.h)) {
                return m.a(getFunctionDelegate(), ((kotlin.jvm.internal.h) obj).getFunctionDelegate());
            }
            return false;
        }

        public final L0.c getFunctionDelegate() {
            return this.a;
        }

        public final int hashCode() {
            return getFunctionDelegate().hashCode();
        }

        public final void onChanged(Object obj) {
            this.a.invoke(obj);
        }
    }

    public final ArrayList j1(TfsProfile tfsProfile) {
        ArrayList arrayList = new ArrayList();
        if (AbstractC0461d.c.booleanValue()) {
            arrayList.add(0);
        } else {
            if ((tfsProfile != null ? tfsProfile.allowed : null) == null) {
                arrayList.add(0);
                arrayList.add(1);
                arrayList.add(2);
            } else {
                TfsProfile.ProfileAllowedMap profileAllowedMap = tfsProfile.allowed;
                if (n.k(profileAllowedMap != null ? profileAllowedMap.music : null)) {
                    arrayList.add(0);
                }
                TfsProfile.ProfileAllowedMap profileAllowedMap2 = tfsProfile.allowed;
                if (n.k(profileAllowedMap2 != null ? profileAllowedMap2.video : null)) {
                    arrayList.add(1);
                }
                TfsProfile.ProfileAllowedMap profileAllowedMap3 = tfsProfile.allowed;
                if (n.k(profileAllowedMap3 != null ? profileAllowedMap3.podcast : null)) {
                    arrayList.add(2);
                }
            }
        }
        arrayList.add(3);
        return arrayList;
    }

    private final void k1(Uri uri) {
        ArrayList f2;
        ArrayList f3;
        ArrayList f4;
        if (uri == null || !m.a(uri.getHost(), "24six.app")) {
            return;
        }
        List<String> pathSegments = uri.getPathSegments();
        if (m.a(pathSegments.get(0), "preview") || m.a(pathSegments.get(0), "app")) {
            String str = pathSegments.size() > 1 ? pathSegments.get(1) : "music";
            C0532a c0532a = null;
            if (m.a("music", str)) {
                b bVar = this.f394w;
                if (bVar == null || (f4 = bVar.f()) == null || !f4.contains(0)) {
                    return;
                }
                C0532a c0532a2 = this.f393v;
                if (c0532a2 == null) {
                    m.w("viewBinding");
                    c0532a2 = null;
                }
                if (c0532a2.f1187h.getCurrentItem() != 0) {
                    C0532a c0532a3 = this.f393v;
                    if (c0532a3 == null) {
                        m.w("viewBinding");
                    } else {
                        c0532a = c0532a3;
                    }
                    c0532a.f1187h.setCurrentItem(0, true);
                }
            } else if (m.a("podcast", str)) {
                b bVar2 = this.f394w;
                if (bVar2 == null || (f3 = bVar2.f()) == null || !f3.contains(2)) {
                    return;
                }
                C0532a c0532a4 = this.f393v;
                if (c0532a4 == null) {
                    m.w("viewBinding");
                    c0532a4 = null;
                }
                if (c0532a4.f1187h.getCurrentItem() != 2) {
                    C0532a c0532a5 = this.f393v;
                    if (c0532a5 == null) {
                        m.w("viewBinding");
                    } else {
                        c0532a = c0532a5;
                    }
                    c0532a.f1187h.setCurrentItem(2, true);
                }
            } else if (m.a("video", str)) {
                b bVar3 = this.f394w;
                if (bVar3 == null || (f2 = bVar3.f()) == null || !f2.contains(1)) {
                    return;
                }
                C0532a c0532a6 = this.f393v;
                if (c0532a6 == null) {
                    m.w("viewBinding");
                    c0532a6 = null;
                }
                if (c0532a6.f1187h.getCurrentItem() != 1) {
                    C0532a c0532a7 = this.f393v;
                    if (c0532a7 == null) {
                        m.w("viewBinding");
                    } else {
                        c0532a = c0532a7;
                    }
                    c0532a.f1187h.setCurrentItem(1, true);
                }
            }
            m.c(this, "null cannot be cast to non-null type app.tfs.activity.AppActivityMediaManager");
            A0(uri);
        }
    }

    public static final v l1(ActivityMain activityMain, Boolean bool) {
        C0532a c0532a = null;
        if (n.k(bool)) {
            C0532a c0532a2 = activityMain.f393v;
            if (c0532a2 == null) {
                m.w("viewBinding");
            } else {
                c0532a = c0532a2;
            }
            c0532a.d.b.i();
        } else {
            C0532a c0532a3 = activityMain.f393v;
            if (c0532a3 == null) {
                m.w("viewBinding");
            } else {
                c0532a = c0532a3;
            }
            c0532a.d.b.e();
        }
        return v.a;
    }

    public final void m1(boolean z2) {
        b bVar = this.f394w;
        C0532a c0532a = null;
        if (bVar != null) {
            C0532a c0532a2 = this.f393v;
            if (c0532a2 == null) {
                m.w("viewBinding");
                c0532a2 = null;
            }
            c0532a2.f1187h.removeOnPageChangeListener(bVar);
        }
        ?? bVar2 = new b(getSupportFragmentManager(), (TfsProfile) C0458a.f992h.a());
        this.f394w = bVar2;
        C0532a c0532a3 = this.f393v;
        if (c0532a3 == null) {
            m.w("viewBinding");
            c0532a3 = null;
        }
        c0532a3.f1187h.setOffscreenPageLimit(99);
        C0532a c0532a4 = this.f393v;
        if (c0532a4 == null) {
            m.w("viewBinding");
            c0532a4 = null;
        }
        c0532a4.f1187h.setAdapter(bVar2);
        C0532a c0532a5 = this.f393v;
        if (c0532a5 == null) {
            m.w("viewBinding");
            c0532a5 = null;
        }
        c0532a5.f1187h.addOnPageChangeListener(bVar2);
        if (z2) {
            while (true) {
                C0532a c0532a6 = this.f393v;
                if (c0532a6 == null) {
                    m.w("viewBinding");
                    c0532a6 = null;
                }
                if (c0532a6.e.getMenu().size() <= 0) {
                    break;
                }
                C0532a c0532a7 = this.f393v;
                if (c0532a7 == null) {
                    m.w("viewBinding");
                    c0532a7 = null;
                }
                Menu menu = c0532a7.e.getMenu();
                C0532a c0532a8 = this.f393v;
                if (c0532a8 == null) {
                    m.w("viewBinding");
                    c0532a8 = null;
                }
                menu.removeItem(c0532a8.e.getMenu().getItem(0).getItemId());
            }
            C0532a c0532a9 = this.f393v;
            if (c0532a9 == null) {
                m.w("viewBinding");
                c0532a9 = null;
            }
            c0532a9.e.inflateMenu(R.h.bottom_nav_menu);
        }
        C0532a c0532a10 = this.f393v;
        if (c0532a10 == null) {
            m.w("viewBinding");
            c0532a10 = null;
        }
        c0532a10.e.setOnItemSelectedListener(bVar2);
        C0532a c0532a11 = this.f393v;
        if (c0532a11 == null) {
            m.w("viewBinding");
            c0532a11 = null;
        }
        c0532a11.e.setOnItemReselectedListener(bVar2);
        if (!bVar2.f().contains(0)) {
            C0532a c0532a12 = this.f393v;
            if (c0532a12 == null) {
                m.w("viewBinding");
                c0532a12 = null;
            }
            c0532a12.e.getMenu().removeItem(R.e.navigation_music);
        }
        if (!bVar2.f().contains(1)) {
            C0532a c0532a13 = this.f393v;
            if (c0532a13 == null) {
                m.w("viewBinding");
                c0532a13 = null;
            }
            c0532a13.e.getMenu().removeItem(R.e.navigation_video);
        }
        if (!bVar2.f().contains(2)) {
            C0532a c0532a14 = this.f393v;
            if (c0532a14 == null) {
                m.w("viewBinding");
                c0532a14 = null;
            }
            c0532a14.e.getMenu().removeItem(R.e.navigation_podcasts);
        }
        C0532a c0532a15 = this.f393v;
        if (c0532a15 == null) {
            m.w("viewBinding");
        } else {
            c0532a = c0532a15;
        }
        c0532a.e.postDelayed(new Runnable() {
            @Override
            public final void run() {
                ActivityMain.n1(ActivityMain.this);
            }
        }, 200L);
    }

    public static final void n1(ActivityMain activityMain) {
        C0636p p2 = activityMain.p();
        if (p2 instanceof C0636p) {
            h.c N = p2.N();
            if (N instanceof h.c) {
                N.i();
            }
        }
        activityMain.k1(activityMain.getIntent().getData());
    }

    @Override
    public f A(boolean z2) {
        f q2;
        if (!z2 && (q2 = q(R.e.fragmentContainerViewOverlay)) != null) {
            return q2;
        }
        C0636p p2 = p();
        if (!(p2 instanceof C0636p)) {
            return null;
        }
        f N = p2.N();
        if (N instanceof f) {
            return N;
        }
        return null;
    }

    @Override
    public void C0() {
        FragmentNowPlaying findFragmentById = getSupportFragmentManager().findFragmentById(R.e.fragmentContainerNowPlaying);
        if (findFragmentById instanceof FragmentNowPlaying) {
            findFragmentById.t1();
        }
    }

    @Override
    protected void E() {
        super.E();
        try {
            C0();
            if (q(R.e.fragmentContainerViewOverlay) != null) {
                s(R.e.fragmentContainerViewOverlay, (Fragment) null);
            }
            C0532a c0532a = this.f393v;
            if (c0532a == null) {
                m.w("viewBinding");
                c0532a = null;
            }
            c0532a.f1187h.setCurrentItem(0, true);
            b bVar = this.f394w;
            h b2 = bVar != null ? bVar.b(0) : null;
            if (b2 == null || !b2.isResumed()) {
                return;
            }
            b2.P(true);
        } catch (Throwable th) {
            k.d("ActivityMain", "Error in onTfsHomeButtonReceived", th);
        }
    }

    public Fragment a(int i2) {
        b bVar = this.f394w;
        if (bVar == null) {
            return null;
        }
        if (i2 == bVar.f().indexOf(0)) {
            return p.f734H.b("music");
        }
        if (i2 == bVar.f().indexOf(1)) {
            return p.f734H.b("video");
        }
        if (i2 == bVar.f().indexOf(2)) {
            return p.f734H.b("podcast");
        }
        if (i2 == bVar.f().indexOf(3)) {
            return o.f716y.a();
        }
        return null;
    }

    @Override
    public void b1() {
        FragmentNowPlaying findFragmentById = getSupportFragmentManager().findFragmentById(R.e.fragmentContainerNowPlaying);
        if (findFragmentById instanceof FragmentNowPlaying) {
            findFragmentById.h2();
        }
    }

    protected boolean i() {
        boolean z2;
        if (q(R.e.fragmentContainerViewSplash) != null) {
            return false;
        }
        f q2 = q(R.e.fragmentContainerViewOverlay);
        C0532a c0532a = null;
        if (q2 == null) {
            z2 = false;
        } else if (q2.u()) {
            z2 = q2.F();
        } else {
            s(R.e.fragmentContainerViewOverlay, (Fragment) null);
            z2 = true;
        }
        if (!z2) {
            FragmentNowPlaying findFragmentById = getSupportFragmentManager().findFragmentById(R.e.fragmentContainerNowPlaying);
            if (findFragmentById instanceof FragmentNowPlaying) {
                z2 = findFragmentById.s1();
            }
        }
        if (!z2) {
            f p2 = p();
            z2 = p2 != null && p2.F();
        }
        if (!z2 && this.f394w != null) {
            C0532a c0532a2 = this.f393v;
            if (c0532a2 == null) {
                m.w("viewBinding");
                c0532a2 = null;
            }
            if (c0532a2.f1187h.getCurrentItem() != 0) {
                C0532a c0532a3 = this.f393v;
                if (c0532a3 == null) {
                    m.w("viewBinding");
                } else {
                    c0532a = c0532a3;
                }
                c0532a.f1187h.setCurrentItem(0, true);
                z2 = true;
            }
        }
        if (z2 || !AbstractC0461d.b.booleanValue() || q2 != null) {
            return z2;
        }
        f p3 = p();
        if (p3 == null || !p3.u()) {
            return true;
        }
        return z2;
    }

    public String m() {
        return "ActivityMain";
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        C0532a c2 = C0532a.c(getLayoutInflater());
        this.f393v = c2;
        C0532a c0532a = null;
        if (c2 == null) {
            m.w("viewBinding");
            c2 = null;
        }
        setContentView(c2.getRoot());
        if (Build.VERSION.SDK_INT >= 35) {
            C0532a c0532a2 = this.f393v;
            if (c0532a2 == null) {
                m.w("viewBinding");
                c0532a2 = null;
            }
            c0532a2.e.setFitsSystemWindows(false);
            C0532a c0532a3 = this.f393v;
            if (c0532a3 == null) {
                m.w("viewBinding");
            } else {
                c0532a = c0532a3;
            }
            c0532a.b.setOnApplyWindowInsetsListener(new c());
        }
        m1(false);
        C().a.observe(this, new e(new l() {
            public final Object invoke(Object obj) {
                L0.v l1;
                l1 = ActivityMain.l1(ActivityMain.this, (Boolean) obj);
                return l1;
            }
        }));
        if (m.a(C0458a.f997m.g("not_needed"), "needed")) {
            new r().F(this);
        }
        m.d.a.b().subscribeOn(k0.c.d()).observeOn(k0.c.d()).subscribe(new d());
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        if (intent == null || intent.getData() == null) {
            return;
        }
        k1(intent.getData());
    }

    public f p() {
        b bVar = this.f394w;
        C0532a c0532a = null;
        if (bVar == null || bVar == null) {
            return null;
        }
        C0532a c0532a2 = this.f393v;
        if (c0532a2 == null) {
            m.w("viewBinding");
        } else {
            c0532a = c0532a2;
        }
        return bVar.b(c0532a.f1187h.getCurrentItem());
    }

    @Override
    public LinearLayout u0() {
        C0532a c0532a = this.f393v;
        if (c0532a == null) {
            m.w("viewBinding");
            c0532a = null;
        }
        LinearLayout linearLayout = c0532a.f1185f.c;
        m.d(linearLayout, "layoutBottomSheet");
        return linearLayout;
    }

    @Override
    public BottomNavigationView v0() {
        C0532a c0532a = this.f393v;
        if (c0532a == null) {
            m.w("viewBinding");
            c0532a = null;
        }
        BottomNavigationView bottomNavigationView = c0532a.e;
        m.d(bottomNavigationView, "navView");
        return bottomNavigationView;
    }

    @Override
    public View x0() {
        C0532a c0532a = this.f393v;
        if (c0532a == null) {
            m.w("viewBinding");
            c0532a = null;
        }
        View view = c0532a.f1186g;
        m.d(view, "systemNavBarBg");
        return view;
    }

    @Override
    public void y0() {
        if (this.f394w != null) {
            C0532a c0532a = this.f393v;
            C0532a c0532a2 = null;
            if (c0532a == null) {
                m.w("viewBinding");
                c0532a = null;
            }
            if (c0532a.f1187h.getCurrentItem() != 3) {
                C0532a c0532a3 = this.f393v;
                if (c0532a3 == null) {
                    m.w("viewBinding");
                } else {
                    c0532a2 = c0532a3;
                }
                c0532a2.f1187h.setCurrentItem(3, true);
            }
        }
    }
}