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

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


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

import android.content.Context;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.bytedance.apm.agent.v2.instrumentation.ClickAgent;
import com.dragon.read.NsCommonDepend;
import com.dragon.read.base.Args;
import com.dragon.read.base.ssconfig.template.acj;
import com.dragon.read.base.util.ContextUtils;
import com.dragon.read.component.biz.api.NsBookshelfApi;
import com.dragon.read.pages.bookmall.model.ItemDataModel;
import com.dragon.read.recyler.AbsRecyclerViewHolder;
import com.dragon.read.repo.BookItemModel;
import com.dragon.read.report.ReportUtils;
import com.dragon.read.rpc.model.BookGroupData;
import com.dragon.read.rpc.model.BookGroupType;
import com.dragon.read.rpc.model.CommentUserStrInfo;
import com.dragon.read.util.ImageLoaderUtils;
import com.dragon.read.util.cr;
import com.dragon.read.widget.FixRecyclerView;
import com.dragon.read.widget.ScaleBookCover;
import com.dragon.read.widget.decoration.DividerItemDecorationFixed;
import com.dragon.read.widget.tag.TagLayout;
import com.facebook.drawee.view.SimpleDraweeView;
import com.phoenix.read.R;
import java.util.List;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

public final class o extends ag<UgcBookListNewModel> {

    public static final b f57650a = new b(null);

    private final TextView f57651b;

    private final View f57652c;
    private final TextView d;
    private final View e;
    private final SimpleDraweeView f;
    private final TextView k;
    private final FixRecyclerView l;
    private final TagLayout m;
    private final a n;

    public static final class b {
        public b(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private b() {
        }
    }

    public final class a extends com.dragon.read.recyler.d<ItemDataModel> {

        public final class C2153a extends com.dragon.read.recyler.f<ItemDataModel> {

            final a f57654a;

            private final SimpleDraweeView f57655b;

            private final ScaleBookCover f57656c;
            private final TextView d;
            private final TextView e;

            public static final class C2154a implements com.dragon.read.component.biz.impl.report.a {
                C2154a() {
                }

                @Override
                public final Args a() {
                    return C2153a.this.a();
                }
            }

            public final Args a() {
                Long l;
                T currentData = o.this.getCurrentData();
                Intrinsics.checkNotNullExpressionValue(currentData, "this@ResultBookListNewHolder.currentData");
                Args put = new Args().put("is_outside_booklist", 1);
                BookGroupData bookGroupData = ((UgcBookListNewModel) currentData).getBookGroupData();
                if (bookGroupData != null) {
                    l = Long.valueOf(bookGroupData.id);
                } else {
                    l = null;
                }
                Args put2 = put.put("gid", String.valueOf(l)).put("booklist_position", "search");
                Intrinsics.checkNotNullExpressionValue(put2, "Args().put(\"is_outside_b…KLIST_POSITION, \"search\")");
                return put2;
            }

            @Override
            public void a(ItemDataModel itemDataModel) {
                if (itemDataModel == null || itemDataModel.isShown()) {
                    return;
                }
                T currentData = o.this.getCurrentData();
                Intrinsics.checkNotNullExpressionValue(currentData, "this@ResultBookListNewHolder.currentData");
                UgcBookListNewModel ugcBookListNewModel = (UgcBookListNewModel) currentData;
                new com.dragon.read.component.biz.impl.report.l().a(o.this.i()).s(ugcBookListNewModel.getCellName()).t("").b(itemDataModel.getBookId()).a(itemDataModel.getGenreType()).f(ReportUtils.getBookType(itemDataModel.getBookType())).g("booklist_card").h(o.this.h()).i(ugcBookListNewModel.getSource()).d(String.valueOf(getAdapterPosition() + 1)).c(String.valueOf(o.this.m())).l(ugcBookListNewModel.resultTab).a(false).k(o.this.j()).j(ugcBookListNewModel.searchAttachInfo).p(ugcBookListNewModel.getSearchSourceBookId()).q(ugcBookListNewModel.getSearchId()).r(itemDataModel.getImpressionRecommendInfo()).a(a()).a();
            }

