红果免费短剧 v6.2.3.32版本的 MD5 值为:a6b05492607eab2c8a25f26d2f238ae0

以下内容为反编译后的 s.java 源代码,内容仅作参考


package com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.holder;

import android.app.Application;
import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.admetaversesdk.adbase.utils.ScreenUtils;
import com.bytedance.apm.agent.v2.instrumentation.ClickAgent;
import com.dragon.read.NsCommonDepend;
import com.dragon.read.app.App;
import com.dragon.read.base.Args;
import com.dragon.read.base.skin.SkinDelegate;
import com.dragon.read.base.ssconfig.template.aer;
import com.dragon.read.base.util.JSONUtils;
import com.dragon.read.base.util.LogWrapper;
import com.dragon.read.component.biz.api.NsBookmallDepend;
import com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.StaggeredPagerInfiniteHolder;
import com.dragon.read.component.interfaces.ay;
import com.dragon.read.pages.bookmall.model.BookMallCellModel;
import com.dragon.read.recyler.AbsRecyclerViewHolder;
import com.dragon.read.recyler.IHolderFactory;
import com.dragon.read.recyler.RecyclerClient;
import com.dragon.read.report.PageRecorder;
import com.dragon.read.rpc.model.BottomTabBarItemType;
import com.dragon.read.util.ImageLoaderUtils;
import com.dragon.read.util.ad;
import com.dragon.read.util.df;
import com.dragon.read.util.kotlin.UIKt;
import com.dragon.read.widget.viewpager.AutoViewPager;
import com.facebook.drawee.view.SimpleDraweeView;
import com.phoenix.read.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;

public final class s extends com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.holder.a<StaggeredUgcModel> {

    public final ViewGroup f52473a;

    public final com.dragon.read.base.impression.a f52474b;

    public final StaggeredPagerInfiniteHolder.c f52475c;
    public final com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.b h;
    private final SimpleDraweeView i;
    private final TextView j;
    private final AutoViewPager<List<BookMallCellModel.TopicItemModel>> k;
    private final ad l;

    @Override
    public void a() {
        super.a();
        a((String) null);
    }

    @Override
    protected void g() {
        this.l.a();
    }

    @Override
    protected void f() {
        this.l.a(BottomTabBarItemType.BookStore.getValue(), this.k);
    }

    private final boolean c() {
        if (((StaggeredUgcModel) getBoundData()).getTopicItemModelList().size() > 3) {
            return true;
        }
        return false;
    }

    private final List<List<BookMallCellModel.TopicItemModel>> n() {
        List<BookMallCellModel.TopicItemModel> topicItemModelList = ((StaggeredUgcModel) getBoundData()).getTopicItemModelList();
        ArrayList arrayList = new ArrayList();
        int size = (topicItemModelList.size() + 2) / 3;
        for (int i = 0; i < size; i++) {
            if (i == size - 1) {
                arrayList.add(topicItemModelList.subList(i * 3, topicItemModelList.size()));
            } else {
                arrayList.add(topicItemModelList.subList(i * 3, (i + 1) * 3));
            }
        }
        return arrayList;
    }

    @Override
    public Args d() {
        Object obj;
        Args a2;
        Args put = super.d().put("unlimited_content_type", "hot_topic");
        StaggeredPagerInfiniteHolder.c cVar = this.f52475c;
        if (cVar != null && (a2 = cVar.a()) != null) {
            obj = a2.get("category_name");
        } else {
            obj = null;
        }
        Args put2 = put.put("category_name", obj).put("recommend_info", ((StaggeredUgcModel) getBoundData()).getImpressionRecommendInfo());
        Intrinsics.checkNotNullExpressionValue(put2, "super.getPrimaryArgs()\n ….impressionRecommendInfo)");
        return put2;
    }

    private final class a extends com.dragon.read.recyler.f<BookMallCellModel.TopicItemModel> {

        public final SimpleDraweeView f52476a;

        public final TextView f52477b;

        public final TextView f52478c;
        final s d;

        public final Args a() {
            Args args;
            Args args2 = new Args();
            StaggeredPagerInfiniteHolder.c cVar = this.d.f52475c;
            if (cVar != null) {
                args = cVar.a();
            } else {
                args = null;
            }
            Args o = com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.f.o(args2.putAll(args).put("rank", Integer.valueOf(this.d.getLayoutPosition() + 1)).put("recommend_info", getBoundData().getRecommendInfo()).put("if_outside_show_book", 0).put("card_left_right_position", this.d.m()).put("unlimited_content_type", "hot_topic"));
            Intrinsics.checkNotNullExpressionValue(o, "redressCommonArgs(\n     …_HOT_TOPIC)\n            )");
            return o;
        }

