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


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

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
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.extension.DrawableScale;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.auction.records.model.AucBiddingRecordItem;
import fi.b;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import kotlin.Metadata;
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\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/records/views/AucBiddingRecordItemView;", "Lcom/shizhuang/duapp/common/component/module/AbsModuleView;", "Lcom/shizhuang/duapp/modules/auction/records/model/AucBiddingRecordItem;", "", "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: AucBiddingRecordItemView.kt */
public final class AucBiddingRecordItemView extends AbsModuleView<AucBiddingRecordItem> {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final SimpleDateFormat b;

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

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

    @JvmOverloads
    public AucBiddingRecordItemView(@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 */ AucBiddingRecordItemView(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, 68447, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.f11106c == null) {
            this.f11106c = new HashMap();
        }
        View view = (View) this.f11106c.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.f11106c.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, 68445, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.auction_item_bidding_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(AucBiddingRecordItem aucBiddingRecordItem) {
        AucBiddingRecordItem aucBiddingRecordItem2 = aucBiddingRecordItem;
        if (!PatchProxy.proxy(new Object[]{aucBiddingRecordItem2}, this, changeQuickRedirect, false, 68446, new Class[]{AucBiddingRecordItem.class}, Void.TYPE).isSupported) {
            super.onChanged(aucBiddingRecordItem2);
            boolean z = aucBiddingRecordItem2.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 = aucBiddingRecordItem2.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 = aucBiddingRecordItem2.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 = aucBiddingRecordItem2.getNickname();
            if (nickname != null) {
                str = nickname;
            }
            textView.setText(str);
            ((TextView) _$_findCachedViewById(R.id.tvTime)).setText(this.b.format(new Date(aucBiddingRecordItem2.getAuctionTime())));
            StringBuilder c5 = c.c(65509);
            c5.append(k.e(aucBiddingRecordItem2.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 AucBiddingRecordItemView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.b = new SimpleDateFormat("MM月dd日HH:mm", Locale.CHINA);
    }
}