导航菜单

页面标题

页面副标题

MX Player v1.97.8 - InboxCommentsFragment.java 源代码

正在查看: MX Player v1.97.8 应用的 InboxCommentsFragment.java JAVA 源代码文件

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


package com.mxtech.videoplayer.ad.online.features.inbox;

import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.m;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.m.x.player.pandora.box.StatusCodeException;
import com.m.x.player.pandora.common.fromstack.FromStack;
import com.mxplay.login.model.UserInfo;
import com.mxplay.login.open.ILoginCallback;
import com.mxtech.annotation.NotProguard;
import com.mxtech.videoplayer.ad.online.features.inbox.InboxCommentsFragment;
import com.mxtech.videoplayer.ad.online.features.inbox.g;
import com.mxtech.videoplayer.ad.utils.GsonUtil;
import com.mxtech.videoplayer.ad.view.list.MXRecyclerView;
import defpackage.a34;
import defpackage.e73;
import defpackage.gh;
import defpackage.h3i;
import defpackage.i0g;
import defpackage.m09;
import defpackage.n83;
import defpackage.o09;
import defpackage.r09;
import defpackage.s09;
import defpackage.shc;
import defpackage.t09;
import defpackage.u09;
import defpackage.xe0;
import defpackage.z09;
import defpackage.zra;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.jvm.JvmClassMappingKt;

public class InboxCommentsFragment extends Fragment implements o09, a34.b, ILoginCallback, zra.b {
    public View b;
    public View c;
    public View f;
    public MXRecyclerView g;
    public mxb h;
    public d i;
    public n83 j;
    public shc k;
    public boolean m;
    public Handler p;
    public List<e73> l = new ArrayList();
    public int n = 0;
    public boolean o = false;
    public final gh q = new gh(this, 3);

    @NotProguard
    public static class ViewedCommentBean {
        private Long[] ts;

        public ViewedCommentBean(Long[] lArr) {
            this.ts = lArr;
        }
    }

    public class a implements Runnable {
        public a() {
        }

        @Override
        public final void run() {
            InboxCommentsFragment inboxCommentsFragment = InboxCommentsFragment.this;
            inboxCommentsFragment.n = inboxCommentsFragment.k9(inboxCommentsFragment.g);
        }
    }

    @Override
    public final void J2() {
        d dVar = this.i;
        if (dVar.k == null) {
            dVar.k = new c3c<>();
        }
        dVar.k.setValue(Boolean.TRUE);
        this.m = false;
    }

