得物.apk(点击下载) / ARMakeupsActivityV2.java
package com.shizhuang.duapp.modules.mall_ar.ui;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import cd.e;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.liulishuo.okdownload.core.cause.EndCause;
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.event.FavoriteChangeEvent;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
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.modules.du_mall_common.constant.MallABTest;
import com.shizhuang.duapp.modules.du_mall_common.helper.MediaPermissionHelper;
import com.shizhuang.duapp.modules.du_mall_common.model.product.QrCodeInfoModel;
import com.shizhuang.duapp.modules.du_mall_common.widget.ar_3d.Mall3dArShareIconTipsPop;
import com.shizhuang.duapp.modules.mall_ar.model.MakeupsLipsModel;
import com.shizhuang.duapp.modules.mall_ar.scrollPicker.NewHorizontalScrollLipsPicker;
import com.shizhuang.duapp.modules.mall_ar.ui.adapter.NewLipsPickerAdapter;
import com.shizhuang.duapp.modules.mall_ar.utils.UserDataMonitor;
import com.shizhuang.duapp.modules.mall_ar.widget.ARSeekBar;
import com.shizhuang.duapp.stream.interfaces.IRecorder;
import com.shizhuang.duapp.stream.model.ComposerNode;
import com.shizhuang.media.view.PreviewSurfaceView;
import df.b0;
import df.r0;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.JvmField;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import o5.i;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import rd.l;
@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\u0004\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0006\u0010\u0007J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0007¨\u0006\b"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_ar/ui/ARMakeupsActivityV2;", "Lcom/shizhuang/duapp/common/ui/BaseLeftBackActivity;", "Lcom/shizhuang/duapp/common/event/FavoriteChangeEvent;", "event", "", "onFavoriteChange", "<init>", "()V", "du_mall_ar_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ARMakeupsActivityV2.kt */
public final class ARMakeupsActivityV2 extends BaseLeftBackActivity {
public static ChangeQuickRedirect changeQuickRedirect;
/* renamed from: c reason: collision with root package name */
public PreviewSurfaceView f19075c;
public IRecorder d;
@Autowired
@JvmField
public long e;
@Autowired
@JvmField
public long f;
@Autowired
@JvmField
@NotNull
/* renamed from: g reason: collision with root package name */
public String f19076g = "";
@JvmField
/* renamed from: h reason: collision with root package name */
public long f19077h;
@NotNull
public String i = "";
public QrCodeInfoModel j;
public MakeupsLipsModel k;
public DuImageLoaderView l;
public int m = -1;
public NewLipsPickerAdapter n;
public long o;
public LinkedList<ComposerNode> p = new LinkedList<>();
/* renamed from: q reason: collision with root package name */
public LinkedList<ComposerNode> f19078q = new LinkedList<>();
public final Lazy r = LazyKt__LazyJVMKt.lazy(new ARMakeupsActivityV2$ipcHelper$2(this));
public final Lazy s = LazyKt__LazyJVMKt.lazy(new ARMakeupsActivityV2$shareIconTipsPop$2(this));
public final Lazy t = LazyKt__LazyJVMKt.lazy(ARMakeupsActivityV2$isWantHave$2.INSTANCE);
/* renamed from: u reason: collision with root package name */
public final String f19079u = MallABTest.f13351a.j();
/* renamed from: v reason: collision with root package name */
public boolean f19080v;
public float w;
public final ARMakeupsActivityV2$newPickerStateListener$1 x = new ARMakeupsActivityV2$newPickerStateListener$1(this);
public final k60.a y = new a(this);
public HashMap z;
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(@Nullable ARMakeupsActivityV2 aRMakeupsActivityV2, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{aRMakeupsActivityV2, bundle}, null, changeQuickRedirect, true, 207982, new Class[]{ARMakeupsActivityV2.class, Bundle.class}, Void.TYPE).isSupported) {
jn.b bVar = jn.b.f34396a;
if (!bVar.b()) {
bVar.d(true);
}
long currentTimeMillis = System.currentTimeMillis();
ARMakeupsActivityV2.d(aRMakeupsActivityV2, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (aRMakeupsActivityV2.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.mall_ar.ui.ARMakeupsActivityV2")) {
bVar.activityOnCreateMethod(aRMakeupsActivityV2, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
@Insert(mayCreateSuper = true, value = "onResume")
@Keep
public static void ActivityMethodWeaver_onResume(ARMakeupsActivityV2 aRMakeupsActivityV2) {
if (!PatchProxy.proxy(new Object[]{aRMakeupsActivityV2}, null, changeQuickRedirect, true, 207983, new Class[]{ARMakeupsActivityV2.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
ARMakeupsActivityV2.e(aRMakeupsActivityV2);
long currentTimeMillis2 = System.currentTimeMillis();
if (aRMakeupsActivityV2.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.mall_ar.ui.ARMakeupsActivityV2")) {
jn.b.f34396a.activityOnResumeMethod(aRMakeupsActivityV2, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
@Insert(mayCreateSuper = true, value = "onStart")
@Keep
public static void ActivityMethodWeaver_onStart(ARMakeupsActivityV2 aRMakeupsActivityV2) {
if (!PatchProxy.proxy(new Object[]{aRMakeupsActivityV2}, null, changeQuickRedirect, true, 207984, new Class[]{ARMakeupsActivityV2.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
ARMakeupsActivityV2.f(aRMakeupsActivityV2);
long currentTimeMillis2 = System.currentTimeMillis();
if (aRMakeupsActivityV2.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.mall_ar.ui.ARMakeupsActivityV2")) {
jn.b.f34396a.activityOnStartMethod(aRMakeupsActivityV2, currentTimeMillis, currentTimeMillis2);
}
}
}
}
/* compiled from: ARMakeupsActivityV2.kt */
public static final class a extends k60.a {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ ARMakeupsActivityV2 e;
/* JADX WARN: Incorrect args count in method signature: ()V */
public a(ARMakeupsActivityV2 aRMakeupsActivityV2) {
this.e = aRMakeupsActivityV2;
}
@Override // k60.a
public void k(@org.jetbrains.annotations.Nullable l<? extends Object> lVar) {
boolean z = PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 207988, 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, 207987, new Class[]{Long.TYPE, Integer.TYPE}, Void.TYPE).isSupported) {
BM.mall().b("mall_detail_lipstick_load", j, false, MapsKt__MapsJVMKt.mapOf(TuplesKt.to("spuId", String.valueOf(this.e.e))));
}
}
}
/* compiled from: ARMakeupsActivityV2.kt */
public static final class b implements View.OnTouchListener {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ ARMakeupsActivityV2 b;
public b(ARMakeupsActivityV2 aRMakeupsActivityV2) {
this.b = aRMakeupsActivityV2;
}
public final boolean onTouch(View view, MotionEvent motionEvent) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{view, motionEvent}, this, changeQuickRedirect, false, 208004, new Class[]{View.class, MotionEvent.class}, Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
String str = "";
String str2 = null;
if (motionEvent.getActionMasked() == 0) {
ARMakeupsActivityV2 aRMakeupsActivityV2 = this.b;
MakeupsLipsModel makeupsLipsModel = aRMakeupsActivityV2.k;
if (aRMakeupsActivityV2.i(makeupsLipsModel != null ? Integer.valueOf(makeupsLipsModel.getTabId()) : null)) {
ARMakeupsActivityV2 aRMakeupsActivityV22 = this.b;
IRecorder iRecorder = aRMakeupsActivityV22.d;
if (iRecorder != null) {
String[] strArr = new String[1];
MakeupsLipsModel makeupsLipsModel2 = aRMakeupsActivityV22.k;
if (makeupsLipsModel2 != null) {
str2 = makeupsLipsModel2.getMakeupFile();
}
if (str2 != null) {
str = str2;
}
strArr[0] = str;
iRecorder.removeComposerNodes(strArr);
}
} else {
ARMakeupsActivityV2 aRMakeupsActivityV23 = this.b;
IRecorder iRecorder2 = aRMakeupsActivityV23.d;
if (iRecorder2 != null) {
MakeupsLipsModel makeupsLipsModel3 = aRMakeupsActivityV23.k;
if (makeupsLipsModel3 != null) {
str2 = makeupsLipsModel3.getMakeupFile();
}
iRecorder2.updateComposerNodes(str2, this.b.m(), i.f36333a);
}
}
i60.b bVar = i60.b.f33293a;
ArrayMap arrayMap = new ArrayMap(8);
Pair[] pairArr = new Pair[1];
ARMakeupsActivityV2 aRMakeupsActivityV24 = this.b;
MakeupsLipsModel makeupsLipsModel4 = aRMakeupsActivityV24.k;
pairArr[0] = TuplesKt.to("spu_id", Long.valueOf(makeupsLipsModel4 != null ? makeupsLipsModel4.getSpuId() : aRMakeupsActivityV24.e));
e.a(arrayMap, pairArr);
bVar.b("trade_common_click", "366", "509", arrayMap);
} else if (motionEvent.getActionMasked() == 1) {
ARMakeupsActivityV2 aRMakeupsActivityV25 = this.b;
MakeupsLipsModel makeupsLipsModel5 = aRMakeupsActivityV25.k;
if (aRMakeupsActivityV25.i(makeupsLipsModel5 != null ? Integer.valueOf(makeupsLipsModel5.getTabId()) : null)) {
ARMakeupsActivityV2 aRMakeupsActivityV26 = this.b;
IRecorder iRecorder3 = aRMakeupsActivityV26.d;
if (iRecorder3 != null) {
String[] strArr2 = new String[1];
MakeupsLipsModel makeupsLipsModel6 = aRMakeupsActivityV26.k;
if (makeupsLipsModel6 != null) {
str2 = makeupsLipsModel6.getMakeupFile();
}
if (str2 != null) {
str = str2;
}
strArr2[0] = str;
iRecorder3.appendComposerNodes(strArr2);
}
} else {
ARMakeupsActivityV2 aRMakeupsActivityV27 = this.b;
IRecorder iRecorder4 = aRMakeupsActivityV27.d;
if (iRecorder4 != null) {
MakeupsLipsModel makeupsLipsModel7 = aRMakeupsActivityV27.k;
if (makeupsLipsModel7 != null) {
str2 = makeupsLipsModel7.getMakeupFile();
}
iRecorder4.updateComposerNodes(str2, this.b.m(), this.b.k());
}
}
}
return true;
}
}
/* compiled from: ARMakeupsActivityV2.kt */
public static final class c implements SeekBar.OnSeekBarChangeListener {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ ARMakeupsActivityV2 b;
/* JADX WARN: Incorrect args count in method signature: ()V */
public c(ARMakeupsActivityV2 aRMakeupsActivityV2) {
this.b = aRMakeupsActivityV2;
}
public void onProgressChanged(@org.jetbrains.annotations.Nullable SeekBar seekBar, int i, boolean z) {
if (!PatchProxy.proxy(new Object[]{seekBar, new Integer(i), new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 208005, new Class[]{SeekBar.class, Integer.TYPE, Boolean.TYPE}, Void.TYPE).isSupported) {
this.b.q((((float) i) * 1.0f) / ((float) 100));
MakeupsLipsModel makeupsLipsModel = this.b.k;
if (makeupsLipsModel != null) {
makeupsLipsModel.setProgress(Integer.valueOf(i));
}
ARMakeupsActivityV2 aRMakeupsActivityV2 = this.b;
IRecorder iRecorder = aRMakeupsActivityV2.d;
if (iRecorder != null) {
MakeupsLipsModel makeupsLipsModel2 = aRMakeupsActivityV2.k;
iRecorder.updateComposerNodes(makeupsLipsModel2 != null ? makeupsLipsModel2.getMakeupFile() : null, this.b.m(), this.b.k());
}
}
}
public void onStartTrackingTouch(@org.jetbrains.annotations.Nullable SeekBar seekBar) {
boolean z = PatchProxy.proxy(new Object[]{seekBar}, this, changeQuickRedirect, false, 208006, new Class[]{SeekBar.class}, Void.TYPE).isSupported;
}
@SensorsDataInstrumented
public void onStopTrackingTouch(@org.jetbrains.annotations.Nullable SeekBar seekBar) {
if (!PatchProxy.proxy(new Object[]{seekBar}, this, changeQuickRedirect, false, 208007, new Class[]{SeekBar.class}, Void.TYPE).isSupported) {
SensorsDataAutoTrackHelper.trackViewOnClick(seekBar);
}
}
}
/* compiled from: ARMakeupsActivityV2.kt */
public static final class d extends vl.a {
public static ChangeQuickRedirect changeQuickRedirect;
/* renamed from: a reason: collision with root package name */
public final /* synthetic */ ARMakeupsActivityV2 f19081a;
public final /* synthetic */ Function0 b;
public d(ARMakeupsActivityV2 aRMakeupsActivityV2, Function0 function0) {
this.f19081a = aRMakeupsActivityV2;
this.b = function0;
}
@Override // vl.a
public void onTaskEnd(@NotNull s9.c cVar, @NotNull EndCause endCause, @org.jetbrains.annotations.Nullable Exception exc) {
File i;
String f;
if (!PatchProxy.proxy(new Object[]{cVar, endCause, exc}, this, changeQuickRedirect, false, 208033, new Class[]{s9.c.class, EndCause.class, Exception.class}, Void.TYPE).isSupported) {
super.onTaskEnd(cVar, endCause, exc);
if (endCause == EndCause.COMPLETED && (i = cVar.i()) != null && (f = fr0.a.f32442a.f(this.f19081a.getContext(), i)) != null && !TextUtils.isEmpty(f)) {
MakeupsLipsModel makeupsLipsModel = this.f19081a.k;
if (makeupsLipsModel != null) {
makeupsLipsModel.setMakeupFile(f);
}
Function0 function0 = this.b;
if (function0 != null) {
Unit unit = (Unit) function0.invoke();
}
}
}
}
@Override // vl.a
public void progress(@NotNull s9.c cVar, float f, long j, long j12) {
Object[] objArr = {cVar, new Float(f), new Long(j), new Long(j12)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Long.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 208032, new Class[]{s9.c.class, Float.TYPE, cls, cls}, Void.TYPE).isSupported) {
super.progress(cVar, f, j, j12);
}
}
}
public static void d(ARMakeupsActivityV2 aRMakeupsActivityV2, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, aRMakeupsActivityV2, changeQuickRedirect, false, 207932, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
aRMakeupsActivityV2.y.d();
super.onCreate(bundle);
ViewGroup.LayoutParams layoutParams = ((ImageView) aRMakeupsActivityV2._$_findCachedViewById(R.id.loading)).getLayoutParams();
if (!(layoutParams instanceof FrameLayout.LayoutParams)) {
layoutParams = null;
}
FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) layoutParams;
float l12 = (((float) fi.b.l(aRMakeupsActivityV2)) - ((((float) fi.b.d(aRMakeupsActivityV2)) / 480.0f) * ((float) 950))) / ((float) 2);
if (layoutParams2 != null) {
layoutParams2.topMargin = (int) l12;
}
((ImageView) aRMakeupsActivityV2._$_findCachedViewById(R.id.loading)).setLayoutParams(layoutParams2);
DuAnimationView duAnimationView = (DuAnimationView) aRMakeupsActivityV2._$_findCachedViewById(R.id.loadingAnimation);
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) duAnimationView.getLayoutParams();
marginLayoutParams.topMargin = (int) l12;
duAnimationView.setLayoutParams(marginLayoutParams);
if (!PatchProxy.proxy(new Object[0], aRMakeupsActivityV2, changeQuickRedirect, false, 207963, new Class[0], Void.TYPE).isSupported && (!aRMakeupsActivityV2.j() || !((Boolean) b0.f("mmkv_ar_loader_animation_key", Boolean.FALSE)).booleanValue())) {
((FrameLayout) aRMakeupsActivityV2._$_findCachedViewById(R.id.loadingParent)).setVisibility(0);
((DuAnimationView) aRMakeupsActivityV2._$_findCachedViewById(R.id.loadingAnimation)).F("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/ar_animation.mp4").p(new ARMakeupsActivityV2$showLoadingAnimation$1(aRMakeupsActivityV2)).s();
}
((FontText) aRMakeupsActivityV2._$_findCachedViewById(R.id.arBottomCollectTx)).setText(aRMakeupsActivityV2.p() ? "想要" : "收藏");
}
}
public static void e(ARMakeupsActivityV2 aRMakeupsActivityV2) {
boolean z4 = false;
if (!PatchProxy.proxy(new Object[0], aRMakeupsActivityV2, changeQuickRedirect, false, 207957, new Class[0], Void.TYPE).isSupported) {
super.onResume();
IRecorder iRecorder = aRMakeupsActivityV2.d;
if (iRecorder != null) {
iRecorder.onRecorderResume();
}
i60.b bVar = i60.b.f33293a;
ArrayMap arrayMap = new ArrayMap(8);
Pair[] pairArr = new Pair[2];
MakeupsLipsModel makeupsLipsModel = aRMakeupsActivityV2.k;
pairArr[0] = TuplesKt.to("spu_id", Long.valueOf(makeupsLipsModel != null ? makeupsLipsModel.getSpuId() : aRMakeupsActivityV2.e));
String str = aRMakeupsActivityV2.f19076g;
if (str.length() == 0) {
z4 = true;
}
if (z4) {
str = "others";
}
pairArr[1] = TuplesKt.to("source_name", str);
e.a(arrayMap, pairArr);
bVar.b("trade_product_detail_pageview", "366", "", arrayMap);
}
}
public static void f(ARMakeupsActivityV2 aRMakeupsActivityV2) {
if (!PatchProxy.proxy(new Object[0], aRMakeupsActivityV2, changeQuickRedirect, false, 207980, new Class[0], Void.TYPE).isSupported) {
super.onStart();
}
}
public static final /* synthetic */ NewLipsPickerAdapter g(ARMakeupsActivityV2 aRMakeupsActivityV2) {
NewLipsPickerAdapter newLipsPickerAdapter = aRMakeupsActivityV2.n;
if (newLipsPickerAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("mNewPickerAdapter");
}
return newLipsPickerAdapter;
}
public View _$_findCachedViewById(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 207977, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.z == null) {
this.z = new HashMap();
}
View view = (View) this.z.get(Integer.valueOf(i3));
if (view != null) {
return view;
}
View findViewById = findViewById(i3);
this.z.put(Integer.valueOf(i3), findViewById);
return findViewById;
}
@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, 207947, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.activity_ar_makeups_v2;
}
public final void h() {
float f12;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207958, new Class[0], Void.TYPE).isSupported) {
HashSet hashSet = new HashSet();
Iterator<T> it2 = this.p.iterator();
while (it2.hasNext()) {
hashSet.add(it2.next().getNode());
}
this.f19078q.clear();
MakeupsLipsModel makeupsLipsModel = this.k;
if (makeupsLipsModel != null) {
hashSet.add(makeupsLipsModel.getMakeupFile());
LinkedList<ComposerNode> linkedList = this.f19078q;
int size = this.f19078q.size();
String makeupFile = makeupsLipsModel.getMakeupFile();
String m12 = m();
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{makeupsLipsModel}, this, changeQuickRedirect, false, 207959, new Class[]{MakeupsLipsModel.class}, Float.TYPE);
if (proxy.isSupported) {
f12 = ((Float) proxy.result).floatValue();
} else if (i(Integer.valueOf(makeupsLipsModel.getTabId()))) {
f12 = 100.0f;
} else {
Integer progress = makeupsLipsModel.getProgress();
f12 = progress != null ? (float) progress.intValue() : 50.0f;
}
linkedList.add(new ComposerNode(size, makeupFile, m12, f12));
}
IRecorder iRecorder = this.d;
if (iRecorder != null) {
iRecorder.setComposerMode(1);
}
IRecorder iRecorder2 = this.d;
if (iRecorder2 != null) {
iRecorder2.setComposerNodes((String[]) CollectionsKt___CollectionsKt.toList(hashSet).toArray(new String[0]));
}
for (T t4 : this.p) {
IRecorder iRecorder3 = this.d;
if (iRecorder3 != null) {
iRecorder3.updateComposerNodes(t4.getNode(), t4.getKey(), t4.getValue() / ((float) 100));
}
}
for (T t12 : this.f19078q) {
IRecorder iRecorder4 = this.d;
if (iRecorder4 != null) {
iRecorder4.updateComposerNodes(t12.getNode(), t12.getKey(), t12.getValue() / ((float) 100));
}
}
}
}
public final boolean i(Integer num) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{num}, this, changeQuickRedirect, false, 207952, new Class[]{Integer.class}, Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
if (num != null && num.intValue() == 8) {
return true;
}
if (num != null && num.intValue() == 9) {
return true;
}
return num != null && num.intValue() == 10;
}
@Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
public void initData() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207933, new Class[0], Void.TYPE).isSupported) {
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.iv_back), 0, new ARMakeupsActivityV2$initData$1(this), 1);
ViewExtensionKt.j((LinearLayout) _$_findCachedViewById(R.id.arBottomCollectParent), 0, new ARMakeupsActivityV2$initData$2(this), 1);
ViewExtensionKt.j((LinearLayout) _$_findCachedViewById(R.id.arBottomBuyParent), 0, new ARMakeupsActivityV2$initData$3(this), 1);
}
}
@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, 207976, 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
@SuppressLint({"ClickableViewAccessibility"})
public void initView(@org.jetbrains.annotations.Nullable Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 207951, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207945, new Class[0], Void.TYPE).isSupported) {
new MediaPermissionHelper(this, ARMakeupsActivityV2$takeCameraPermission$1.INSTANCE, new ARMakeupsActivityV2$takeCameraPermission$2(this)).a();
}
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.iv_beauty), 0, new ARMakeupsActivityV2$initView$1(this), 1);
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.iv_clear), 0, new ARMakeupsActivityV2$initView$2(this), 1);
((ImageView) _$_findCachedViewById(R.id.iv_clear)).setOnTouchListener(new b(this));
((ARSeekBar) _$_findCachedViewById(R.id.seek_progress)).setOnSeekBarChangeListener(new c(this));
this.n = new NewLipsPickerAdapter(this.x);
NewHorizontalScrollLipsPicker newHorizontalScrollLipsPicker = (NewHorizontalScrollLipsPicker) _$_findCachedViewById(R.id.f_makeup_v2);
NewLipsPickerAdapter newLipsPickerAdapter = this.n;
if (newLipsPickerAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("mNewPickerAdapter");
}
newHorizontalScrollLipsPicker.setAdapter(newLipsPickerAdapter);
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.iv_captures), 0, new ARMakeupsActivityV2$initView$5(this), 1);
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.ivPic), 0, new ARMakeupsActivityV2$initView$6(this), 1);
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.ivArShare), 0, new ARMakeupsActivityV2$initView$7(this), 1);
}
}
public final boolean j() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207971, new Class[0], Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
return new File(fr0.a.f32442a.d(this), "ComposeMakeup.bundle/ComposeMakeup.bundle/ComposeMakeup/beauty_Android_camera/config.json").exists();
}
public final float k() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207949, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.w;
}
public final h50.e l() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207928, new Class[0], h50.e.class);
return (h50.e) (proxy.isSupported ? proxy.result : this.r.getValue());
}
public final String m() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207954, new Class[0], String.class);
if (proxy.isSupported) {
return (String) proxy.result;
}
MakeupsLipsModel makeupsLipsModel = this.k;
String makeupFileCode = makeupsLipsModel != null ? makeupsLipsModel.getMakeupFileCode() : null;
return makeupFileCode != null ? makeupFileCode : "";
}
public final Mall3dArShareIconTipsPop n() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207929, new Class[0], Mall3dArShareIconTipsPop.class);
return (Mall3dArShareIconTipsPop) (proxy.isSupported ? proxy.result : this.s.getValue());
}
public final void o() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207962, new Class[0], Void.TYPE).isSupported) {
if (!j() || !((Boolean) b0.f("mmkv_ar_loader_animation_key", Boolean.FALSE)).booleanValue()) {
((FrameLayout) _$_findCachedViewById(R.id.loadingParent)).setVisibility(8);
((DuAnimationView) _$_findCachedViewById(R.id.loadingAnimation)).setVisibility(8);
((DuAnimationView) _$_findCachedViewById(R.id.loadingAnimation)).E();
b0.l("mmkv_ar_loader_animation_key", Boolean.TRUE);
}
}
}
@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, 207931, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
_boostWeave.ActivityMethodWeaver_onCreate(this, bundle);
}
}
@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, 207975, new Class[0], Void.TYPE).isSupported) {
super.onDestroy();
UserDataMonitor.e.b();
tr.c.e();
IRecorder iRecorder = this.d;
if (iRecorder != null) {
iRecorder.onRecorderDestroy();
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public final void onFavoriteChange(@NotNull FavoriteChangeEvent favoriteChangeEvent) {
List<MakeupsLipsModel> list;
if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, this, changeQuickRedirect, false, 207943, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported && !this.f19080v && favoriteChangeEvent.getSendType() != 999) {
NewLipsPickerAdapter newLipsPickerAdapter = this.n;
if (newLipsPickerAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("mNewPickerAdapter");
}
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], newLipsPickerAdapter, NewLipsPickerAdapter.changeQuickRedirect, false, 208688, new Class[0], List.class);
if (proxy.isSupported) {
list = (List) proxy.result;
} else {
list = newLipsPickerAdapter.f19146a;
}
if (!list.isEmpty()) {
Iterator<MakeupsLipsModel> it2 = list.iterator();
int i3 = 0;
while (true) {
if (!it2.hasNext()) {
i3 = -1;
break;
}
if (it2.next().getSkuId() == favoriteChangeEvent.getSkuId()) {
break;
}
i3++;
}
if (i3 >= 0) {
MakeupsLipsModel makeupsLipsModel = list.get(i3);
makeupsLipsModel.setFavoriteId(favoriteChangeEvent.getFavoriteId());
makeupsLipsModel.setAdded(favoriteChangeEvent.isAdd() ? 1 : 0);
NewLipsPickerAdapter newLipsPickerAdapter2 = this.n;
if (newLipsPickerAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("mNewPickerAdapter");
}
newLipsPickerAdapter2.notifyItemChanged(i3);
long skuId = makeupsLipsModel.getSkuId();
MakeupsLipsModel makeupsLipsModel2 = this.k;
if (makeupsLipsModel2 != null && skuId == makeupsLipsModel2.getSkuId()) {
((ImageView) _$_findCachedViewById(R.id.arBottomCollection)).setSelected(favoriteChangeEvent.isAdd());
}
}
}
}
}
@Override // androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
public void onPause() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207955, new Class[0], Void.TYPE).isSupported) {
super.onPause();
IRecorder iRecorder = this.d;
if (iRecorder != null) {
iRecorder.onRecorderPause();
}
this.f19080v = false;
}
}
public void onRestart() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207948, new Class[0], Void.TYPE).isSupported) {
super.onRestart();
this.f19080v = true;
}
}
@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, 207956, 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, 207979, new Class[0], Void.TYPE).isSupported) {
_boostWeave.ActivityMethodWeaver_onStart(this);
}
}
public final boolean p() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 207930, new Class[0], Boolean.TYPE);
return ((Boolean) (proxy.isSupported ? proxy.result : this.t.getValue())).booleanValue();
}
public final void q(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 207950, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.w = f12;
}
}
public final void r(@NotNull String str) {
if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 207927, new Class[]{String.class}, Void.TYPE).isSupported) {
this.i = str;
}
}
public final void s(Function0<Unit> function0) {
String str;
if (!PatchProxy.proxy(new Object[]{function0}, this, changeQuickRedirect, false, 207974, new Class[]{Function0.class}, Void.TYPE).isSupported) {
MakeupsLipsModel makeupsLipsModel = this.k;
if (makeupsLipsModel == null || (str = makeupsLipsModel.getMakeupFile()) == null) {
str = "";
}
tl.a.n(str, new d(this, function0));
}
}
}