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


package com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.view;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.GradientDrawable;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
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.NormalModuleAdapter;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.extension.LifecycleExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.callback.IMallViewExposureObserver;
import com.shizhuang.duapp.modules.productv2.facedetect.result.model.AiSkinDetectRecord;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.dialog.SkinIssueEditDialog;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.model.MySkin;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.model.SkinConfig;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.model.SkinConfigGroup;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.model.UserSkinValue;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.pop.PopExtendsKt$showSkinIssuePop$2;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.pop.VerticalDivider;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.vm.AiSkinHelpViewModel;
import j51.b;
import java.util.HashMap;
import java.util.List;
import k51.a;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import nd.e;
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\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\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\r\u001a\u00020\f\u0012\n\b\u0002\u0010\u000f\u001a\u0004\u0018\u00010\u000e\u0012\b\b\u0002\u0010\u0010\u001a\u00020\u0004¢\u0006\u0004\b\u0011\u0010\u0012J\b\u0010\u0005\u001a\u00020\u0004H\u0016R\u001b\u0010\u000b\u001a\u00020\u00068BX‚„\u0002¢\u0006\f\n\u0004\b\u0007\u0010\b\u001a\u0004\b\t\u0010\n¨\u0006\u0013"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/facedetect/skinhelp/view/MySkinStateView;", "Lcom/shizhuang/duapp/common/component/module/AbsModuleView;", "Lcom/shizhuang/duapp/modules/productv2/facedetect/skinhelp/model/MySkin;", "Lcom/shizhuang/duapp/modules/du_mall_common/utils/exposure/callback/IMallViewExposureObserver;", "", "getLayoutId", "Lcom/shizhuang/duapp/modules/productv2/facedetect/skinhelp/vm/AiSkinHelpViewModel;", "b", "Lkotlin/Lazy;", "getVm", "()Lcom/shizhuang/duapp/modules/productv2/facedetect/skinhelp/vm/AiSkinHelpViewModel;", "vm", "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: MySkinStateView.kt */
public final class MySkinStateView extends AbsModuleView<MySkin> implements IMallViewExposureObserver {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final Lazy b;

    /* renamed from: c  reason: collision with root package name */
    public final List<a> f23702c;
    public HashMap d;

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

