小红书.apk(点击下载) / AlphaIntroducingGoodsCardViewV2.java


package com.xingin.alpha.goods.view.card;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.net.Uri;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import bj2.l;
import com.meizu.cloud.pushsdk.notification.model.AdvanceSetting;
import com.xingin.alpha.R$color;
import com.xingin.alpha.R$drawable;
import com.xingin.alpha.R$id;
import com.xingin.alpha.R$layout;
import com.xingin.alpha.bean.AlphaTextConfig;
import com.xingin.alpha.bean.GoodsCardConfig;
import com.xingin.alpha.bean.GoodsCardTagConfig;
import com.xingin.alpha.bean.IconUrlConfig;
import com.xingin.alpha.goods.onermb.audience.AlphaAudienceOneRMBPurchaseDetailDialog;
import com.xingin.alpha.ui.widget.AlphaConfigLottieView;
import com.xingin.android.mixim.msg.bean.common.MsgGoodsCardInfo;
import com.xingin.android.mixim.msg.bean.receive.ExplainGoodsInfo;
import com.xingin.android.xhscomm.router.Routers;
import com.xingin.entities.TopicBean;
import com.xingin.ui.textview.XYTextView;
import com.xingin.utils.core.l0;
import com.xingin.widgets.XYImageView;
import el.g0;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import ln.d2;
import ms.e;
import ms.g;
import so.m;
import sy.i0;
import sy.q1;
import sy.v0;
import uq.i;
import y7.f;
import z60.h;