            public C2153a(a aVar, ViewGroup parent) {
                super(r3);
                Intrinsics.checkNotNullParameter(parent, "parent");
                this.f57654a = aVar;
                View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.ah7, parent, false);
                Intrinsics.checkNotNullExpressionValue(inflate, "from(parent.context).inf…ore_scale, parent, false)");
                View findViewById = this.itemView.findViewById(R.id.ac3);
                Intrinsics.checkNotNullExpressionValue(findViewById, "itemView.findViewById(R.id.book_origin_cover)");
                this.f57655b = (SimpleDraweeView) findViewById;
                View findViewById2 = this.itemView.findViewById(R.id.e8x);
                Intrinsics.checkNotNullExpressionValue(findViewById2, "itemView.findViewById(R.id.scale_book_cover)");
                this.f57656c = (ScaleBookCover) findViewById2;
                View findViewById3 = this.itemView.findViewById(R.id.nd);
                Intrinsics.checkNotNullExpressionValue(findViewById3, "itemView.findViewById(R.id.name)");
                this.d = (TextView) findViewById3;
                View findViewById4 = this.itemView.findViewById(R.id.acf);
                Intrinsics.checkNotNullExpressionValue(findViewById4, "itemView.findViewById(R.id.book_score)");
                TextView textView = (TextView) findViewById4;
                this.e = textView;
                textView.setVisibility(8);
            }

            @Override
            public void onBind(ItemDataModel itemDataModel, int i) {
                float f;
                super.onBind(itemDataModel, i);
                boolean b2 = com.dragon.read.component.biz.impl.ui.a.b.b();
                ScaleBookCover scaleBookCover = this.f57656c;
                Context context = getContext();
                if (b2) {
                    f = 8.0f;
                } else {
                    f = 4.0f;
                }
                scaleBookCover.setRoundCornerRadius(ContextUtils.dp2px(context, f));
                this.f57656c.setAudioCoverSize(com.dragon.read.component.biz.impl.ui.a.b.b(24), com.dragon.read.component.biz.impl.ui.a.b.b(16), com.dragon.read.component.biz.impl.ui.a.b.b(13), com.dragon.read.component.biz.impl.ui.a.b.b(13), 8);
                if (itemDataModel != null) {
                    if (com.dragon.read.component.biz.impl.help.f.a()) {
                        this.f57656c.setIsAudioCover(com.dragon.read.component.biz.impl.help.f.a(itemDataModel));
                        this.f57656c.loadBookCover(itemDataModel.getThumbUrl());
                    } else {
                        ImageLoaderUtils.loadImage(this.f57655b, itemDataModel.getThumbUrl());
                    }
                    this.d.setText(itemDataModel.getBookName());
                }
                View audioCover = this.f57656c.getAudioCover();
                if (audioCover != null) {
                    com.dragon.read.component.biz.impl.help.f.a(itemDataModel, audioCover);
                }
                T currentData = o.this.getCurrentData();
                Intrinsics.checkNotNullExpressionValue(currentData, "this@ResultBookListNewHolder.currentData");
                UgcBookListNewModel ugcBookListNewModel = (UgcBookListNewModel) currentData;
                C2154a c2154a = new C2154a();
                if (audioCover != null) {
                    o.this.a(ugcBookListNewModel.searchAttachInfo, audioCover, itemDataModel, i + 1, "booklist_card", false, (String) null, (String) null, (com.dragon.read.component.biz.impl.report.a) c2154a);
                }
                o.this.a(ugcBookListNewModel.searchAttachInfo, this.itemView, itemDataModel, i + 1, "booklist_card", false, ugcBookListNewModel.getCellName(), "", "", c2154a);
                o.this.a((com.bytedance.article.common.impression.e) itemDataModel, this.itemView);
            }
        }

        public a() {
        }

