得物.apk(点击下载) / AucRecordView.java


package com.shizhuang.duapp.modules.auction.detail.views;

import a.f;
import android.content.Context;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import cd.g;
import cd.k;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.module.AbsModuleView;
import com.shizhuang.duapp.common.component.module.IModuleExposureObserver;
import com.shizhuang.duapp.common.component.module.ModuleAdapterDelegateKt;
import com.shizhuang.duapp.common.component.module.NormalModuleAdapter;
import com.shizhuang.duapp.common.exposure.DuExposureHelper;
import com.shizhuang.duapp.common.extension.DrawableScale;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.auction.detail.model.AucPriceRecordsModel;
import com.shizhuang.duapp.modules.auction.detail.model.AucRecordItem;
import com.shizhuang.duapp.modules.du_mall_common.widget.DuIconsTextView;
import fi.b;
import i60.a;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.JvmOverloads;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import us.c;

@Metadata(bv = {}, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003:\u0001\rB'\b\u0007\u0012\u0006\u0010\u0007\u001a\u00020\u0006\u0012\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\b\u0012\b\b\u0002\u0010\n\u001a\u00020\u0004¢\u0006\u0004\b\u000b\u0010\fJ\b\u0010\u0005\u001a\u00020\u0004H\u0016¨\u0006\u000e"}, d2 = {"Lcom/shizhuang/duapp/modules/auction/detail/views/AucRecordView;", "Lcom/shizhuang/duapp/modules/auction/detail/views/AucBaseCardView;", "Lcom/shizhuang/duapp/modules/auction/detail/model/AucPriceRecordsModel;", "Lcom/shizhuang/duapp/common/component/module/IModuleExposureObserver;", "", "getLayoutId", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "AucRecordItemView", "du_mall_auction_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: AucRecordView.kt */
public final class AucRecordView extends AucBaseCardView<AucPriceRecordsModel> implements IModuleExposureObserver {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final NormalModuleAdapter d;
    public HashMap e;

    @Metadata(bv = {}, d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B'\b\u0007\u0012\u0006\u0010\u0006\u001a\u00020\u0005\u0012\n\b\u0002\u0010\b\u001a\u0004\u0018\u00010\u0007\u0012\b\b\u0002\u0010\t\u001a\u00020\u0003¢\u0006\u0004\b\n\u0010\u000bJ\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\f"}, d2 = {"Lcom/shizhuang/duapp/modules/auction/detail/views/AucRecordView$AucRecordItemView;", "Lcom/shizhuang/duapp/common/component/module/AbsModuleView;", "Lcom/shizhuang/duapp/modules/auction/detail/model/AucRecordItem;", "", "getLayoutId", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "du_mall_auction_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: AucRecordView.kt */
    public static final class AucRecordItemView extends AbsModuleView<AucRecordItem> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final SimpleDateFormat b;

        /* renamed from: c  reason: collision with root package name */
        public HashMap f11086c;

        @JvmOverloads
        public AucRecordItemView(@NotNull Context context) {
            this(context, null, 0, 6);
        }

        @JvmOverloads
        public AucRecordItemView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
            this(context, attributeSet, 0, 4);
        }

        /* JADX INFO: this call moved to the top of the method (can break code semantics) */
        public /* synthetic */ AucRecordItemView(Context context, AttributeSet attributeSet, int i, int i3) {
            this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
        }

        public View _$_findCachedViewById(int i) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 68260, new Class[]{Integer.TYPE}, View.class);
            if (proxy.isSupported) {
                return (View) proxy.result;
            }
            if (this.f11086c == null) {
                this.f11086c = new HashMap();
            }
            View view = (View) this.f11086c.get(Integer.valueOf(i));
            if (view != null) {
                return view;
            }
            View findViewById = findViewById(i);
            this.f11086c.put(Integer.valueOf(i), findViewById);
            return findViewById;
        }

        @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
        public int getLayoutId() {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 68258, new Class[0], Integer.TYPE);
            return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.auction_item_detail_record_item_view;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
        public void onChanged(AucRecordItem aucRecordItem) {
            AucRecordItem aucRecordItem2 = aucRecordItem;
            if (!PatchProxy.proxy(new Object[]{aucRecordItem2}, this, changeQuickRedirect, false, 68259, new Class[]{AucRecordItem.class}, Void.TYPE).isSupported) {
                super.onChanged(aucRecordItem2);
                boolean z = aucRecordItem2.getStatus() == 1;
                int i = R.color.auction_color_a1a1b6;
                String str = "";
                if (z) {
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setText("领先");
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setTextColor(-1);
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setBackgroundResource(R.drawable.auction_ic_bidding_record_head_bg);
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setPadding(0, 0, 0, 0);
                    ((DuImageLoaderView) _$_findCachedViewById(R.id.ivAvatarBorder)).setVisibility(0);
                    ((DuImageLoaderView) _$_findCachedViewById(R.id.ivAvatarBorder)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/auction/auction_ic_record_avatar_bg.webp").j0(getContext(), R.drawable.auction_ic_detail_record_max_avatar_border).d0(300).x();
                    DuImageLoaderView duImageLoaderView = (DuImageLoaderView) _$_findCachedViewById(R.id.ivAvatar);
                    String avatar = aucRecordItem2.getAvatar();
                    if (avatar == null) {
                        avatar = str;
                    }
                    g.a(duImageLoaderView.i(avatar), DrawableScale.OneToOne).o0(true).Y(1.0f).X(-1).d0(300).x();
                } else {
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setText("出局");
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setTextColor(ContextCompat.getColor(getContext(), R.color.auction_color_a1a1b6));
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setBackgroundColor(-1);
                    ((TextView) _$_findCachedViewById(R.id.tvStatus)).setPadding(0, 0, b.b((float) 6), 0);
                    ((DuImageLoaderView) _$_findCachedViewById(R.id.ivAvatarBorder)).setVisibility(8);
                    DuImageLoaderView duImageLoaderView2 = (DuImageLoaderView) _$_findCachedViewById(R.id.ivAvatar);
                    String avatar2 = aucRecordItem2.getAvatar();
                    if (avatar2 == null) {
                        avatar2 = str;
                    }
                    g.a(duImageLoaderView2.i(avatar2), DrawableScale.OneToOne).o0(true).d0(300).x();
                }
                TextView textView = (TextView) _$_findCachedViewById(R.id.tvNickname);
                String nickname = aucRecordItem2.getNickname();
                if (nickname != null) {
                    str = nickname;
                }
                textView.setText(str);
                ((TextView) _$_findCachedViewById(R.id.tvTime)).setText(this.b.format(new Date(aucRecordItem2.getAuctionTime())));
                StringBuilder c5 = c.c(65509);
                c5.append(k.e(aucRecordItem2.getPrice(), false, null, 3));
                ((TextView) _$_findCachedViewById(R.id.tvPrice)).setText(c5.toString());
                Context context = getContext();
                if (z) {
                    i = R.color.auction_color_14151a;
                }
                int color = ContextCompat.getColor(context, i);
                ((TextView) _$_findCachedViewById(R.id.tvNickname)).setTextColor(color);
                ((TextView) _$_findCachedViewById(R.id.tvPrice)).setTextColor(color);
                ((TextView) _$_findCachedViewById(R.id.tvTime)).setTextColor(color);
            }
        }

        @JvmOverloads
        public AucRecordItemView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
            super(context, attributeSet, i);
            this.b = new SimpleDateFormat("MM月dd日HH:mm", Locale.CHINA);
        }
    }

    @JvmOverloads
    public AucRecordView(@NotNull Context context) {
        this(context, null, 0, 6);
    }

    @JvmOverloads
    public AucRecordView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, 0, 4);
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ AucRecordView(Context context, AttributeSet attributeSet, int i, int i3) {
        this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
    }

    public View _$_findCachedViewById(int i) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 68255, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.e == null) {
            this.e = new HashMap();
        }
        View view = (View) this.e.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.e.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    public final void b(String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 68253, new Class[]{String.class}, Void.TYPE).isSupported) {
            a aVar = a.f33292a;
            Integer valueOf = Integer.valueOf(ModuleAdapterDelegateKt.b(this) + 1);
            Long valueOf2 = Long.valueOf(getViewModel$du_mall_auction_release().getSkuId());
            Long valueOf3 = Long.valueOf(getViewModel$du_mall_auction_release().getSpuId());
            String b = getViewModel$du_mall_auction_release().b();
            if (!PatchProxy.proxy(new Object[]{valueOf, valueOf2, valueOf3, str, b}, aVar, a.changeQuickRedirect, false, 124466, new Class[]{Object.class, Object.class, Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap b2 = g.a.b(8, "block_content_position", valueOf, "sku_id", valueOf2);
                b2.put("spu_id", valueOf3);
                b2.put("button_title", str);
                b2.put("page_content_id", b);
                bVar.b("trade_common_click", "1089", "2056", b2);
            }
        }
    }

    @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
    public int getLayoutId() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 68251, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.auction_item_detail_record_view;
    }

    @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
    public void onChanged(Object obj) {
        AucPriceRecordsModel aucPriceRecordsModel = (AucPriceRecordsModel) obj;
        int i = 0;
        if (!PatchProxy.proxy(new Object[]{aucPriceRecordsModel}, this, changeQuickRedirect, false, 68252, new Class[]{AucPriceRecordsModel.class}, Void.TYPE).isSupported) {
            super.onChanged(aucPriceRecordsModel);
            StringBuilder h12 = f.h("竞价记录(");
            h12.append(aucPriceRecordsModel.getTotal());
            h12.append((char) 65289);
            ((TextView) _$_findCachedViewById(R.id.tvRecordCount)).setText(h12.toString());
            NormalModuleAdapter normalModuleAdapter = this.d;
            List<AucRecordItem> records = aucPriceRecordsModel.getRecords();
            if (records == null) {
                records = CollectionsKt__CollectionsKt.emptyList();
            }
            normalModuleAdapter.setItems(records);
            ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvRefresh), 0, new AucRecordView$onChanged$1(this), 1);
            DuIconsTextView duIconsTextView = (DuIconsTextView) _$_findCachedViewById(R.id.tvViewAll);
            if (!aucPriceRecordsModel.getMore()) {
                i = 8;
            }
            duIconsTextView.setVisibility(i);
            ViewExtensionKt.j((DuIconsTextView) _$_findCachedViewById(R.id.tvViewAll), 0, new AucRecordView$onChanged$2(this), 1);
        }
    }

    @Override // com.shizhuang.duapp.common.component.module.IModuleExposureObserver
    public void onExposure(@Nullable DuExposureHelper.State state) {
        if (!PatchProxy.proxy(new Object[]{state}, this, changeQuickRedirect, false, 68254, new Class[]{DuExposureHelper.State.class}, Void.TYPE).isSupported) {
            a aVar = a.f33292a;
            Long valueOf = Long.valueOf(getViewModel$du_mall_auction_release().getSkuId());
            Long valueOf2 = Long.valueOf(getViewModel$du_mall_auction_release().getSpuId());
            String b = getViewModel$du_mall_auction_release().b();
            if (!PatchProxy.proxy(new Object[]{valueOf, valueOf2, b}, aVar, a.changeQuickRedirect, false, 124467, new Class[]{Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap f = h.b.f(8, "sku_id", valueOf, "spu_id", valueOf2);
                f.put("page_content_id", b);
                bVar.b("trade_common_exposure", "1089", "2056", f);
            }
        }
    }

    @JvmOverloads
    public AucRecordView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        NormalModuleAdapter normalModuleAdapter = new NormalModuleAdapter(true);
        this.d = normalModuleAdapter;
        normalModuleAdapter.getDelegate().C(AucRecordItem.class, 1, null, -1, true, null, null, AnonymousClass1.INSTANCE);
        ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setLayoutManager(new LinearLayoutManager(context));
        ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setAdapter(normalModuleAdapter);
    }
}