        private final void d(BookMallCellModel.TopicItemModel topicItemModel) {
            this.itemView.setOnClickListener(new ViewOnClickListenerC1909a(this.d, this, topicItemModel));
        }

        @Override
        public void a(BookMallCellModel.TopicItemModel topicItemModel) {
            Intrinsics.checkNotNullParameter(topicItemModel, com.bytedance.accountseal.a.l.n);
            b(topicItemModel).c(topicItemModel.getReportId(), "hot_topic");
        }

        public final ay b(BookMallCellModel.TopicItemModel topicItemModel) {
            Intrinsics.checkNotNullParameter(topicItemModel, com.bytedance.accountseal.a.l.n);
            ay k = NsBookmallDepend.IMPL.topicReporterV2(a()).g(topicItemModel.getLabel()).a(com.dragon.read.social.util.m.a(topicItemModel.getGoldCoinTask(), topicItemModel.getOriginType())).f(topicItemModel.getRecommendInfo()).a("if_show_list_page_push_book_button", "0").a("rec_reason", topicItemModel.getTopicDesc().cardTips).a(com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.f.a(topicItemModel.getTopicDesc().coverType, topicItemModel.getTopicDesc().topicCover, topicItemModel.getTopicDesc().coverId)).j("hot_topic").k(topicItemModel.getReportId());
            Intrinsics.checkNotNullExpressionValue(k, "IMPL.topicReporterV2(get…setTopicId(data.reportId)");
            return k;
        }

        public final PageRecorder c(BookMallCellModel.TopicItemModel topicItemModel) {
            Intrinsics.checkNotNullParameter(topicItemModel, com.bytedance.accountseal.a.l.n);
            PageRecorder addParam = this.d.j().addParam("topic_id", topicItemModel.getReportId()).addParam("pre_topic_id", topicItemModel.getReportId()).addParam("topic_position", "hot_topic").addParam("topic_recommend_info", topicItemModel.getRecommendInfo()).addParam("rec_reason", topicItemModel.getTopicDesc().cardTips).addParam(a());
            Intrinsics.checkNotNullExpressionValue(addParam, "parentRecorder.addParam(…     .addParam(getArgs())");
            return addParam;
        }

        public static final class ViewOnClickListenerC1909a implements View.OnClickListener {

            final s f52480a;

            final a f52481b;

            final BookMallCellModel.TopicItemModel f52482c;

            ViewOnClickListenerC1909a(s sVar, a aVar, BookMallCellModel.TopicItemModel topicItemModel) {
                this.f52480a = sVar;
                this.f52481b = aVar;
                this.f52482c = topicItemModel;
            }

            @Override
            public final void onClick(View view) {
                ClickAgent.onClick(view);
                s sVar = this.f52480a;
                sVar.d(com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.monitor.f.a(sVar.f52475c));
                this.f52480a.a("hot_topic_page");
                ay b2 = this.f52481b.b(this.f52482c);
                b2.b(this.f52482c.getReportId(), "hot_topic");
                if (this.f52482c.isBookListType()) {
                    b2.n("click_booklist");
                    b2.n("click_booklist_entrance");
                }
                NsBookmallDepend.IMPL.setUgcTopicPassData(null, this.f52482c.getTopicDesc());
                s sVar2 = this.f52480a;
                sVar2.c(com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.monitor.f.a(sVar2.f52475c));
                HashMap hashMap = new HashMap();
                String str = this.f52482c.getTopicDesc().expandTopicCover;
                if (str == null) {
                    str = "";
                }
                hashMap.put("topic_outside_cover_url", str);
                NsCommonDepend.IMPL.appNavigator().openUrl(this.f52481b.getContext(), this.f52482c.getUrl(), this.f52481b.c(this.f52482c).addParam(com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.f.a(this.f52482c.getTopicDesc().coverType, this.f52482c.getTopicDesc().topicCover, this.f52482c.getTopicDesc().coverId)), hashMap, true);
            }
        }

