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


package com.shizhuang.duapp.modules.mall_ar.ui;

import android.graphics.Bitmap;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Process;
import android.util.ArrayMap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModelLazy;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
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.notification.model.NotifyType;
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.helper.LoginHelper;
import com.shizhuang.duapp.common.ui.BaseLeftBackActivity;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.libs.animation.DuAnimationView;
import com.shizhuang.duapp.libs.bpm.BM;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuRequestOptions;
import com.shizhuang.duapp.libs.yeezy.Yeezy;
import com.shizhuang.duapp.modules.du_mall_common.constant.MallABTest;
import com.shizhuang.duapp.modules.du_mall_common.extension.LiveDataExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.model.product.QrCodeInfoModel;
import com.shizhuang.duapp.modules.du_mall_common.router.service.IProductDetailService;
import com.shizhuang.duapp.modules.du_mall_common.utils.Ar3DShareHelper;
import com.shizhuang.duapp.modules.du_mall_common.widget.ar_3d.Mall3dArCaptureButton;
import com.shizhuang.duapp.modules.du_mall_common.widget.ar_3d.Mall3dArRecordIconTipsPop;
import com.shizhuang.duapp.modules.du_mall_common.widget.ar_3d.Mall3dArShareIconTipsPop;
import com.shizhuang.duapp.modules.mall_ar.api.ProductFacadeV2;
import com.shizhuang.duapp.modules.mall_ar.constants.SensorArSourcePage;
import com.shizhuang.duapp.modules.mall_ar.dialogs.ArServiceGuideDialog;
import com.shizhuang.duapp.modules.mall_ar.model.ArDetailInfoModel;
import com.shizhuang.duapp.modules.mall_ar.model.ArDetailModel;
import com.shizhuang.duapp.modules.mall_ar.ui.ARProductWearActivity$vykingKitListener$2;
import com.shizhuang.duapp.modules.mall_ar.utils.UserDataMonitor;
import com.shizhuang.duapp.modules.mall_ar.utils.arshoe.IArShoeDriver;
import com.shizhuang.duapp.modules.mall_ar.vm.ARViewModel;
import com.vk.duapp.utils.FileUtil;
import df.b0;
import df.r0;
import df.u0;
import e60.d;
import java.io.File;
import java.util.HashMap;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.TuplesKt;
import kotlin.TypeCastException;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.JvmField;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import mn.a;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import rd.l;
import zq0.e0;
import zq0.f0;

