929 lines
37 KiB
Java
929 lines
37 KiB
Java
package com.google.android.material.snackbar;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.animation.AnimatorSet;
|
|
import android.animation.TimeInterpolator;
|
|
import android.animation.ValueAnimator;
|
|
import android.content.Context;
|
|
import android.content.res.ColorStateList;
|
|
import android.content.res.TypedArray;
|
|
import android.graphics.Color;
|
|
import android.graphics.Point;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.Rect;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.graphics.drawable.GradientDrawable;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.os.Message;
|
|
import android.util.AttributeSet;
|
|
import android.view.Display;
|
|
import android.view.LayoutInflater;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewParent;
|
|
import android.view.ViewTreeObserver;
|
|
import android.view.WindowInsets;
|
|
import android.view.WindowManager;
|
|
import android.view.accessibility.AccessibilityManager;
|
|
import android.widget.FrameLayout;
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.core.view.WindowInsetsCompat;
|
|
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import com.google.android.material.behavior.SwipeDismissBehavior;
|
|
import com.google.android.material.snackbar.BaseTransientBottomBar;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.List;
|
|
import o.C14739fyr;
|
|
import o.C16021kYS;
|
|
import o.C17052tZT;
|
|
import o.C17525xWe;
|
|
import o.C4363bXv;
|
|
import o.C6217cMa;
|
|
import o.DAZ;
|
|
import o.FLD;
|
|
import o.InterfaceC15708htK;
|
|
import o.LbT;
|
|
import o.Lot;
|
|
import o.Rez;
|
|
import o.Tlu;
|
|
import o.ULx;
|
|
import o.hdZ;
|
|
import o.uqW;
|
|
import o.yZt;
|
|
import org.bouncycastle.asn1.cmp.PKIFailureInfo;
|
|
import org.bouncycastle.crypto.tls.CipherSuite;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class BaseTransientBottomBar<B extends BaseTransientBottomBar<B>> {
|
|
private int A;
|
|
private boolean C;
|
|
private int D;
|
|
private final ViewGroup G;
|
|
final int b;
|
|
final TimeInterpolator c;
|
|
final TimeInterpolator d;
|
|
final int e;
|
|
final int f;
|
|
final InterfaceC15708htK g;
|
|
final Context h;
|
|
List<Object<B>> i;
|
|
int j;
|
|
int k;
|
|
int l;
|
|
int n;
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
int f6481o;
|
|
protected final SnackbarBaseLayout t;
|
|
private final AccessibilityManager u;
|
|
private final TimeInterpolator v;
|
|
private IeS w;
|
|
private Behavior y;
|
|
private boolean z;
|
|
private static final TimeInterpolator q = C6217cMa.d;
|
|
private static final TimeInterpolator s = C6217cMa.e;
|
|
private static final TimeInterpolator r = C6217cMa.b;
|
|
private static final int[] p = {C17052tZT.IeS.snackbarStyle};
|
|
static final Handler a = new Handler(Looper.getMainLooper(), new Handler.Callback() { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.2
|
|
@Override // android.os.Handler.Callback
|
|
public final boolean handleMessage(Message message) {
|
|
int i = message.what;
|
|
if (i == 0) {
|
|
((BaseTransientBottomBar) message.obj).g();
|
|
return true;
|
|
}
|
|
if (i != 1) {
|
|
return false;
|
|
}
|
|
((BaseTransientBottomBar) message.obj).a(message.arg1);
|
|
return true;
|
|
}
|
|
});
|
|
private boolean x = false;
|
|
private final Runnable B = new Runnable(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.10
|
|
private BaseTransientBottomBar a;
|
|
|
|
{
|
|
this.a = this;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
Rect rect;
|
|
if (this.a.t == null || this.a.h == null) {
|
|
return;
|
|
}
|
|
WindowManager windowManager = (WindowManager) this.a.h.getSystemService("window");
|
|
if (Build.VERSION.SDK_INT >= 30) {
|
|
rect = windowManager.getCurrentWindowMetrics().getBounds();
|
|
} else {
|
|
Display defaultDisplay = windowManager.getDefaultDisplay();
|
|
Point point = new Point();
|
|
defaultDisplay.getRealSize(point);
|
|
rect = new Rect();
|
|
rect.right = point.x;
|
|
rect.bottom = point.y;
|
|
}
|
|
int height = (rect.height() - BaseTransientBottomBar.a(this.a)) + ((int) this.a.t.getTranslationY());
|
|
if (height >= this.a.l) {
|
|
BaseTransientBottomBar baseTransientBottomBar = this.a;
|
|
baseTransientBottomBar.j = baseTransientBottomBar.l;
|
|
return;
|
|
}
|
|
ViewGroup.LayoutParams layoutParams = this.a.t.getLayoutParams();
|
|
if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
|
|
BaseTransientBottomBar baseTransientBottomBar2 = this.a;
|
|
baseTransientBottomBar2.j = baseTransientBottomBar2.l;
|
|
((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin += this.a.l - height;
|
|
this.a.t.requestLayout();
|
|
}
|
|
}
|
|
};
|
|
ULx.HBt m = new ULx.HBt(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.15
|
|
private BaseTransientBottomBar c;
|
|
|
|
{
|
|
this.c = this;
|
|
}
|
|
|
|
@Override // o.ULx.HBt
|
|
public final void b() {
|
|
Handler handler = BaseTransientBottomBar.a;
|
|
handler.sendMessage(handler.obtainMessage(0, this.c));
|
|
}
|
|
|
|
@Override // o.ULx.HBt
|
|
public final void a(int i) {
|
|
BaseTransientBottomBar.a.sendMessage(BaseTransientBottomBar.a.obtainMessage(1, i, 0, this.c));
|
|
}
|
|
};
|
|
|
|
static /* synthetic */ int a(BaseTransientBottomBar baseTransientBottomBar) {
|
|
int[] iArr = new int[2];
|
|
baseTransientBottomBar.t.getLocationOnScreen(iArr);
|
|
return iArr[1] + baseTransientBottomBar.t.getHeight();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public BaseTransientBottomBar(Context context, ViewGroup viewGroup, View view, InterfaceC15708htK interfaceC15708htK) {
|
|
if (viewGroup == null) {
|
|
throw new IllegalArgumentException("Transient bottom bar must have non-null parent");
|
|
}
|
|
if (view == null) {
|
|
throw new IllegalArgumentException("Transient bottom bar must have non-null content");
|
|
}
|
|
if (interfaceC15708htK == null) {
|
|
throw new IllegalArgumentException("Transient bottom bar must have non-null callback");
|
|
}
|
|
this.G = viewGroup;
|
|
this.g = interfaceC15708htK;
|
|
this.h = context;
|
|
uqW.b(context, uqW.c, "Theme.AppCompat");
|
|
LayoutInflater from = LayoutInflater.from(context);
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(p);
|
|
int resourceId = obtainStyledAttributes.getResourceId(0, -1);
|
|
obtainStyledAttributes.recycle();
|
|
SnackbarBaseLayout snackbarBaseLayout = (SnackbarBaseLayout) from.inflate(resourceId != -1 ? C17052tZT.tOB.mtrl_layout_snackbar : C17052tZT.tOB.design_layout_snackbar, viewGroup, false);
|
|
this.t = snackbarBaseLayout;
|
|
snackbarBaseLayout.a = this;
|
|
if (view instanceof SnackbarContentLayout) {
|
|
SnackbarContentLayout snackbarContentLayout = (SnackbarContentLayout) view;
|
|
float f = snackbarBaseLayout.b;
|
|
if (f != 1.0f) {
|
|
snackbarContentLayout.d.setTextColor(Rez.a(Rez.d(snackbarContentLayout.d.getCurrentTextColor(), Math.round(Color.alpha(r1) * f)), C16021kYS.d(snackbarContentLayout, C17052tZT.IeS.colorSurface)));
|
|
}
|
|
snackbarContentLayout.setMaxInlineActionWidth(snackbarBaseLayout.c);
|
|
}
|
|
snackbarBaseLayout.addView(view);
|
|
ViewCompat.c(snackbarBaseLayout, 1);
|
|
ViewCompat.g(snackbarBaseLayout, 1);
|
|
ViewCompat.a((View) snackbarBaseLayout, true);
|
|
ViewCompat.c(snackbarBaseLayout, new LbT(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.9
|
|
private BaseTransientBottomBar b;
|
|
|
|
{
|
|
this.b = this;
|
|
}
|
|
|
|
@Override // o.LbT
|
|
public final WindowInsetsCompat e(View view2, WindowInsetsCompat windowInsetsCompat) {
|
|
this.b.k = windowInsetsCompat.f();
|
|
this.b.f6481o = windowInsetsCompat.g();
|
|
this.b.n = windowInsetsCompat.j();
|
|
this.b.m();
|
|
return windowInsetsCompat;
|
|
}
|
|
});
|
|
ViewCompat.e(snackbarBaseLayout, new yZt(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.13
|
|
private BaseTransientBottomBar b;
|
|
|
|
{
|
|
this.b = this;
|
|
}
|
|
|
|
@Override // o.yZt
|
|
public final void onInitializeAccessibilityNodeInfo(View view2, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
|
super.onInitializeAccessibilityNodeInfo(view2, accessibilityNodeInfoCompat);
|
|
accessibilityNodeInfoCompat.d(PKIFailureInfo.badCertTemplate);
|
|
accessibilityNodeInfoCompat.i(true);
|
|
}
|
|
|
|
@Override // o.yZt
|
|
public final boolean performAccessibilityAction(View view2, int i, Bundle bundle) {
|
|
if (i == 1048576) {
|
|
this.b.a();
|
|
return true;
|
|
}
|
|
return super.performAccessibilityAction(view2, i, bundle);
|
|
}
|
|
});
|
|
this.u = (AccessibilityManager) context.getSystemService("accessibility");
|
|
this.f = DAZ.a(context, C17052tZT.IeS.motionDurationLong2, 250);
|
|
this.e = DAZ.a(context, C17052tZT.IeS.motionDurationLong2, CipherSuite.TLS_RSA_WITH_SEED_CBC_SHA);
|
|
this.b = DAZ.a(context, C17052tZT.IeS.motionDurationMedium1, 75);
|
|
this.c = DAZ.Kh_(context, C17052tZT.IeS.motionEasingEmphasizedInterpolator, s);
|
|
this.d = DAZ.Kh_(context, C17052tZT.IeS.motionEasingEmphasizedInterpolator, r);
|
|
this.v = DAZ.Kh_(context, C17052tZT.IeS.motionEasingEmphasizedInterpolator, q);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void m() {
|
|
ViewGroup.LayoutParams layoutParams = this.t.getLayoutParams();
|
|
if (!(layoutParams instanceof ViewGroup.MarginLayoutParams) || this.t.i == null || this.t.getParent() == null) {
|
|
return;
|
|
}
|
|
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) layoutParams;
|
|
int i = this.t.i.bottom + this.k;
|
|
int i2 = this.t.i.left + this.f6481o;
|
|
int i3 = this.t.i.right + this.n;
|
|
int i4 = this.t.i.top;
|
|
boolean z = (marginLayoutParams.bottomMargin == i && marginLayoutParams.leftMargin == i2 && marginLayoutParams.rightMargin == i3 && marginLayoutParams.topMargin == i4) ? false : true;
|
|
if (z) {
|
|
marginLayoutParams.bottomMargin = i;
|
|
marginLayoutParams.leftMargin = i2;
|
|
marginLayoutParams.rightMargin = i3;
|
|
marginLayoutParams.topMargin = i4;
|
|
this.t.requestLayout();
|
|
}
|
|
if ((z || this.j != this.l) && Build.VERSION.SDK_INT >= 29 && f()) {
|
|
this.t.removeCallbacks(this.B);
|
|
this.t.post(this.B);
|
|
}
|
|
}
|
|
|
|
private boolean f() {
|
|
if (this.l > 0) {
|
|
ViewGroup.LayoutParams layoutParams = this.t.getLayoutParams();
|
|
if ((layoutParams instanceof CoordinatorLayout.RVV) && (((CoordinatorLayout.RVV) layoutParams).h instanceof SwipeDismissBehavior)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void h() {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx uLx = ULx.d;
|
|
int d = d();
|
|
ULx.HBt hBt = this.m;
|
|
synchronized (uLx.b) {
|
|
ULx.RVV rvv = uLx.a;
|
|
if (rvv != null && hBt != null && rvv.d.get() == hBt) {
|
|
uLx.a.b = d;
|
|
uLx.c.removeCallbacksAndMessages(uLx.a);
|
|
uLx.e(uLx.a);
|
|
return;
|
|
}
|
|
ULx.RVV rvv2 = uLx.e;
|
|
if (rvv2 != null && hBt != null && rvv2.d.get() == hBt) {
|
|
uLx.e.b = d;
|
|
} else {
|
|
uLx.e = new ULx.RVV(d, hBt);
|
|
}
|
|
ULx.RVV rvv3 = uLx.a;
|
|
if (rvv3 == null || !uLx.e(rvv3, 4)) {
|
|
uLx.a = null;
|
|
uLx.c();
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
public final void c() {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.b(this.m, 1);
|
|
}
|
|
|
|
final void g() {
|
|
if (this.t.getParent() == null) {
|
|
ViewGroup.LayoutParams layoutParams = this.t.getLayoutParams();
|
|
if (layoutParams instanceof CoordinatorLayout.RVV) {
|
|
CoordinatorLayout.RVV rvv = (CoordinatorLayout.RVV) layoutParams;
|
|
Behavior behavior = new Behavior();
|
|
behavior.f.b = this.m;
|
|
behavior.d = new SwipeDismissBehavior.IeS(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.11
|
|
private BaseTransientBottomBar b;
|
|
|
|
{
|
|
this.b = this;
|
|
}
|
|
|
|
@Override // com.google.android.material.behavior.SwipeDismissBehavior.IeS
|
|
public final void c(View view) {
|
|
if (view.getParent() != null) {
|
|
view.setVisibility(8);
|
|
}
|
|
BaseTransientBottomBar baseTransientBottomBar = this.b;
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.b(baseTransientBottomBar.m, 0);
|
|
}
|
|
|
|
@Override // com.google.android.material.behavior.SwipeDismissBehavior.IeS
|
|
public final void b(int i) {
|
|
if (i == 0) {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.e(this.b.m);
|
|
} else if (i == 1 || i == 2) {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.d(this.b.m);
|
|
}
|
|
}
|
|
};
|
|
rvv.e(behavior);
|
|
rvv.a = 80;
|
|
}
|
|
SnackbarBaseLayout snackbarBaseLayout = this.t;
|
|
ViewGroup viewGroup = this.G;
|
|
snackbarBaseLayout.e = true;
|
|
viewGroup.addView(snackbarBaseLayout);
|
|
snackbarBaseLayout.e = false;
|
|
this.D = 0;
|
|
m();
|
|
this.t.setVisibility(4);
|
|
}
|
|
if (ViewCompat.G(this.t)) {
|
|
o();
|
|
} else {
|
|
this.z = true;
|
|
}
|
|
}
|
|
|
|
final void b() {
|
|
WindowInsets rootWindowInsets;
|
|
if (Build.VERSION.SDK_INT < 29 || (rootWindowInsets = this.t.getRootWindowInsets()) == null) {
|
|
return;
|
|
}
|
|
this.l = rootWindowInsets.getMandatorySystemGestureInsets().bottom;
|
|
m();
|
|
}
|
|
|
|
final void e() {
|
|
if (this.z) {
|
|
o();
|
|
this.z = false;
|
|
}
|
|
}
|
|
|
|
private void o() {
|
|
if (!l()) {
|
|
if (this.t.getParent() != null) {
|
|
this.t.setVisibility(0);
|
|
}
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.b(this.m);
|
|
return;
|
|
}
|
|
this.t.post(new Runnable(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.14
|
|
private BaseTransientBottomBar c;
|
|
|
|
{
|
|
this.c = this;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
if (this.c.t == null) {
|
|
return;
|
|
}
|
|
if (this.c.t.getParent() != null) {
|
|
this.c.t.setVisibility(0);
|
|
}
|
|
if (this.c.t.d == 1) {
|
|
BaseTransientBottomBar baseTransientBottomBar = this.c;
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f);
|
|
ofFloat.setInterpolator(baseTransientBottomBar.c);
|
|
ofFloat.addUpdateListener(new AnonymousClass4(baseTransientBottomBar));
|
|
ValueAnimator ofFloat2 = ValueAnimator.ofFloat(0.8f, 1.0f);
|
|
ofFloat2.setInterpolator(baseTransientBottomBar.d);
|
|
ofFloat2.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(baseTransientBottomBar) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.3
|
|
private BaseTransientBottomBar b;
|
|
|
|
{
|
|
this.b = baseTransientBottomBar;
|
|
}
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
|
|
float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue();
|
|
this.b.t.setScaleX(floatValue);
|
|
this.b.t.setScaleY(floatValue);
|
|
}
|
|
});
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
animatorSet.playTogether(ofFloat, ofFloat2);
|
|
animatorSet.setDuration(baseTransientBottomBar.e);
|
|
animatorSet.addListener(new AnimatorListenerAdapter(baseTransientBottomBar) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.19
|
|
private BaseTransientBottomBar e;
|
|
|
|
{
|
|
this.e = baseTransientBottomBar;
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationEnd(Animator animator) {
|
|
BaseTransientBottomBar baseTransientBottomBar2 = this.e;
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.b(baseTransientBottomBar2.m);
|
|
List<Object<B>> list = baseTransientBottomBar2.i;
|
|
}
|
|
});
|
|
animatorSet.start();
|
|
return;
|
|
}
|
|
BaseTransientBottomBar.b(this.c);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: com.google.android.material.snackbar.BaseTransientBottomBar$4, reason: invalid class name */
|
|
/* loaded from: classes2.dex */
|
|
public final class AnonymousClass4 implements ValueAnimator.AnimatorUpdateListener {
|
|
private BaseTransientBottomBar a;
|
|
|
|
AnonymousClass4(BaseTransientBottomBar baseTransientBottomBar) {
|
|
this.a = baseTransientBottomBar;
|
|
}
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
|
|
this.a.t.setAlpha(((Float) valueAnimator.getAnimatedValue()).floatValue());
|
|
}
|
|
}
|
|
|
|
private int i() {
|
|
int height = this.t.getHeight();
|
|
ViewGroup.LayoutParams layoutParams = this.t.getLayoutParams();
|
|
return layoutParams instanceof ViewGroup.MarginLayoutParams ? height + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin : height;
|
|
}
|
|
|
|
final void a(int i) {
|
|
if (!l() || this.t.getVisibility() != 0) {
|
|
j();
|
|
return;
|
|
}
|
|
if (this.t.d == 1) {
|
|
ValueAnimator ofFloat = ValueAnimator.ofFloat(1.0f, BitmapDescriptorFactory.HUE_RED);
|
|
ofFloat.setInterpolator(this.c);
|
|
ofFloat.addUpdateListener(new AnonymousClass4(this));
|
|
ofFloat.setDuration(this.b);
|
|
ofFloat.addListener(new AnimatorListenerAdapter(this, i) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.1
|
|
private BaseTransientBottomBar a;
|
|
private int b;
|
|
|
|
{
|
|
this.a = this;
|
|
this.b = i;
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationEnd(Animator animator) {
|
|
this.a.j();
|
|
}
|
|
});
|
|
ofFloat.start();
|
|
return;
|
|
}
|
|
ValueAnimator valueAnimator = new ValueAnimator();
|
|
valueAnimator.setIntValues(0, i());
|
|
valueAnimator.setInterpolator(this.v);
|
|
valueAnimator.setDuration(this.f);
|
|
valueAnimator.addListener(new AnimatorListenerAdapter(this, i) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.7
|
|
private BaseTransientBottomBar a;
|
|
private int c;
|
|
|
|
{
|
|
this.a = this;
|
|
this.c = i;
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationEnd(Animator animator) {
|
|
this.a.j();
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationStart(Animator animator) {
|
|
this.a.g.c(this.a.b);
|
|
}
|
|
});
|
|
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.6
|
|
private BaseTransientBottomBar a;
|
|
private int d = 0;
|
|
|
|
{
|
|
this.a = this;
|
|
}
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator2) {
|
|
int intValue = ((Integer) valueAnimator2.getAnimatedValue()).intValue();
|
|
this.a.t.setTranslationY(intValue);
|
|
this.d = intValue;
|
|
}
|
|
});
|
|
valueAnimator.start();
|
|
}
|
|
|
|
final void j() {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.a(this.m);
|
|
ViewParent parent = this.t.getParent();
|
|
if (parent instanceof ViewGroup) {
|
|
((ViewGroup) parent).removeView(this.t);
|
|
}
|
|
}
|
|
|
|
private boolean l() {
|
|
AccessibilityManager accessibilityManager = this.u;
|
|
if (accessibilityManager == null) {
|
|
return true;
|
|
}
|
|
try {
|
|
List list = (List) Class.forName("android.view.accessibility.AccessibilityManager").getMethod("getEnabledAccessibilityServiceList", Integer.TYPE).invoke(accessibilityManager, 1);
|
|
return list != null && list.isEmpty();
|
|
} catch (Throwable th) {
|
|
Throwable cause = th.getCause();
|
|
if (cause != null) {
|
|
throw cause;
|
|
}
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
/* loaded from: classes2.dex */
|
|
public static class SnackbarBaseLayout extends FrameLayout {
|
|
private static final View.OnTouchListener j = new View.OnTouchListener() { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.SnackbarBaseLayout.1
|
|
@Override // android.view.View.OnTouchListener
|
|
public final boolean onTouch(View view, MotionEvent motionEvent) {
|
|
return true;
|
|
}
|
|
};
|
|
BaseTransientBottomBar<?> a;
|
|
final float b;
|
|
final int c;
|
|
int d;
|
|
boolean e;
|
|
private PorterDuff.Mode f;
|
|
private ColorStateList g;
|
|
private final float h;
|
|
Rect i;
|
|
private FLD n;
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
private final int f6482o;
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
public SnackbarBaseLayout(Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public SnackbarBaseLayout(Context context, AttributeSet attributeSet) {
|
|
super(hdZ.MQ_(context, attributeSet, 0, 0), attributeSet);
|
|
GradientDrawable gradientDrawable;
|
|
Drawable pI_;
|
|
Context context2 = getContext();
|
|
TypedArray obtainStyledAttributes = context2.obtainStyledAttributes(attributeSet, C17052tZT.jNh.SnackbarLayout);
|
|
if (obtainStyledAttributes.hasValue(C17052tZT.jNh.SnackbarLayout_elevation)) {
|
|
ViewCompat.e(this, obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.SnackbarLayout_elevation, 0));
|
|
}
|
|
this.d = obtainStyledAttributes.getInt(C17052tZT.jNh.SnackbarLayout_animationMode, 0);
|
|
if (obtainStyledAttributes.hasValue(C17052tZT.jNh.SnackbarLayout_shapeAppearance) || obtainStyledAttributes.hasValue(C17052tZT.jNh.SnackbarLayout_shapeAppearanceOverlay)) {
|
|
this.n = new FLD(FLD.Ll_(context2, attributeSet, 0, 0, new C17525xWe(BitmapDescriptorFactory.HUE_RED)), (byte) 0);
|
|
}
|
|
float f = obtainStyledAttributes.getFloat(C17052tZT.jNh.SnackbarLayout_backgroundOverlayColorAlpha, 1.0f);
|
|
this.h = f;
|
|
setBackgroundTintList(C14739fyr.Ku_(context2, obtainStyledAttributes, C17052tZT.jNh.SnackbarLayout_backgroundTint));
|
|
setBackgroundTintMode(Lot.Kf_(obtainStyledAttributes.getInt(C17052tZT.jNh.SnackbarLayout_backgroundTintMode, -1), PorterDuff.Mode.SRC_IN));
|
|
this.b = obtainStyledAttributes.getFloat(C17052tZT.jNh.SnackbarLayout_actionTextColorAlpha, 1.0f);
|
|
this.f6482o = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.SnackbarLayout_android_maxWidth, -1);
|
|
this.c = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.SnackbarLayout_maxActionInlineWidth, -1);
|
|
obtainStyledAttributes.recycle();
|
|
setOnTouchListener(j);
|
|
setFocusable(true);
|
|
if (getBackground() == null) {
|
|
int i = C17052tZT.IeS.colorSurface;
|
|
int i2 = C17052tZT.IeS.colorOnSurface;
|
|
int a = Rez.a(Rez.d(C16021kYS.d(this, i2), Math.round(Color.alpha(r1) * f)), C16021kYS.d(this, i));
|
|
FLD fld = this.n;
|
|
if (fld != null) {
|
|
C4363bXv c4363bXv = new C4363bXv(fld);
|
|
ColorStateList valueOf = ColorStateList.valueOf(a);
|
|
ColorStateList colorStateList = c4363bXv.B.d;
|
|
gradientDrawable = c4363bXv;
|
|
if (colorStateList != valueOf) {
|
|
c4363bXv.B.d = valueOf;
|
|
c4363bXv.onStateChange(c4363bXv.getState());
|
|
gradientDrawable = c4363bXv;
|
|
}
|
|
} else {
|
|
float dimension = getResources().getDimension(C17052tZT.HBt.mtrl_snackbar_background_corner_radius);
|
|
GradientDrawable gradientDrawable2 = new GradientDrawable();
|
|
gradientDrawable2.setShape(0);
|
|
gradientDrawable2.setCornerRadius(dimension);
|
|
gradientDrawable2.setColor(a);
|
|
gradientDrawable = gradientDrawable2;
|
|
}
|
|
if (this.g != null) {
|
|
pI_ = Tlu.pI_(gradientDrawable);
|
|
Tlu.pF_(pI_, this.g);
|
|
} else {
|
|
pI_ = Tlu.pI_(gradientDrawable);
|
|
}
|
|
ViewCompat.sn_(this, pI_);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackground(Drawable drawable) {
|
|
setBackgroundDrawable(drawable);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundDrawable(Drawable drawable) {
|
|
if (drawable != null && this.g != null) {
|
|
drawable = Tlu.pI_(drawable.mutate());
|
|
Tlu.pF_(drawable, this.g);
|
|
Tlu.pG_(drawable, this.f);
|
|
}
|
|
super.setBackgroundDrawable(drawable);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundTintList(ColorStateList colorStateList) {
|
|
this.g = colorStateList;
|
|
if (getBackground() != null) {
|
|
Drawable pI_ = Tlu.pI_(getBackground().mutate());
|
|
Tlu.pF_(pI_, colorStateList);
|
|
Tlu.pG_(pI_, this.f);
|
|
if (pI_ != getBackground()) {
|
|
super.setBackgroundDrawable(pI_);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundTintMode(PorterDuff.Mode mode) {
|
|
this.f = mode;
|
|
if (getBackground() != null) {
|
|
Drawable pI_ = Tlu.pI_(getBackground().mutate());
|
|
Tlu.pG_(pI_, mode);
|
|
if (pI_ != getBackground()) {
|
|
super.setBackgroundDrawable(pI_);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setOnClickListener(View.OnClickListener onClickListener) {
|
|
setOnTouchListener(onClickListener != null ? null : j);
|
|
super.setOnClickListener(onClickListener);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // android.widget.FrameLayout, android.view.View
|
|
public void onMeasure(int i, int i2) {
|
|
super.onMeasure(i, i2);
|
|
if (this.f6482o > 0) {
|
|
int measuredWidth = getMeasuredWidth();
|
|
int i3 = this.f6482o;
|
|
if (measuredWidth > i3) {
|
|
super.onMeasure(View.MeasureSpec.makeMeasureSpec(i3, 1073741824), i2);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
|
|
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
|
super.onLayout(z, i, i2, i3, i4);
|
|
BaseTransientBottomBar<?> baseTransientBottomBar = this.a;
|
|
if (baseTransientBottomBar != null) {
|
|
baseTransientBottomBar.e();
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void onAttachedToWindow() {
|
|
super.onAttachedToWindow();
|
|
BaseTransientBottomBar<?> baseTransientBottomBar = this.a;
|
|
if (baseTransientBottomBar != null) {
|
|
baseTransientBottomBar.b();
|
|
}
|
|
ViewCompat.J(this);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void onDetachedFromWindow() {
|
|
super.onDetachedFromWindow();
|
|
BaseTransientBottomBar<?> baseTransientBottomBar = this.a;
|
|
if (baseTransientBottomBar != null) {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
if (ULx.d.c(baseTransientBottomBar.m)) {
|
|
BaseTransientBottomBar.a.post(new Runnable(baseTransientBottomBar) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.12
|
|
private BaseTransientBottomBar c;
|
|
|
|
{
|
|
this.c = baseTransientBottomBar;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
this.c.j();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
super.setLayoutParams(layoutParams);
|
|
if (this.e || !(layoutParams instanceof ViewGroup.MarginLayoutParams)) {
|
|
return;
|
|
}
|
|
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) layoutParams;
|
|
this.i = new Rect(marginLayoutParams.leftMargin, marginLayoutParams.topMargin, marginLayoutParams.rightMargin, marginLayoutParams.bottomMargin);
|
|
BaseTransientBottomBar<?> baseTransientBottomBar = this.a;
|
|
if (baseTransientBottomBar != null) {
|
|
baseTransientBottomBar.m();
|
|
}
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes2.dex */
|
|
public static class HBt {
|
|
ULx.HBt b;
|
|
|
|
public HBt(SwipeDismissBehavior<?> swipeDismissBehavior) {
|
|
swipeDismissBehavior.a = Math.min(Math.max(BitmapDescriptorFactory.HUE_RED, 0.1f), 1.0f);
|
|
swipeDismissBehavior.b = Math.min(Math.max(BitmapDescriptorFactory.HUE_RED, 0.6f), 1.0f);
|
|
swipeDismissBehavior.g = 0;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes2.dex */
|
|
public static class Behavior extends SwipeDismissBehavior<View> {
|
|
final HBt f = new HBt(this);
|
|
|
|
@Override // com.google.android.material.behavior.SwipeDismissBehavior
|
|
public final boolean e(View view) {
|
|
return view instanceof SnackbarBaseLayout;
|
|
}
|
|
|
|
@Override // com.google.android.material.behavior.SwipeDismissBehavior, androidx.coordinatorlayout.widget.CoordinatorLayout.Sts
|
|
public final boolean LJ_(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) {
|
|
HBt hBt = this.f;
|
|
int actionMasked = motionEvent.getActionMasked();
|
|
if (actionMasked != 0) {
|
|
if (actionMasked == 1 || actionMasked == 3) {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.e(hBt.b);
|
|
}
|
|
} else if (coordinatorLayout.e(view, (int) motionEvent.getX(), (int) motionEvent.getY())) {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.d(hBt.b);
|
|
}
|
|
return super.LJ_(coordinatorLayout, view, motionEvent);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes2.dex */
|
|
static class IeS implements View.OnAttachStateChangeListener, ViewTreeObserver.OnGlobalLayoutListener {
|
|
private final WeakReference<BaseTransientBottomBar> d;
|
|
|
|
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
|
|
public final void onGlobalLayout() {
|
|
throw null;
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public final void onViewAttachedToWindow(View view) {
|
|
throw null;
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public final void onViewDetachedFromWindow(View view) {
|
|
throw null;
|
|
}
|
|
}
|
|
|
|
static /* synthetic */ void b(BaseTransientBottomBar baseTransientBottomBar) {
|
|
int i = baseTransientBottomBar.i();
|
|
baseTransientBottomBar.t.setTranslationY(i);
|
|
ValueAnimator valueAnimator = new ValueAnimator();
|
|
valueAnimator.setIntValues(i, 0);
|
|
valueAnimator.setInterpolator(baseTransientBottomBar.v);
|
|
valueAnimator.setDuration(baseTransientBottomBar.f);
|
|
valueAnimator.addListener(new AnimatorListenerAdapter(baseTransientBottomBar) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.5
|
|
private BaseTransientBottomBar e;
|
|
|
|
{
|
|
this.e = baseTransientBottomBar;
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationStart(Animator animator) {
|
|
this.e.g.d(this.e.f - this.e.e, this.e.e);
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public final void onAnimationEnd(Animator animator) {
|
|
BaseTransientBottomBar baseTransientBottomBar2 = this.e;
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.b(baseTransientBottomBar2.m);
|
|
List<Object<B>> list = baseTransientBottomBar2.i;
|
|
}
|
|
});
|
|
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(baseTransientBottomBar, i) { // from class: com.google.android.material.snackbar.BaseTransientBottomBar.8
|
|
private int b;
|
|
private int d;
|
|
private BaseTransientBottomBar e;
|
|
|
|
{
|
|
this.e = baseTransientBottomBar;
|
|
this.b = i;
|
|
this.d = i;
|
|
}
|
|
|
|
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
|
|
public final void onAnimationUpdate(ValueAnimator valueAnimator2) {
|
|
int intValue = ((Integer) valueAnimator2.getAnimatedValue()).intValue();
|
|
this.e.t.setTranslationY(intValue);
|
|
this.d = intValue;
|
|
}
|
|
});
|
|
valueAnimator.start();
|
|
}
|
|
|
|
public void a() {
|
|
if (ULx.d == null) {
|
|
ULx.d = new ULx();
|
|
}
|
|
ULx.d.b(this.m, 3);
|
|
}
|
|
|
|
public final B e(int i) {
|
|
this.A = i;
|
|
return this;
|
|
}
|
|
|
|
public int d() {
|
|
return this.A;
|
|
}
|
|
}
|