        @Override
        public AbsRecyclerViewHolder<ItemDataModel> onCreateViewHolder(ViewGroup parent, int i) {
            Intrinsics.checkNotNullParameter(parent, "parent");
            return new C2153a(this, parent);
        }
    }

    @Override
    public boolean V_() {
        return acj.f44631a.b();
    }

    @Override
    public void a(UgcBookListNewModel ugcBookListNewModel) {
        BookGroupData bookGroupData;
        UgcBookListNewModel ugcBookListNewModel2 = ugcBookListNewModel;
        super.a((o) ugcBookListNewModel2);
        a(ugcBookListNewModel2, "booklist_card");
        if (ugcBookListNewModel != null && (bookGroupData = ugcBookListNewModel.getBookGroupData()) != null) {
            a(bookGroupData).d();
        }
    }

    public static final class c implements View.OnClickListener {

        final BookGroupData f57658a;

        final o f57659b;

        final UgcBookListNewModel f57660c;

        c(BookGroupData bookGroupData, o oVar, UgcBookListNewModel ugcBookListNewModel) {
            this.f57658a = bookGroupData;
            this.f57659b = oVar;
            this.f57660c = ugcBookListNewModel;
        }

        @Override
        public final void onClick(View view) {
            ClickAgent.onClick(view);
            BookGroupData bookGroupData = this.f57658a;
            o oVar = this.f57659b;
            oVar.b(this.f57660c);
            NsCommonDepend.IMPL.appNavigator().openUrl(oVar.getContext(), bookGroupData.schema, oVar.c().addParam(oVar.a(bookGroupData).a()));
        }
    }

    public final void b(UgcBookListNewModel ugcBookListNewModel) {
        BookGroupData bookGroupData = ugcBookListNewModel.getBookGroupData();
        if (bookGroupData == null) {
            return;
        }
        a(ugcBookListNewModel, "booklist_card", "booklist_page");
        a(bookGroupData).a("click_to", "landing_page").b().o("click_search_result_booklist").c();
    }

    public final com.dragon.read.component.biz.api.j.b a(BookGroupData bookGroupData) {
        com.dragon.read.component.biz.api.j.b a2 = NsBookshelfApi.IMPL.getBookListReporter().j("booklist_card").i(String.valueOf(bookGroupData.id)).a(bookGroupData.title);
        com.dragon.read.util.y yVar = com.dragon.read.util.y.f94056a;
        BookGroupType bookGroupType = bookGroupData.booklistType;
        Intrinsics.checkNotNullExpressionValue(bookGroupType, "data.booklistType");
        return a2.l(yVar.a(bookGroupType)).k("search").a(getAdapterPosition() + 1).a("recommend_info", bookGroupData.recommendInfo).a(c().toArgs());
    }

