387 lines
15 KiB
Java
387 lines
15 KiB
Java
package o;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.animation.AnimatorSet;
|
|
import android.animation.TimeInterpolator;
|
|
import android.animation.ValueAnimator;
|
|
import android.graphics.Path;
|
|
import android.graphics.Rect;
|
|
import android.graphics.RectF;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.EditText;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageButton;
|
|
import android.widget.TextView;
|
|
import androidx.appcompat.widget.ActionMenuView;
|
|
import androidx.appcompat.widget.Toolbar;
|
|
import androidx.core.view.ViewCompat;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import com.google.android.material.internal.ClippableRoundedCornerLayout;
|
|
import com.google.android.material.internal.TouchObserverFrameLayout;
|
|
import com.google.android.material.search.SearchBar;
|
|
import com.google.android.material.search.SearchView;
|
|
import o.VZM;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class zJx {
|
|
final SearchView a;
|
|
final EditText b;
|
|
final ClippableRoundedCornerLayout c;
|
|
public SearchBar d;
|
|
final Toolbar e;
|
|
private final FrameLayout f;
|
|
private final View g;
|
|
private final ImageButton h;
|
|
private final TouchObserverFrameLayout i;
|
|
private final View j;
|
|
private final TextView k;
|
|
private final Toolbar m;
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
private final FrameLayout f9335o;
|
|
|
|
static /* synthetic */ void d(zJx zjx, float f) {
|
|
ActionMenuView c;
|
|
zjx.h.setAlpha(f);
|
|
zjx.j.setAlpha(f);
|
|
zjx.i.setAlpha(f);
|
|
if (!zjx.a.c || (c = C15753iLf.c(zjx.m)) == null) {
|
|
return;
|
|
}
|
|
c.setAlpha(f);
|
|
}
|
|
|
|
public zJx(SearchView searchView) {
|
|
this.a = searchView;
|
|
this.g = searchView.l;
|
|
this.c = searchView.f6479o;
|
|
this.f = searchView.j;
|
|
this.f9335o = searchView.q;
|
|
this.m = searchView.r;
|
|
this.e = searchView.i;
|
|
this.k = searchView.k;
|
|
this.b = searchView.h;
|
|
this.h = searchView.a;
|
|
this.j = searchView.f;
|
|
this.i = searchView.e;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final AnimatorSet KT_(boolean z) {
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
animatorSet.playTogether(KV_());
|
|
KK_(animatorSet);
|
|
TimeInterpolator timeInterpolator = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
animatorSet.setInterpolator(timeInterpolator);
|
|
animatorSet.setDuration(z ? 350L : 300L);
|
|
return animatorSet;
|
|
}
|
|
|
|
private Animator KV_() {
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(this.c.getHeight(), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat.addUpdateListener(new VZM(new AOB(), this.c));
|
|
return ofFloat;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final AnimatorSet KQ_(boolean z) {
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
animatorSet.playTogether(KS_(z), KR_(z), KO_(z), KP_(z), KN_(z), KU_(z, false, this.f), KU_(z, false, this.e), KM_(z), KU_(z, true, this.b), KU_(z, true, this.k));
|
|
animatorSet.addListener(new AnimatorListenerAdapter(this, z) { // from class: o.zJx.3
|
|
private boolean a;
|
|
private zJx b;
|
|
|
|
{
|
|
this.b = this;
|
|
this.a = z;
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationStart(Animator animator) {
|
|
zJx.d(this.b, this.a ? BitmapDescriptorFactory.HUE_RED : 1.0f);
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationEnd(Animator animator) {
|
|
zJx.d(this.b, this.a ? 1.0f : BitmapDescriptorFactory.HUE_RED);
|
|
if (this.a) {
|
|
ClippableRoundedCornerLayout clippableRoundedCornerLayout = this.b.c;
|
|
clippableRoundedCornerLayout.d = null;
|
|
clippableRoundedCornerLayout.invalidate();
|
|
}
|
|
}
|
|
});
|
|
return animatorSet;
|
|
}
|
|
|
|
private Animator KS_(boolean z) {
|
|
TimeInterpolator timeInterpolator = z ? C6217cMa.e : C6217cMa.d;
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat.setDuration(z ? 300L : 250L);
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
ofFloat.setInterpolator(timeInterpolator);
|
|
ofFloat.addUpdateListener(new VZM(new UCm(), this.g));
|
|
return ofFloat;
|
|
}
|
|
|
|
private Rect KL_() {
|
|
int[] iArr = new int[2];
|
|
this.d.getLocationOnScreen(iArr);
|
|
int i = iArr[0];
|
|
int i2 = iArr[1];
|
|
int[] iArr2 = new int[2];
|
|
this.c.getLocationOnScreen(iArr2);
|
|
int i3 = i - iArr2[0];
|
|
int i4 = i2 - iArr2[1];
|
|
return new Rect(i3, i4, this.d.getWidth() + i3, this.d.getHeight() + i4);
|
|
}
|
|
|
|
private Animator KO_(boolean z) {
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat.setDuration(z ? 50L : 42L);
|
|
ofFloat.setStartDelay(z ? 250L : 0L);
|
|
TimeInterpolator timeInterpolator = C6217cMa.e;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
ofFloat.setInterpolator(timeInterpolator);
|
|
ofFloat.addUpdateListener(new VZM(new UCm(), this.h));
|
|
return ofFloat;
|
|
}
|
|
|
|
private Animator KN_(boolean z) {
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
View Ke_ = C15753iLf.Ke_(this.m);
|
|
if (Ke_ != null) {
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(d(Ke_), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat.addUpdateListener(new VZM(new vOR(), Ke_));
|
|
ValueAnimator ofFloat2 = ValueAnimator.ofFloat(b(), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat2.addUpdateListener(new VZM(new AOB(), Ke_));
|
|
animatorSet.playTogether(ofFloat, ofFloat2);
|
|
}
|
|
KK_(animatorSet);
|
|
View c = C15753iLf.c(this.m);
|
|
if (c != null) {
|
|
ValueAnimator ofFloat3 = ValueAnimator.ofFloat(a(c), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat3.addUpdateListener(new VZM(new vOR(), c));
|
|
ValueAnimator ofFloat4 = ValueAnimator.ofFloat(b(), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat4.addUpdateListener(new VZM(new AOB(), c));
|
|
animatorSet.playTogether(ofFloat3, ofFloat4);
|
|
}
|
|
animatorSet.setDuration(z ? 300L : 250L);
|
|
TimeInterpolator timeInterpolator = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
animatorSet.setInterpolator(timeInterpolator);
|
|
return animatorSet;
|
|
}
|
|
|
|
private void KK_(AnimatorSet animatorSet) {
|
|
ImageButton Ke_ = C15753iLf.Ke_(this.m);
|
|
if (Ke_ == null) {
|
|
return;
|
|
}
|
|
Drawable pH_ = Tlu.pH_(Ke_.getDrawable());
|
|
if (this.a.d) {
|
|
if (pH_ instanceof ZVM) {
|
|
final ZVM zvm = (ZVM) pH_;
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(zvm) { // from class: o.soW
|
|
private ZVM b;
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
|
|
ZVM zvm2 = this.b;
|
|
float animatedFraction = valueAnimator.getAnimatedFraction();
|
|
if (zvm2.b != animatedFraction) {
|
|
zvm2.b = animatedFraction;
|
|
zvm2.invalidateSelf();
|
|
}
|
|
}
|
|
|
|
{
|
|
this.b = zvm;
|
|
}
|
|
});
|
|
animatorSet.playTogether(ofFloat);
|
|
}
|
|
if (pH_ instanceof C3441axc) {
|
|
final C3441axc c3441axc = (C3441axc) pH_;
|
|
ValueAnimator ofFloat2 = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(c3441axc) { // from class: o.XPa
|
|
private C3441axc c;
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
|
|
this.c.e(valueAnimator.getAnimatedFraction());
|
|
}
|
|
|
|
{
|
|
this.c = c3441axc;
|
|
}
|
|
});
|
|
animatorSet.playTogether(ofFloat2);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (pH_ instanceof ZVM) {
|
|
ZVM zvm2 = (ZVM) pH_;
|
|
if (zvm2.b != 1.0f) {
|
|
zvm2.b = 1.0f;
|
|
zvm2.invalidateSelf();
|
|
}
|
|
}
|
|
if (pH_ instanceof C3441axc) {
|
|
((C3441axc) pH_).e(1.0f);
|
|
}
|
|
}
|
|
|
|
private Animator KM_(boolean z) {
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat.setDuration(z ? 300L : 250L);
|
|
TimeInterpolator timeInterpolator = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
ofFloat.setInterpolator(timeInterpolator);
|
|
if (this.a.c) {
|
|
ofFloat.addUpdateListener(new dND(C15753iLf.c(this.e), C15753iLf.c(this.m)));
|
|
}
|
|
return ofFloat;
|
|
}
|
|
|
|
private Animator KP_(boolean z) {
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
Animator[] animatorArr = new Animator[3];
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat.setDuration(z ? 150L : 83L);
|
|
ofFloat.setStartDelay(z ? 75L : 0L);
|
|
TimeInterpolator timeInterpolator = C6217cMa.e;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
ofFloat.setInterpolator(timeInterpolator);
|
|
ofFloat.addUpdateListener(new VZM(new UCm(), this.j, this.i));
|
|
animatorArr[0] = ofFloat;
|
|
ValueAnimator ofFloat2 = ValueAnimator.ofFloat((this.i.getHeight() * 0.050000012f) / 2.0f, BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat2.setDuration(z ? 300L : 250L);
|
|
TimeInterpolator timeInterpolator2 = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator2 = new hWf(timeInterpolator2);
|
|
}
|
|
ofFloat2.setInterpolator(timeInterpolator2);
|
|
ofFloat2.addUpdateListener(new VZM(new AOB(), this.j));
|
|
animatorArr[1] = ofFloat2;
|
|
ValueAnimator ofFloat3 = ValueAnimator.ofFloat(0.95f, 1.0f);
|
|
ofFloat3.setDuration(z ? 300L : 250L);
|
|
TimeInterpolator timeInterpolator3 = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator3 = new hWf(timeInterpolator3);
|
|
}
|
|
ofFloat3.setInterpolator(timeInterpolator3);
|
|
ofFloat3.addUpdateListener(new VZM(new VZM.LWm() { // from class: o.aYc
|
|
@Override // o.VZM.LWm
|
|
public final void JY_(ValueAnimator valueAnimator, View view) {
|
|
Float f = (Float) valueAnimator.getAnimatedValue();
|
|
view.setScaleX(f.floatValue());
|
|
view.setScaleY(f.floatValue());
|
|
}
|
|
}, this.i));
|
|
animatorArr[2] = ofFloat3;
|
|
animatorSet.playTogether(animatorArr);
|
|
return animatorSet;
|
|
}
|
|
|
|
private Animator KU_(boolean z, boolean z2, View view) {
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(z2 ? d(view) : a(view), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat.addUpdateListener(new VZM(new vOR(), view));
|
|
ValueAnimator ofFloat2 = ValueAnimator.ofFloat(b(), BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat2.addUpdateListener(new VZM(new AOB(), view));
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
animatorSet.playTogether(ofFloat, ofFloat2);
|
|
animatorSet.setDuration(z ? 300L : 250L);
|
|
TimeInterpolator timeInterpolator = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
animatorSet.setInterpolator(timeInterpolator);
|
|
return animatorSet;
|
|
}
|
|
|
|
private int d(View view) {
|
|
int ry_ = CYM.ry_((ViewGroup.MarginLayoutParams) view.getLayoutParams());
|
|
int q = ViewCompat.q(this.d);
|
|
if (ViewCompat.m(this.d) == 1) {
|
|
return ((this.d.getWidth() - this.d.getRight()) + ry_) - q;
|
|
}
|
|
return (this.d.getLeft() - ry_) + q;
|
|
}
|
|
|
|
private int a(View view) {
|
|
int rx_ = CYM.rx_((ViewGroup.MarginLayoutParams) view.getLayoutParams());
|
|
if (ViewCompat.m(this.d) == 1) {
|
|
return this.d.getLeft() - rx_;
|
|
}
|
|
return (this.d.getRight() - this.a.getWidth()) + rx_;
|
|
}
|
|
|
|
private int b() {
|
|
return ((this.d.getTop() + this.d.getBottom()) / 2) - ((this.f9335o.getTop() + this.f9335o.getBottom()) / 2);
|
|
}
|
|
|
|
private Animator KR_(boolean z) {
|
|
SearchView searchView = this.a;
|
|
Rect rect = new Rect(searchView.getLeft(), searchView.getTop(), searchView.getRight(), searchView.getBottom());
|
|
Rect KL_ = KL_();
|
|
final Rect rect2 = new Rect(KL_);
|
|
final float h = this.d.y.h();
|
|
ValueAnimator ofObject = ValueAnimator.ofObject(new AKI(rect2), KL_, rect);
|
|
ofObject.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this, h, rect2) { // from class: o.WFm
|
|
private float a;
|
|
private Rect b;
|
|
private zJx d;
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
|
|
zJx zjx = this.d;
|
|
float f = this.a;
|
|
Rect rect3 = this.b;
|
|
float animatedFraction = valueAnimator.getAnimatedFraction();
|
|
ClippableRoundedCornerLayout clippableRoundedCornerLayout = zjx.c;
|
|
float f2 = f * (1.0f - animatedFraction);
|
|
RectF rectF = new RectF(rect3.left, rect3.top, rect3.right, rect3.bottom);
|
|
if (clippableRoundedCornerLayout.d == null) {
|
|
clippableRoundedCornerLayout.d = new Path();
|
|
}
|
|
clippableRoundedCornerLayout.d.reset();
|
|
clippableRoundedCornerLayout.d.addRoundRect(rectF, f2, f2, Path.Direction.CW);
|
|
clippableRoundedCornerLayout.d.close();
|
|
clippableRoundedCornerLayout.invalidate();
|
|
}
|
|
|
|
{
|
|
this.d = this;
|
|
this.a = h;
|
|
this.b = rect2;
|
|
}
|
|
});
|
|
ofObject.setDuration(z ? 300L : 250L);
|
|
TimeInterpolator timeInterpolator = C6217cMa.d;
|
|
if (!z) {
|
|
timeInterpolator = new hWf(timeInterpolator);
|
|
}
|
|
ofObject.setInterpolator(timeInterpolator);
|
|
return ofObject;
|
|
}
|
|
}
|