    @Override
    public final void P3(a34 a34Var, boolean z) {
        this.f.setVisibility(8);
        this.g.W0();
        this.g.X0();
        if (a34Var.cloneData().size() == 0) {
            this.b.setVisibility(0);
            this.i.w().setValue(Boolean.TRUE);
        } else {
            this.b.setVisibility(8);
            this.i.w().setValue(Boolean.FALSE);
        }
        mxb mxbVar = this.h;
        this.l = mxbVar.i;
        mxbVar.i = a34Var.cloneData();
        boolean booleanValue = this.i.x().getValue() == null ? false : ((Boolean) this.i.x().getValue()).booleanValue();
        Iterator it = j9().iterator();
        while (it.hasNext()) {
            e73 e73Var = (e73) it.next();
            e73Var.j = booleanValue;
            List<e73> list = this.l;
            if (list != null && list.size() > 0) {
                Iterator<e73> it2 = this.l.iterator();
                while (true) {
                    if (it2.hasNext()) {
                        e73 next = it2.next();
                        if (e73Var.b.equals(next.b)) {
                            e73Var.j = next.j;
                            break;
                        }
                    }
                }
            }
        }
        l9(this.i.t().getValue() == null ? false : ((Boolean) this.i.t().getValue()).booleanValue());
        this.h.notifyDataSetChanged();
        List cloneData = a34Var.cloneData();
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < cloneData.size(); i++) {
            Object obj = cloneData.get(i);
            if (obj instanceof e73) {
                e73 e73Var2 = (e73) obj;
                if (e73Var2.h == 1) {
                    arrayList.add(e73Var2);
                }
            }
        }
        this.i.v().setValue(arrayList);
        if (z) {
            this.p.postDelayed(new a(), 100L);
        }
    }

    @Override
    public final void V0(a34 a34Var, Throwable th) {
        this.g.W0();
        this.g.X0();
        if (!(th instanceof IOException) || (th instanceof StatusCodeException)) {
            return;
        }
        this.f.setVisibility(0);
    }

    public final ArrayList j9() {
        ArrayList arrayList = new ArrayList();
        mxb mxbVar = this.h;
        if (mxbVar == null) {
            return arrayList;
        }
        List list = mxbVar.i;
        int itemCount = mxbVar.getItemCount();
        if (itemCount > 0 && (list.get(itemCount - 1) instanceof e73)) {
            arrayList.addAll(list.subList(0, itemCount));
        } else if (itemCount > 0) {
            int i = itemCount - 1;
            if (list.get(i) instanceof ui6) {
                arrayList.addAll(list.subList(0, i));
            }
        }
        return arrayList;
    }

    public final int k9(@NonNull RecyclerView recyclerView) {
        LinearLayoutManager layoutManager = recyclerView.getLayoutManager();
        int h1 = layoutManager instanceof LinearLayoutManager ? layoutManager.h1() : 0;
        ArrayList arrayList = new ArrayList();
        List list = this.h.i;
        for (int i = 0; i < h1 + 1; i++) {
            Object obj = list.get(i);
            if (obj instanceof e73) {
                e73 e73Var = (e73) obj;
                if (e73Var.h == 1) {
                    arrayList.add(Long.valueOf(e73Var.d));
                    e73Var.h = 0;
                }
            }
        }
        if (arrayList.size() > 0) {
            xe0.c cVar = new xe0.c();
            cVar.a = "https://androidapi.mxplay.com/v1/message/view_comment";
            cVar.d = GsonUtil.a().toJson(new ViewedCommentBean((Long[]) arrayList.toArray(new Long[arrayList.size()])));
            cVar.b = "POST";
            new xe0(cVar).d(new u09());
        }
        int i2 = this.n;
        List list2 = this.h.i;
        if (list2 != null && list2.size() != 0) {
            ArrayList arrayList2 = new ArrayList();
            for (Object obj2 : list2) {
                if (obj2 instanceof e73) {
                    arrayList2.add((e73) obj2);
                }
            }
            g.a.b bVar = g.a.b;
            m09 m09Var = new m09();
            if (i2 != h1 && h1 >= 0 && i2 >= 0) {
                m09Var.c(arrayList2, i2, h1);
                d0d.g1("MX Social", String.valueOf(Math.abs(h1 - i2) + 1), "internal", m09Var.g, (String) null, (String) null, m09Var.f);
            }
        }
        return h1;
    }

    public final void l9(boolean z) {
        ArrayList j9 = j9();
        Iterator it = j9.iterator();
        while (it.hasNext()) {
            ((e73) it.next()).i = z;
        }
        this.i.y().setValue(j9);
    }

    public final void onCreate(Bundle bundle) {
        aii c;
        super.onCreate(bundle);
        m activity = getActivity();
        gii giiVar = new gii();
        kii viewModelStore = activity.getViewModelStore();
        gw3 defaultViewModelCreationExtras = activity.getDefaultViewModelCreationExtras();
        mu9 kotlinClass = JvmClassMappingKt.getKotlinClass(d.class);
        String k = kotlinClass.k();
        if (k == null) {
            throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
        }
        String concat = "androidx.lifecycle.ViewModelProvider.DefaultKey:".concat(k);
        aii b = viewModelStore.b(concat);
        if (!kotlinClass.i(b)) {
            o2c o2cVar = new o2c(defaultViewModelCreationExtras);
            o2cVar.a(jii.a, concat);
            try {
                try {
                    c = giiVar.b(kotlinClass, o2cVar);
                } catch (AbstractMethodError unused) {
                    c = giiVar.c(JvmClassMappingKt.getJavaClass(kotlinClass));
                }
            } catch (AbstractMethodError unused2) {
                c = giiVar.a(JvmClassMappingKt.getJavaClass(kotlinClass), o2cVar);
            }
            b = c;
            aii aiiVar = (aii) viewModelStore.a.put(concat, b);
            if (aiiVar != null) {
                aiiVar.clear$lifecycle_viewmodel_release();
            }
        }
        this.i = (d) b;
        getActivity();
        n83 n83Var = new n83();
        n83.a aVar = new n83.a();
        n83Var.a = aVar;
        aVar.registerSourceListener(this);
        this.j = n83Var;
        if (h3i.a.a.c()) {
            this.j.a.loadNext();
        }
        d dVar = this.i;
        if (dVar.j == null) {
            dVar.j = new c3c<>();
        }
        final int i = 0;
        dVar.j.observe(getActivity(), new hrc() {
            public final void a(Object obj) {
                switch (i) {
                    case 0:
                        InboxCommentsFragment inboxCommentsFragment = (InboxCommentsFragment) this;
                        inboxCommentsFragment.getClass();
                        if (((Boolean) obj).booleanValue()) {
                            inboxCommentsFragment.j.a.reload();
                            break;
                        }
                        break;
                    default:
                        this.v9(true);
                        break;
                }
            }
        });
        d dVar2 = this.i;
        if (dVar2.m == null) {
            dVar2.m = new c3c<>();
        }
        dVar2.m.observe(getActivity(), new hrc() {
            public final void a(Object obj) {
                InboxCommentsFragment inboxCommentsFragment = InboxCommentsFragment.this;
                inboxCommentsFragment.getClass();
                inboxCommentsFragment.f.setVisibility(((Boolean) obj).booleanValue() ? 0 : 8);
            }
        });
        this.p = new Handler();
    }

    public final View onCreateView(@NonNull LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(2131558997, viewGroup, false);
        this.b = inflate.findViewById(2131364005);
        this.f = inflate.findViewById(2131365168);
        View findViewById = inflate.findViewById(2131362416);
        this.c = findViewById;
        findViewById.setOnClickListener(new r09(this));
        MXRecyclerView findViewById2 = inflate.findViewById(2131364012);
        this.g = findViewById2;
        getContext();
        findViewById2.setLayoutManager(new LinearLayoutManager(1));
        mxb mxbVar = new mxb();
        this.h = mxbVar;
        mxbVar.g(e73.class, new z09(getActivity(), this));
        this.g.setAdapter(this.h);
        mmc mmcVar = new mmc(getContext());
        mmcVar.i(i0g.b().d().m(getContext(), 2131100951), getResources().getDimensionPixelSize(2131165639));
        this.g.j(mmcVar, -1);
        this.g.setOnActionListener(new s09(this));
        getContext();
        this.k = new shc(this.q);
        this.g.m(new t09(this));
        return inflate;
    }

    public final void onDestroy() {
        super.onDestroy();
        shc shcVar = this.k;
        if (shcVar != null) {
            shcVar.e();
            this.k.c();
        }
    }

    public final void onPause() {
        super.onPause();
        if (this.h == null || getActivity().isFinishing() || this.o) {
            return;
        }
        this.h.notifyDataSetChanged();
    }

    @Override
    public final boolean onPrepareRequest() {
        return false;
    }

    public final void onResume() {
        super.onResume();
        if (!h3i.a.a.c() && !this.m) {
            zra t9 = zra.t9(FromStack.empty(), "commentList");
            t9.E9(getActivity());
            t9.m = this;
            t9.o = this;
            this.m = true;
            g.a.b bVar = g.a.b;
            d0d.w1("MX Social", "yes");
        }
        MXRecyclerView mXRecyclerView = this.g;
        if (mXRecyclerView != null) {
            this.n = k9(mXRecyclerView);
            this.o = false;
        }
    }

    public final void onStart() {
        super.onStart();
        shc shcVar = this.k;
        if (shcVar != null) {
            shcVar.d();
        }
    }

    @Override
    public final void onSucceed(UserInfo userInfo) {
        this.m = false;
        if (userInfo != null) {
            this.j.a.loadNext();
        }
    }

    @Override
    public final void onCancelled() {
    }

    @Override
    public final void onFailed() {
    }

    @Override
    public final void E(a34 a34Var) {
    }

    @Override
    public final void p(a34 a34Var) {
    }
}