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


package com.shizhuang.duapp.modules.productv2.luxury.views;

import android.content.Context;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
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.extension.DrawableScale;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuScaleType;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.callback.IMallViewExposureObserver;
import com.shizhuang.duapp.modules.productv2.luxury.model.FlagshipProductModel;
import i60.a;
import i60.b;
import j50.p;
import j60.z;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.JvmOverloads;
import kotlin.text.StringsKt__StringsJVMKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import y51.d;

@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\u0005\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003B'\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\r"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/luxury/views/TPLandingFlagshipProductView;", "Lcom/shizhuang/duapp/modules/productv2/luxury/views/BaseTopProductLandingView;", "Ly51/d;", "Lcom/shizhuang/duapp/modules/du_mall_common/utils/exposure/callback/IMallViewExposureObserver;", "", "getLayoutId", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "du_product_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: TPLandingFlagshipProductView.kt */
public final class TPLandingFlagshipProductView extends BaseTopProductLandingView<d> implements IMallViewExposureObserver {
    public static ChangeQuickRedirect changeQuickRedirect;

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

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

    @JvmOverloads
    public TPLandingFlagshipProductView(@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 */ TPLandingFlagshipProductView(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, 297657, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.f23832c == null) {
            this.f23832c = new HashMap();
        }
        View view = (View) this.f23832c.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.f23832c.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, 297653, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.item_top_product_landing_flagship_product;
    }

    @Override // com.shizhuang.duapp.common.component.module.AbsModuleView
    public void onChanged(Object obj) {
        String logoUrl;
        d dVar = (d) obj;
        if (!PatchProxy.proxy(new Object[]{dVar}, this, changeQuickRedirect, false, 297654, new Class[]{d.class}, Void.TYPE).isSupported) {
            FlagshipProductModel a5 = dVar.a();
            g.a(((DuImageLoaderView) _$_findCachedViewById(R.id.ivProduct)).i((a5 == null || (logoUrl = a5.getLogoUrl()) == null) ? null : p.b(logoUrl)), DrawableScale.OneToOne).d0(300).x();
            TextView textView = (TextView) _$_findCachedViewById(R.id.tvProductTag);
            String tag = a5 != null ? a5.getTag() : null;
            int i = 8;
            textView.setVisibility((tag == null || StringsKt__StringsJVMKt.isBlank(tag)) ^ true ? 0 : 8);
            ((TextView) _$_findCachedViewById(R.id.tvProductTag)).setText(a5 != null ? a5.getTag() : null);
            TextView textView2 = (TextView) _$_findCachedViewById(R.id.tvProductName);
            String spuTitle = a5 != null ? a5.getSpuTitle() : null;
            if (!(spuTitle == null || StringsKt__StringsJVMKt.isBlank(spuTitle))) {
                i = 0;
            }
            textView2.setVisibility(i);
            ((TextView) _$_findCachedViewById(R.id.tvProductName)).setText(a5 != null ? a5.getSpuTitle() : null);
            ((FontText) _$_findCachedViewById(R.id.tvPrice)).c(k.g(a5 != null ? Long.valueOf(a5.getPrice()) : null, false, null, 3), 12, 17);
            ViewExtensionKt.j(this, 0, new TPLandingFlagshipProductView$onChanged$1(this, a5), 1);
        }
    }

    @Override // com.shizhuang.duapp.modules.du_mall_common.utils.exposure.callback.IMallViewExposureObserver
    public void onExposure() {
        d dVar;
        FlagshipProductModel a5;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 297655, new Class[0], Void.TYPE).isSupported && (dVar = (d) getData()) != null && (a5 = dVar.a()) != null) {
            a aVar = a.f33292a;
            Long valueOf = Long.valueOf(a5.getSpuId());
            Integer valueOf2 = Integer.valueOf(getViewModel().a(getData()));
            String c5 = getViewModel().c();
            if (!PatchProxy.proxy(new Object[]{valueOf, valueOf2, c5}, aVar, a.changeQuickRedirect, false, 125125, new Class[]{Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                b bVar = b.f33293a;
                ArrayMap c12 = g.a.c(8, "spu_id", valueOf, "block_position", valueOf2);
                c12.put("page_content_id", c5);
                bVar.b("trade_common_exposure", "1384", "624", c12);
            }
        }
    }

    @JvmOverloads
    public TPLandingFlagshipProductView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        int b = fi.b.b((float) 2);
        z.a aVar = z.b;
        aVar.a((ConstraintLayout) _$_findCachedViewById(R.id.clProduct), b, null);
        aVar.a((TextView) _$_findCachedViewById(R.id.tvProductTag), fi.b.b((float) 1), null);
        ((DuImageLoaderView) _$_findCachedViewById(R.id.vBottomBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/du_product/trend_landing_product_bottom_bg.webp").p0(DuScaleType.FIT_XY).x();
    }
}