    @JvmOverloads
    public MySkinStateView(@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 */ MySkinStateView(Context context, AttributeSet attributeSet, int i, int i3) {
        this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
    }

    private final AiSkinHelpViewModel getVm() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294929, new Class[0], AiSkinHelpViewModel.class);
        return (AiSkinHelpViewModel) (proxy.isSupported ? proxy.result : this.b.getValue());
    }

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

    public final void a(a aVar) {
        int i;
        int i3;
        char c5;
        int i12;
        int i13;
        Point point;
        int i14;
        if (!PatchProxy.proxy(new Object[]{aVar}, this, changeQuickRedirect, false, 294933, new Class[]{a.class}, Void.TYPE).isSupported) {
            i60.a.f33292a.x0(aVar.c().getVisibility() == 0 ? aVar.c().getText() : "编辑", aVar.a().getLabel());
            Context context = getContext();
            int indexOf = this.f23702c.indexOf(aVar);
            SkinConfigGroup d12 = getVm().d(aVar.a().getKey());
            if (d12 != null) {
                b bVar = new b(context);
                MySkinStateView$onIssueClick$1 mySkinStateView$onIssueClick$1 = new MySkinStateView$onIssueClick$1(this, aVar, d12);
                Object[] objArr = {bVar, context, new Integer(indexOf), aVar, d12, mySkinStateView$onIssueClick$1};
                ChangeQuickRedirect changeQuickRedirect2 = j51.a.changeQuickRedirect;
                Class cls = Integer.TYPE;
                if (!PatchProxy.proxy(objArr, null, changeQuickRedirect2, true, 294856, new Class[]{b.class, Context.class, cls, a.class, SkinConfigGroup.class, Function1.class}, Void.TYPE).isSupported) {
                    List<SkinConfig> skinConfigs = d12.getSkinConfigs();
                    if ((context instanceof Activity) && indexOf != -1) {
                        if (!(skinConfigs == null || skinConfigs.isEmpty())) {
                            Object[] objArr2 = {new Byte((byte) 1)};
                            ChangeQuickRedirect changeQuickRedirect3 = b.changeQuickRedirect;
                            Class cls2 = Boolean.TYPE;
                            PatchProxyResult proxy = PatchProxy.proxy(objArr2, bVar, changeQuickRedirect3, false, 294883, new Class[]{cls2}, b.class);
                            if (proxy.isSupported) {
                                b bVar2 = (b) proxy.result;
                            } else {
                                bVar.setOutsideTouchable(true);
                                bVar.setTouchable(true);
                            }
                            int size = (skinConfigs.size() + fi.b.b((float) (skinConfigs.size() * 28))) - 1;
                            RecyclerView recyclerView = new RecyclerView(context);
                            recyclerView.setLayoutParams(new FrameLayout.LayoutParams(fi.b.b((float) 68), size));
                            GradientDrawable gradientDrawable = new GradientDrawable();
                            gradientDrawable.setColor(Color.parseColor("#FFFFFF"));
                            gradientDrawable.setCornerRadius((float) fi.b.b((float) 2));
                            Unit unit = Unit.INSTANCE;
                            recyclerView.setBackground(gradientDrawable);
                            NormalModuleAdapter normalModuleAdapter = new NormalModuleAdapter(false, 1);
                            normalModuleAdapter.getDelegate().C(SkinConfig.class, 1, null, -1, true, null, null, new PopExtendsKt$showSkinIssuePop$2(bVar, context, mySkinStateView$onIssueClick$1));
                            recyclerView.setLayoutManager(new LinearLayoutManager(context));
                            recyclerView.addItemDecoration(new VerticalDivider(1, fi.b.b((float) 6), Color.parseColor("#46A1A1B6")));
                            recyclerView.setAdapter(normalModuleAdapter);
                            normalModuleAdapter.setItems(skinConfigs);
                            bVar.getContentView().addView(recyclerView);
                            ViewParent parent = bVar.getContentView().getParent();
                            if (parent instanceof RelativeLayout) {
                                View view = (View) parent;
                                LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) view.getLayoutParams();
                                layoutParams.height = size;
                                view.setLayoutParams(layoutParams);
                            }
                            Activity activity = (Activity) context;
                            View c12 = aVar.c().getVisibility() == 0 ? aVar.c() : aVar.b();
                            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{new Integer(indexOf)}, null, j51.a.changeQuickRedirect, true, 294858, new Class[]{cls}, cls);
                            if (proxy2.isSupported) {
                                i = ((Integer) proxy2.result).intValue();
                                i3 = 4;
                            } else if (indexOf == 0 || indexOf == 1) {
                                i3 = 4;
                                i = 128;
                            } else if (indexOf != 2) {
                                if (indexOf != 3) {
                                    i3 = 4;
                                    if (indexOf != 4) {
                                        i = 72;
                                    }
                                } else {
                                    i3 = 4;
                                }
                                i = 64;
                            } else {
                                i3 = 4;
                                i = 136;
                            }
                            PatchProxyResult proxy3 = PatchProxy.proxy(new Object[]{new Integer(indexOf)}, null, j51.a.changeQuickRedirect, true, 294857, new Class[]{cls}, cls);
                            int intValue = proxy3.isSupported ? ((Integer) proxy3.result).intValue() : (indexOf == 0 || indexOf == 1) ? 310 : indexOf != 2 ? (indexOf == 3 || indexOf == i3) ? 410 : 430 : 330;
                            int b2 = fi.b.b((float) (indexOf > 2 ? -9 : 9));
                            PatchProxyResult proxy4 = PatchProxy.proxy(new Object[]{new Integer(indexOf), aVar}, null, j51.a.changeQuickRedirect, true, 294859, new Class[]{cls, a.class}, cls);
                            if (proxy4.isSupported) {
                                i13 = ((Integer) proxy4.result).intValue();
                                i12 = 6;
                                c5 = 5;
                            } else {
                                int b5 = fi.b.b((float) 8);
                                int b12 = fi.b.b((float) 12);
                                if (indexOf == 0) {
                                    c5 = 5;
                                    i13 = (-(aVar.b().getHeight() - b5)) / 2;
                                } else if (indexOf != 1) {
                                    if (indexOf == 2) {
                                        c5 = 5;
                                        i14 = (aVar.b().getHeight() + b12) / 2;
                                    } else if (indexOf == 3) {
                                        c5 = 5;
                                        i13 = (-(aVar.c().getHeight() - b5)) / 2;
                                    } else if (indexOf != i3) {
                                        c5 = 5;
                                        if (indexOf != 5) {
                                            i13 = 0;
                                        } else {
                                            i14 = (aVar.c().getHeight() + b12) / 2;
                                        }
                                    } else {
                                        c5 = 5;
                                        i13 = (-(aVar.c().getHeight() - b5)) / 2;
                                    }
                                    i13 = i14 + b5;
                                } else {
                                    c5 = 5;
                                    i13 = (-(aVar.b().getHeight() - b5)) / 2;
                                }
                                i12 = 6;
                            }
                            Object[] objArr3 = new Object[i12];
                            objArr3[0] = activity;
                            objArr3[1] = c12;
                            objArr3[2] = new Integer(i);
                            objArr3[3] = new Integer(intValue);
                            objArr3[i3] = new Integer(b2);
                            objArr3[c5] = new Integer(i13);
                            ChangeQuickRedirect changeQuickRedirect4 = b.changeQuickRedirect;
                            Class[] clsArr = new Class[6];
                            clsArr[0] = Activity.class;
                            clsArr[1] = View.class;
                            clsArr[2] = cls;
                            clsArr[3] = cls;
                            clsArr[i3] = cls;
                            clsArr[c5] = cls;
                            PatchProxyResult proxy5 = PatchProxy.proxy(objArr3, bVar, changeQuickRedirect4, false, 294875, clsArr, cls2);
                            if (proxy5.isSupported) {
                                ((Boolean) proxy5.result).booleanValue();
                            } else if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) {
                                if (bVar.f34173g) {
                                    point = bVar.a(c12, i, b2, i13);
                                    bVar.f(c12, intValue);
                                } else {
                                    bVar.f(c12, intValue);
                                    point = bVar.a(c12, i, b2, i13);
                                }
                                if (c12.getWindowToken() != null) {
                                    try {
                                        bVar.showAtLocation(c12, 0, point.x, point.y);
                                        int i15 = bVar.i;
                                        if (i15 > 0) {
                                            c12.postDelayed(new dc.a(bVar, 15), (long) i15);
                                        }
                                    } catch (Exception unused) {
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public final void b(TextView textView, ImageView imageView, boolean z, String str) {
        int i = 4;
        if (!PatchProxy.proxy(new Object[]{textView, imageView, new Byte(z ? (byte) 1 : 0), str}, this, changeQuickRedirect, false, 294932, new Class[]{TextView.class, ImageView.class, Boolean.TYPE, String.class}, Void.TYPE).isSupported) {
            textView.setVisibility(!z ? 1 : 0 ? 4 : 0);
            if (!z) {
                i = 0;
            }
            imageView.setVisibility(i);
            textView.setText(str);
        }
    }

    public final void c(String str, Integer num) {
        if (!PatchProxy.proxy(new Object[]{str, num}, this, changeQuickRedirect, false, 294934, new Class[]{String.class, Integer.class}, Void.TYPE).isSupported) {
            getVm().f(MapsKt__MapsJVMKt.mapOf(TuplesKt.to(str, num)));
        }
    }

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

    @Override // com.shizhuang.duapp.modules.du_mall_common.utils.exposure.callback.IMallViewExposureObserver
    public void onExposure() {
        MySkin mySkin;
        Integer wrinkleLevel;
        Integer poreLevel;
        Integer blackheadLevel;
        Integer acneLevel;
        Integer speckleLevel;
        Integer darkCircleLevel;
        Integer sensitivity;
        Integer skinQuality;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294935, new Class[0], Void.TYPE).isSupported && (mySkin = (MySkin) getData()) != null) {
            ArrayMap arrayMap = new ArrayMap();
            SkinIssue skinIssue = SkinIssue.SKIN_TYPE;
            String label = skinIssue.getLabel();
            AiSkinHelpViewModel vm2 = getVm();
            String key = skinIssue.getKey();
            UserSkinValue userSkinResponse = mySkin.getUserSkinResponse();
            arrayMap.put(label, vm2.c(key, Integer.valueOf((userSkinResponse == null || (skinQuality = userSkinResponse.getSkinQuality()) == null) ? 0 : skinQuality.intValue())));
            SkinIssue skinIssue2 = SkinIssue.SKIN_SENSITIVITY;
            String label2 = skinIssue2.getLabel();
            AiSkinHelpViewModel vm3 = getVm();
            String key2 = skinIssue2.getKey();
            UserSkinValue userSkinResponse2 = mySkin.getUserSkinResponse();
            arrayMap.put(label2, vm3.c(key2, Integer.valueOf((userSkinResponse2 == null || (sensitivity = userSkinResponse2.getSensitivity()) == null) ? 0 : sensitivity.intValue())));
            SkinIssue skinIssue3 = SkinIssue.DARK_CIRCLE;
            String label3 = skinIssue3.getLabel();
            AiSkinHelpViewModel vm4 = getVm();
            String key3 = skinIssue3.getKey();
            UserSkinValue userSkinResponse3 = mySkin.getUserSkinResponse();
            arrayMap.put(label3, vm4.c(key3, Integer.valueOf((userSkinResponse3 == null || (darkCircleLevel = userSkinResponse3.getDarkCircleLevel()) == null) ? 0 : darkCircleLevel.intValue())));
            SkinIssue skinIssue4 = SkinIssue.SPECKLE;
            String label4 = skinIssue4.getLabel();
            AiSkinHelpViewModel vm5 = getVm();
            String key4 = skinIssue4.getKey();
            UserSkinValue userSkinResponse4 = mySkin.getUserSkinResponse();
            arrayMap.put(label4, vm5.c(key4, Integer.valueOf((userSkinResponse4 == null || (speckleLevel = userSkinResponse4.getSpeckleLevel()) == null) ? 0 : speckleLevel.intValue())));
            SkinIssue skinIssue5 = SkinIssue.ACNE;
            String label5 = skinIssue5.getLabel();
            AiSkinHelpViewModel vm6 = getVm();
            String key5 = skinIssue5.getKey();
            UserSkinValue userSkinResponse5 = mySkin.getUserSkinResponse();
            arrayMap.put(label5, vm6.c(key5, Integer.valueOf((userSkinResponse5 == null || (acneLevel = userSkinResponse5.getAcneLevel()) == null) ? 0 : acneLevel.intValue())));
            SkinIssue skinIssue6 = SkinIssue.BLACK_HEAD;
            String label6 = skinIssue6.getLabel();
            AiSkinHelpViewModel vm7 = getVm();
            String key6 = skinIssue6.getKey();
            UserSkinValue userSkinResponse6 = mySkin.getUserSkinResponse();
            arrayMap.put(label6, vm7.c(key6, Integer.valueOf((userSkinResponse6 == null || (blackheadLevel = userSkinResponse6.getBlackheadLevel()) == null) ? 0 : blackheadLevel.intValue())));
            SkinIssue skinIssue7 = SkinIssue.PORE;
            String label7 = skinIssue7.getLabel();
            AiSkinHelpViewModel vm8 = getVm();
            String key7 = skinIssue7.getKey();
            UserSkinValue userSkinResponse7 = mySkin.getUserSkinResponse();
            arrayMap.put(label7, vm8.c(key7, Integer.valueOf((userSkinResponse7 == null || (poreLevel = userSkinResponse7.getPoreLevel()) == null) ? 0 : poreLevel.intValue())));
            SkinIssue skinIssue8 = SkinIssue.WRINKLE;
            String label8 = skinIssue8.getLabel();
            AiSkinHelpViewModel vm9 = getVm();
            String key8 = skinIssue8.getKey();
            UserSkinValue userSkinResponse8 = mySkin.getUserSkinResponse();
            arrayMap.put(label8, vm9.c(key8, Integer.valueOf((userSkinResponse8 == null || (wrinkleLevel = userSkinResponse8.getWrinkleLevel()) == null) ? 0 : wrinkleLevel.intValue())));
            i60.a aVar = i60.a.f33292a;
            String n = e.n(arrayMap);
            String str = "";
            if (n == null) {
                n = str;
            }
            String title = mySkin.getTitle();
            if (title == null) {
                title = str;
            }
            aVar.I0(str, n, title);
            if (mySkin.getHasAiReport()) {
                String fullTitle = mySkin.getFullTitle();
                if (fullTitle == null) {
                    fullTitle = str;
                }
                String title2 = mySkin.getTitle();
                if (title2 != null) {
                    str = title2;
                }
                if (!PatchProxy.proxy(new Object[]{fullTitle, str}, aVar, i60.a.changeQuickRedirect, false, 124911, new Class[]{Object.class, Object.class}, Void.TYPE).isSupported) {
                    i60.b.f33293a.b("trade_common_exposure", "1534", "2976", g.a.e(8, "button_title", fullTitle, "tab_title", str));
                }
            }
        }
    }

    /* 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(MySkin mySkin) {
        MySkin mySkin2 = mySkin;
        if (!PatchProxy.proxy(new Object[]{mySkin2}, this, changeQuickRedirect, false, 294931, new Class[]{MySkin.class}, Void.TYPE).isSupported) {
            super.update(mySkin2);
            ((DuImageLoaderView) _$_findCachedViewById(R.id.ivHeadBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product/bg_ai_skin_help_state_head_v2.png").d0(300).x();
            ((TextView) _$_findCachedViewById(R.id.tvTitle)).setText(mySkin2.getTitle());
            ((TextView) _$_findCachedViewById(R.id.tvAiSkinEntranceText)).setText(mySkin2.getNoReportTitle());
            int i = 8;
            ((Group) _$_findCachedViewById(R.id.groupAiSkinEntrance)).setVisibility(mySkin2.getHasAiReport() ^ true ? 0 : 8);
            ((TextView) _$_findCachedViewById(R.id.tvSeeReport)).setText(mySkin2.getFullTitle());
            Group group = (Group) _$_findCachedViewById(R.id.groupAiReportEntrance);
            if (mySkin2.getHasAiReport()) {
                i = 0;
            }
            group.setVisibility(i);
            UserSkinValue userSkinResponse = mySkin2.getUserSkinResponse();
            Integer num = null;
            Integer skinQuality = userSkinResponse != null ? userSkinResponse.getSkinQuality() : null;
            b((TextView) _$_findCachedViewById(R.id.tvSkinTypeResult), (ImageView) _$_findCachedViewById(R.id.ivSkinTypeEdit), skinQuality != null, getVm().c(SkinIssue.SKIN_TYPE.getKey(), skinQuality));
            UserSkinValue userSkinResponse2 = mySkin2.getUserSkinResponse();
            if (userSkinResponse2 != null) {
                num = userSkinResponse2.getSensitivity();
            }
            b((TextView) _$_findCachedViewById(R.id.tvSensitivityResult), (ImageView) _$_findCachedViewById(R.id.ivSensitivityEdit), num != null, getVm().c(SkinIssue.SKIN_SENSITIVITY.getKey(), num));
            for (T t : this.f23702c) {
                Integer b2 = getVm().b(t.a().getKey());
                b(t.c(), t.b(), b2 != null, getVm().c(t.a().getKey(), b2));
            }
        }
    }

    @JvmOverloads
    public MySkinStateView(@NotNull final Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        View view;
        LiveData<Integer> liveData;
        this.b = LazyKt__LazyJVMKt.lazy(LazyThreadSafetyMode.NONE, (Function0) new MySkinStateView$vm$2(this));
        LifecycleOwner i3 = LifecycleExtensionKt.i(this);
        if (i3 != null) {
            AiSkinHelpViewModel vm2 = getVm();
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], vm2, AiSkinHelpViewModel.changeQuickRedirect, false, 294969, new Class[0], LiveData.class);
            if (proxy.isSupported) {
                liveData = (LiveData) proxy.result;
            } else {
                liveData = vm2.f23703c;
            }
            liveData.observe(i3, new MySkinStateView$$special$$inlined$let$lambda$1(this));
        }
        View _$_findCachedViewById = _$_findCachedViewById(R.id.ivHeadStateBg);
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setStroke(fi.b.b(0.5f), Color.parseColor("#E6E6EC"));
        gradientDrawable.setColor(Color.parseColor("#FCFCFC"));
        float f = (float) 2;
        gradientDrawable.setCornerRadius((float) fi.b.b(f));
        Unit unit = Unit.INSTANCE;
        _$_findCachedViewById.setBackground(gradientDrawable);
        View _$_findCachedViewById2 = _$_findCachedViewById(R.id.bgAiSkinEntrance);
        GradientDrawable gradientDrawable2 = new GradientDrawable();
        gradientDrawable2.setColor(Color.parseColor("#7fFFFFFF"));
        gradientDrawable2.setCornerRadius((float) fi.b.b(f));
        _$_findCachedViewById2.setBackground(gradientDrawable2);
        GradientDrawable gradientDrawable3 = new GradientDrawable();
        gradientDrawable3.setColor(Color.parseColor("#01C2C3"));
        gradientDrawable3.setCornerRadius((float) fi.b.b(f));
        ((TextView) _$_findCachedViewById(R.id.tvAiSkinEntrance)).setBackground(gradientDrawable3);
        _$_findCachedViewById(R.id.f40932bg).setBackground(new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{Color.parseColor("#FFFFFF"), Color.parseColor("#7fE9EBF3"), Color.parseColor("#3fC7CBDA")}));
        View _$_findCachedViewById3 = _$_findCachedViewById(R.id.bottomBg);
        GradientDrawable gradientDrawable4 = new GradientDrawable();
        float b2 = (float) fi.b.b((float) 6);
        gradientDrawable4.setColor(-1);
        gradientDrawable4.setCornerRadii(new float[]{b2, b2, b2, b2, 0.0f, 0.0f, 0.0f, 0.0f});
        _$_findCachedViewById3.setBackground(gradientDrawable4);
        ViewExtensionKt.e(_$_findCachedViewById(R.id.clickDelegate), 0, new Function1<View, Unit>(this) {
            /* class com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.view.MySkinStateView.AnonymousClass6 */
            public static ChangeQuickRedirect changeQuickRedirect;
            public final /* synthetic */ MySkinStateView this$0;

            {
                this.this$0 = r1;
            }

            /* 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) {
                MySkin mySkin;
                AiSkinDetectRecord report;
                if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 294941, new Class[]{View.class}, Void.TYPE).isSupported && (mySkin = (MySkin) this.this$0.getData()) != null) {
                    i60.a aVar = i60.a.f33292a;
                    String fullTitle = mySkin.getFullTitle();
                    String str = fullTitle != null ? fullTitle : "";
                    String title = mySkin.getTitle();
                    if (title == null) {
                        title = "";
                    }
                    if (!PatchProxy.proxy(new Object[]{str, title}, aVar, i60.a.changeQuickRedirect, false, 124912, new Class[]{Object.class, Object.class}, Void.TYPE).isSupported) {
                        i60.b.f33293a.b("trade_common_click", "1534", "2976", g.a.e(8, "button_title", str, "tab_title", title));
                    }
                    MySkin mySkin2 = (MySkin) this.this$0.getData();
                    if (mySkin2 != null && (report = mySkin2.getReport()) != null) {
                        e60.b.F0(e60.b.f31725a, context, 1, 16, null, null, 0, null, null, report, true, 248);
                    }
                }
            }
        }, 1);
        ViewExtensionKt.e((TextView) _$_findCachedViewById(R.id.tvAiSkinEntrance), 0, new Function1<View, Unit>() {
            /* class com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.view.MySkinStateView.AnonymousClass7 */
            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) {
                if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 294942, new Class[]{View.class}, Void.TYPE).isSupported) {
                    e60.b.f31725a.D0(context, 1, 16);
                }
            }
        }, 1);
        List<a> listOf = CollectionsKt__CollectionsKt.listOf((Object[]) new a[]{new a(SkinIssue.DARK_CIRCLE, (ImageView) _$_findCachedViewById(R.id.ivHYQEdit), (TextView) _$_findCachedViewById(R.id.tvHYQResult), _$_findCachedViewById(R.id.clickHYQ)), new a(SkinIssue.SPECKLE, (ImageView) _$_findCachedViewById(R.id.ivSBEdit), (TextView) _$_findCachedViewById(R.id.tvSBResult), _$_findCachedViewById(R.id.clickSB)), new a(SkinIssue.ACNE, (ImageView) _$_findCachedViewById(R.id.ivDDEdit), (TextView) _$_findCachedViewById(R.id.tvDDResult), _$_findCachedViewById(R.id.clickDD)), new a(SkinIssue.BLACK_HEAD, (ImageView) _$_findCachedViewById(R.id.ivHTEdit), (TextView) _$_findCachedViewById(R.id.tvHTResult), _$_findCachedViewById(R.id.clickHT)), new a(SkinIssue.PORE, (ImageView) _$_findCachedViewById(R.id.ivMKEdit), (TextView) _$_findCachedViewById(R.id.tvMKResult), _$_findCachedViewById(R.id.clickMK)), new a(SkinIssue.WRINKLE, (ImageView) _$_findCachedViewById(R.id.ivZWEdit), (TextView) _$_findCachedViewById(R.id.tvZWResult), _$_findCachedViewById(R.id.clickZW))});
        this.f23702c = listOf;
        for (T t : listOf) {
            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[0], t, a.changeQuickRedirect, false, 294968, new Class[0], View.class);
            if (proxy2.isSupported) {
                view = (View) proxy2.result;
            } else {
                view = t.d;
            }
            ViewExtensionKt.e(view, 0, new MySkinStateView$$special$$inlined$forEach$lambda$1(t, this), 1);
        }
        ViewExtensionKt.e(_$_findCachedViewById(R.id.clickSkinSensitivity), 0, new Function1<View, Unit>(this) {
            /* class com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.view.MySkinStateView.AnonymousClass9 */
            public static ChangeQuickRedirect changeQuickRedirect;
            public final /* synthetic */ MySkinStateView this$0;

            {
                this.this$0 = r1;
            }

            /* 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) {
                CharSequence charSequence;
                boolean z = true;
                if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 294943, new Class[]{View.class}, Void.TYPE).isSupported) {
                    i60.a aVar = i60.a.f33292a;
                    if (((ImageView) this.this$0._$_findCachedViewById(R.id.ivSensitivityEdit)).getVisibility() != 0) {
                        z = false;
                    }
                    if (z) {
                        charSequence = "编辑";
                    } else {
                        charSequence = ((TextView) this.this$0._$_findCachedViewById(R.id.tvSensitivityResult)).getText();
                    }
                    aVar.x0(charSequence, "敏感度");
                    AppCompatActivity y = com.shizhuang.duapp.common.extension.ViewExtensionKt.y(this.this$0);
                    if (y != null) {
                        new SkinIssueEditDialog().i(y);
                    }
                }
            }
        }, 1);
        ViewExtensionKt.e(_$_findCachedViewById(R.id.clickSkinType), 0, new Function1<View, Unit>(this) {
            /* class com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.view.MySkinStateView.AnonymousClass10 */
            public static ChangeQuickRedirect changeQuickRedirect;
            public final /* synthetic */ MySkinStateView this$0;

            {
                this.this$0 = r1;
            }

            /* 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) {
                CharSequence charSequence;
                boolean z = true;
                if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 294940, new Class[]{View.class}, Void.TYPE).isSupported) {
                    i60.a aVar = i60.a.f33292a;
                    if (((ImageView) this.this$0._$_findCachedViewById(R.id.ivSkinTypeEdit)).getVisibility() != 0) {
                        z = false;
                    }
                    if (z) {
                        charSequence = "编辑";
                    } else {
                        charSequence = ((TextView) this.this$0._$_findCachedViewById(R.id.tvSkinTypeResult)).getText();
                    }
                    aVar.x0(charSequence, "肤质");
                    AppCompatActivity y = com.shizhuang.duapp.common.extension.ViewExtensionKt.y(this.this$0);
                    if (y != null) {
                        new SkinIssueEditDialog().i(y);
                    }
                }
            }
        }, 1);
    }
}