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


package com.shizhuang.duapp.modules.productv2.facedetect.result.ui;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.ArrayMap;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModelLazy;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import co.c;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.google.android.material.appbar.AppBarLayout;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.sensorsdata.analytics.android.sdk.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.event.FavoriteChangeEvent;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.ui.BaseLeftBackActivity;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.api.LoadResultKt;
import com.shizhuang.duapp.modules.du_mall_common.extension.LiveDataExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.widget.tablayout.MTabLayout;
import com.shizhuang.duapp.modules.productv2.api.ProductFacadeV2;
import com.shizhuang.duapp.modules.productv2.facedetect.result.model.RelatedRecommendProductModel;
import com.shizhuang.duapp.modules.productv2.facedetect.result.views.baseinfo.RelatedRecommendProductItemView;
import com.shizhuang.duapp.modules.productv2.facedetect.result.views.report.RelateRecommendProductFragmentItemView;
import com.shizhuang.duapp.modules.productv2.facedetect.result.vm.FaceDetectReportVM;
import com.shizhuang.duapp.modules.productv2.facedetect.skinhelp.ui.AiSkinTypeHelpActivity;
import com.shizhuang.duapp.modules.router.ServiceManager;
import df.q;
import df.r0;
import fi.d;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.concurrent.CancellationException;
import jn.b;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.JvmField;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.Job;
import m60.k;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import rd.l;
import td.s;

@Route(path = "/product/FaceDetectReportActivity")
@Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001:\u0001\bB\u0007¢\u0006\u0004\b\u0006\u0010\u0007J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0007¨\u0006\t"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/facedetect/result/ui/FaceDetectReportActivity;", "Lcom/shizhuang/duapp/common/ui/BaseLeftBackActivity;", "Lcom/shizhuang/duapp/common/event/FavoriteChangeEvent;", "event", "", "syncFavoriteState", "<init>", "()V", "ViewPagerAdapter", "du_product_release"}, k = 1, mv = {1, 4, 2})
@SuppressLint({"MallShouldTryCatchCheck"})
/* compiled from: FaceDetectReportActivity.kt */
public final class FaceDetectReportActivity extends BaseLeftBackActivity {
    public static ChangeQuickRedirect changeQuickRedirect;
    @Autowired(name = "from")
    @JvmField

    /* renamed from: c  reason: collision with root package name */
    public int f23646c;
    @Autowired
    @JvmField
    public int d;
    @Autowired
    @JvmField
    @Nullable
    public String e;
    @Autowired(name = PushConstants.WEB_URL)
    @JvmField
    @Nullable
    public String f;

    /* renamed from: g  reason: collision with root package name */
    public final Lazy f23647g = new ViewModelLazy(Reflection.getOrCreateKotlinClass(FaceDetectReportVM.class), new FaceDetectReportActivity$$special$$inlined$viewModels$2(this), new FaceDetectReportActivity$$special$$inlined$viewModels$1(this));