    public o(ViewGroup parent) {
        super(LayoutInflater.from(parent.getContext()).inflate(R.layout.b9o, parent, false));
        Intrinsics.checkNotNullParameter(parent, "parent");
        View findViewById = this.itemView.findViewById(R.id.ane);
        Intrinsics.checkNotNullExpressionValue(findViewById, "itemView.findViewById(R.id.cell_name)");
        this.f57651b = (TextView) findViewById;
        View findViewById2 = this.itemView.findViewById(R.id.abh);
        Intrinsics.checkNotNullExpressionValue(findViewById2, "itemView.findViewById(R.id.book_list_area)");
        this.f57652c = findViewById2;
        View findViewById3 = this.itemView.findViewById(R.id.abm);
        Intrinsics.checkNotNullExpressionValue(findViewById3, "itemView.findViewById(R.id.book_list_name)");
        this.d = (TextView) findViewById3;
        this.e = this.itemView.findViewById(R.id.fxo);
        View findViewById4 = this.itemView.findViewById(R.id.ly);
        Intrinsics.checkNotNullExpressionValue(findViewById4, "itemView.findViewById(R.id.user_avatar)");
        this.f = (SimpleDraweeView) findViewById4;
        View findViewById5 = this.itemView.findViewById(R.id.d8);
        Intrinsics.checkNotNullExpressionValue(findViewById5, "itemView.findViewById(R.id.user_name)");
        this.k = (TextView) findViewById5;
        View findViewById6 = this.itemView.findViewById(R.id.ld);
        Intrinsics.checkNotNullExpressionValue(findViewById6, "itemView.findViewById(R.id.recycler_view)");
        FixRecyclerView fixRecyclerView = (FixRecyclerView) findViewById6;
        this.l = fixRecyclerView;
        View findViewById7 = this.itemView.findViewById(R.id.abl);
        Intrinsics.checkNotNullExpressionValue(findViewById7, "itemView.findViewById(R.id.book_list_info)");
        this.m = (TagLayout) findViewById7;
        cr.a(findViewById2, 8.0f);
        fixRecyclerView.setConsumeTouchEventIfScrollable(true);
        fixRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), 0, false));
        DividerItemDecorationFixed dividerItemDecorationFixed = new DividerItemDecorationFixed(getContext(), 0);
        dividerItemDecorationFixed.setDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ah7));
        dividerItemDecorationFixed.setStartDivider(ContextCompat.getDrawable(getContext(), R.drawable.ah9));
        dividerItemDecorationFixed.setEndDivider(ContextCompat.getDrawable(getContext(), R.drawable.ah9));
        fixRecyclerView.addItemDecoration(dividerItemDecorationFixed);
        a aVar = new a();
        this.n = aVar;
        fixRecyclerView.setAdapter(aVar);
    }

    @Override
    public void onBind(UgcBookListNewModel ugcBookListNewModel, int i) {
        List<List<Integer>> list;
        Intrinsics.checkNotNullParameter(ugcBookListNewModel, com.bytedance.accountseal.a.l.n);
        super.onBind((o) ugcBookListNewModel, i);
        g();
        BookGroupData bookGroupData = ugcBookListNewModel.getBookGroupData();
        if (bookGroupData == null) {
            return;
        }
        this.n.a(ugcBookListNewModel.getBookListData());
        this.f57651b.setText(ugcBookListNewModel.getCellName());
        TextView textView = this.d;
        String str = bookGroupData.title;
        BookItemModel.a titleHighLight = ugcBookListNewModel.getTitleHighLight();
        List<List<Integer>> list2 = null;
        if (titleHighLight != null) {
            list = titleHighLight.f80222c;
        } else {
            list = null;
        }
        textView.setText(a(a(str, list), this.d.getTextSize()));
        if (bookGroupData.userInfo != null) {
            CommentUserStrInfo commentUserStrInfo = bookGroupData.userInfo;
            if (commentUserStrInfo != null) {
                this.e.setVisibility(0);
                ImageLoaderUtils.loadImage(this.f, commentUserStrInfo.userAvatar);
                TextView textView2 = this.k;
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(commentUserStrInfo.userName);
                if (!TextUtils.isEmpty(bookGroupData.desc)) {
                    spannableStringBuilder.append((CharSequence) ":");
                    String str2 = bookGroupData.desc;
                    BookItemModel.a descHighLight = ugcBookListNewModel.getDescHighLight();
                    if (descHighLight != null) {
                        list2 = descHighLight.f80222c;
                    }
                    spannableStringBuilder.append(a(a(str2, list2), this.k.getTextSize()));
                }
                textView2.setText(spannableStringBuilder);
            }
        } else {
            this.e.setVisibility(8);
        }
        if (!TextUtils.isEmpty(bookGroupData.searchRecommendText)) {
            this.m.setVisibility(0);
            this.m.d(com.dragon.read.component.biz.impl.ui.a.b.a(12));
            this.m.setTags(CollectionsKt.listOf(bookGroupData.searchRecommendText));
        } else {
            this.m.setVisibility(8);
        }
        this.f57652c.setOnClickListener(new c(bookGroupData, this, ugcBookListNewModel));
    }
}