@Metadata(bv = {}, d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\n\n\u0002\u0010\t\n\u0002\b\u0010\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u00002\u00020\u0001B'\b\u0007\u0012\u0006\u0010\u0017\u001a\u00020\u0016\u0012\n\b\u0002\u00109\u001a\u0004\u0018\u000108\u0012\b\b\u0002\u0010;\u001a\u00020:¢\u0006\u0004\b<\u0010=J6\u0010\u000b\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\b\b\u0002\u0010\u0005\u001a\u00020\u00042\b\b\u0002\u0010\u0006\u001a\u00020\u00042\b\b\u0002\u0010\u0007\u001a\u00020\u00042\b\u0010\t\u001a\u0004\u0018\u00010\bJ\u0010\u0010\u000e\u001a\u00020\n2\b\u0010\r\u001a\u0004\u0018\u00010\fJ\b\u0010\u000f\u001a\u00020\nH\u0016J\b\u0010\u0010\u001a\u00020\nH\u0016J\b\u0010\u0011\u001a\u00020\nH\u0016J\u000e\u0010\u0014\u001a\u00020\n2\u0006\u0010\u0013\u001a\u00020\u0012J(\u0010\u0015\u001a\u00020\n2\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u0004H\u0002J\u0010\u0010\u0018\u001a\u00020\n2\u0006\u0010\u0017\u001a\u00020\u0016H\u0002J\u0018\u0010\u001a\u001a\u00020\n2\u0006\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0019\u001a\u00020\u0002H\u0002J\u0010\u0010\u001b\u001a\u00020\n2\u0006\u0010\u0019\u001a\u00020\u0002H\u0002J\u0010\u0010\u001d\u001a\u00020\u001c2\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\b\u0010\u001e\u001a\u00020\nH\u0002J\u0018\u0010 \u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u001f\u001a\u00020\u001cH\u0002J\u0010\u0010!\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\u0018\u0010#\u001a\u00020\n2\u0006\u0010\u0019\u001a\u00020\u00022\u0006\u0010\"\u001a\u00020\u001cH\u0002R\u0018\u0010&\u001a\u0004\u0018\u00010\u00028\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b$\u0010%R\u0016\u0010*\u001a\u00020'8\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b(\u0010)R\u0018\u0010-\u001a\u0004\u0018\u00010\b8\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b+\u0010,R\u0016\u00100\u001a\u00020\u00048\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b.\u0010/R\u0016\u00102\u001a\u00020\u00048\u0002@\u0002X‚\u000e¢\u0006\u0006\n\u0004\b1\u0010/R\u001c\u00107\u001a\u00020\u001c8\u0002@\u0002X‚\u000e¢\u0006\f\n\u0004\b3\u00104\u0012\u0004\b5\u00106¨\u0006>"}, d2 = {"Lcom/xingin/alpha/goods/view/card/AlphaIntroducingGoodsCardViewV2;", "Lcom/xingin/alpha/goods/view/card/AlphaAbsGoodsCard;", "Lcom/xingin/android/mixim/msg/bean/common/MsgGoodsCardInfo;", "info", "", TopicBean.TOPIC_SOURCE_RECOMMEND, "isAuto", "isFlashBuy", "Landroid/view/View;", "rootView", "", "G0", "Lcom/xingin/android/mixim/msg/bean/receive/ExplainGoodsInfo;", "goodsInfo", "L0", com.igexin.push.core.d.c.f25536c, "O", "F0", "Lcom/xingin/alpha/bean/GoodsCardConfig;", "config", "setConfig", "A0", "Landroid/content/Context;", "context", "C0", AdvanceSetting.NETWORK_TYPE, "D0", "E0", "", "B0", "J0", "cardType", "K0", "I0", "trackId", "H0", "e", "Lcom/xingin/android/mixim/msg/bean/common/MsgGoodsCardInfo;", "goodsCardInfo", "", f.f156778k, "J", "startDisplayTime", "g", "Landroid/view/View;", "rootViewGroup", h.f160753a, "Z", "hadTrackedHot", "i", "isFlashBuyGoods", "j", "Ljava/lang/String;", "getGoodsCardType$annotations", "()V", "goodsCardType", "Landroid/util/AttributeSet;", "attrs", "", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "alpha_library_release"}, k = 1, mv = {1, 6, 0})
/* compiled from: AlphaIntroducingGoodsCardViewV2.kt */
public final class AlphaIntroducingGoodsCardViewV2 extends AlphaAbsGoodsCard {

    /* renamed from: e  reason: collision with root package name */
    public MsgGoodsCardInfo f43846e;

    /* renamed from: f  reason: collision with root package name */
    public long f43847f;

    /* renamed from: g  reason: collision with root package name */
    public View f43848g;

    /* renamed from: h  reason: collision with root package name */
    public boolean f43849h;

    /* renamed from: i  reason: collision with root package name */
    public boolean f43850i;

    /* renamed from: j  reason: collision with root package name */
    public String f43851j;

    /* renamed from: k  reason: collision with root package name */
    public Map<Integer, View> f43852k;

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    /* compiled from: AlphaIntroducingGoodsCardViewV2.kt */
    public static final class a extends Lambda implements Function0<Unit> {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ AlphaIntroducingGoodsCardViewV2 f43853a;

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ Context f43854b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a(AlphaIntroducingGoodsCardViewV2 alphaIntroducingGoodsCardViewV2, Context context) {
            super(0);
            this.f43853a = alphaIntroducingGoodsCardViewV2;
            this.f43854b = context;
        }

        @Override // kotlin.jvm.functions.Function0
        public final void invoke() {
            this.f43853a.C0(this.f43854b);
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    /* compiled from: AlphaIntroducingGoodsCardViewV2.kt */
    public static final class b extends Lambda implements Function0<Unit> {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ AlphaIntroducingGoodsCardViewV2 f43855a;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b(AlphaIntroducingGoodsCardViewV2 alphaIntroducingGoodsCardViewV2) {
            super(0);
            this.f43855a = alphaIntroducingGoodsCardViewV2;
        }

        @Override // kotlin.jvm.functions.Function0
        public final void invoke() {
            MsgGoodsCardInfo msgGoodsCardInfo = this.f43855a.f43846e;
            if (msgGoodsCardInfo != null) {
                this.f43855a.I0(msgGoodsCardInfo);
            }
            this.f43855a.O();
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    /* compiled from: AlphaIntroducingGoodsCardViewV2.kt */
    public static final class c extends Lambda implements Function0<Unit> {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ AlphaIntroducingGoodsCardViewV2 f43856a;

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ MsgGoodsCardInfo f43857b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public c(AlphaIntroducingGoodsCardViewV2 alphaIntroducingGoodsCardViewV2, MsgGoodsCardInfo msgGoodsCardInfo) {
            super(0);
            this.f43856a = alphaIntroducingGoodsCardViewV2;
            this.f43857b = msgGoodsCardInfo;
        }

        @Override // kotlin.jvm.functions.Function0
        public final void invoke() {
            this.f43856a.E0(this.f43857b);
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    /* compiled from: AlphaIntroducingGoodsCardViewV2.kt */
    public static final class d extends Lambda implements Function0<Unit> {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ AlphaIntroducingGoodsCardViewV2 f43858a;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public d(AlphaIntroducingGoodsCardViewV2 alphaIntroducingGoodsCardViewV2) {
            super(0);
            this.f43858a = alphaIntroducingGoodsCardViewV2;
        }

        @Override // kotlin.jvm.functions.Function0
        public final void invoke() {
            l.b(this.f43858a);
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    @JvmOverloads
    public AlphaIntroducingGoodsCardViewV2(Context context, AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        Intrinsics.checkNotNullParameter(context, "context");
        this.f43852k = new LinkedHashMap();
        this.f43851j = "unknown";
        ViewGroup.inflate(context, R$layout.f40370alpha_view_introducing_goods_card_v2, this);
        Resources system = Resources.getSystem();
        Intrinsics.checkExpressionValueIsNotNull(system, "Resources.getSystem()");
        setLayoutParams(new ConstraintLayout.LayoutParams((int) TypedValue.applyDimension(1, (float) 108, system.getDisplayMetrics()), -2));
        setBackgroundResource(R$drawable.alpha_bg_rectangle_white_4_corner);
        ((TextView) _$_findCachedViewById(R$id.ap7)).setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/REDNumber-Medium.ttf"));
        q1.S(this, 0, new a(this, context), 1, null);
        ImageView imageView = (ImageView) _$_findCachedViewById(R$id.closeBtn);
        Intrinsics.checkNotNullExpressionValue(imageView, "closeBtn");
        q1.S(imageView, 0, new b(this), 1, null);
    }

    private static /* synthetic */ void getGoodsCardType$annotations() {
    }

    public final void A0(boolean z14, boolean z15, MsgGoodsCardInfo msgGoodsCardInfo, boolean z16) {
        this.f43851j = msgGoodsCardInfo.isSeckill() == 1 ? "sec-killing goods" : z16 ? "flash_buy" : z14 ? "recommend_goods" : z15 ? "auto_goods" : "unknown";
    }

    public final String B0(MsgGoodsCardInfo msgGoodsCardInfo) {
        Uri.Builder appendQueryParameter = Uri.parse(msgGoodsCardInfo.getLinkDetail()).buildUpon().appendQueryParameter("source", "live_page");
        d2 d2Var = d2.f102239a;
        String uri = appendQueryParameter.appendQueryParameter("anchor_id", d2Var.T()).appendQueryParameter("live_page_id", String.valueOf(d2Var.z0())).build().toString();
        Intrinsics.checkNotNullExpressionValue(uri, "parse(link)\n            …)\n            .toString()");
        return uri;
    }

    public final void C0(Context context) {
        MsgGoodsCardInfo msgGoodsCardInfo = this.f43846e;
        if (msgGoodsCardInfo == null) {
            return;
        }
        if (msgGoodsCardInfo.isOneRMBGoods()) {
            D0(context, msgGoodsCardInfo);
        } else {
            m.Z(m.f130812a, context, new c(this, msgGoodsCardInfo), null, false, true, 12, null);
        }
    }

    public final void D0(Context context, MsgGoodsCardInfo msgGoodsCardInfo) {
        if (d2.f102239a.y0().isNormalUser()) {
            new AlphaAudienceOneRMBPurchaseDetailDialog(context).M(i.f138342a.a(msgGoodsCardInfo));
        }
    }

    public final void E0(MsgGoodsCardInfo msgGoodsCardInfo) {
        String str;
        String uuid = UUID.randomUUID().toString();
        Intrinsics.checkNotNullExpressionValue(uuid, "randomUUID().toString()");
        String a14 = i0.f131674a.a("&contract_track_id=" + uuid);
        H0(msgGoodsCardInfo, uuid);
        String linkSuffix = msgGoodsCardInfo.getLinkSuffix();
        if (linkSuffix == null || linkSuffix.length() == 0) {
            str = B0(msgGoodsCardInfo) + a14;
        } else {
            str = msgGoodsCardInfo.getLinkDetail() + msgGoodsCardInfo.getLinkSuffix() + a14;
        }
        v0.f131783a.c("AlphaGoodsCard", null, "AlphaIntroducingGoodsViewV2.gotoGoodsDetail url=" + str);
        Routers.build(str).open(getContext());
        ws.a.f151188a.d(0);
        sy.i.f131651a.L(true);
    }

    public void F0() {
        d2.f102239a.a2(false);
        this.f43849h = false;
        e.f107591a.h();
        v0();
        this.f43846e = null;
    }

    public final void G0(MsgGoodsCardInfo msgGoodsCardInfo, boolean z14, boolean z15, boolean z16, View view) {
        String str;
        String d14;
        String str2;
        String str3;
        String str4;
        String str5;
        Intrinsics.checkNotNullParameter(msgGoodsCardInfo, "info");
        this.f43846e = msgGoodsCardInfo;
        this.f43848g = view;
        boolean z17 = false;
        A0(z14, z15, msgGoodsCardInfo, z16 || msgGoodsCardInfo.getFlashBuy());
        this.f43847f = System.currentTimeMillis();
        int i10 = R$id.c9z;
        AlphaConfigLottieView alphaConfigLottieView = (AlphaConfigLottieView) _$_findCachedViewById(i10);
        Intrinsics.checkNotNullExpressionValue(alphaConfigLottieView, "introducingLottie");
        q1.Q(alphaConfigLottieView, !z15 && msgGoodsCardInfo.isExplain() == 1, false, 2, null);
        IconUrlConfig explainUrl = ak.c.f3514a.F().getExplainUrl();
        if (explainUrl != null && !z15 && msgGoodsCardInfo.isExplain() == 1) {
            ((AlphaConfigLottieView) _$_findCachedViewById(i10)).D(explainUrl);
        }
        if (msgGoodsCardInfo.getSeckillState() == 1) {
            int i14 = R$id.ffb;
            XYImageView xYImageView = (XYImageView) _$_findCachedViewById(i14);
            Intrinsics.checkNotNullExpressionValue(xYImageView, "tagView");
            ViewGroup.LayoutParams layoutParams = xYImageView.getLayoutParams();
            Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
            ConstraintLayout.LayoutParams layoutParams2 = (ConstraintLayout.LayoutParams) layoutParams;
            Resources system = Resources.getSystem();
            Intrinsics.checkExpressionValueIsNotNull(system, "Resources.getSystem()");
            ((ViewGroup.MarginLayoutParams) layoutParams2).width = (int) TypedValue.applyDimension(1, (float) 30, system.getDisplayMetrics());
            xYImageView.setLayoutParams(layoutParams2);
            l.q((XYImageView) _$_findCachedViewById(i14));
            XYImageView xYImageView2 = (XYImageView) _$_findCachedViewById(i14);
            GoodsCardTagConfig tagConfig = getTagConfig();
            if (tagConfig == null || (str5 = tagConfig.getSeckillTagUrl()) == null) {
                str5 = "https://picasso-static.xiaohongshu.com/fe-platform/8f666f2b27537598d34529723ec5b1d6471e0da1.png";
            }
            xYImageView2.o(str5, g0.f72750a.t());
        } else if (msgGoodsCardInfo.getSeckillState() == 2) {
            int i15 = R$id.ffb;
            XYImageView xYImageView3 = (XYImageView) _$_findCachedViewById(i15);
            Intrinsics.checkNotNullExpressionValue(xYImageView3, "tagView");
            ViewGroup.LayoutParams layoutParams3 = xYImageView3.getLayoutParams();
            Objects.requireNonNull(layoutParams3, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
            ConstraintLayout.LayoutParams layoutParams4 = (ConstraintLayout.LayoutParams) layoutParams3;
            Resources system2 = Resources.getSystem();
            Intrinsics.checkExpressionValueIsNotNull(system2, "Resources.getSystem()");
            ((ViewGroup.MarginLayoutParams) layoutParams4).width = (int) TypedValue.applyDimension(1, (float) 50, system2.getDisplayMetrics());
            xYImageView3.setLayoutParams(layoutParams4);
            l.q((XYImageView) _$_findCachedViewById(i15));
            XYImageView xYImageView4 = (XYImageView) _$_findCachedViewById(i15);
            GoodsCardTagConfig tagConfig2 = getTagConfig();
            if (tagConfig2 == null || (str4 = tagConfig2.getSeckillPreTagUrl()) == null) {
                str4 = "https://picasso-static.xiaohongshu.com/fe-platform/27881029296d4a0eba9932cc4b71ef3129c80482.png";
            }
            xYImageView4.o(str4, g0.f72750a.t());
        } else if (z16 || msgGoodsCardInfo.getFlashBuy()) {
            this.f43850i = true;
            int i16 = R$id.ffb;
            XYImageView xYImageView5 = (XYImageView) _$_findCachedViewById(i16);
            Intrinsics.checkNotNullExpressionValue(xYImageView5, "tagView");
            ViewGroup.LayoutParams layoutParams5 = xYImageView5.getLayoutParams();
            Objects.requireNonNull(layoutParams5, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
            ConstraintLayout.LayoutParams layoutParams6 = (ConstraintLayout.LayoutParams) layoutParams5;
            Resources system3 = Resources.getSystem();
            Intrinsics.checkExpressionValueIsNotNull(system3, "Resources.getSystem()");
            ((ViewGroup.MarginLayoutParams) layoutParams6).width = (int) TypedValue.applyDimension(1, (float) 30, system3.getDisplayMetrics());
            xYImageView5.setLayoutParams(layoutParams6);
            l.q((XYImageView) _$_findCachedViewById(i16));
            XYImageView xYImageView6 = (XYImageView) _$_findCachedViewById(i16);
            GoodsCardTagConfig tagConfig3 = getTagConfig();
            if (tagConfig3 == null || (str2 = tagConfig3.getFlashBuyUrl()) == null) {
                str2 = "https://picasso-static.xiaohongshu.com/fe-platform/85c57c7657b826aba8e4d1084575d9aa6352e11b.png";
            }
            xYImageView6.o(str2, g0.f72750a.t());
        } else if (z14) {
            int i17 = R$id.ffb;
            XYImageView xYImageView7 = (XYImageView) _$_findCachedViewById(i17);
            Intrinsics.checkNotNullExpressionValue(xYImageView7, "tagView");
            ViewGroup.LayoutParams layoutParams7 = xYImageView7.getLayoutParams();
            Objects.requireNonNull(layoutParams7, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
            ConstraintLayout.LayoutParams layoutParams8 = (ConstraintLayout.LayoutParams) layoutParams7;
            Resources system4 = Resources.getSystem();
            Intrinsics.checkExpressionValueIsNotNull(system4, "Resources.getSystem()");
            ((ViewGroup.MarginLayoutParams) layoutParams8).width = (int) TypedValue.applyDimension(1, (float) 30, system4.getDisplayMetrics());
            xYImageView7.setLayoutParams(layoutParams8);
            l.q((XYImageView) _$_findCachedViewById(i17));
            XYImageView xYImageView8 = (XYImageView) _$_findCachedViewById(i17);
            GoodsCardTagConfig tagConfig4 = getTagConfig();
            if (tagConfig4 == null || (str3 = tagConfig4.getRecommendTagUrl()) == null) {
                str3 = "https://picasso-static.xiaohongshu.com/fe-platform/80e4f0074795e6eb82d3030ed46489b722e732f7.png";
            }
            xYImageView8.o(str3, g0.f72750a.t());
        } else {
            l.b((XYImageView) _$_findCachedViewById(R$id.ffb));
        }
        e eVar = e.f107591a;
        String d15 = eVar.d();
        if (!(d15 != null && d15.length() > 0) || !Intrinsics.areEqual(eVar.d(), msgGoodsCardInfo.getContractId())) {
            ((XYTextView) _$_findCachedViewById(R$id.bh3)).setMaxLines(2);
            ((TextView) _$_findCachedViewById(R$id.ap7)).setTextSize(16.0f);
        } else {
            ((XYTextView) _$_findCachedViewById(R$id.bh3)).setMaxLines(1);
            ((TextView) _$_findCachedViewById(R$id.ap7)).setTextSize(12.0f);
            eVar.c();
        }
        if (msgGoodsCardInfo.getImage().length() > 0) {
            XYImageView xYImageView9 = (XYImageView) _$_findCachedViewById(R$id.goodsImageView);
            String image = msgGoodsCardInfo.getImage();
            float f14 = (float) 100;
            Resources system5 = Resources.getSystem();
            Intrinsics.checkExpressionValueIsNotNull(system5, "Resources.getSystem()");
            int applyDimension = (int) TypedValue.applyDimension(1, f14, system5.getDisplayMetrics());
            Resources system6 = Resources.getSystem();
            Intrinsics.checkExpressionValueIsNotNull(system6, "Resources.getSystem()");
            g9.c.h(xYImageView9, image, applyDimension, (int) TypedValue.applyDimension(1, f14, system6.getDisplayMetrics()), null, g0.f72750a.t(), null, 40, null);
        }
        XYTextView xYTextView = (XYTextView) _$_findCachedViewById(R$id.bh3);
        String subTitle = msgGoodsCardInfo.getSubTitle();
        xYTextView.setText(subTitle != null && subTitle.length() > 0 ? msgGoodsCardInfo.getSubTitle() : msgGoodsCardInfo.getTitle());
        TextView textView = (TextView) _$_findCachedViewById(R$id.ap7);
        String str6 = "";
        if (msgGoodsCardInfo.getShowFinalPrice()) {
            String finalPrice = msgGoodsCardInfo.getFinalPrice();
            if (finalPrice != null && finalPrice.length() > 0) {
                z17 = true;
            }
            if (z17) {
                String finalPrice2 = msgGoodsCardInfo.getFinalPrice();
                if (finalPrice2 != null) {
                    str6 = finalPrice2;
                }
                str = ks.e.L(str6);
                textView.setText(str);
                l.q(this);
                d2.f102239a.a2(true);
                AlphaAbsGoodsCard.q0(this, this.f43848g, null, 2, null);
                r0(Integer.valueOf(msgGoodsCardInfo.getDuration()));
                K0(msgGoodsCardInfo, this.f43851j);
                setConfig(getIntroduceConfig());
            }
        }
        Double discountPrice = msgGoodsCardInfo.getDiscountPrice();
        if (!(discountPrice == null || (d14 = discountPrice.toString()) == null)) {
            str6 = d14;
        }
        str = ks.e.L(str6);
        textView.setText(str);
        l.q(this);
        d2.f102239a.a2(true);
        AlphaAbsGoodsCard.q0(this, this.f43848g, null, 2, null);
        r0(Integer.valueOf(msgGoodsCardInfo.getDuration()));
        K0(msgGoodsCardInfo, this.f43851j);
        setConfig(getIntroduceConfig());
    }

    public final void H0(MsgGoodsCardInfo msgGoodsCardInfo, String str) {
        if (this.f43850i) {
            fy.l lVar = fy.l.f79526a;
            d2 d2Var = d2.f102239a;
            String valueOf = String.valueOf(d2Var.z0());
            String T = d2Var.T();
            String goodsId = msgGoodsCardInfo.getGoodsId();
            String couponTrackId = msgGoodsCardInfo.getCouponTrackId();
            int goodsType = msgGoodsCardInfo.getGoodsType();
            Double discountPrice = msgGoodsCardInfo.getDiscountPrice();
            lVar.f(valueOf, T, goodsId, couponTrackId, goodsType, discountPrice != null ? (float) discountPrice.doubleValue() : 0.0f, str, d2Var.J(), msgGoodsCardInfo.getSource(), this.f43851j, msgGoodsCardInfo.isExplain() == 1, this.f43849h);
            return;
        }
        fy.l lVar2 = fy.l.f79526a;
        d2 d2Var2 = d2.f102239a;
        String valueOf2 = String.valueOf(d2Var2.z0());
        String T2 = d2Var2.T();
        String goodsId2 = msgGoodsCardInfo.getGoodsId();
        String couponTrackId2 = msgGoodsCardInfo.getCouponTrackId();
        int goodsType2 = msgGoodsCardInfo.getGoodsType();
        Double discountPrice2 = msgGoodsCardInfo.getDiscountPrice();
        float doubleValue = discountPrice2 != null ? (float) discountPrice2.doubleValue() : 0.0f;
        boolean J2 = d2Var2.J();
        Integer source = msgGoodsCardInfo.getSource();
        Integer sellerRole = msgGoodsCardInfo.getSellerRole();
        String str2 = this.f43851j;
        boolean z14 = msgGoodsCardInfo.isExplain() == 1;
        boolean z15 = this.f43849h;
        String contractId = msgGoodsCardInfo.getContractId();
        if (contractId == null) {
            contractId = "";
        }
        lVar2.h(valueOf2, T2, goodsId2, couponTrackId2, goodsType2, doubleValue, str, J2, source, sellerRole, str2, z14, z15, contractId);
    }

    public final void I0(MsgGoodsCardInfo msgGoodsCardInfo) {
        fy.l lVar = fy.l.f79526a;
        d2 d2Var = d2.f102239a;
        String valueOf = String.valueOf(d2Var.z0());
        String T = d2Var.T();
        String goodsId = msgGoodsCardInfo.getGoodsId();
        String couponTrackId = msgGoodsCardInfo.getCouponTrackId();
        int goodsType = msgGoodsCardInfo.getGoodsType();
        Double discountPrice = msgGoodsCardInfo.getDiscountPrice();
        lVar.g(valueOf, T, goodsId, couponTrackId, goodsType, discountPrice != null ? (float) discountPrice.doubleValue() : 0.0f, (int) (System.currentTimeMillis() - this.f43847f), d2Var.J(), msgGoodsCardInfo.getSource(), msgGoodsCardInfo.getSellerRole(), this.f43851j, msgGoodsCardInfo.isExplain() == 1, this.f43849h);
    }

    public final void J0() {
        fy.m mVar = fy.m.f79689a;
        d2 d2Var = d2.f102239a;
        String valueOf = String.valueOf(d2Var.z0());
        String T = d2Var.T();
        MsgGoodsCardInfo msgGoodsCardInfo = this.f43846e;
        mVar.E(valueOf, T, msgGoodsCardInfo != null ? msgGoodsCardInfo.getGoodsId() : null);
    }

    public final void K0(MsgGoodsCardInfo msgGoodsCardInfo, String str) {
        fy.l lVar = fy.l.f79526a;
        d2 d2Var = d2.f102239a;
        String valueOf = String.valueOf(d2Var.z0());
        String T = d2Var.T();
        String goodsId = msgGoodsCardInfo.getGoodsId();
        String couponTrackId = msgGoodsCardInfo.getCouponTrackId();
        int goodsType = msgGoodsCardInfo.getGoodsType();
        Double discountPrice = msgGoodsCardInfo.getDiscountPrice();
        lVar.i(valueOf, T, goodsId, couponTrackId, goodsType, discountPrice != null ? (float) discountPrice.doubleValue() : 0.0f, d2Var.J(), msgGoodsCardInfo.getSource(), msgGoodsCardInfo.getSellerRole(), str, msgGoodsCardInfo.isExplain() == 1, false);
    }

    public final void L0(ExplainGoodsInfo explainGoodsInfo) {
        if (isShown() && explainGoodsInfo != null) {
            String contractId = explainGoodsInfo.getContractId();
            MsgGoodsCardInfo msgGoodsCardInfo = this.f43846e;
            if (Intrinsics.areEqual(contractId, msgGoodsCardInfo != null ? msgGoodsCardInfo.getContractId() : null) && explainGoodsInfo.getSalesNum() != 0) {
                MsgGoodsCardInfo msgGoodsCardInfo2 = this.f43846e;
                boolean z14 = false;
                if (msgGoodsCardInfo2 != null && msgGoodsCardInfo2.isSeckill() == 1) {
                    z14 = true;
                }
                if (!z14 && !this.f43849h) {
                    J0();
                    this.f43849h = true;
                }
            }
        }
    }

    @Override // ms.f
    public void O() {
        F0();
        View view = this.f43848g;
        View view2 = null;
        View findViewById = view != null ? view.findViewById(R$id.ben) : null;
        View view3 = this.f43848g;
        if (view3 != null) {
            view2 = view3.findViewById(R$id.bh6);
        }
        if (findViewById != null && view2 != null) {
            g.f107596a.b(view2, findViewById, new d(this));
        }
    }

    public View _$_findCachedViewById(int i10) {
        Map<Integer, View> map = this.f43852k;
        View view = map.get(Integer.valueOf(i10));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i10);
        if (findViewById == null) {
            return null;
        }
        map.put(Integer.valueOf(i10), findViewById);
        return findViewById;
    }

    @Override // ms.f
    public void p() {
        F0();
        l.b(this);
    }

    public final void setConfig(GoodsCardConfig goodsCardConfig) {
        Intrinsics.checkNotNullParameter(goodsCardConfig, "config");
        XYTextView xYTextView = (XYTextView) _$_findCachedViewById(R$id.bh3);
        sy.f fVar = sy.f.f131630a;
        AlphaTextConfig titleColor = goodsCardConfig.getTitleColor();
        String str = null;
        xYTextView.setTextColor(fVar.b(titleColor != null ? titleColor.getColor() : null, l0.a(getContext(), R$color.alpha_goods_card_title_color)));
        TextView textView = (TextView) _$_findCachedViewById(R$id.ap7);
        AlphaTextConfig priceColor = goodsCardConfig.getPriceColor();
        String color = priceColor != null ? priceColor.getColor() : null;
        Context context = getContext();
        int i10 = R$color.xhsTheme_colorGrayPatch1_unchanged;
        textView.setTextColor(fVar.b(color, l0.a(context, i10)));
        TextView textView2 = (TextView) _$_findCachedViewById(R$id.e9j);
        AlphaTextConfig priceColor2 = goodsCardConfig.getPriceColor();
        if (priceColor2 != null) {
            str = priceColor2.getColor();
        }
        textView2.setTextColor(fVar.b(str, l0.a(getContext(), i10)));
    }

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