    /* renamed from: h  reason: collision with root package name */
    public int f23648h;
    public final ColorDrawable i = new ColorDrawable(-1);
    public final ColorDrawable j = new ColorDrawable(-1);
    public final GradientDrawable k = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{Color.parseColor("#10A9A9A9"), Color.parseColor("#FFFFFF"), Color.parseColor("#FFFFFF"), Color.parseColor("#FFFFFF")});
    public Drawable l;
    public final Lazy m = LazyKt__LazyJVMKt.lazy(new FaceDetectReportActivity$pagerAdapter$2(this));
    public final Lazy n = LazyKt__LazyJVMKt.lazy(new FaceDetectReportActivity$topReportExposureHelper$2(this));
    public final Lazy o = LazyKt__LazyJVMKt.lazy(new FaceDetectReportActivity$syncViewExposureHelper$2(this));
    public View p;

    /* renamed from: q  reason: collision with root package name */
    public final Lazy f23649q = LazyKt__LazyJVMKt.lazy(new FaceDetectReportActivity$inAnim$2(this));
    public final Lazy r = LazyKt__LazyJVMKt.lazy(new FaceDetectReportActivity$outAnim$2(this));
    public Job s;
    public HashMap t;

    @Metadata(bv = {}, d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b†\u0004\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/facedetect/result/ui/FaceDetectReportActivity$ViewPagerAdapter;", "Landroidx/viewpager2/adapter/FragmentStateAdapter;", "du_product_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: FaceDetectReportActivity.kt */
    public final class ViewPagerAdapter extends FragmentStateAdapter {
        public static ChangeQuickRedirect changeQuickRedirect;

        public ViewPagerAdapter(@NotNull FaceDetectReportActivity faceDetectReportActivity, FragmentActivity fragmentActivity) {
            super(fragmentActivity);
        }

        @Override // androidx.viewpager2.adapter.FragmentStateAdapter
        @NotNull
        public Fragment createFragment(int i) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 294130, new Class[]{Integer.TYPE}, Fragment.class);
            if (proxy.isSupported) {
                return (Fragment) proxy.result;
            }
            if (i == 0) {
                return new FaceDetectBaseInfoFragment();
            }
            return new FaceDetectReportFragment();
        }

        @Override // androidx.recyclerview.widget.RecyclerView.Adapter
        public int getItemCount() {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294129, new Class[0], Integer.TYPE);
            if (proxy.isSupported) {
                return ((Integer) proxy.result).intValue();
            }
            return 2;
        }
    }

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void ActivityMethodWeaver_onCreate(@androidx.annotation.Nullable FaceDetectReportActivity faceDetectReportActivity, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{faceDetectReportActivity, bundle}, null, changeQuickRedirect, true, 294132, new Class[]{FaceDetectReportActivity.class, Bundle.class}, Void.TYPE).isSupported) {
                b bVar = b.f34396a;
                if (!bVar.b()) {
                    bVar.d(true);
                }
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectReportActivity.e(faceDetectReportActivity, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectReportActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.result.ui.FaceDetectReportActivity")) {
                    bVar.activityOnCreateMethod(faceDetectReportActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void ActivityMethodWeaver_onResume(FaceDetectReportActivity faceDetectReportActivity) {
            if (!PatchProxy.proxy(new Object[]{faceDetectReportActivity}, null, changeQuickRedirect, true, 294131, new Class[]{FaceDetectReportActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectReportActivity.d(faceDetectReportActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectReportActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.result.ui.FaceDetectReportActivity")) {
                    b.f34396a.activityOnResumeMethod(faceDetectReportActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void ActivityMethodWeaver_onStart(FaceDetectReportActivity faceDetectReportActivity) {
            if (!PatchProxy.proxy(new Object[]{faceDetectReportActivity}, null, changeQuickRedirect, true, 294133, new Class[]{FaceDetectReportActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectReportActivity.f(faceDetectReportActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectReportActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.result.ui.FaceDetectReportActivity")) {
                    b.f34396a.activityOnStartMethod(faceDetectReportActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    /* compiled from: FaceDetectReportActivity.kt */
    public static final class a extends s<Boolean> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FaceDetectReportActivity b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ long f23650c;
        public final /* synthetic */ String d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a(FaceDetectReportActivity faceDetectReportActivity, long j, String str, Context context) {
            super(context);
            this.b = faceDetectReportActivity;
            this.f23650c = j;
            this.d = str;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@Nullable l<Boolean> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 294163, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                if (lVar == null || lVar.a() != 20801005) {
                    q.r("添加想要失败");
                } else {
                    this.b.m(this.f23650c, this.d);
                }
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            Boolean bool = (Boolean) obj;
            if (!PatchProxy.proxy(new Object[]{bool}, this, changeQuickRedirect, false, 294162, new Class[]{Boolean.class}, Void.TYPE).isSupported) {
                super.onSuccess(bool);
                if (Intrinsics.areEqual(bool, Boolean.TRUE)) {
                    this.b.syncFavoriteState(new FavoriteChangeEvent(0, true, null, 0, false, 0, this.f23650c, 1, 60, null));
                    q.r("已加入想要,可在「我-想要」查看");
                    return;
                }
                q.r("添加想要失败");
            }
        }
    }

    public static void d(FaceDetectReportActivity faceDetectReportActivity) {
        if (!PatchProxy.proxy(new Object[0], faceDetectReportActivity, changeQuickRedirect, false, 294110, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            i60.a aVar = i60.a.f33292a;
            Object h12 = faceDetectReportActivity.h();
            String str = "";
            if (!PatchProxy.proxy(new Object[]{h12}, aVar, i60.a.changeQuickRedirect, false, 124808, new Class[]{Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap arrayMap = new ArrayMap(8);
                arrayMap.put("source_name", h12);
                bVar.b("trade_ai_pageview", "1228", str, arrayMap);
            }
            if (faceDetectReportActivity.k().k()) {
                String value = faceDetectReportActivity.k().i().getValue();
                if (value == null) {
                    value = str;
                }
                aVar.z(value);
                String value2 = faceDetectReportActivity.k().h().getValue();
                if (value2 != null) {
                    str = value2;
                }
                aVar.z(str);
                return;
            }
            String value3 = faceDetectReportActivity.k().h().getValue();
            if (value3 != null) {
                str = value3;
            }
            aVar.z(str);
        }
    }

    public static void e(FaceDetectReportActivity faceDetectReportActivity, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, faceDetectReportActivity, changeQuickRedirect, false, 294123, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void f(FaceDetectReportActivity faceDetectReportActivity) {
        if (!PatchProxy.proxy(new Object[0], faceDetectReportActivity, changeQuickRedirect, false, 294125, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public final void g() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294115, new Class[0], Void.TYPE).isSupported) {
            Job job = this.s;
            if (job != null) {
                job.cancel((Job) ((CancellationException) null));
            }
            View view = this.p;
            if (view != null) {
                PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294113, new Class[0], TranslateAnimation.class);
                view.startAnimation((TranslateAnimation) (proxy.isSupported ? proxy.result : this.r.getValue()));
            }
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public int getLayout() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294092, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.activity_face_detect_report;
    }

    public final Object h() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294119, new Class[0], Object.class);
        if (proxy.isSupported) {
            return proxy.result;
        }
        int i3 = this.f23646c;
        if (i3 != 2) {
            return i3 != 3 ? Integer.valueOf(this.d) : "测肤首页历史记录";
        }
        return "检测";
    }

    public final k i() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294091, new Class[0], k.class);
        return (k) (proxy.isSupported ? proxy.result : this.o.getValue());
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initData() {
        LiveData<Boolean> liveData;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294093, new Class[0], Void.TYPE).isSupported) {
            LoadResultKt.i(k().getPageResult(), this, new FaceDetectReportActivity$initData$1(this), new FaceDetectReportActivity$initData$3(this), new FaceDetectReportActivity$initData$2(this));
            FaceDetectReportVM k6 = k();
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], k6, FaceDetectReportVM.changeQuickRedirect, false, 294564, new Class[0], LiveData.class);
            if (proxy.isSupported) {
                liveData = (LiveData) proxy.result;
            } else {
                liveData = k6.f23672c;
            }
            liveData.observe(this, new FaceDetectReportActivity$initData$4(this));
            k().c().observe(this, new FaceDetectReportActivity$initData$5(this));
            LiveDataExtensionKt.b(k().h(), this, new FaceDetectReportActivity$initData$6(this));
            LiveDataExtensionKt.b(k().i(), this, new FaceDetectReportActivity$initData$7(this));
            LiveDataExtensionKt.b(k().d(), this, new FaceDetectReportActivity$initData$8(this));
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initStatusBar() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294095, new Class[0], Void.TYPE).isSupported) {
            r0.B(this);
            r0.z(this, null);
            d.a(getWindow(), true, true);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    @SuppressLint({"SetTextI18n"})
    public void initView(@Nullable Bundle bundle) {
        Drawable mutate;
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 294096, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.initView(bundle);
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294099, new Class[0], Void.TYPE).isSupported) {
                ((c) ((DuImageLoaderView) _$_findCachedViewById(R.id.bgTop)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/bg_mall_face_detect_top.png").d0(300).u(new FaceDetectReportActivity$loadHeadBg$1(this))).x();
                ((DuImageLoaderView) _$_findCachedViewById(R.id.bgTopBorder)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/bg_mall_face_detect_top_border_new.png").d0(300).x();
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivAvatar)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product/bg_mall_face_detect_avatar_v3.png").d0(300).x();
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294104, new Class[0], Void.TYPE).isSupported) {
                this.f23648h = r0.i(this);
                ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.toolbar.getLayoutParams();
                int i3 = r0.i(getContext());
                marginLayoutParams.topMargin = i3;
                this.toolbar.setLayoutParams(marginLayoutParams);
                ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) _$_findCachedViewById(R.id.customStatusBar).getLayoutParams();
                marginLayoutParams2.height = i3;
                _$_findCachedViewById(R.id.customStatusBar).setLayoutParams(marginLayoutParams2);
                this.toolbar.setBackground(this.i);
                _$_findCachedViewById(R.id.customStatusBar).setBackground(this.j);
                Drawable navigationIcon = this.toolbar.getNavigationIcon();
                if (!(navigationIcon == null || (mutate = navigationIcon.mutate()) == null)) {
                    this.l = DrawableCompat.wrap(mutate);
                }
                this.toolbar.setNavigationIcon(this.l);
                Drawable drawable = this.l;
                if (drawable != null) {
                    DrawableCompat.setTint(drawable, ViewCompat.MEASURED_STATE_MASK);
                }
                this.toolbar.setTitleTextColor(ViewCompat.MEASURED_STATE_MASK);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294102, new Class[0], Void.TYPE).isSupported) {
                ((AppBarLayout) _$_findCachedViewById(R.id.appBarLayout)).addOnOffsetChangedListener((AppBarLayout.OnOffsetChangedListener) new e51.a(this));
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294101, new Class[0], Void.TYPE).isSupported) {
                ViewPager2 viewPager2 = (ViewPager2) _$_findCachedViewById(R.id.viewPager);
                PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294089, new Class[0], ViewPagerAdapter.class);
                viewPager2.setAdapter((ViewPagerAdapter) (proxy.isSupported ? proxy.result : this.m.getValue()));
                ((MTabLayout) _$_findCachedViewById(R.id.tabLayout)).G((ViewPager2) _$_findCachedViewById(R.id.viewPager), e51.b.f31723a);
                ((MTabLayout) _$_findCachedViewById(R.id.tabLayout)).c(new e51.c());
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294100, new Class[0], Void.TYPE).isSupported) {
                ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.shareIcon), 0, new FaceDetectReportActivity$initListener$1(this), 1);
                ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.recordIcon), 0, new FaceDetectReportActivity$initListener$2(this), 1);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294094, new Class[0], Void.TYPE).isSupported) {
                int i12 = 8;
                ((FrameLayout) _$_findCachedViewById(R.id.layoutTestAgain)).setVisibility(k().k() ^ true ? 0 : 8);
                LinearLayout linearLayout = (LinearLayout) _$_findCachedViewById(R.id.layoutAiHelp);
                if (k().k()) {
                    i12 = 0;
                }
                linearLayout.setVisibility(i12);
                ((ImageView) _$_findCachedViewById(R.id.recordIcon)).setVisibility(0);
                if (k().k()) {
                    GradientDrawable gradientDrawable = new GradientDrawable();
                    float f12 = (float) 2;
                    g00.a.l(gradientDrawable, (float) fi.b.b(f12), "#01C2C3");
                    Unit unit = Unit.INSTANCE;
                    ((TextView) _$_findCachedViewById(R.id.tvToAiHelp)).setBackground(gradientDrawable);
                    GradientDrawable gradientDrawable2 = new GradientDrawable();
                    gradientDrawable2.setCornerRadius((float) fi.b.b(f12));
                    gradientDrawable2.setStroke(fi.b.b(0.5f), Color.parseColor("#26000000"));
                    gradientDrawable2.setColor(-1);
                    ((TextView) _$_findCachedViewById(R.id.tvAiHelpTest)).setBackground(gradientDrawable2);
                    ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvAiHelpTest), 0, new FaceDetectReportActivity$initBottomButton$3(this), 1);
                    ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvToAiHelp), 0, new FaceDetectReportActivity$initBottomButton$4(this), 1);
                } else {
                    GradientDrawable gradientDrawable3 = new GradientDrawable();
                    g00.a.l(gradientDrawable3, (float) fi.b.b((float) 2), "#01C2C3");
                    Unit unit2 = Unit.INSTANCE;
                    ((TextView) _$_findCachedViewById(R.id.tvTest)).setBackground(gradientDrawable3);
                    ViewExtensionKt.j((FrameLayout) _$_findCachedViewById(R.id.layoutTestAgain), 0, new FaceDetectReportActivity$initBottomButton$6(this), 1);
                }
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294097, new Class[0], Void.TYPE).isSupported) {
                GradientDrawable gradientDrawable4 = new GradientDrawable();
                gradientDrawable4.setStroke(fi.b.b(0.5f), Color.parseColor("#C7C7D7"));
                gradientDrawable4.setCornerRadius((float) fi.b.b((float) 2));
                Unit unit3 = Unit.INSTANCE;
                ((TextView) _$_findCachedViewById(R.id.tvSyncReport)).setBackground(gradientDrawable4);
                ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvSyncReport), 0, new FaceDetectReportActivity$initSkinSyncView$2(this), 1);
                ViewExtensionKt.j(_$_findCachedViewById(R.id.sizeHelpEntrance), 0, new FaceDetectReportActivity$initSkinSyncView$3(this), 1);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294098, new Class[0], Void.TYPE).isSupported) {
                j().setExposureCallback(FaceDetectReportActivity$initExposureHelper$1.INSTANCE);
                i().setExposureCallback(new FaceDetectReportActivity$initExposureHelper$2(this));
            }
        }
    }

    public final k j() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294090, new Class[0], k.class);
        return (k) (proxy.isSupported ? proxy.result : this.n.getValue());
    }

    public final FaceDetectReportVM k() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294088, new Class[0], FaceDetectReportVM.class);
        return (FaceDetectReportVM) (proxy.isSupported ? proxy.result : this.f23647g.getValue());
    }

    public final void l(long j12, boolean z, @NotNull String str) {
        if (!PatchProxy.proxy(new Object[]{new Long(j12), new Byte(z ? (byte) 1 : 0), str}, this, changeQuickRedirect, false, 294111, new Class[]{Long.TYPE, Boolean.TYPE, String.class}, Void.TYPE).isSupported) {
            if (z) {
                ProductFacadeV2.addSpuFavorite$default(ProductFacadeV2.f23068a, j12, 0, null, new a(this, j12, str, this), 6, null);
            } else {
                m(j12, str);
            }
        }
    }

    public final void m(long j12, String str) {
        if (!PatchProxy.proxy(new Object[]{new Long(j12), str}, this, changeQuickRedirect, false, 294117, new Class[]{Long.TYPE, String.class}, Void.TYPE).isSupported) {
            ServiceManager.u().showFavoriteDialog(getSupportFragmentManager(), j12, null, str, null);
        }
    }

    @Override // androidx.activity.ComponentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onBackPressed() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294107, new Class[0], Void.TYPE).isSupported) {
            if (k().k()) {
                startActivity(new Intent(this, AiSkinTypeHelpActivity.class));
            } else {
                super.onBackPressed();
            }
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 294122, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void onNetErrorRetryClick() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294106, new Class[0], Void.TYPE).isSupported) {
            super.onNetErrorRetryClick();
            k().fetchData();
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseLeftBackActivity
    @SensorsDataInstrumented
    public boolean onOptionsItemSelected(@NotNull MenuItem menuItem) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{menuItem}, this, changeQuickRedirect, false, 294108, new Class[]{MenuItem.class}, Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        if (menuItem.getItemId() == 16908332) {
            i60.a.f33292a.w("返回");
            if (k().k()) {
                startActivity(new Intent(this, AiSkinTypeHelpActivity.class));
                SensorsDataAutoTrackHelper.trackMenuItem(this, menuItem);
                return true;
            }
        }
        boolean onOptionsItemSelected = super.onOptionsItemSelected(menuItem);
        SensorsDataAutoTrackHelper.trackMenuItem(this, menuItem);
        return onOptionsItemSelected;
    }

    @Override // androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294109, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onResume(this);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294124, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onStart(this);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onStop() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 294118, new Class[0], Void.TYPE).isSupported) {
            super.onStop();
            DecimalFormat decimalFormat = new DecimalFormat("0.000", DecimalFormatSymbols.getInstance(Locale.CHINA));
            i60.a aVar = i60.a.f33292a;
            String format = decimalFormat.format(Float.valueOf(((float) getRemainTime()) / 1000.0f));
            Object h12 = h();
            if (!PatchProxy.proxy(new Object[]{format, h12}, aVar, i60.a.changeQuickRedirect, false, 124819, new Class[]{Object.class, Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap arrayMap = new ArrayMap(8);
                arrayMap.put("view_duration", format);
                arrayMap.put("source_name", h12);
                bVar.b("trade_common_duration_pageview", "1228", "", arrayMap);
            }
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void syncFavoriteState(@NotNull FavoriteChangeEvent favoriteChangeEvent) {
        boolean z = true;
        if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, this, changeQuickRedirect, false, 294105, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported) {
            Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("FaceDetectRelateRecommendFragment");
            if (findFragmentByTag instanceof RelateRecommendFragment) {
                RelateRecommendFragment relateRecommendFragment = (RelateRecommendFragment) findFragmentByTag;
                if (relateRecommendFragment.isVisible()) {
                    if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, relateRecommendFragment, RelateRecommendFragment.changeQuickRedirect, false, 294264, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported) {
                        long spuId = favoriteChangeEvent.getSpuId();
                        boolean z4 = favoriteChangeEvent.getFavoriteCount() > 0;
                        int i3 = 0;
                        for (T t4 : relateRecommendFragment.f23661c.getItems()) {
                            int i12 = i3 + 1;
                            if (i3 < 0) {
                                CollectionsKt__CollectionsKt.throwIndexOverflow();
                            }
                            if (t4 instanceof RelatedRecommendProductModel) {
                                T t12 = t4;
                                if (t12.getSpuId() == spuId) {
                                    t12.setHasFavorite(z4);
                                    RecyclerView.ViewHolder findViewHolderForAdapterPosition = ((RecyclerView) relateRecommendFragment._$_findCachedViewById(R.id.recyclerView)).findViewHolderForAdapterPosition(i3);
                                    View view = findViewHolderForAdapterPosition != null ? findViewHolderForAdapterPosition.itemView : null;
                                    if ((view instanceof RelateRecommendProductFragmentItemView) && ((ImageView) view.findViewById(R.id.iconFav)).isSelected() != z4) {
                                        relateRecommendFragment.f23661c.notifyItemChanged(i3, "");
                                    }
                                }
                            }
                            i3 = i12;
                        }
                    }
                }
            }
            Fragment findFragmentByTag2 = getSupportFragmentManager().findFragmentByTag("f0");
            if (findFragmentByTag2 instanceof FaceDetectBaseInfoFragment) {
                FaceDetectBaseInfoFragment faceDetectBaseInfoFragment = (FaceDetectBaseInfoFragment) findFragmentByTag2;
                if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, faceDetectBaseInfoFragment, FaceDetectBaseInfoFragment.changeQuickRedirect, false, 294020, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported) {
                    long spuId2 = favoriteChangeEvent.getSpuId();
                    boolean z5 = favoriteChangeEvent.getFavoriteCount() > 0;
                    int i13 = 0;
                    for (T t13 : faceDetectBaseInfoFragment.f23640c.getItems()) {
                        int i14 = i13 + 1;
                        if (i13 < 0) {
                            CollectionsKt__CollectionsKt.throwIndexOverflow();
                        }
                        if (t13 instanceof RelatedRecommendProductModel) {
                            T t14 = t13;
                            if (t14.getSpuId() == spuId2) {
                                t14.setHasFavorite(z5);
                                RecyclerView.ViewHolder findViewHolderForAdapterPosition2 = ((RecyclerView) faceDetectBaseInfoFragment._$_findCachedViewById(R.id.recyclerView)).findViewHolderForAdapterPosition(i13);
                                View view2 = findViewHolderForAdapterPosition2 != null ? findViewHolderForAdapterPosition2.itemView : null;
                                if ((view2 instanceof RelatedRecommendProductItemView) && ((ImageView) view2.findViewById(R.id.iconFav)).isSelected() != z5) {
                                    faceDetectBaseInfoFragment.f23640c.notifyItemChanged(i13, "");
                                }
                            }
                        }
                        i13 = i14;
                    }
                }
            }
            FaceDetectReportVM k6 = k();
            if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, k6, FaceDetectReportVM.changeQuickRedirect, false, 294597, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported) {
                long spuId3 = favoriteChangeEvent.getSpuId();
                if (favoriteChangeEvent.getFavoriteCount() <= 0) {
                    z = false;
                }
                Iterator<T> it2 = k6.J.iterator();
                while (it2.hasNext()) {
                    for (T t15 : it2.next().c()) {
                        if (t15.getSpuId() == spuId3) {
                            t15.setHasFavorite(z);
                        }
                    }
                }
                for (T t16 : k6.K) {
                    if (t16.getSpuId() == spuId3) {
                        t16.setHasFavorite(z);
                    }
                }
            }
        }
    }
}