package o; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; import android.text.Editable; import android.view.View; import android.widget.EditText; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.material.textfield.EndCompoundLayout; import o.C17052tZT; import org.bouncycastle.crypto.tls.CipherSuite; /* loaded from: classes2.dex */ public final class THi extends SQv { private final TimeInterpolator a; private final int b; EditText c; private final TimeInterpolator d; private final int e; private ValueAnimator f; private AnimatorSet h; private final View.OnFocusChangeListener m; private final View.OnClickListener n; public THi(EndCompoundLayout endCompoundLayout) { super(endCompoundLayout); this.n = new View.OnClickListener(this) { // from class: o.XWE private THi a; @Override // android.view.View.OnClickListener public final void onClick(View view) { THi tHi = this.a; EditText editText = tHi.c; if (editText != null) { Editable text = editText.getText(); if (text != null) { text.clear(); } tHi.i.a(false); } } { this.a = this; } }; this.m = new View.OnFocusChangeListener(this) { // from class: o.HGo private THi b; @Override // android.view.View.OnFocusChangeListener public final void onFocusChange(View view, boolean z) { THi tHi = this.b; tHi.b(tHi.d()); } { this.b = this; } }; this.b = DAZ.a(endCompoundLayout.getContext(), C17052tZT.IeS.motionDurationShort3, 100); this.e = DAZ.a(endCompoundLayout.getContext(), C17052tZT.IeS.motionDurationShort3, CipherSuite.TLS_RSA_WITH_SEED_CBC_SHA); this.d = DAZ.Kh_(endCompoundLayout.getContext(), C17052tZT.IeS.motionEasingLinearInterpolator, C6217cMa.e); this.a = DAZ.Kh_(endCompoundLayout.getContext(), C17052tZT.IeS.motionEasingEmphasizedInterpolator, C6217cMa.b); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final void f() { EditText editText = this.c; if (editText != null) { editText.post(new Runnable(this) { // from class: o.yuY private THi c; @Override // java.lang.Runnable public final void run() { this.c.b(true); } { this.c = this; } }); } } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final int c() { return C17052tZT.LWm.mtrl_ic_cancel; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final int a() { return C17052tZT.ojQ.clear_text_end_icon_content_description; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final void e(boolean z) { if (this.i.t == null) { return; } b(z); } @Override // o.SQv public final void Mz_(EditText editText) { this.c = editText; this.k.setEndIconVisible(d()); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final void e() { if (this.i.t != null) { return; } b(d()); } /* JADX INFO: Access modifiers changed from: package-private */ public final void b(boolean z) { EndCompoundLayout endCompoundLayout = this.i; boolean z2 = (endCompoundLayout.c.getVisibility() == 0 && endCompoundLayout.f6484o.getVisibility() == 0) == z; if (z && !this.h.isRunning()) { this.f.cancel(); this.h.start(); if (z2) { this.h.end(); return; } return; } if (z) { return; } this.h.cancel(); this.f.start(); if (z2) { this.f.end(); } } private ValueAnimator LV_(float... fArr) { ValueAnimator ofFloat = ValueAnimator.ofFloat(fArr); ofFloat.setInterpolator(this.d); ofFloat.setDuration(this.b); ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: o.uGY private THi b; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { THi tHi = this.b; tHi.g.setAlpha(((Float) valueAnimator.getAnimatedValue()).floatValue()); } { this.b = this; } }); return ofFloat; } /* JADX INFO: Access modifiers changed from: package-private */ public final boolean d() { EditText editText = this.c; return editText != null && (editText.hasFocus() || this.g.hasFocus()) && this.c.getText().length() > 0; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final void g() { ValueAnimator ofFloat = ValueAnimator.ofFloat(0.8f, 1.0f); ofFloat.setInterpolator(this.a); ofFloat.setDuration(this.e); ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: o.RsY private THi b; @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { THi tHi = this.b; float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue(); tHi.g.setScaleX(floatValue); tHi.g.setScaleY(floatValue); } { this.b = this; } }); ValueAnimator LV_ = LV_(BitmapDescriptorFactory.HUE_RED, 1.0f); AnimatorSet animatorSet = new AnimatorSet(); this.h = animatorSet; animatorSet.playTogether(ofFloat, LV_); this.h.addListener(new AnimatorListenerAdapter(this) { // from class: o.THi.2 private THi a; { this.a = this; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationStart(Animator animator) { this.a.i.e(true); } }); ValueAnimator LV_2 = LV_(1.0f, BitmapDescriptorFactory.HUE_RED); this.f = LV_2; LV_2.addListener(new AnimatorListenerAdapter(this) { // from class: o.THi.1 private THi c; { this.c = this; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationEnd(Animator animator) { this.c.i.e(false); } }); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final View.OnFocusChangeListener Ml_() { return this.m; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final View.OnClickListener My_() { return this.n; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.SQv public final View.OnFocusChangeListener Mj_() { return this.m; } }