导航菜单

页面标题

页面副标题

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

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

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


package com.mxtech.videoplayer.ad.online.features.download.view;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;
import com.m.x.player.pandora.common.fromstack.FromStack;
import com.mxtech.videoplayer.ad.online.model.bean.Feed;
import com.mxtech.videoplayer.ad.online.model.bean.next.OnlineResource;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceFlow;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceStyle;
import com.mxtech.videoplayer.ad.view.list.MXRecyclerView;
import defpackage.ccf;
import defpackage.nz4;
import defpackage.pn7;
import defpackage.rt4;
import defpackage.xe0;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class RecommendCardsLayout extends FrameLayout {
    public static final int q = 0;
    public final Context b;
    public xe0<ResourceFlow> c;
    public wmc d;
    public final View f;
    public final MXRecyclerView g;
    public final AppCompatTextView h;
    public boolean i;
    public List<OnlineResource> j;
    public mxb k;
    public rt4 l;
    public String m;
    public Activity n;
    public FromStack o;
    public final b p;

    public class a implements OnlineResource.ClickListener {
        public a() {
        }

        @Override
        public final void bindData(OnlineResource onlineResource, int i) {
            RecommendCardsLayout recommendCardsLayout = RecommendCardsLayout.this;
            wmc wmcVar = recommendCardsLayout.d;
            if (wmcVar != null) {
                String str = recommendCardsLayout.m;
                d0d.k1(onlineResource, wmcVar.c, wmcVar.d, wmcVar.f, i, str);
            }
        }

        @Override
        public final void onClick(OnlineResource onlineResource, int i) {
            RecommendCardsLayout recommendCardsLayout = RecommendCardsLayout.this;
            wmc wmcVar = recommendCardsLayout.d;
            if (wmcVar != null) {
                String str = recommendCardsLayout.m;
                if (onlineResource == null) {
                    return;
                }
                lmc.c(wmcVar.b, onlineResource, wmcVar.c, wmcVar.d, i, (String) null, wmcVar.f, wmcVar.g, str);
            }
        }
    }

    public class b extends pn7<ResourceFlow> {
        public b() {
            super(ResourceFlow.class);
        }

        @Override
        public final void a(xe0 xe0Var, Throwable th) {
            RecommendCardsLayout.this.c = null;
        }

        @Override
        public final void c(xe0 xe0Var, Object obj) {
            ResourceFlow resourceFlow = (ResourceFlow) obj;
            RecommendCardsLayout recommendCardsLayout = RecommendCardsLayout.this;
            recommendCardsLayout.c = null;
            if (ti.n(resourceFlow.getResourceList())) {
                return;
            }
            List<OnlineResource> resourceList = resourceFlow.getResourceList();
            recommendCardsLayout.j = resourceList;
            int size = resourceList.size();
            int i = RecommendCardsLayout.q;
            if (size < 4) {
                return;
            }
            recommendCardsLayout.f.setVisibility(0);
            fuh.g(recommendCardsLayout.h, resourceFlow.getName());
            if (recommendCardsLayout.n == null) {
                return;
            }
            if (recommendCardsLayout.d == null) {
                FromStack newAndPush = recommendCardsLayout.o.newAndPush(pzh.c(resourceFlow));
                recommendCardsLayout.o = newAndPush;
                recommendCardsLayout.k.g(Feed.class, new nz4((Activity) recommendCardsLayout.b, null, newAndPush, recommendCardsLayout.l));
                recommendCardsLayout.d = new wmc(recommendCardsLayout.n, (OnlineResource) null, (OnlineResource) null, recommendCardsLayout.o, (ccf) null);
            }
            mxb mxbVar = recommendCardsLayout.k;
            mxbVar.i = recommendCardsLayout.j;
            mxbVar.notifyDataSetChanged();
        }
    }

    public RecommendCardsLayout(@NonNull Context context) {
        this(context, null);
    }

    @Override
    public final void onDetachedFromWindow() {
        super.onDetachedFromWindow();
    }

    public void setModeListener(rt4 rt4Var) {
        this.l = rt4Var;
    }

    @Override
    public void setVisibility(int i) {
        xe0<ResourceFlow> xe0Var;
        super.setVisibility(i);
        if (i != 8 || (xe0Var = this.c) == null) {
            return;
        }
        xe0Var.c();
        this.c = null;
    }

    public void setupViews(Activity activity, FromStack fromStack, String str) {
        this.n = activity;
        this.o = fromStack;
        if (this.i) {
            this.i = false;
            mxb mxbVar = new mxb();
            this.k = mxbVar;
            this.g.setAdapter(mxbVar);
            this.f.setVisibility(8);
        }
        xe0<ResourceFlow> xe0Var = this.c;
        if (xe0Var != null) {
            xe0Var.c();
            this.c = null;
        }
        xe0.c cVar = new xe0.c();
        cVar.a = "https://androidapi.mxplay.com/v1/downloads_recommend";
        cVar.c(Collections.emptyMap(), "resources");
        cVar.b = "POST";
        xe0<ResourceFlow> xe0Var2 = new xe0<>(cVar);
        this.c = xe0Var2;
        xe0Var2.d(this.p);
        this.m = str;
    }

    public RecommendCardsLayout(@NonNull Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public RecommendCardsLayout(@NonNull Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.i = true;
        this.j = new ArrayList();
        this.p = new b();
        this.b = context;
        View inflate = View.inflate(context, 2131559506, this);
        this.f = inflate;
        MXRecyclerView findViewById = inflate.findViewById(2131365597);
        this.g = findViewById;
        findViewById.setLayoutManager(oie.a(this.k, ResourceStyle.COLUMNx3_VERTICAL));
        findViewById.j(f74.e(context), -1);
        findViewById.T0();
        findViewById.S0();
        findViewById.setListener(new a());
        AppCompatTextView findViewById2 = findViewById(2131366977);
        this.h = findViewById2;
        findViewById2.setVisibility(8);
    }
}