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


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

import a40.j;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.util.ArrayMap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwnerKt;
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.sensorsdata.analytics.android.sdk.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.helper.LoginHelper;
import com.shizhuang.duapp.common.ui.BaseFragment;
import com.shizhuang.duapp.libs.animation.DuAnimationView;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.widget.DuIconsTextView;
import df.r0;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.jetbrains.annotations.NotNull;
import u91.e;

@Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0007\u0018\u00002\u00020\u0001:\u0001\nB\u0007¢\u0006\u0004\b\b\u0010\tJ\b\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0004H\u0016J\b\u0010\u0007\u001a\u00020\u0002H\u0016¨\u0006\u000b"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/facedetect/detect/ui/FaceDetectMainFragment;", "Lcom/shizhuang/duapp/common/ui/BaseFragment;", "", "onResume", "", "hidden", "onHiddenChanged", "onPause", "<init>", "()V", "a", "du_product_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: FaceDetectMainFragment.kt */
public final class FaceDetectMainFragment extends BaseFragment {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public static final a e = new a(null);
    public long b;

    /* renamed from: c  reason: collision with root package name */
    public int f23624c;
    public HashMap d;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void FragmentMethodWeaver_onCreate(FaceDetectMainFragment faceDetectMainFragment, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{faceDetectMainFragment, bundle}, null, changeQuickRedirect, true, 293345, new Class[]{FaceDetectMainFragment.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectMainFragment.d(faceDetectMainFragment, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectMainFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.detect.ui.FaceDetectMainFragment")) {
                    jn.b.f34396a.fragmentOnCreateMethod(faceDetectMainFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreateView")
        @Keep
        public static View FragmentMethodWeaver_onCreateView(@NonNull FaceDetectMainFragment faceDetectMainFragment, @Nullable LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, Bundle bundle) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{faceDetectMainFragment, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 293347, new Class[]{FaceDetectMainFragment.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy.isSupported) {
                return (View) proxy.result;
            }
            long currentTimeMillis = System.currentTimeMillis();
            View f = FaceDetectMainFragment.f(faceDetectMainFragment, layoutInflater, viewGroup, bundle);
            long currentTimeMillis2 = System.currentTimeMillis();
            if (faceDetectMainFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.detect.ui.FaceDetectMainFragment")) {
                jn.b.f34396a.fragmentOnCreateViewMethod(faceDetectMainFragment, currentTimeMillis, currentTimeMillis2);
            }
            return f;
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void FragmentMethodWeaver_onResume(FaceDetectMainFragment faceDetectMainFragment) {
            if (!PatchProxy.proxy(new Object[]{faceDetectMainFragment}, null, changeQuickRedirect, true, 293344, new Class[]{FaceDetectMainFragment.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectMainFragment.c(faceDetectMainFragment);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectMainFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.detect.ui.FaceDetectMainFragment")) {
                    jn.b.f34396a.fragmentOnResumeMethod(faceDetectMainFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void FragmentMethodWeaver_onStart(FaceDetectMainFragment faceDetectMainFragment) {
            if (!PatchProxy.proxy(new Object[]{faceDetectMainFragment}, null, changeQuickRedirect, true, 293346, new Class[]{FaceDetectMainFragment.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectMainFragment.e(faceDetectMainFragment);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectMainFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.detect.ui.FaceDetectMainFragment")) {
                    jn.b.f34396a.fragmentOnStartMethod(faceDetectMainFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onViewCreated")
        @Keep
        public static void FragmentMethodWeaver_onViewCreated(@NonNull FaceDetectMainFragment faceDetectMainFragment, @Nullable View view, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{faceDetectMainFragment, view, bundle}, null, changeQuickRedirect, true, 293348, new Class[]{FaceDetectMainFragment.class, View.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FaceDetectMainFragment.g(faceDetectMainFragment, view, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (faceDetectMainFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.facedetect.detect.ui.FaceDetectMainFragment")) {
                    jn.b.f34396a.fragmentOnViewCreatedMethod(faceDetectMainFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    /* compiled from: FaceDetectMainFragment.kt */
    public static final class a {
        public static ChangeQuickRedirect changeQuickRedirect;

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    /* compiled from: FaceDetectMainFragment.kt */
    public static final class b extends ClickableSpan {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FaceDetectMainFragment b;

        /* compiled from: FaceDetectMainFragment.kt */
        public static final class a implements Runnable {
            public static ChangeQuickRedirect changeQuickRedirect;
            public final /* synthetic */ Context b;

            public a(Context context) {
                this.b = context;
            }

            public final void run() {
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293357, new Class[0], Void.TYPE).isSupported) {
                    e.U(this.b, "https://cdn-fast.dewu.com/nezha-plus/detail/61e928c5d00b4c35d7b45e8b?duWebviewBg=%23ffffff", "《AI测肤服务用户授权协议》");
                    if (!PatchProxy.proxy(new Object[]{"AI测肤服务用户授权协议"}, i60.a.f33292a, i60.a.changeQuickRedirect, false, 124796, new Class[]{Object.class}, Void.TYPE).isSupported) {
                        i60.b.f33293a.b("trade_ai_click", "1218", "1933", j.e(8, "button_title", "AI测肤服务用户授权协议"));
                    }
                }
            }
        }

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

        @SensorsDataInstrumented
        public void onClick(@NotNull View view) {
            if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 293356, new Class[]{View.class}, Void.TYPE).isSupported) {
                Context context = this.b.getContext();
                if (context != null) {
                    LoginHelper.k(context, new a(context));
                }
                SensorsDataAutoTrackHelper.trackViewOnClick(view);
            }
        }
    }

    public static void c(FaceDetectMainFragment faceDetectMainFragment) {
        if (!PatchProxy.proxy(new Object[0], faceDetectMainFragment, changeQuickRedirect, false, 293319, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            faceDetectMainFragment.b = SystemClock.elapsedRealtime();
            FragmentActivity activity = faceDetectMainFragment.getActivity();
            if (!(activity instanceof FaceDetectActivity)) {
                activity = null;
            }
            FaceDetectActivity faceDetectActivity = (FaceDetectActivity) activity;
            int i = faceDetectActivity != null ? faceDetectActivity.f23615c : 0;
            faceDetectMainFragment.f23624c = i;
            i60.a aVar = i60.a.f33292a;
            Integer valueOf = Integer.valueOf(i);
            if (!PatchProxy.proxy(new Object[]{valueOf}, aVar, i60.a.changeQuickRedirect, false, 124951, new Class[]{Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap arrayMap = new ArrayMap(8);
                arrayMap.put("source_name", valueOf);
                bVar.b("trade_ai_pageview", "1218", "", arrayMap);
            }
            ((DuAnimationView) faceDetectMainFragment._$_findCachedViewById(R.id.imgDisplay)).y();
        }
    }

    public static void d(FaceDetectMainFragment faceDetectMainFragment, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, faceDetectMainFragment, changeQuickRedirect, false, 293333, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void e(FaceDetectMainFragment faceDetectMainFragment) {
        if (!PatchProxy.proxy(new Object[0], faceDetectMainFragment, changeQuickRedirect, false, 293335, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

    public static View f(FaceDetectMainFragment faceDetectMainFragment, LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, faceDetectMainFragment, changeQuickRedirect, false, 293337, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : super.onCreateView(layoutInflater, viewGroup, bundle);
    }

    public static void g(FaceDetectMainFragment faceDetectMainFragment, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, faceDetectMainFragment, changeQuickRedirect, false, 293339, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
        }
    }

    public View _$_findCachedViewById(int i) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 293330, 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 view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.d.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

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

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initData() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293322, new Class[0], Void.TYPE).isSupported && !PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293326, new Class[0], Void.TYPE).isSupported) {
            LifecycleOwnerKt.getLifecycleScope(this).launchWhenResumed(new FaceDetectMainFragment$loadRemoteResources$1(this, null));
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initStatusBar() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293321, new Class[0], Void.TYPE).isSupported) {
            r0.q(getActivity(), 0, null);
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initView(@org.jetbrains.annotations.Nullable Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 293323, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.imgDetectHis), 0, new FaceDetectMainFragment$initView$1(this), 1);
            ViewExtensionKt.j((DuImageLoaderView) _$_findCachedViewById(R.id.imgDetect), 0, new FaceDetectMainFragment$initView$2(this), 1);
            ((DuIconsTextView) _$_findCachedViewById(R.id.checkBoxPrivacy)).setOnClickListener(new FaceDetectMainFragment$initView$3(this));
            ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.tvBack), 0, new FaceDetectMainFragment$initView$4(this), 1);
            showLoadingView();
            SpannableString spannableString = new SpannableString("阅读并同意《AI测肤服务用户授权协议》授权得物收集、共享您的照片用于AI测肤");
            spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#01C2C3")), 5, 19, 34);
            spannableString.setSpan(new b(this), 5, 19, 34);
            ((TextView) _$_findCachedViewById(R.id.tvPrivacy)).setText(spannableString);
            ((TextView) _$_findCachedViewById(R.id.tvPrivacy)).setMovementMethod(LinkMovementMethod.getInstance());
            int i = r0.i(getContext());
            ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) _$_findCachedViewById(R.id.viewPlaceholder).getLayoutParams();
            ((ViewGroup.MarginLayoutParams) layoutParams).height = i;
            _$_findCachedViewById(R.id.viewPlaceholder).setLayoutParams(layoutParams);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 293332, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 293336, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onDestroyView() {
        HashMap hashMap;
        super.onDestroyView();
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293331, new Class[0], Void.TYPE).isSupported && (hashMap = this.d) != null) {
            hashMap.clear();
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onHiddenChanged(boolean z) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 293328, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.onHiddenChanged(z);
            if (z) {
                i60.a.f33292a.F0(Float.valueOf(((float) (SystemClock.elapsedRealtime() - this.b)) / 1000.0f), Integer.valueOf(this.f23624c));
            } else {
                this.b = SystemClock.elapsedRealtime();
            }
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onPause() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293329, new Class[0], Void.TYPE).isSupported) {
            super.onPause();
            if (isVisible()) {
                i60.a.f33292a.F0(Float.valueOf(((float) (SystemClock.elapsedRealtime() - this.b)) / 1000.0f), Integer.valueOf(this.f23624c));
            }
            ((DuAnimationView) _$_findCachedViewById(R.id.imgDisplay)).E();
        }
    }

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

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293334, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 293338, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
        }
    }
}