得物.apk(点击下载) / MyOwnSkuCardItemViewNew.java
package com.shizhuang.duapp.modules.product_detail.own.views;
import a.f;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.text.InputFilter;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.ViewModelLazy;
import cd.g;
import cd.l;
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.ModuleAdapterDelegateKt;
import com.shizhuang.duapp.common.extension.DrawableScale;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.ui.view.ProductImageLoaderView;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.common.widget.shapeview.ShapeTextView;
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.pay.R$styleable;
import com.shizhuang.duapp.modules.product_detail.own.model.FriendGreetingCarInfo;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnGiverInfo;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnOrderModel;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnSkuCardItemModel;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnSkuListItemModel;
import com.shizhuang.duapp.modules.product_detail.own.p005interface.MyOwnCommentCallBack;
import com.shizhuang.duapp.modules.product_detail.own.p005interface.MyOwnSkuCardItemOperateCallBack;
import com.shizhuang.duapp.modules.product_detail.own.ui.MyOwnActivity;
import com.shizhuang.duapp.modules.product_detail.own.vm.MyOwnViewModel;
import com.shizhuang.duapp.modules.product_detail.own.widget.MyOwnEditorMessageEditText;
import fi.b;
import fi.c;
import g00.a;
import j50.p;
import j60.l0;
import j60.z;
import java.util.HashMap;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function4;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.text.StringsKt__StringsKt;
import m21.q;
import m21.r;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(bv = {}, d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003J\b\u0010\u0005\u001a\u00020\u0004H\u0002J\u0010\u0010\b\u001a\u00020\u00072\u0006\u0010\u0006\u001a\u00020\u0004H\u0002J\b\u0010\t\u001a\u00020\u0004H\u0002J\b\u0010\u000b\u001a\u00020\nH\u0002J\b\u0010\f\u001a\u00020\nH\u0016R=\u0010\u0015\u001a$\u0012 \u0012\u001e\u0012\f\u0012\n \u0010*\u0004\u0018\u00010\u000f0\u000f\u0012\f\u0012\n \u0010*\u0004\u0018\u00010\u000f0\u000f0\u000e0\r8BX\u0002¢\u0006\f\n\u0004\b\u0011\u0010\u0012\u001a\u0004\b\u0013\u0010\u0014R\u001b\u0010\u001a\u001a\u00020\u00168BX\u0002¢\u0006\f\n\u0004\b\u0017\u0010\u0012\u001a\u0004\b\u0018\u0010\u0019¨\u0006\u001b"}, d2 = {"Lcom/shizhuang/duapp/modules/product_detail/own/views/MyOwnSkuCardItemViewNew;", "Lcom/shizhuang/duapp/common/component/module/AbsModuleView;", "Lcom/shizhuang/duapp/modules/product_detail/own/model/MyOwnSkuCardItemModel;", "Lcom/shizhuang/duapp/modules/du_mall_common/utils/exposure/callback/IMallViewExposureObserver;", "", "getInputText", "hintContent", "", "setEditTextHintTextSize", "getContentTitle", "", "getContentType", "getLayoutId", "", "Lkotlin/Pair;", "Landroid/widget/TextView;", "kotlin.jvm.PlatformType", "d", "Lkotlin/Lazy;", "getDescViews", "()[Lkotlin/Pair;", "descViews", "Lcom/shizhuang/duapp/modules/product_detail/own/vm/MyOwnViewModel;", "e", "getViewModel", "()Lcom/shizhuang/duapp/modules/product_detail/own/vm/MyOwnViewModel;", "viewModel", "du_product_detail_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: MyOwnSkuCardItemViewNew.kt */
public final class MyOwnSkuCardItemViewNew extends AbsModuleView<MyOwnSkuCardItemModel> implements IMallViewExposureObserver {
public static ChangeQuickRedirect changeQuickRedirect;
public final String b;
/* renamed from: c reason: collision with root package name */
public int f22858c;
public final Lazy d;
public final Lazy e;
public final MyOwnSkuCardItemOperateCallBack f;
/* renamed from: g reason: collision with root package name */
public final MyOwnCommentCallBack f22859g;
/* renamed from: h reason: collision with root package name */
public HashMap f22860h;
@JvmOverloads
public MyOwnSkuCardItemViewNew(@NotNull Context context) {
this(context, null, 0, null, null, 30);
}
@JvmOverloads
public MyOwnSkuCardItemViewNew(@NotNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0, null, null, 28);
}
@JvmOverloads
public MyOwnSkuCardItemViewNew(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
this(context, attributeSet, i, null, null, 24);
}
/* JADX WARNING: Illegal instructions before constructor call */
public MyOwnSkuCardItemViewNew(Context context, AttributeSet attributeSet, int i, MyOwnSkuCardItemOperateCallBack myOwnSkuCardItemOperateCallBack, MyOwnCommentCallBack myOwnCommentCallBack, int i3) {
super(context, attributeSet, i);
attributeSet = (i3 & 2) != 0 ? null : attributeSet;
i = (i3 & 4) != 0 ? 0 : i;
myOwnSkuCardItemOperateCallBack = (i3 & 8) != 0 ? null : myOwnSkuCardItemOperateCallBack;
myOwnCommentCallBack = (i3 & 16) != 0 ? null : myOwnCommentCallBack;
this.f = myOwnSkuCardItemOperateCallBack;
this.f22859g = myOwnCommentCallBack;
this.b = "https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product_detail/ic_own_card_del_tip.png";
this.f22858c = 40;
this.d = LazyKt__LazyJVMKt.lazy(new MyOwnSkuCardItemViewNew$descViews$2(this));
AppCompatActivity g3 = ViewExtensionKt.g(this);
this.e = new ViewModelLazy(Reflection.getOrCreateKotlinClass(MyOwnViewModel.class), new MyOwnSkuCardItemViewNew$$special$$inlined$activityViewModels$2(g3), new MyOwnSkuCardItemViewNew$$special$$inlined$activityViewModels$1(g3));
setLayoutParams(new ViewGroup.LayoutParams((int) (((float) b.f32351a) * 0.8666667f), -2));
setOnLongClickListener(new q(this));
com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt.e((ConstraintLayout) _$_findCachedViewById(R.id.delLayout), 0, new Function1<View, Unit>() {
/* class com.shizhuang.duapp.modules.product_detail.own.views.MyOwnSkuCardItemViewNew.AnonymousClass2 */
public static ChangeQuickRedirect changeQuickRedirect;
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(View view) {
invoke(view);
return Unit.INSTANCE;
}
public final void invoke(@NotNull View view) {
MyOwnSkuCardItemModel myOwnSkuCardItemModel;
MyOwnSkuCardItemViewNew myOwnSkuCardItemViewNew;
MyOwnSkuCardItemOperateCallBack myOwnSkuCardItemOperateCallBack;
if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 280828, new Class[]{View.class}, Void.TYPE).isSupported && (myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) MyOwnSkuCardItemViewNew.this.getData()) != null && (myOwnSkuCardItemOperateCallBack = (myOwnSkuCardItemViewNew = MyOwnSkuCardItemViewNew.this).f) != null) {
myOwnSkuCardItemOperateCallBack.onCancelLongClick(myOwnSkuCardItemModel, ModuleAdapterDelegateKt.b(myOwnSkuCardItemViewNew));
}
}
}, 1);
com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt.e(_$_findCachedViewById(R.id.ivDelete), 0, new Function1<View, Unit>() {
/* class com.shizhuang.duapp.modules.product_detail.own.views.MyOwnSkuCardItemViewNew.AnonymousClass3 */
public static ChangeQuickRedirect changeQuickRedirect;
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(View view) {
invoke(view);
return Unit.INSTANCE;
}
public final void invoke(@NotNull View view) {
MyOwnSkuCardItemModel myOwnSkuCardItemModel;
MyOwnSkuCardItemViewNew myOwnSkuCardItemViewNew;
MyOwnSkuCardItemOperateCallBack myOwnSkuCardItemOperateCallBack;
if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 280829, new Class[]{View.class}, Void.TYPE).isSupported && (myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) MyOwnSkuCardItemViewNew.this.getData()) != null && (myOwnSkuCardItemOperateCallBack = (myOwnSkuCardItemViewNew = MyOwnSkuCardItemViewNew.this).f) != null) {
myOwnSkuCardItemOperateCallBack.onConfirmDelete(myOwnSkuCardItemModel, ModuleAdapterDelegateKt.b(myOwnSkuCardItemViewNew));
}
}
}, 1);
GradientDrawable gradientDrawable = new GradientDrawable();
float f12 = (float) 2;
a.l(gradientDrawable, (float) b.b(f12), "#80000000");
Unit unit = Unit.INSTANCE;
((ConstraintLayout) _$_findCachedViewById(R.id.delLayout)).setBackground(gradientDrawable);
z.b.a(_$_findCachedViewById(R.id.ivDelete), b.b(f12), null);
ViewExtensionKt.r((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput), new Function4<CharSequence, Integer, Integer, Integer, Unit>() {
/* class com.shizhuang.duapp.modules.product_detail.own.views.MyOwnSkuCardItemViewNew.AnonymousClass5 */
public static ChangeQuickRedirect changeQuickRedirect;
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function4
public /* bridge */ /* synthetic */ Unit invoke(CharSequence charSequence, Integer num, Integer num2, Integer num3) {
invoke(charSequence, num.intValue(), num2.intValue(), num3.intValue());
return Unit.INSTANCE;
}
public final void invoke(@Nullable CharSequence charSequence, int i, int i3, int i12) {
Object[] objArr = {charSequence, new Integer(i), new Integer(i3), new Integer(i12)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Integer.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 280830, new Class[]{CharSequence.class, cls, cls, cls}, Void.TYPE).isSupported) {
MyOwnSkuCardItemViewNew.this.d();
}
}
});
((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput)).setOnEditorActionListener(new r(this));
}
private final String getContentTitle() {
MyOwnSkuListItemModel sku;
boolean z = false;
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280821, new Class[0], String.class);
if (proxy.isSupported) {
return (String) proxy.result;
}
FontText fontText = (FontText) _$_findCachedViewById(R.id.tvHornoraryTitle);
if (fontText == null) {
return "";
}
if (fontText.getVisibility() == 0) {
z = true;
}
if (!z) {
return "";
}
MyOwnSkuCardItemModel myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) getData();
String title = (myOwnSkuCardItemModel == null || (sku = myOwnSkuCardItemModel.getSku()) == null) ? null : sku.getTitle();
if (title != null) {
return title;
}
return "";
}
private final int getContentType() {
MyOwnSkuCardItemModel myOwnSkuCardItemModel;
MyOwnSkuListItemModel sku;
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280822, new Class[0], Integer.TYPE);
if (proxy.isSupported) {
return ((Integer) proxy.result).intValue();
}
FontText fontText = (FontText) _$_findCachedViewById(R.id.tvHornoraryTitle);
if (fontText == null) {
return 0;
}
if (!(fontText.getVisibility() == 0) || (myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) getData()) == null || (sku = myOwnSkuCardItemModel.getSku()) == null) {
return 0;
}
return sku.getTitleType();
}
private final Pair<TextView, TextView>[] getDescViews() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280807, new Class[0], Pair[].class);
return (Pair[]) (proxy.isSupported ? proxy.result : this.d.getValue());
}
private final String getInputText() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280813, new Class[0], String.class);
return proxy.isSupported ? (String) proxy.result : StringsKt__StringsKt.trim((CharSequence) String.valueOf(((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput)).getText())).toString();
}
private final void setEditTextHintTextSize(String str) {
if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 280817, new Class[]{String.class}, Void.TYPE).isSupported) {
SpannableString spannableString = new SpannableString(str);
spannableString.setSpan(new AbsoluteSizeSpan(9, true), 0, spannableString.length(), 33);
((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput)).setHint(new SpannableString(spannableString));
}
}
public View _$_findCachedViewById(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 280823, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.f22860h == null) {
this.f22860h = new HashMap();
}
View view = (View) this.f22860h.get(Integer.valueOf(i));
if (view != null) {
return view;
}
View findViewById = findViewById(i);
this.f22860h.put(Integer.valueOf(i), findViewById);
return findViewById;
}
public final void a(boolean z, boolean z4) {
int i = 0;
Object[] objArr = {new Byte(z ? (byte) 1 : 0), new Byte(z4 ? (byte) 1 : 0)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Boolean.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 280815, new Class[]{cls, cls}, Void.TYPE).isSupported) {
((LinearLayout) _$_findCachedViewById(R.id.messageEdParent)).setVisibility(z ? 0 : 8);
LinearLayout linearLayout = (LinearLayout) _$_findCachedViewById(R.id.messageEdTips);
if (!z4) {
i = 8;
}
linearLayout.setVisibility(i);
}
}
public final void b(boolean z, String str) {
MyOwnSkuListItemModel sku;
if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0), str}, this, changeQuickRedirect, false, 280814, new Class[]{Boolean.TYPE, String.class}, Void.TYPE).isSupported && l.b(this)) {
if (z) {
MyOwnSkuCardItemModel myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) getData();
if (!(myOwnSkuCardItemModel == null || (sku = myOwnSkuCardItemModel.getSku()) == null)) {
sku.setShowVerifyText(false);
}
((AppCompatTextView) _$_findCachedViewById(R.id.messageVerifyText)).setVisibility(8);
((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput)).setText(str);
MyOwnEditorMessageEditText myOwnEditorMessageEditText = (MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput);
if (str == null) {
str = "";
}
myOwnEditorMessageEditText.setSelection(str.length());
}
a(true, false);
MyOwnEditorMessageEditText myOwnEditorMessageEditText2 = (MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput);
if (myOwnEditorMessageEditText2 != null) {
myOwnEditorMessageEditText2.requestFocus();
}
c.e((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput), getContext());
}
}
public final void c(MyOwnSkuCardItemModel myOwnSkuCardItemModel) {
MyOwnSkuListItemModel sku;
int i = 1;
if (!PatchProxy.proxy(new Object[]{myOwnSkuCardItemModel}, this, changeQuickRedirect, false, 280818, new Class[]{MyOwnSkuCardItemModel.class}, Void.TYPE).isSupported) {
u21.a aVar = u21.a.f38776a;
MyOwnSkuListItemModel sku2 = myOwnSkuCardItemModel.getSku();
FriendGreetingCarInfo friendGreetingCarInfo = null;
String c5 = p.c(sku2 != null ? sku2.getRowKey() : null);
String contentTitle = getContentTitle();
MyOwnSkuListItemModel sku3 = myOwnSkuCardItemModel.getSku();
Long valueOf = Long.valueOf(sku3 != null ? sku3.getSkuId() : 0);
Long valueOf2 = Long.valueOf(myOwnSkuCardItemModel.getSpuId());
MyOwnSkuListItemModel sku4 = myOwnSkuCardItemModel.getSku();
if (sku4 != null) {
friendGreetingCarInfo = sku4.getIntentionInfo();
}
String str = "";
String str2 = friendGreetingCarInfo != null ? "贺卡" : str;
MyOwnSkuListItemModel sku5 = myOwnSkuCardItemModel.getSku();
if (sku5 != null && sku5.isGift()) {
str = ((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).getText().toString();
}
MyOwnSkuListItemModel sku6 = myOwnSkuCardItemModel.getSku();
if ((sku6 == null || !sku6.isVerifySuccess()) && ((sku = myOwnSkuCardItemModel.getSku()) == null || !sku.isVerifyIng())) {
i = 0;
}
aVar.f(c5, contentTitle, valueOf, valueOf2, str2, str, Integer.valueOf(i), Integer.valueOf(getContentType()));
}
}
public final void d() {
MyOwnSkuListItemModel sku;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280816, new Class[0], Void.TYPE).isSupported) {
int length = StringsKt__StringsKt.trim((CharSequence) String.valueOf(((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput)).getText())).toString().length();
MyOwnSkuCardItemModel myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) getData();
if (!(myOwnSkuCardItemModel == null || (sku = myOwnSkuCardItemModel.getSku()) == null)) {
sku.setInputMessage(getInputText());
}
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
if (length > 0) {
spannableStringBuilder.append(String.valueOf(length), new ForegroundColorSpan(Color.parseColor("#B3AAAABB")), 17);
StringBuilder sb2 = new StringBuilder();
sb2.append('/');
sb2.append(this.f22858c);
spannableStringBuilder.append((CharSequence) sb2.toString());
} else {
spannableStringBuilder.append((CharSequence) "");
}
((TextView) _$_findCachedViewById(R.id.messageEdCount)).setText(spannableStringBuilder);
}
}
@Override // com.shizhuang.duapp.common.component.module.AbsModuleView
public int getLayoutId() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280809, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.item_own_sku_card_new;
}
public final MyOwnViewModel getViewModel() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280808, new Class[0], MyOwnViewModel.class);
return (MyOwnViewModel) (proxy.isSupported ? proxy.result : this.e.getValue());
}
/* 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(MyOwnSkuCardItemModel myOwnSkuCardItemModel) {
int i;
Pair[] pairArr;
String str;
MyOwnSkuCardItemModel myOwnSkuCardItemModel2 = myOwnSkuCardItemModel;
if (!PatchProxy.proxy(new Object[]{myOwnSkuCardItemModel2}, this, changeQuickRedirect, false, 280811, new Class[]{MyOwnSkuCardItemModel.class}, Void.TYPE).isSupported) {
super.onChanged(myOwnSkuCardItemModel2);
((DuImageLoaderView) _$_findCachedViewById(R.id.iconEdit)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product_detail/icon_edit_gray.png").x();
((DuImageLoaderView) _$_findCachedViewById(R.id.ivTips)).i(this.b).x();
((FontText) _$_findCachedViewById(R.id.tvProductTitle)).setText(myOwnSkuCardItemModel2.getName());
MyOwnSkuListItemModel sku = myOwnSkuCardItemModel2.getSku();
MyOwnSkuListItemModel myOwnSkuListItemModel = sku != null ? sku : new MyOwnSkuListItemModel(null, null, null, null, null, null, 0, 0, null, 0, null, null, null, 8191, null);
TextView textView = (TextView) _$_findCachedViewById(R.id.tvSkuDesc);
StringBuilder h12 = f.h("规格 ");
String propertiesValue = myOwnSkuListItemModel.getPropertiesValue();
String str2 = "";
if (propertiesValue == null) {
propertiesValue = str2;
}
h12.append(propertiesValue);
textView.setText(h12.toString());
MyOwnSkuListItemModel sku2 = myOwnSkuCardItemModel2.getSku();
if (sku2 == null || sku2.getIntentionInfo() == null) {
((ImageView) _$_findCachedViewById(R.id.ivGreetingCard)).setVisibility(8);
} else {
((ImageView) _$_findCachedViewById(R.id.ivGreetingCard)).setVisibility(0);
l0.a((ImageView) _$_findCachedViewById(R.id.ivGreetingCard), b.b((float) 20));
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.ivGreetingCard), 0, new MyOwnSkuCardItemViewNew$onChanged$$inlined$let$lambda$1(this, myOwnSkuCardItemModel2), 1);
}
Unit unit = Unit.INSTANCE;
if (((ImageView) _$_findCachedViewById(R.id.ivGreetingCard)).getVisibility() == 0) {
((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).setMaxWidth(b.b((float) R$styleable.AppCompatTheme_textAppearanceSearchResultTitle));
} else {
((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).setMaxWidth(b.b((float) 180));
}
if (myOwnSkuListItemModel.isGift()) {
((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
FontText fontText = (FontText) _$_findCachedViewById(R.id.tvHornoraryTitle);
MyOwnGiverInfo giverInfo = myOwnSkuListItemModel.getGiverInfo();
String userName = giverInfo != null ? giverInfo.getUserName() : null;
String str3 = userName != null ? userName : str2;
FontText fontText2 = (FontText) _$_findCachedViewById(R.id.tvHornoraryTitle);
int maxWidth = ((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).getMaxWidth();
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{str3, fontText2, new Integer(maxWidth)}, this, changeQuickRedirect, false, 280820, new Class[]{String.class, TextView.class, Integer.TYPE}, String.class);
if (proxy.isSupported) {
str = (String) proxy.result;
} else {
String g3 = a01.a.g("来自", str3, "的礼物");
float measureText = fontText2.getPaint().measureText(g3);
String str4 = str3;
while (measureText > ((float) maxWidth)) {
String l = fd0.c.l(str4, 1, 0);
int length = l.length() - 1;
int i3 = 0;
boolean z = false;
while (i3 <= length) {
boolean z4 = Intrinsics.compare(l.charAt(!z ? i3 : length), 32) <= 0;
if (!z) {
if (!z4) {
z = true;
} else {
i3++;
}
} else if (!z4) {
break;
} else {
length--;
}
}
str4 = androidx.appcompat.widget.a.f(length, 1, l, i3);
g3 = a0.b.f("来自", str4, "...", "的礼物");
measureText = fontText2.getPaint().measureText(g3);
}
str = g3;
}
fontText.setText(str);
i = R.id.tvHornoraryTitle;
((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).setVisibility(0);
} else {
i = R.id.tvHornoraryTitle;
((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_own_card_wheat_left, 0, R.drawable.ic_own_card_wheat_right, 0);
((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).setText(myOwnSkuListItemModel.getTitle());
FontText fontText3 = (FontText) _$_findCachedViewById(R.id.tvHornoraryTitle);
String title = myOwnSkuListItemModel.getTitle();
fontText3.setVisibility((title == null || title.length() == 0) ^ true ? 0 : 8);
}
((ImageView) _$_findCachedViewById(R.id.goodTagView)).setVisibility((((FontText) _$_findCachedViewById(i)).getVisibility() == 0) ^ true ? 0 : 8);
boolean isPlatformBuy = myOwnSkuListItemModel.isPlatformBuy();
co.c i12 = ((DuImageLoaderView) _$_findCachedViewById(R.id.bgCard)).i(isPlatformBuy ? "https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product_detail/bg_own_detail_card_poizion_new.png" : "https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product_detail/bg_own_detail_card_new.png");
MyOwnActivity.a aVar = MyOwnActivity.f22821q;
((co.c) ((co.c) i12.v(aVar.b())).d()).x();
((DuImageLoaderView) _$_findCachedViewById(R.id.ivPoizonTag)).setVisibility(isPlatformBuy ? 0 : 8);
if (isPlatformBuy) {
((co.c) ((DuImageLoaderView) _$_findCachedViewById(R.id.ivPoizonTag)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product_detail/icon_detail_card_poizon_tag_new.png").v(aVar.a())).p0(DuScaleType.FIT_XY).x();
}
if (isPlatformBuy) {
pairArr = new Pair[3];
StringBuilder sb2 = new StringBuilder();
MyOwnOrderModel orderInfo = myOwnSkuListItemModel.getOrderInfo();
sb2.append(orderInfo != null ? orderInfo.getBuyerName() : null);
sb2.append(" ");
MyOwnOrderModel orderInfo2 = myOwnSkuListItemModel.getOrderInfo();
sb2.append(orderInfo2 != null ? orderInfo2.getBuyerPhone() : null);
pairArr[0] = new Pair("收货人", sb2.toString());
MyOwnOrderModel orderInfo3 = myOwnSkuListItemModel.getOrderInfo();
pairArr[1] = new Pair("购入金额", orderInfo3 != null ? orderInfo3.getOrderMoney() : null);
pairArr[2] = new Pair("下单时间", myOwnSkuListItemModel.getCreateTime());
} else {
pairArr = new Pair[]{new Pair("添加时间", myOwnSkuListItemModel.getCreateTime())};
}
Pair<TextView, TextView>[] descViews = getDescViews();
int length2 = descViews.length;
int i13 = 0;
int i14 = 0;
while (i13 < length2) {
Pair<TextView, TextView> pair = descViews[i13];
int i15 = i14 + 1;
TextView component1 = pair.component1();
TextView component2 = pair.component2();
Pair pair2 = (Pair) ArraysKt___ArraysKt.getOrNull(pairArr, i14);
component1.setText(pair2 != null ? (String) pair2.getFirst() : null);
CharSequence text = component1.getText();
component1.setVisibility((text == null || text.length() == 0) ^ true ? 0 : 8);
component2.setText(pair2 != null ? (String) pair2.getSecond() : null);
CharSequence text2 = component2.getText();
component2.setVisibility((text2 == null || text2.length() == 0) ^ true ? 0 : 8);
i13++;
i14 = i15;
}
ProductImageLoaderView productImageLoaderView = (ProductImageLoaderView) _$_findCachedViewById(R.id.ivProduct);
String img = myOwnSkuListItemModel.getImg();
if (img != null) {
str2 = img;
}
g.a(productImageLoaderView.i(str2), DrawableScale.OneToOne).d0(300).x();
ViewExtensionKt.j((ShapeTextView) _$_findCachedViewById(R.id.tvEnterProductDetail), 0, new MyOwnSkuCardItemViewNew$onChanged$4(this, myOwnSkuCardItemModel2, myOwnSkuListItemModel), 1);
setEditTextHintTextSize("请输入你拥有Ta时的心情吧~");
((MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput)).setFilters(new InputFilter[]{new InputFilter.LengthFilter(this.f22858c)});
ViewExtensionKt.h((LinearLayout) _$_findCachedViewById(R.id.messageEdTips), new MyOwnSkuCardItemViewNew$onChanged$5(this, myOwnSkuListItemModel, myOwnSkuCardItemModel2));
}
}
@Override // com.shizhuang.duapp.modules.du_mall_common.utils.exposure.callback.IMallViewExposureObserver
public void onExposure() {
MyOwnSkuListItemModel sku;
MyOwnSkuListItemModel sku2;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280819, new Class[0], Void.TYPE).isSupported) {
MyOwnSkuCardItemModel myOwnSkuCardItemModel = (MyOwnSkuCardItemModel) getData();
if (myOwnSkuCardItemModel != null) {
u21.a aVar = u21.a.f38776a;
String contentTitle = getContentTitle();
MyOwnSkuListItemModel sku3 = myOwnSkuCardItemModel.getSku();
Long valueOf = Long.valueOf(sku3 != null ? sku3.getSkuId() : 0);
Long valueOf2 = Long.valueOf(myOwnSkuCardItemModel.getSpuId());
MyOwnSkuListItemModel sku4 = myOwnSkuCardItemModel.getSku();
Integer valueOf3 = Integer.valueOf(((sku4 == null || !sku4.isVerifySuccess()) && ((sku2 = myOwnSkuCardItemModel.getSku()) == null || !sku2.isVerifyIng())) ? 0 : 1);
Integer valueOf4 = Integer.valueOf(getContentType());
if (!PatchProxy.proxy(new Object[]{contentTitle, valueOf, valueOf2, valueOf3, valueOf4}, aVar, u21.a.changeQuickRedirect, false, 282590, new Class[]{Object.class, Object.class, Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
i60.b bVar = i60.b.f33293a;
ArrayMap c5 = a.c(8, "block_content_title", contentTitle, "sku_id", valueOf);
c5.put("spu_id", valueOf2);
c5.put("is_labeled", valueOf3);
c5.put("block_content_type", valueOf4);
bVar.b("trade_common_exposure", "1016", "380", c5);
}
MyOwnSkuListItemModel sku5 = myOwnSkuCardItemModel.getSku();
FriendGreetingCarInfo friendGreetingCarInfo = null;
String c12 = p.c(sku5 != null ? sku5.getRowKey() : null);
String contentTitle2 = getContentTitle();
MyOwnSkuListItemModel sku6 = myOwnSkuCardItemModel.getSku();
Long valueOf5 = Long.valueOf(sku6 != null ? sku6.getSkuId() : 0);
Long valueOf6 = Long.valueOf(myOwnSkuCardItemModel.getSpuId());
MyOwnSkuListItemModel sku7 = myOwnSkuCardItemModel.getSku();
if (sku7 != null) {
friendGreetingCarInfo = sku7.getIntentionInfo();
}
String str = "";
String str2 = friendGreetingCarInfo != null ? "贺卡" : str;
MyOwnSkuListItemModel sku8 = myOwnSkuCardItemModel.getSku();
if (sku8 != null && sku8.isGift()) {
str = ((FontText) _$_findCachedViewById(R.id.tvHornoraryTitle)).getText().toString();
}
MyOwnSkuListItemModel sku9 = myOwnSkuCardItemModel.getSku();
aVar.t(c12, contentTitle2, valueOf5, valueOf6, str2, str, Integer.valueOf(((sku9 == null || !sku9.isVerifySuccess()) && ((sku = myOwnSkuCardItemModel.getSku()) == null || !sku.isVerifyIng())) ? 0 : 1), Integer.valueOf(getContentType()));
}
}
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // com.shizhuang.duapp.common.component.module.IModuleView, com.shizhuang.duapp.common.component.module.AbsModuleView
public void update(MyOwnSkuCardItemModel myOwnSkuCardItemModel) {
String str;
MyOwnSkuCardItemModel myOwnSkuCardItemModel2 = myOwnSkuCardItemModel;
boolean z = true;
if (!PatchProxy.proxy(new Object[]{myOwnSkuCardItemModel2}, this, changeQuickRedirect, false, 280810, new Class[]{MyOwnSkuCardItemModel.class}, Void.TYPE).isSupported) {
super.update(myOwnSkuCardItemModel2);
int i = 8;
((ConstraintLayout) _$_findCachedViewById(R.id.delLayout)).setVisibility(myOwnSkuCardItemModel2.isLongSelected() || myOwnSkuCardItemModel2.isShowDeleteTips() ? 0 : 8);
((Group) _$_findCachedViewById(R.id.groupDelete)).setVisibility(myOwnSkuCardItemModel2.isLongSelected() && !myOwnSkuCardItemModel2.isShowDeleteTips() ? 0 : 8);
((DuImageLoaderView) _$_findCachedViewById(R.id.ivTips)).setVisibility(!myOwnSkuCardItemModel2.isLongSelected() && myOwnSkuCardItemModel2.isShowDeleteTips() ? 0 : 8);
MyOwnSkuListItemModel sku = myOwnSkuCardItemModel2.getSku();
if (sku == null) {
sku = new MyOwnSkuListItemModel(null, null, null, null, null, null, 0, 0, null, 0, null, null, null, 8191, null);
}
ViewExtensionKt.h((AppCompatTextView) _$_findCachedViewById(R.id.messageVerifyText), new MyOwnSkuCardItemViewNew$update$1(this, sku, myOwnSkuCardItemModel2));
String selectEmotion = sku.getSelectEmotion();
boolean z4 = !(selectEmotion == null || selectEmotion.length() == 0) && (sku.isVerifyIng() || sku.isVerifySuccess());
if (z4) {
a(false, false);
} else {
a(!sku.getShowTipsParent(), sku.getShowTipsParent());
}
String str2 = "";
String str3 = sku.isVerifyIng() ? "(内容审核中)" : str2;
AppCompatTextView appCompatTextView = (AppCompatTextView) _$_findCachedViewById(R.id.messageVerifyText);
if (z4) {
StringBuilder sb2 = new StringBuilder();
String selectEmotion2 = sku.getSelectEmotion();
if (selectEmotion2 == null) {
selectEmotion2 = str2;
}
str = f.g(sb2, selectEmotion2, str3);
} else {
str = str2;
}
appCompatTextView.setText(str);
AppCompatTextView appCompatTextView2 = (AppCompatTextView) _$_findCachedViewById(R.id.messageVerifyText);
if (z4) {
i = 0;
}
appCompatTextView2.setVisibility(i);
sku.setShowVerifyText(z4);
AppCompatTextView appCompatTextView3 = (AppCompatTextView) _$_findCachedViewById(R.id.messageVerifyText);
Integer selectEmotionStatus = sku.getSelectEmotionStatus();
appCompatTextView3.setClickable(selectEmotionStatus == null || selectEmotionStatus.intValue() != 1);
MyOwnEditorMessageEditText myOwnEditorMessageEditText = (MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput);
String inputMessage = sku.getInputMessage();
if (inputMessage == null) {
inputMessage = str2;
}
myOwnEditorMessageEditText.setText(inputMessage);
MyOwnEditorMessageEditText myOwnEditorMessageEditText2 = (MyOwnEditorMessageEditText) _$_findCachedViewById(R.id.messageEdInput);
String inputMessage2 = sku.getInputMessage();
if (inputMessage2 == null) {
inputMessage2 = str2;
}
myOwnEditorMessageEditText2.setSelection(inputMessage2.length());
if (sku.getOpenSoftKeyBoard()) {
if (!sku.isVerifySuccess() || !sku.isShowVerifyText()) {
z = false;
}
String selectEmotion3 = sku.getSelectEmotion();
if (selectEmotion3 != null) {
str2 = selectEmotion3;
}
b(z, str2);
}
}
}
}