得物.apk(点击下载) / FaceDetectFlawView.java
package com.shizhuang.duapp.modules.productv2.facedetect.detect.widgets;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.libs.animation.DuAnimationView;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.JvmOverloads;
import o5.i;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(bv = {}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u00002\u00020\u0001B'\b\u0007\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0004\u0012\b\b\u0002\u0010\u0007\u001a\u00020\u0006¢\u0006\u0004\b\b\u0010\t¨\u0006\n"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/facedetect/detect/widgets/FaceDetectFlawView;", "Landroidx/constraintlayout/widget/ConstraintLayout;", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "du_product_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: FaceDetectFlawView.kt */
public final class FaceDetectFlawView extends ConstraintLayout {
public static ChangeQuickRedirect changeQuickRedirect;
public ObjectAnimator b;
/* renamed from: c reason: collision with root package name */
public ObjectAnimator f23632c;
public ObjectAnimator d;
public final Runnable e;
public final Runnable f;
/* renamed from: g reason: collision with root package name */
public HashMap f23633g;
/* compiled from: FaceDetectFlawView.kt */
public static final class a implements Runnable {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ FaceDetectFlawView b;
public a(FaceDetectFlawView faceDetectFlawView) {
this.b = faceDetectFlawView;
}
public final void run() {
ObjectAnimator objectAnimator;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293498, new Class[0], Void.TYPE).isSupported && (objectAnimator = this.b.d) != null) {
objectAnimator.reverse();
}
}
}
/* compiled from: FaceDetectFlawView.kt */
public static final class b implements Runnable {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ FaceDetectFlawView b;
public b(FaceDetectFlawView faceDetectFlawView) {
this.b = faceDetectFlawView;
}
public final void run() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293499, new Class[0], Void.TYPE).isSupported) {
ObjectAnimator objectAnimator = this.b.b;
if (objectAnimator != null) {
objectAnimator.reverse();
}
ObjectAnimator objectAnimator2 = this.b.f23632c;
if (objectAnimator2 != null) {
objectAnimator2.reverse();
}
}
}
}
@JvmOverloads
public FaceDetectFlawView(@NotNull Context context) {
this(context, null, 0, 6);
}
@JvmOverloads
public FaceDetectFlawView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0, 4);
}
@JvmOverloads
public FaceDetectFlawView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.e = new b(this);
this.f = new a(this);
LayoutInflater.from(context).inflate(R.layout.layout_face_detect_result, (ViewGroup) this, true);
}
public View a(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 293496, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.f23633g == null) {
this.f23633g = new HashMap();
}
View view = (View) this.f23633g.get(Integer.valueOf(i));
if (view != null) {
return view;
}
View findViewById = findViewById(i);
this.f23633g.put(Integer.valueOf(i), findViewById);
return findViewById;
}
public final void b(boolean z, @Nullable String str, @Nullable String str2, float f12, float f13) {
Object[] objArr = {new Byte(z ? (byte) 1 : 0), str, str2, new Float(f12), new Float(f13)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Float.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 293493, new Class[]{Boolean.TYPE, String.class, String.class, cls, cls}, Void.TYPE).isSupported) {
if (z) {
((DuAnimationView) a(R.id.imgFlawLeft)).setVisibility(0);
((DuAnimationView) a(R.id.imgFlawRight)).setVisibility(8);
((TextView) a(R.id.tvTitleLeft)).setVisibility(0);
((TextView) a(R.id.tvEngTitleLeft)).setVisibility(0);
((TextView) a(R.id.tvTitleRight)).setVisibility(8);
((TextView) a(R.id.tvEngTitleRight)).setVisibility(8);
((TextView) a(R.id.tvTitleLeft)).setText(str);
((TextView) a(R.id.tvEngTitleLeft)).setText(str2);
((DuAnimationView) a(R.id.imgFlawLeft)).F("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/facedetect_animation4.mp4").w(1).p(new FaceDetectFlawView$showFlawAnimation$1(this, f12, f13)).s();
return;
}
((DuAnimationView) a(R.id.imgFlawLeft)).setVisibility(8);
((DuAnimationView) a(R.id.imgFlawRight)).setVisibility(0);
((TextView) a(R.id.tvTitleLeft)).setVisibility(8);
((TextView) a(R.id.tvEngTitleLeft)).setVisibility(8);
((TextView) a(R.id.tvTitleRight)).setVisibility(0);
((TextView) a(R.id.tvEngTitleRight)).setVisibility(0);
((TextView) a(R.id.tvTitleRight)).setText(str);
((TextView) a(R.id.tvEngTitleRight)).setText(str2);
((DuAnimationView) a(R.id.imgFlawRight)).F("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/facedetect_animation5.mp4").w(1).p(new FaceDetectFlawView$showFlawAnimation$2(this, f12, f13)).s();
}
}
public final void c(TextView textView, TextView textView2, float f12, float f13, boolean z) {
Object[] objArr = {textView, textView2, new Float(f12), new Float(f13), new Byte(z ? (byte) 1 : 0)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Float.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 293494, new Class[]{TextView.class, TextView.class, cls, cls, Boolean.TYPE}, Void.TYPE).isSupported) {
float[] fArr = new float[3];
fArr[0] = f12;
fArr[1] = z ? ((float) fi.b.b((float) 10)) + f13 : f13 - ((float) fi.b.b((float) 10));
fArr[2] = f13;
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(textView, "translationX", fArr);
ofFloat.setInterpolator(new LinearInterpolator());
ofFloat.setDuration(680L);
ofFloat.setStartDelay(320);
Unit unit = Unit.INSTANCE;
this.b = ofFloat;
ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(textView, "alpha", i.f36333a, 1.0f);
ofFloat2.setInterpolator(new LinearInterpolator());
ofFloat2.setDuration(680L);
ofFloat2.setStartDelay(320);
this.f23632c = ofFloat2;
ObjectAnimator objectAnimator = this.b;
if (objectAnimator != null) {
objectAnimator.start();
}
ObjectAnimator objectAnimator2 = this.f23632c;
if (objectAnimator2 != null) {
objectAnimator2.start();
}
postDelayed(this.e, 1320);
ObjectAnimator ofFloat3 = ObjectAnimator.ofFloat(textView2, "alpha", i.f36333a, 1.0f);
ofFloat3.setInterpolator(new LinearInterpolator());
ofFloat3.setDuration(680L);
ofFloat3.setStartDelay(320);
this.d = ofFloat3;
ofFloat3.start();
postDelayed(this.f, 1320);
}
}
public void onDetachedFromWindow() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 293495, new Class[0], Void.TYPE).isSupported) {
super.onDetachedFromWindow();
removeCallbacks(this.e);
removeCallbacks(this.f);
DuAnimationView duAnimationView = (DuAnimationView) a(R.id.imgFlawLeft);
if (duAnimationView != null) {
duAnimationView.E();
}
DuAnimationView duAnimationView2 = (DuAnimationView) a(R.id.imgFlawRight);
if (duAnimationView2 != null) {
duAnimationView2.E();
}
ObjectAnimator objectAnimator = this.b;
if (objectAnimator != null) {
objectAnimator.cancel();
}
ObjectAnimator objectAnimator2 = this.f23632c;
if (objectAnimator2 != null) {
objectAnimator2.cancel();
}
ObjectAnimator objectAnimator3 = this.d;
if (objectAnimator3 != null) {
objectAnimator3.cancel();
}
}
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ FaceDetectFlawView(Context context, AttributeSet attributeSet, int i, int i3) {
this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
}
}