        public a(final s sVar, ViewGroup parent) {
            super(r5);
            Intrinsics.checkNotNullParameter(parent, "parent");
            this.d = sVar;
            View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.aio, parent, false);
            Intrinsics.checkNotNullExpressionValue(inflate, "from(parent.context).inf…tem_topic, parent, false)");
            View findViewById = this.itemView.findViewById(R.id.f2s);
            Intrinsics.checkNotNullExpressionValue(findViewById, "itemView.findViewById(R.id.topic_cover)");
            this.f52476a = (SimpleDraweeView) findViewById;
            View findViewById2 = this.itemView.findViewById(R.id.f3_);
            Intrinsics.checkNotNullExpressionValue(findViewById2, "itemView.findViewById(R.id.topic_name)");
            this.f52477b = (TextView) findViewById2;
            View findViewById3 = this.itemView.findViewById(R.id.er1);
            Intrinsics.checkNotNullExpressionValue(findViewById3, "itemView.findViewById(R.id.sub_info)");
            TextView textView = (TextView) findViewById3;
            this.f52478c = textView;
            this.itemView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    ClickAgent.onClick(view);
                    s.this.a("hot_topic_page");
                }
            });
            if (aer.f44724a.b()) {
                SkinDelegate.setTextColor(textView, R.color.skin_color_gold_brand_light);
            } else {
                SkinDelegate.setTextColor(textView, R.color.skin_color_gray_40_light);
            }
        }

        @Override
        public void onBind(BookMallCellModel.TopicItemModel topicItemModel, int i) {
            Intrinsics.checkNotNullParameter(topicItemModel, com.bytedance.accountseal.a.l.n);
            super.onBind(topicItemModel, i);
            if (i == 0) {
                df.b(this.itemView, 0.0f);
            } else {
                df.b(this.itemView, 16.0f);
            }
            ImageLoaderUtils.loadImage(this.f52476a, topicItemModel.getTopicDesc().topicCover);
            this.f52477b.setText(topicItemModel.getTitle());
            s sVar = this.d;
            TextView textView = this.f52478c;
            String str = topicItemModel.getTopicDesc().cardTips;
            float a2 = com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.holder.a.a(getContext());
            ScreenUtils screenUtils = ScreenUtils.f6281a;
            Context context = getContext();
            Intrinsics.checkNotNullExpressionValue(context, "context");
            sVar.a(textView, str, (int) (a2 - screenUtils.b(context, 68.0f)));
            d(topicItemModel);
        }
    }

    public final Args b() {
        Args args;
        Args args2 = new Args();
        StaggeredPagerInfiniteHolder.c cVar = this.f52475c;
        if (cVar != null) {
            args = cVar.a();
        } else {
            args = null;
        }
        args2.putAll(args);
        com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.f.o(args2);
        Args put = args2.put("unlimited_content_type", "hot_topic").put("content_rank", Integer.valueOf(getLayoutPosition() + 1)).put("rank", Integer.valueOf(getLayoutPosition() + 1)).put("recommend_info", ((StaggeredUgcModel) getBoundData()).getImpressionRecommendInfo()).put("if_outside_show_book", 0).put("card_left_right_position", m());
        Intrinsics.checkNotNullExpressionValue(put, "args.put(ReportConst.KEY…N, cardLeftRightPosition)");
        return put;
    }

    public static final class b extends com.dragon.read.widget.viewpager.c<List<? extends BookMallCellModel.TopicItemModel>> {
        b() {
        }

        public static final class a<T> implements IHolderFactory<BookMallCellModel.TopicItemModel> {

            final s f52484a;

            a(s sVar) {
                this.f52484a = sVar;
            }

            @Override
            public final AbsRecyclerViewHolder<BookMallCellModel.TopicItemModel> createHolder(ViewGroup viewGroup) {
                Intrinsics.checkNotNullParameter(viewGroup, "viewGroup");
                return new a(this.f52484a, viewGroup);
            }
        }

        @Override
        public View a(Context context, List<? extends BookMallCellModel.TopicItemModel> list) {
            Application application;
            if (context == null) {
                Application context2 = App.context();
                Intrinsics.checkNotNullExpressionValue(context2, "context()");
                application = context2;
            } else {
                application = context;
            }
            RecyclerView recyclerView = new RecyclerView(application);
            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context, 1, false);
            RecyclerClient recyclerClient = new RecyclerClient();
            recyclerClient.register(BookMallCellModel.TopicItemModel.class, new a(s.this));
            recyclerView.setLayoutManager(linearLayoutManager);
            recyclerView.setAdapter(recyclerClient);
            recyclerView.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
            recyclerView.setNestedScrollingEnabled(false);
            return recyclerView;
        }

        @Override
        public void a(View view, List<? extends BookMallCellModel.TopicItemModel> list, int i) {
            RecyclerView recyclerView;
            Object obj;
            RecyclerClient recyclerClient = null;
            if (view instanceof RecyclerView) {
                recyclerView = (RecyclerView) view;
            } else {
                recyclerView = null;
            }
            if (recyclerView != null) {
                obj = recyclerView.getAdapter();
            } else {
                obj = null;
            }
            if (obj instanceof RecyclerClient) {
                recyclerClient = (RecyclerClient) obj;
            }
            if (recyclerClient != null) {
                recyclerClient.dispatchDataUpdate(list);
            }
        }
    }

    @Override
    public void a(String str) {
        Args b2 = b();
        if (str != null) {
            b2.put("click_to", str);
            com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.f.j(b2);
        } else {
            com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.f.i(b2);
        }
    }

    private final void a(StaggeredUgcModel staggeredUgcModel) {
        try {
            String authority = Uri.parse(staggeredUgcModel.getCellUrl()).getAuthority();
            if (authority != null && StringsKt.startsWith$default(authority, "lynxview", false, 2, (Object) null)) {
                String json = JSONUtils.toJson(staggeredUgcModel.originalData);
                HashMap hashMap = new HashMap();
                Intrinsics.checkNotNullExpressionValue(json, "json");
                hashMap.put(com.bytedance.accountseal.a.l.n, json);
                com.dragon.read.pages.bullet.e.f69526a.a(hashMap);
            }
        } catch (Exception unused) {
            LogWrapper.i("书荒lynx落地页的预加载数据处理失败", staggeredUgcModel.getCellName());
        }
    }

    @Override
    public void a(View view) {
        d(com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.monitor.f.a(this.f52475c));
        a("hot_topic_list");
        T boundData = getBoundData();
        Intrinsics.checkNotNullExpressionValue(boundData, "boundData");
        a((StaggeredUgcModel) boundData);
        c(com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.monitor.f.a(this.f52475c));
        NsCommonDepend.IMPL.appNavigator().openUrl(getContext(), ((StaggeredUgcModel) getBoundData()).getCellUrl(), j().addParam(b()), null, true);
    }

    @Override
    public void onBind(StaggeredUgcModel staggeredUgcModel, int i) {
        Intrinsics.checkNotNullParameter(staggeredUgcModel, com.bytedance.accountseal.a.l.n);
        super.onBind((s) staggeredUgcModel, i);
        if (!TextUtils.isEmpty(staggeredUgcModel.getCellName())) {
            this.j.setText(staggeredUgcModel.getCellName());
        } else {
            this.j.setText("书荒广场");
        }
        if (c()) {
            df.b((View) this.k, UIKt.getDp(228));
        } else {
            df.b((View) this.k, UIKt.getDp(212));
        }
        this.k.a(n());
    }

    public s(ViewGroup parent, com.dragon.read.base.impression.a imp, StaggeredPagerInfiniteHolder.c cVar, com.dragon.read.component.biz.impl.bookmall.holder.staggeredinfinite.b actionCallback) {
        super(LayoutInflater.from(parent.getContext()).inflate(R.layout.a89, parent, false), imp);
        Intrinsics.checkNotNullParameter(parent, "parent");
        Intrinsics.checkNotNullParameter(imp, "imp");
        Intrinsics.checkNotNullParameter(actionCallback, "actionCallback");
        this.f52473a = parent;
        this.f52474b = imp;
        this.f52475c = cVar;
        this.h = actionCallback;
        View findViewById = this.itemView.findViewById(R.id.a7t);
        Intrinsics.checkNotNullExpressionValue(findViewById, "itemView.findViewById(R.id.bg_header)");
        SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById;
        this.i = simpleDraweeView;
        View findViewById2 = this.itemView.findViewById(R.id.ane);
        Intrinsics.checkNotNullExpressionValue(findViewById2, "itemView.findViewById(R.id.cell_name)");
        this.j = (TextView) findViewById2;
        View findViewById3 = this.itemView.findViewById(R.id.a4_);
        Intrinsics.checkNotNullExpressionValue(findViewById3, "itemView.findViewById(R.id.auto_view_pager)");
        AutoViewPager<List<BookMallCellModel.TopicItemModel>> autoViewPager = (AutoViewPager) findViewById3;
        this.k = autoViewPager;
        this.l = new ad();
        ImageLoaderUtils.loadImage(simpleDraweeView, "http://tosv.byted.org/obj/novel-common/img_611_staggered_topic_card_bg_feeling.png");
        b bVar = new b();
        bVar.d = true;
        autoViewPager.setAdapter(bVar);
        autoViewPager.setCornerRadius(0);
        autoViewPager.setAutoScroll(false);
    }
}