401 lines
12 KiB
Java
401 lines
12 KiB
Java
|
package o;
|
||
|
|
||
|
import android.content.res.Resources;
|
||
|
import android.os.SystemClock;
|
||
|
import android.util.DisplayMetrics;
|
||
|
import android.view.MotionEvent;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewConfiguration;
|
||
|
import android.view.animation.AccelerateInterpolator;
|
||
|
import android.view.animation.AnimationUtils;
|
||
|
import android.view.animation.Interpolator;
|
||
|
import androidx.core.view.ViewCompat;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public abstract class llf implements View.OnTouchListener {
|
||
|
private static final int g = ViewConfiguration.getTapTimeout();
|
||
|
boolean a;
|
||
|
final Sts b;
|
||
|
boolean c;
|
||
|
boolean d;
|
||
|
public boolean e;
|
||
|
private final Interpolator f;
|
||
|
final View h;
|
||
|
private int i;
|
||
|
private boolean j;
|
||
|
private float[] k;
|
||
|
private int l;
|
||
|
private float[] m;
|
||
|
private boolean n;
|
||
|
|
||
|
/* renamed from: o, reason: collision with root package name */
|
||
|
private float[] f9208o;
|
||
|
private Runnable q;
|
||
|
private float[] s;
|
||
|
private float[] t;
|
||
|
|
||
|
static float a(float f) {
|
||
|
if (f > 1.0f) {
|
||
|
return 1.0f;
|
||
|
}
|
||
|
return f < BitmapDescriptorFactory.HUE_RED ? BitmapDescriptorFactory.HUE_RED : f;
|
||
|
}
|
||
|
|
||
|
public abstract boolean d(int i);
|
||
|
|
||
|
public abstract void e(int i);
|
||
|
|
||
|
public llf(View view) {
|
||
|
Sts sts = new Sts();
|
||
|
this.b = sts;
|
||
|
this.f = new AccelerateInterpolator();
|
||
|
this.s = new float[]{BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED};
|
||
|
this.f9208o = new float[]{Float.MAX_VALUE, Float.MAX_VALUE};
|
||
|
this.t = new float[]{BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED};
|
||
|
this.m = new float[]{BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED};
|
||
|
this.k = new float[]{Float.MAX_VALUE, Float.MAX_VALUE};
|
||
|
this.h = view;
|
||
|
DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics();
|
||
|
int i = (int) ((displayMetrics.density * 1575.0f) + 0.5f);
|
||
|
int i2 = (int) ((displayMetrics.density * 315.0f) + 0.5f);
|
||
|
float[] fArr = this.k;
|
||
|
float f = i / 1000.0f;
|
||
|
fArr[0] = f;
|
||
|
fArr[1] = f;
|
||
|
float[] fArr2 = this.m;
|
||
|
float f2 = i2 / 1000.0f;
|
||
|
fArr2[0] = f2;
|
||
|
fArr2[1] = f2;
|
||
|
this.l = 1;
|
||
|
float[] fArr3 = this.f9208o;
|
||
|
fArr3[0] = Float.MAX_VALUE;
|
||
|
fArr3[1] = Float.MAX_VALUE;
|
||
|
float[] fArr4 = this.s;
|
||
|
fArr4[0] = 0.2f;
|
||
|
fArr4[1] = 0.2f;
|
||
|
float[] fArr5 = this.t;
|
||
|
fArr5[0] = 0.001f;
|
||
|
fArr5[1] = 0.001f;
|
||
|
this.i = g;
|
||
|
sts.g = 500;
|
||
|
sts.c = 500;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:11:0x0013, code lost:
|
||
|
|
||
|
if (r0 == 3) goto L12;
|
||
|
*/
|
||
|
@Override // android.view.View.OnTouchListener
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public boolean onTouch(android.view.View r6, android.view.MotionEvent r7) {
|
||
|
/*
|
||
|
r5 = this;
|
||
|
boolean r0 = r5.e
|
||
|
r1 = 0
|
||
|
if (r0 != 0) goto L6
|
||
|
return r1
|
||
|
L6:
|
||
|
int r0 = r7.getActionMasked()
|
||
|
r2 = 1
|
||
|
if (r0 == 0) goto L19
|
||
|
if (r0 == r2) goto L15
|
||
|
r3 = 2
|
||
|
if (r0 == r3) goto L1d
|
||
|
r6 = 3
|
||
|
if (r0 != r6) goto L7c
|
||
|
L15:
|
||
|
r5.b()
|
||
|
goto L7c
|
||
|
L19:
|
||
|
r5.a = r2
|
||
|
r5.j = r1
|
||
|
L1d:
|
||
|
float r0 = r7.getX()
|
||
|
int r3 = r6.getWidth()
|
||
|
float r3 = (float) r3
|
||
|
android.view.View r4 = r5.h
|
||
|
int r4 = r4.getWidth()
|
||
|
float r4 = (float) r4
|
||
|
float r0 = r5.a(r1, r0, r3, r4)
|
||
|
float r7 = r7.getY()
|
||
|
int r6 = r6.getHeight()
|
||
|
float r6 = (float) r6
|
||
|
android.view.View r3 = r5.h
|
||
|
int r3 = r3.getHeight()
|
||
|
float r3 = (float) r3
|
||
|
float r6 = r5.a(r2, r7, r6, r3)
|
||
|
o.llf$Sts r7 = r5.b
|
||
|
r7.i = r0
|
||
|
r7.k = r6
|
||
|
boolean r6 = r5.d
|
||
|
if (r6 != 0) goto L7c
|
||
|
boolean r6 = r5.d()
|
||
|
if (r6 == 0) goto L7c
|
||
|
java.lang.Runnable r6 = r5.q
|
||
|
if (r6 != 0) goto L60
|
||
|
o.llf$LWm r6 = new o.llf$LWm
|
||
|
r6.<init>(r5)
|
||
|
r5.q = r6
|
||
|
L60:
|
||
|
r5.d = r2
|
||
|
r5.c = r2
|
||
|
boolean r6 = r5.j
|
||
|
if (r6 != 0) goto L75
|
||
|
int r6 = r5.i
|
||
|
if (r6 <= 0) goto L75
|
||
|
android.view.View r7 = r5.h
|
||
|
java.lang.Runnable r0 = r5.q
|
||
|
long r3 = (long) r6
|
||
|
androidx.core.view.ViewCompat.b(r7, r0, r3)
|
||
|
goto L7a
|
||
|
L75:
|
||
|
java.lang.Runnable r6 = r5.q
|
||
|
r6.run()
|
||
|
L7a:
|
||
|
r5.j = r2
|
||
|
L7c:
|
||
|
return r1
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: o.llf.onTouch(android.view.View, android.view.MotionEvent):boolean");
|
||
|
}
|
||
|
|
||
|
final boolean d() {
|
||
|
Sts sts = this.b;
|
||
|
float f = sts.k;
|
||
|
int abs = (int) (f / Math.abs(f));
|
||
|
Math.abs(sts.i);
|
||
|
return abs != 0 && d(abs);
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:35:0x0043, code lost:
|
||
|
|
||
|
if (r6 < (-1.0f)) goto L17;
|
||
|
*/
|
||
|
/* JADX WARN: Removed duplicated region for block: B:15:0x004b A[RETURN] */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:17:0x004c */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private float a(int r5, float r6, float r7, float r8) {
|
||
|
/*
|
||
|
r4 = this;
|
||
|
float[] r0 = r4.s
|
||
|
r0 = r0[r5]
|
||
|
float[] r1 = r4.f9208o
|
||
|
r1 = r1[r5]
|
||
|
float r0 = r0 * r7
|
||
|
int r2 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))
|
||
|
r3 = 0
|
||
|
if (r2 <= 0) goto Lf
|
||
|
goto L16
|
||
|
Lf:
|
||
|
int r1 = (r0 > r3 ? 1 : (r0 == r3 ? 0 : -1))
|
||
|
if (r1 >= 0) goto L15
|
||
|
r1 = r3
|
||
|
goto L16
|
||
|
L15:
|
||
|
r1 = r0
|
||
|
L16:
|
||
|
float r0 = r4.e(r6, r1)
|
||
|
float r7 = r7 - r6
|
||
|
float r6 = r4.e(r7, r1)
|
||
|
float r6 = r6 - r0
|
||
|
int r7 = (r6 > r3 ? 1 : (r6 == r3 ? 0 : -1))
|
||
|
if (r7 >= 0) goto L2d
|
||
|
android.view.animation.Interpolator r7 = r4.f
|
||
|
float r6 = -r6
|
||
|
float r6 = r7.getInterpolation(r6)
|
||
|
float r6 = -r6
|
||
|
goto L37
|
||
|
L2d:
|
||
|
int r7 = (r6 > r3 ? 1 : (r6 == r3 ? 0 : -1))
|
||
|
if (r7 <= 0) goto L46
|
||
|
android.view.animation.Interpolator r7 = r4.f
|
||
|
float r6 = r7.getInterpolation(r6)
|
||
|
L37:
|
||
|
r7 = 1065353216(0x3f800000, float:1.0)
|
||
|
int r0 = (r6 > r7 ? 1 : (r6 == r7 ? 0 : -1))
|
||
|
if (r0 <= 0) goto L3f
|
||
|
L3d:
|
||
|
r6 = r7
|
||
|
goto L47
|
||
|
L3f:
|
||
|
r7 = -1082130432(0xffffffffbf800000, float:-1.0)
|
||
|
int r0 = (r6 > r7 ? 1 : (r6 == r7 ? 0 : -1))
|
||
|
if (r0 >= 0) goto L47
|
||
|
goto L3d
|
||
|
L46:
|
||
|
r6 = r3
|
||
|
L47:
|
||
|
int r7 = (r6 > r3 ? 1 : (r6 == r3 ? 0 : -1))
|
||
|
if (r7 != 0) goto L4c
|
||
|
return r3
|
||
|
L4c:
|
||
|
float[] r0 = r4.t
|
||
|
r0 = r0[r5]
|
||
|
float[] r1 = r4.m
|
||
|
r1 = r1[r5]
|
||
|
float[] r2 = r4.k
|
||
|
r5 = r2[r5]
|
||
|
float r0 = r0 * r8
|
||
|
if (r7 <= 0) goto L67
|
||
|
float r6 = r6 * r0
|
||
|
int r7 = (r6 > r5 ? 1 : (r6 == r5 ? 0 : -1))
|
||
|
if (r7 <= 0) goto L61
|
||
|
return r5
|
||
|
L61:
|
||
|
int r5 = (r6 > r1 ? 1 : (r6 == r1 ? 0 : -1))
|
||
|
if (r5 >= 0) goto L66
|
||
|
return r1
|
||
|
L66:
|
||
|
return r6
|
||
|
L67:
|
||
|
float r6 = -r6
|
||
|
float r6 = r6 * r0
|
||
|
int r7 = (r6 > r5 ? 1 : (r6 == r5 ? 0 : -1))
|
||
|
if (r7 <= 0) goto L6f
|
||
|
r1 = r5
|
||
|
goto L75
|
||
|
L6f:
|
||
|
int r5 = (r6 > r1 ? 1 : (r6 == r1 ? 0 : -1))
|
||
|
if (r5 >= 0) goto L74
|
||
|
goto L75
|
||
|
L74:
|
||
|
r1 = r6
|
||
|
L75:
|
||
|
float r5 = -r1
|
||
|
return r5
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: o.llf.a(int, float, float, float):float");
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
class LWm implements Runnable {
|
||
|
final llf d;
|
||
|
|
||
|
LWm(llf llfVar) {
|
||
|
this.d = llfVar;
|
||
|
}
|
||
|
|
||
|
@Override // java.lang.Runnable
|
||
|
public final void run() {
|
||
|
if (this.d.d) {
|
||
|
if (this.d.c) {
|
||
|
this.d.c = false;
|
||
|
Sts sts = this.d.b;
|
||
|
long currentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
|
||
|
sts.j = currentAnimationTimeMillis;
|
||
|
sts.f = -1L;
|
||
|
sts.a = currentAnimationTimeMillis;
|
||
|
sts.h = 0.5f;
|
||
|
sts.d = 0;
|
||
|
sts.e = 0;
|
||
|
}
|
||
|
Sts sts2 = this.d.b;
|
||
|
if ((sts2.f > 0 && AnimationUtils.currentAnimationTimeMillis() > sts2.f + sts2.b) || !this.d.d()) {
|
||
|
this.d.d = false;
|
||
|
return;
|
||
|
}
|
||
|
if (this.d.a) {
|
||
|
this.d.a = false;
|
||
|
llf llfVar = this.d;
|
||
|
long uptimeMillis = SystemClock.uptimeMillis();
|
||
|
MotionEvent obtain = MotionEvent.obtain(uptimeMillis, uptimeMillis, 3, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 0);
|
||
|
llfVar.h.onTouchEvent(obtain);
|
||
|
obtain.recycle();
|
||
|
}
|
||
|
if (sts2.a == 0) {
|
||
|
throw new RuntimeException("Cannot compute scroll delta before calling start()");
|
||
|
}
|
||
|
long currentAnimationTimeMillis2 = AnimationUtils.currentAnimationTimeMillis();
|
||
|
float a = sts2.a(currentAnimationTimeMillis2);
|
||
|
long j = sts2.a;
|
||
|
sts2.a = currentAnimationTimeMillis2;
|
||
|
float f = ((float) (currentAnimationTimeMillis2 - j)) * (((-4.0f) * a * a) + (a * 4.0f));
|
||
|
sts2.d = (int) (sts2.i * f);
|
||
|
sts2.e = (int) (f * sts2.k);
|
||
|
int i = sts2.d;
|
||
|
this.d.e(sts2.e);
|
||
|
ViewCompat.e(this.d.h, this);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes.dex */
|
||
|
public static class Sts {
|
||
|
int b;
|
||
|
int c;
|
||
|
int g;
|
||
|
float h;
|
||
|
float i;
|
||
|
float k;
|
||
|
long j = Long.MIN_VALUE;
|
||
|
long f = -1;
|
||
|
long a = 0;
|
||
|
int d = 0;
|
||
|
int e = 0;
|
||
|
|
||
|
Sts() {
|
||
|
}
|
||
|
|
||
|
final float a(long j) {
|
||
|
long j2 = this.j;
|
||
|
if (j < j2) {
|
||
|
return BitmapDescriptorFactory.HUE_RED;
|
||
|
}
|
||
|
long j3 = this.f;
|
||
|
if (j3 < 0 || j < j3) {
|
||
|
return llf.a(((float) (j - j2)) / this.g) * 0.5f;
|
||
|
}
|
||
|
float f = this.h;
|
||
|
return (1.0f - f) + (f * llf.a(((float) (j - j3)) / this.b));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final void b() {
|
||
|
int i = 0;
|
||
|
if (this.c) {
|
||
|
this.d = false;
|
||
|
return;
|
||
|
}
|
||
|
Sts sts = this.b;
|
||
|
long currentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
|
||
|
int i2 = (int) (currentAnimationTimeMillis - sts.j);
|
||
|
int i3 = sts.c;
|
||
|
if (i2 > i3) {
|
||
|
i = i3;
|
||
|
} else if (i2 >= 0) {
|
||
|
i = i2;
|
||
|
}
|
||
|
sts.b = i;
|
||
|
sts.h = sts.a(currentAnimationTimeMillis);
|
||
|
sts.f = currentAnimationTimeMillis;
|
||
|
}
|
||
|
|
||
|
private float e(float f, float f2) {
|
||
|
if (f2 == BitmapDescriptorFactory.HUE_RED) {
|
||
|
return BitmapDescriptorFactory.HUE_RED;
|
||
|
}
|
||
|
int i = this.l;
|
||
|
if (i == 0 || i == 1) {
|
||
|
if (f < f2) {
|
||
|
if (f >= BitmapDescriptorFactory.HUE_RED) {
|
||
|
return 1.0f - (f / f2);
|
||
|
}
|
||
|
if (this.d && i == 1) {
|
||
|
return 1.0f;
|
||
|
}
|
||
|
}
|
||
|
} else if (i == 2 && f < BitmapDescriptorFactory.HUE_RED) {
|
||
|
return f / (-f2);
|
||
|
}
|
||
|
return BitmapDescriptorFactory.HUE_RED;
|
||
|
}
|
||
|
}
|