@Route(path = "/product/detailArTryOn")
@Metadata(bv = {}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u0003B\u0007¢\u0006\u0004\b\u000e\u0010\u000fJ\u0010\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0007J\u0010\u0010\n\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\bH\u0016J\u0010\u0010\r\u001a\u00020\u00062\u0006\u0010\f\u001a\u00020\u000bH\u0007¨\u0006\u0010"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_ar/ui/ARProductWearActivity;", "Lcom/shizhuang/duapp/common/ui/BaseLeftBackActivity;", "Landroid/view/View$OnClickListener;", "Lcom/shizhuang/duapp/modules/du_mall_common/widget/ar_3d/Mall3dArCaptureButton$OnCaptureClickListener;", "Lcom/shizhuang/duapp/modules/mall_ar/ui/ARActivityActionNotifyEvent;", "notifyEvent", "", "onEvent", "Landroid/view/View;", NotifyType.VIBRATE, "onClick", "Lcom/shizhuang/duapp/common/event/FavoriteChangeEvent;", "event", "onFavoriteChange", "<init>", "()V", "du_mall_ar_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ARProductWearActivity.kt */
public final class ARProductWearActivity extends BaseLeftBackActivity implements View.OnClickListener, Mall3dArCaptureButton.OnCaptureClickListener {
    public static final int E = fi.b.b((float) 165);
    public static final int F = fi.b.b((float) 73);
    public static final int G = fi.b.b((float) 140);
    public static ChangeQuickRedirect changeQuickRedirect;
    public boolean A = true;
    public long B;
    public final k60.a C = new a(this);
    public HashMap D;

    /* renamed from: c  reason: collision with root package name */
    public AnimationDrawable f19106c;
    @Autowired
    @JvmField
    @Nullable
    public String d;
    @Autowired
    @JvmField
    public long e;
    @Autowired
    @JvmField
    @Nullable
    public String f;
    @Autowired
    @JvmField

    /* renamed from: g  reason: collision with root package name */
    public long f19107g;
    @Autowired
    @JvmField

    /* renamed from: h  reason: collision with root package name */
    public long f19108h;
    @Autowired
    @JvmField
    @Nullable
    public String i;
    @Autowired
    @JvmField
    @Nullable
    public String j;
    @Autowired
    @JvmField
    public int k;
    @Autowired
    @JvmField
    @NotNull
    public String l = "";
    public QrCodeInfoModel m;
    public String n;
    public final boolean o = MallABTest.f13351a.F();
    public final Lazy p = new ViewModelLazy(Reflection.getOrCreateKotlinClass(ARViewModel.class), new ARProductWearActivity$$special$$inlined$viewModels$2(this), new ARProductWearActivity$$special$$inlined$viewModels$1(this));

    /* renamed from: q  reason: collision with root package name */
    public final Lazy f19109q = LazyKt__LazyJVMKt.lazy(new ARProductWearActivity$shareIconTipsPop$2(this));
    public final Lazy r = LazyKt__LazyJVMKt.lazy(new ARProductWearActivity$captureButtonTipsPop$2(this));
    public IArShoeDriver s;
    public Bitmap t;

    /* renamed from: u  reason: collision with root package name */
    public Bitmap f19110u;

    /* renamed from: v  reason: collision with root package name */
    public Bitmap f19111v;
    public boolean w;
    public String x;
    public String y;
    public final Lazy z = LazyKt__LazyJVMKt.lazy(new ARProductWearActivity$vykingKitListener$2(this));

    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 ARProductWearActivity aRProductWearActivity, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{aRProductWearActivity, bundle}, null, changeQuickRedirect, true, 208348, new Class[]{ARProductWearActivity.class, Bundle.class}, Void.TYPE).isSupported) {
                jn.b bVar = jn.b.f34396a;
                if (!bVar.b()) {
                    bVar.d(true);
                }
                long currentTimeMillis = System.currentTimeMillis();
                ARProductWearActivity.d(aRProductWearActivity, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (aRProductWearActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.mall_ar.ui.ARProductWearActivity")) {
                    bVar.activityOnCreateMethod(aRProductWearActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

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

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

    /* compiled from: ARProductWearActivity.kt */
    public static final class a extends k60.a {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ ARProductWearActivity e;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public a(ARProductWearActivity aRProductWearActivity) {
            this.e = aRProductWearActivity;
        }

        @Override // k60.a
        public void k(@Nullable l<? extends Object> lVar) {
            boolean z = PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 208352, new Class[]{l.class}, Void.TYPE).isSupported;
        }

        @Override // k60.a
        public void l(long j, int i) {
            if (!PatchProxy.proxy(new Object[]{new Long(j), new Integer(i)}, this, changeQuickRedirect, false, 208351, new Class[]{Long.TYPE, Integer.TYPE}, Void.TYPE).isSupported) {
                BM.mall().b("mall_detail_wear_load", j, false, MapsKt__MapsJVMKt.mapOf(TuplesKt.to("spuId", String.valueOf(this.e.e))));
            }
        }
    }

    /* compiled from: ARProductWearActivity.kt */
    public static final class b extends com.shizhuang.duapp.modules.router.service.account.b {
        public static ChangeQuickRedirect changeQuickRedirect;

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

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public b(ARProductWearActivity aRProductWearActivity) {
            this.f19112a = aRProductWearActivity;
        }

        @Override // com.shizhuang.duapp.modules.router.service.account.IAccountService.LoginCallback, com.shizhuang.duapp.modules.router.service.account.b
        public void onLoginSuccess() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208367, new Class[0], Void.TYPE).isSupported) {
                super.onLoginSuccess();
                IProductDetailService.a.b(d.f31730a.d(), this.f19112a.getSupportFragmentManager(), this.f19112a.e, null, null, null, "473", null, 92, null);
            }
        }
    }

    /* compiled from: ARProductWearActivity.kt */
    public static final class c implements Runnable {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ ARProductWearActivity b;

        public c(ARProductWearActivity aRProductWearActivity) {
            this.b = aRProductWearActivity;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208381, new Class[0], Void.TYPE).isSupported) {
                this.b.j().e();
                ARProductWearActivity aRProductWearActivity = this.b;
                if (aRProductWearActivity.o) {
                    if (!PatchProxy.proxy(new Object[0], aRProductWearActivity, ARProductWearActivity.changeQuickRedirect, false, 208304, new Class[0], Void.TYPE).isSupported) {
                        ((FrameLayout) aRProductWearActivity._$_findCachedViewById(R.id.newLoadingParent)).setVisibility(8);
                        ((DuAnimationView) aRProductWearActivity._$_findCachedViewById(R.id.newLoadingAnimation)).setVisibility(8);
                        ((ImageView) aRProductWearActivity._$_findCachedViewById(R.id.ivArShare)).setVisibility(0);
                        ((LinearLayout) aRProductWearActivity._$_findCachedViewById(R.id.toolBarTitle)).setVisibility(0);
                        ((DuAnimationView) aRProductWearActivity._$_findCachedViewById(R.id.newLoadingAnimation)).E();
                        ((DuAnimationView) aRProductWearActivity._$_findCachedViewById(R.id.newLoadingAnimation)).removeAllViews();
                    }
                } else if (!PatchProxy.proxy(new Object[0], aRProductWearActivity, ARProductWearActivity.changeQuickRedirect, false, 208322, new Class[0], Void.TYPE).isSupported) {
                    AnimationDrawable animationDrawable = aRProductWearActivity.f19106c;
                    if (animationDrawable == null) {
                        Intrinsics.throwUninitializedPropertyAccessException("animationArLoading");
                    }
                    if ((animationDrawable != null ? Boolean.valueOf(animationDrawable.isRunning()) : null).booleanValue()) {
                        AnimationDrawable animationDrawable2 = aRProductWearActivity.f19106c;
                        if (animationDrawable2 == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("animationArLoading");
                        }
                        animationDrawable2.stop();
                    }
                }
                if (((Boolean) b0.f("ARProductWearActivitySHOW_GUIDE_AR_SERVICE_DIALOG", Boolean.TRUE)).booleanValue()) {
                    ArServiceGuideDialog.i.a("ARProductWearActivity").k(this.b.getSupportFragmentManager());
                }
                ((RelativeLayout) this.b._$_findCachedViewById(R.id.fl_ar_loading_parent)).setVisibility(8);
            }
        }
    }

    public static void d(ARProductWearActivity aRProductWearActivity, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, aRProductWearActivity, changeQuickRedirect, false, 208295, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            aRProductWearActivity.C.d();
            super.onCreate(bundle);
            EventBus.b().f(new ARActivityActionNotifyEvent(aRProductWearActivity.TAG));
        }
    }

    public static void e(ARProductWearActivity aRProductWearActivity) {
        boolean z4 = false;
        if (!PatchProxy.proxy(new Object[0], aRProductWearActivity, changeQuickRedirect, false, 208331, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            IArShoeDriver iArShoeDriver = aRProductWearActivity.s;
            if (iArShoeDriver != null) {
                iArShoeDriver.onResume();
            }
            i60.b bVar = i60.b.f33293a;
            ArrayMap arrayMap = new ArrayMap(8);
            arrayMap.put("ar_source_page", SensorArSourcePage.FROM_PRODUCT.getType());
            arrayMap.put("spu_id", Long.valueOf(aRProductWearActivity.e));
            String str = aRProductWearActivity.l;
            if (str.length() == 0) {
                z4 = true;
            }
            if (z4) {
                str = "others";
            }
            arrayMap.put("source_name", str);
            bVar.b("community_ar_pageview", "473", "", arrayMap);
        }
    }

    public static void f(ARProductWearActivity aRProductWearActivity) {
        if (!PatchProxy.proxy(new Object[0], aRProductWearActivity, changeQuickRedirect, false, 208341, 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, 208338, 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(i3));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i3);
        this.D.put(Integer.valueOf(i3), findViewById);
        return findViewById;
    }

    public final void g(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 208327, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            this.w = z4;
            ((TextView) _$_findCachedViewById(R.id.tvRecordCountDown)).setVisibility(z4 ? 0 : 4);
            ((ImageView) _$_findCachedViewById(R.id.iv_ar_collection)).setVisibility(z4 ? 4 : 0);
            ((ImageView) _$_findCachedViewById(R.id.iv_ar_buy)).setVisibility(z4 ? 4 : 0);
            if (z4) {
                ((TextView) _$_findCachedViewById(R.id.tvRecordCountDown)).setVisibility(0);
                ((ImageView) _$_findCachedViewById(R.id.iv_ar_collection)).setVisibility(4);
                ((ImageView) _$_findCachedViewById(R.id.iv_ar_buy)).setVisibility(4);
                j().a();
                i().c();
                return;
            }
            ((TextView) _$_findCachedViewById(R.id.tvRecordCountDown)).setVisibility(4);
            ((ImageView) _$_findCachedViewById(R.id.iv_ar_collection)).setVisibility(0);
            ((ImageView) _$_findCachedViewById(R.id.iv_ar_buy)).setVisibility(0);
            j().e();
            i().a();
        }
    }

    @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, 208300, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.activity_arcamera;
    }

    public final ARViewModel h() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208291, new Class[0], ARViewModel.class);
        return (ARViewModel) (proxy.isSupported ? proxy.result : this.p.getValue());
    }

    public final Mall3dArRecordIconTipsPop i() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208293, new Class[0], Mall3dArRecordIconTipsPop.class);
        return (Mall3dArRecordIconTipsPop) (proxy.isSupported ? proxy.result : this.r.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, 208312, new Class[0], Void.TYPE).isSupported) {
            h().setSpuId(this.e);
            h().b(this, null, null);
            ARViewModel h12 = h();
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], h12, ARViewModel.changeQuickRedirect, false, 209228, new Class[0], LiveData.class);
            if (proxy.isSupported) {
                liveData = (LiveData) proxy.result;
            } else {
                liveData = h12.f;
            }
            LiveDataExtensionKt.b(liveData, this, new ARProductWearActivity$initData$1(this));
            LiveDataExtensionKt.b(h().getModel(), this, new ARProductWearActivity$initData$2(this));
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208316, new Class[0], Void.TYPE).isSupported) {
                a.C0563a aVar = mn.a.f35714a;
                ((DuRequestOptions) ((DuRequestOptions) aVar.g("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/common/mall_share_ar_product_wear_bg.png").v(new co.d(fi.b.b((float) 354), fi.b.b((float) 560)))).G(this).u(new ARProductWearActivity$preloadShareBgBitMap$1(this))).y();
                ((DuRequestOptions) aVar.g("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/ar/ar_product_wear_share_pic_bg.jpg").G(this).u(new ARProductWearActivity$preloadShareBgBitMap$2(this))).y();
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208314, new Class[0], Void.TYPE).isSupported) {
                ProductFacadeV2.f18958a.r(this.e, this.f19108h, "ar-wear", new e0(this, 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, 208336, new Class[0], Void.TYPE).isSupported) {
            r0.z(this, this.toolbar);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initView(@Nullable Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 208301, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.initView(bundle);
            FrameLayout.LayoutParams layoutParams = null;
            if (this.o) {
                ((ImageView) _$_findCachedViewById(R.id.ivArShare)).setVisibility(8);
                ((LinearLayout) _$_findCachedViewById(R.id.toolBarTitle)).setVisibility(8);
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208303, new Class[0], Void.TYPE).isSupported) {
                    ViewGroup.LayoutParams layoutParams2 = ((ImageView) _$_findCachedViewById(R.id.newLoading)).getLayoutParams();
                    if (layoutParams2 instanceof FrameLayout.LayoutParams) {
                        layoutParams = layoutParams2;
                    }
                    FrameLayout.LayoutParams layoutParams3 = layoutParams;
                    float l12 = (((float) fi.b.l(this)) - ((((float) fi.b.d(this)) / 480.0f) * ((float) 950))) / ((float) 2);
                    if (layoutParams3 != null) {
                        layoutParams3.topMargin = (int) l12;
                    }
                    ((ImageView) _$_findCachedViewById(R.id.newLoading)).setLayoutParams(layoutParams3);
                    DuAnimationView duAnimationView = (DuAnimationView) _$_findCachedViewById(R.id.newLoadingAnimation);
                    ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) duAnimationView.getLayoutParams();
                    marginLayoutParams.topMargin = (int) l12;
                    duAnimationView.setLayoutParams(marginLayoutParams);
                    if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208305, new Class[0], Void.TYPE).isSupported) {
                        ((FrameLayout) _$_findCachedViewById(R.id.newLoadingParent)).setVisibility(0);
                        ((DuAnimationView) _$_findCachedViewById(R.id.newLoadingAnimation)).F("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/ar/ar_product_wear_loader_animation.mp4").p(new ARProductWearActivity$showLoadingAnimation$1(this)).s();
                    }
                }
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208306, new Class[0], Void.TYPE).isSupported) {
                    ((FontText) _$_findCachedViewById(R.id.arProductWearFootText)).setText("请将摄像头对准脚");
                    DuImageLoaderView duImageLoaderView = (DuImageLoaderView) _$_findCachedViewById(R.id.arProductWearFootLoading);
                    int i3 = E;
                    ViewGroup.LayoutParams layoutParams4 = duImageLoaderView.getLayoutParams();
                    if (layoutParams4 != null) {
                        layoutParams4.width = i3;
                        layoutParams4.height = i3;
                        duImageLoaderView.setLayoutParams(layoutParams4);
                        ((co.c) h.b.h(i3, i3, ((DuImageLoaderView) _$_findCachedViewById(R.id.arProductWearFootLoading)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/ar/ic_ar_share_foot_deteced_loading.webp"))).x();
                    } else {
                        throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
                    }
                }
            } else {
                ((ImageView) _$_findCachedViewById(R.id.ivArShare)).setVisibility(0);
                ((LinearLayout) _$_findCachedViewById(R.id.toolBarTitle)).setVisibility(0);
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208302, new Class[0], Void.TYPE).isSupported) {
                    ViewGroup.LayoutParams layoutParams5 = ((FrameLayout) _$_findCachedViewById(R.id.loading)).getLayoutParams();
                    if (layoutParams5 instanceof RelativeLayout.LayoutParams) {
                        layoutParams = layoutParams5;
                    }
                    RelativeLayout.LayoutParams layoutParams6 = layoutParams;
                    float l13 = (((float) fi.b.l(this)) - ((((float) fi.b.d(this)) / 480.0f) * ((float) 288))) / ((float) 2);
                    if (layoutParams6 != null) {
                        layoutParams6.topMargin = (int) l13;
                    }
                    ((FrameLayout) _$_findCachedViewById(R.id.loading)).setLayoutParams(layoutParams6);
                    if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208321, new Class[0], Void.TYPE).isSupported) {
                        ((RelativeLayout) _$_findCachedViewById(R.id.fl_ar_loading_parent)).setVisibility(0);
                        AnimationDrawable animationDrawable = (AnimationDrawable) ((ImageView) _$_findCachedViewById(R.id.iv_ar_loading)).getDrawable();
                        this.f19106c = animationDrawable;
                        animationDrawable.start();
                    }
                }
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208307, new Class[0], Void.TYPE).isSupported) {
                    ((FontText) _$_findCachedViewById(R.id.arProductWearFootText)).setText("请将脚放到画面内");
                    DuImageLoaderView duImageLoaderView2 = (DuImageLoaderView) _$_findCachedViewById(R.id.arProductWearFootLoading);
                    int i12 = F;
                    int i13 = G;
                    ViewGroup.LayoutParams layoutParams7 = duImageLoaderView2.getLayoutParams();
                    if (layoutParams7 != null) {
                        layoutParams7.width = i12;
                        layoutParams7.height = i13;
                        duImageLoaderView2.setLayoutParams(layoutParams7);
                        ((DuImageLoaderView) _$_findCachedViewById(R.id.arProductWearFootLoading)).h(R.mipmap.ic_ar_share_foot_deteced).x();
                    } else {
                        throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
                    }
                }
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208311, new Class[0], Void.TYPE).isSupported) {
                ((ImageView) _$_findCachedViewById(R.id.iv_ar_buy)).setOnClickListener(this);
                ((ImageView) _$_findCachedViewById(R.id.iv_ar_collection)).setOnClickListener(this);
                ((Mall3dArCaptureButton) _$_findCachedViewById(R.id.iv_ar_camera)).setOnCameraClickListener(this);
                ((ImageView) _$_findCachedViewById(R.id.ivArShare)).setOnClickListener(this);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208309, new Class[0], Void.TYPE).isSupported) {
                cr0.a aVar = cr0.a.f31228a;
                PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208317, new Class[0], ARProductWearActivity$vykingKitListener$2.AnonymousClass1.class);
                IArShoeDriver a5 = aVar.a(this, (ARProductWearActivity$vykingKitListener$2.AnonymousClass1) (proxy.isSupported ? proxy.result : this.z.getValue()));
                this.s = a5;
                if (a5 != null) {
                    a5.setOnOperationListener(new f0(this));
                }
                IArShoeDriver iArShoeDriver = this.s;
                if (iArShoeDriver != null) {
                    iArShoeDriver.prepareSo(this);
                }
            }
            ((DuImageLoaderView) _$_findCachedViewById(R.id.ivRedDot)).h(R.drawable.reddot_flashing).x();
        }
    }

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

    public final void k() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208310, new Class[0], Void.TYPE).isSupported) {
            u0.a(getContext(), "初始化失败,请稍后重试");
            finish();
        }
    }

    public final void l() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208323, new Class[0], Void.TYPE).isSupported) {
            runOnUiThread(new c(this));
        }
    }

    @Override // com.shizhuang.duapp.modules.du_mall_common.widget.ar_3d.Mall3dArCaptureButton.OnCaptureClickListener
    public void onCapturePic() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208325, new Class[0], Void.TYPE).isSupported) {
            showProgressDialog("正在合成分享图片");
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208328, new Class[0], Void.TYPE).isSupported) {
                int height = this.toolbar.getHeight() + this.toolbar.getTop();
                IArShoeDriver iArShoeDriver = this.s;
                if (iArShoeDriver != null) {
                    iArShoeDriver.takePhoto(0, height);
                }
            }
            i60.b bVar = i60.b.f33293a;
            ArrayMap arrayMap = new ArrayMap(8);
            long j12 = this.e;
            if (j12 > 0) {
                arrayMap.put("spu_id", String.valueOf(j12));
            }
            arrayMap.put("shoot_type", "0");
            bVar.b("community_ar_block_click", "473", "241", arrayMap);
        }
    }

    @Override // com.shizhuang.duapp.modules.du_mall_common.widget.ar_3d.Mall3dArCaptureButton.OnCaptureClickListener
    public void onCaptureVideo(@NotNull Mall3dArCaptureButton.a aVar) {
        if (!PatchProxy.proxy(new Object[]{aVar}, this, changeQuickRedirect, false, 208326, new Class[]{Mall3dArCaptureButton.a.class}, Void.TYPE).isSupported) {
            if (Intrinsics.areEqual(aVar, Mall3dArCaptureButton.a.c.f13840a)) {
                IArShoeDriver iArShoeDriver = this.s;
                if (iArShoeDriver != null) {
                    iArShoeDriver.startVideoCapture(false);
                }
                g(true);
                i60.b bVar = i60.b.f33293a;
                ArrayMap arrayMap = new ArrayMap(8);
                long j12 = this.e;
                if (j12 > 0) {
                    arrayMap.put("spu_id", String.valueOf(j12));
                }
                arrayMap.put("shoot_type", "1");
                bVar.b("community_ar_block_click", "473", "241", arrayMap);
            } else if (Intrinsics.areEqual(aVar, Mall3dArCaptureButton.a.C0252a.f13838a)) {
                IArShoeDriver iArShoeDriver2 = this.s;
                if (iArShoeDriver2 != null) {
                    iArShoeDriver2.stopVideoCapture();
                }
                showProgressDialog("正在合成视频");
                g(false);
            } else if (Intrinsics.areEqual(aVar, Mall3dArCaptureButton.a.d.f13841a)) {
                IArShoeDriver iArShoeDriver3 = this.s;
                if (iArShoeDriver3 != null) {
                    iArShoeDriver3.cancelVideoCapture();
                }
                g(false);
                u0.a(getContext(), "录制时间过短");
            } else if (aVar instanceof Mall3dArCaptureButton.a.b) {
                Mall3dArCaptureButton.a.b bVar2 = (Mall3dArCaptureButton.a.b) aVar;
                if (bVar2.a() == -1) {
                    ((TextView) _$_findCachedViewById(R.id.tvRecordCountDown)).setVisibility(8);
                    ((DuImageLoaderView) _$_findCachedViewById(R.id.ivRedDot)).setVisibility(8);
                    return;
                }
                ((TextView) _$_findCachedViewById(R.id.tvRecordCountDown)).setVisibility(0);
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivRedDot)).setVisibility(0);
                long a5 = bVar2.a() / ((long) 1000);
                ((TextView) _$_findCachedViewById(R.id.tvRecordCountDown)).setText((a5 + 1) + "s / 30s");
            }
        }
    }

    @SensorsDataInstrumented
    public void onClick(@NotNull View view) {
        ArDetailInfoModel detail;
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 208324, new Class[]{View.class}, Void.TYPE).isSupported) {
            if (Intrinsics.areEqual(view, (ImageView) _$_findCachedViewById(R.id.iv_ar_buy))) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap arrayMap = new ArrayMap(8);
                long j12 = this.e;
                if (j12 > 0) {
                    arrayMap.put("spu_id", String.valueOf(j12));
                }
                bVar.b("community_ar_block_click", "473", "160", arrayMap);
                IProductDetailService.a.a(d.f31730a.d(), this, this.e, 0, this.i, null, 0, 48, null);
            } else if (Intrinsics.areEqual(view, (ImageView) _$_findCachedViewById(R.id.iv_ar_collection))) {
                i60.b bVar2 = i60.b.f33293a;
                ArrayMap arrayMap2 = new ArrayMap(8);
                long j13 = this.e;
                if (j13 > 0) {
                    arrayMap2.put("spu_id", String.valueOf(j13));
                }
                bVar2.b("community_ar_block_click", "473", "19", arrayMap2);
                LoginHelper.l(this, LoginHelper.LoginTipsType.TYPE_COLLECT, "", "", new b(this));
            } else if (Intrinsics.areEqual(view, (ImageView) _$_findCachedViewById(R.id.ivArShare))) {
                if (this.w) {
                    SensorsDataAutoTrackHelper.trackViewOnClick(view);
                    return;
                }
                j().a();
                Ar3DShareHelper ar3DShareHelper = Ar3DShareHelper.f13588a;
                Long valueOf = Long.valueOf(h().getSpuId());
                ArDetailModel value = h().getModel().getValue();
                ar3DShareHelper.e(this, valueOf, (value == null || (detail = value.getDetail()) == null) ? null : detail.getTitle(), this.t, new ARProductWearActivity$onClick$4(this));
            }
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
        }
    }

    @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, 208294, 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 onCreateViewBefore(@Nullable Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 208296, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreateViewBefore(bundle);
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208297, new Class[0], Void.TYPE).isSupported) {
                Yeezy.Companion.load(false, this, new ARProductWearActivity$loadNewAdditionPathFile$1(this), new ARProductWearActivity$loadNewAdditionPathFile$2(this), "6cfa3c657ea31b1364ac0bce8d93d8c1");
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208298, new Class[0], Void.TYPE).isSupported) {
                Yeezy.Companion.load(false, this, new ARProductWearActivity$loadNewWaterMarkPathFile$1(this), new ARProductWearActivity$loadNewWaterMarkPathFile$2(this), "608f180ef6e22c25a92d0b5c23ec3a89");
            }
            if (this.o && !PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208299, new Class[0], Void.TYPE).isSupported) {
                DuRequestOptions g3 = mn.a.f35714a.g("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/ar/ic_ar_share_foot_deteced_loading.webp");
                int i3 = E;
                ((DuRequestOptions) g3.v(new co.d(i3, i3))).G(this).y();
            }
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onDestroy() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208333, new Class[0], Void.TYPE).isSupported) {
            super.onDestroy();
            j().c();
            UserDataMonitor.e.b();
            IArShoeDriver iArShoeDriver = this.s;
            if (iArShoeDriver != null) {
                iArShoeDriver.onDestroy();
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208329, new Class[0], Void.TYPE).isSupported && this.n != null) {
                FileUtil.o(new File(this.n));
            }
            tr.c.e();
            Process.killProcess(Process.myPid());
            System.exit(0);
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onEvent(@NotNull ARActivityActionNotifyEvent aRActivityActionNotifyEvent) {
        if (!PatchProxy.proxy(new Object[]{aRActivityActionNotifyEvent}, this, changeQuickRedirect, false, 208308, new Class[]{ARActivityActionNotifyEvent.class}, Void.TYPE).isSupported) {
            String notifyFrom = aRActivityActionNotifyEvent.getNotifyFrom();
            if (notifyFrom == null || !notifyFrom.equals(this.TAG)) {
                finish();
            }
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onFavoriteChange(@NotNull FavoriteChangeEvent favoriteChangeEvent) {
        boolean z4 = true;
        if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, this, changeQuickRedirect, false, 208337, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported && favoriteChangeEvent.getSpuId() == h().getSpuId()) {
            ImageView imageView = (ImageView) _$_findCachedViewById(R.id.iv_ar_collection);
            if (favoriteChangeEvent.getFavoriteCount() <= 0) {
                z4 = false;
            }
            imageView.setSelected(z4);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.ILoginState
    public void onLoginStatusChange(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 208313, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.onLoginStatusChange(z4);
            h().b(this, null, null);
        }
    }

    @Override // androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onPause() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 208332, new Class[0], Void.TYPE).isSupported) {
            super.onPause();
            IArShoeDriver iArShoeDriver = this.s;
            if (iArShoeDriver != null) {
                iArShoeDriver.onPause();
            }
            i60.b.f33293a.d("community_ar_duration_pageview", "473", getRemainTime(), new ARProductWearActivity$onPause$1(this));
        }
    }

    @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, 208330, 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, 208340, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onStart(this);
        }
    }
}