139 lines
4.8 KiB
Java
139 lines
4.8 KiB
Java
|
package com.google.android.material.behavior;
|
||
|
|
||
|
import android.animation.Animator;
|
||
|
import android.animation.AnimatorListenerAdapter;
|
||
|
import android.animation.TimeInterpolator;
|
||
|
import android.content.Context;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.util.TypedValue;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.view.ViewPropertyAnimator;
|
||
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.LinkedHashSet;
|
||
|
import o.C17052tZT;
|
||
|
import o.C6217cMa;
|
||
|
import o.DAZ;
|
||
|
import org.bouncycastle.crypto.tls.CipherSuite;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public class HideBottomViewOnScrollBehavior<V extends View> extends CoordinatorLayout.Sts<V> {
|
||
|
public int a;
|
||
|
ViewPropertyAnimator b;
|
||
|
public int c;
|
||
|
public int e;
|
||
|
private int g;
|
||
|
private int i;
|
||
|
private TimeInterpolator j;
|
||
|
private final LinkedHashSet<HBt> m;
|
||
|
private TimeInterpolator n;
|
||
|
private static final int d = C17052tZT.IeS.motionDurationLong2;
|
||
|
private static final int h = C17052tZT.IeS.motionDurationMedium4;
|
||
|
private static final int f = C17052tZT.IeS.motionEasingEmphasizedInterpolator;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public interface HBt {
|
||
|
}
|
||
|
|
||
|
@Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts
|
||
|
public boolean e(CoordinatorLayout coordinatorLayout, V v, View view, View view2, int i, int i2) {
|
||
|
return i == 2;
|
||
|
}
|
||
|
|
||
|
public HideBottomViewOnScrollBehavior() {
|
||
|
this.m = new LinkedHashSet<>();
|
||
|
this.a = 0;
|
||
|
this.e = 2;
|
||
|
this.c = 0;
|
||
|
}
|
||
|
|
||
|
public HideBottomViewOnScrollBehavior(Context context, AttributeSet attributeSet) {
|
||
|
super(context, attributeSet);
|
||
|
this.m = new LinkedHashSet<>();
|
||
|
this.a = 0;
|
||
|
this.e = 2;
|
||
|
this.c = 0;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts
|
||
|
public boolean c(CoordinatorLayout coordinatorLayout, V v, int i) {
|
||
|
this.a = v.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) v.getLayoutParams()).bottomMargin;
|
||
|
Context context = v.getContext();
|
||
|
int i2 = d;
|
||
|
TypedValue typedValue = new TypedValue();
|
||
|
if (!context.getTheme().resolveAttribute(i2, typedValue, true)) {
|
||
|
typedValue = null;
|
||
|
}
|
||
|
int i3 = 225;
|
||
|
if (typedValue != null && typedValue.type == 16) {
|
||
|
i3 = typedValue.data;
|
||
|
}
|
||
|
this.g = i3;
|
||
|
Context context2 = v.getContext();
|
||
|
int i4 = h;
|
||
|
TypedValue typedValue2 = new TypedValue();
|
||
|
TypedValue typedValue3 = context2.getTheme().resolveAttribute(i4, typedValue2, true) ? typedValue2 : null;
|
||
|
int i5 = CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA384;
|
||
|
if (typedValue3 != null && typedValue3.type == 16) {
|
||
|
i5 = typedValue3.data;
|
||
|
}
|
||
|
this.i = i5;
|
||
|
Context context3 = v.getContext();
|
||
|
int i6 = f;
|
||
|
this.j = DAZ.Kh_(context3, i6, C6217cMa.b);
|
||
|
this.n = DAZ.Kh_(v.getContext(), i6, C6217cMa.c);
|
||
|
return super.c(coordinatorLayout, v, i);
|
||
|
}
|
||
|
|
||
|
private void d(int i) {
|
||
|
this.e = i;
|
||
|
Iterator<HBt> it = this.m.iterator();
|
||
|
while (it.hasNext()) {
|
||
|
it.next();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void Ib_(V v, int i, long j, TimeInterpolator timeInterpolator) {
|
||
|
this.b = v.animate().translationY(i).setInterpolator(timeInterpolator).setDuration(j).setListener(new AnimatorListenerAdapter(this) { // from class: com.google.android.material.behavior.HideBottomViewOnScrollBehavior.5
|
||
|
private HideBottomViewOnScrollBehavior d;
|
||
|
|
||
|
{
|
||
|
this.d = this;
|
||
|
}
|
||
|
|
||
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
||
|
public final void onAnimationEnd(Animator animator) {
|
||
|
this.d.b = null;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
@Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts
|
||
|
public final void a(CoordinatorLayout coordinatorLayout, V v, View view, int i, int i2, int i3, int i4, int i5, int[] iArr) {
|
||
|
if (i2 > 0) {
|
||
|
if (this.e != 1) {
|
||
|
ViewPropertyAnimator viewPropertyAnimator = this.b;
|
||
|
if (viewPropertyAnimator != null) {
|
||
|
viewPropertyAnimator.cancel();
|
||
|
v.clearAnimation();
|
||
|
}
|
||
|
d(1);
|
||
|
Ib_(v, this.a + this.c, this.i, this.n);
|
||
|
return;
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
if (i2 >= 0 || this.e == 2) {
|
||
|
return;
|
||
|
}
|
||
|
ViewPropertyAnimator viewPropertyAnimator2 = this.b;
|
||
|
if (viewPropertyAnimator2 != null) {
|
||
|
viewPropertyAnimator2.cancel();
|
||
|
v.clearAnimation();
|
||
|
}
|
||
|
d(2);
|
||
|
Ib_(v, 0, this.g, this.j);
|
||
|
}
|
||
|
}
|