251 lines
7.5 KiB
Java
251 lines
7.5 KiB
Java
|
package o;
|
||
|
|
||
|
import android.os.SystemClock;
|
||
|
import android.view.MotionEvent;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewConfiguration;
|
||
|
import android.view.ViewParent;
|
||
|
import androidx.appcompat.widget.DropDownListView;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public abstract class nHL implements View.OnTouchListener, View.OnAttachStateChangeListener {
|
||
|
final View a;
|
||
|
private final int b;
|
||
|
private boolean c;
|
||
|
private int d;
|
||
|
private Runnable e;
|
||
|
private final float f;
|
||
|
private final int[] h = new int[2];
|
||
|
private Runnable i;
|
||
|
private final int j;
|
||
|
|
||
|
public abstract AZJ e();
|
||
|
|
||
|
@Override // android.view.View.OnAttachStateChangeListener
|
||
|
public void onViewAttachedToWindow(View view) {
|
||
|
}
|
||
|
|
||
|
public nHL(View view) {
|
||
|
this.a = view;
|
||
|
view.setLongClickable(true);
|
||
|
view.addOnAttachStateChangeListener(this);
|
||
|
this.f = ViewConfiguration.get(view.getContext()).getScaledTouchSlop();
|
||
|
int tapTimeout = ViewConfiguration.getTapTimeout();
|
||
|
this.j = tapTimeout;
|
||
|
this.b = (tapTimeout + ViewConfiguration.getLongPressTimeout()) / 2;
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.OnTouchListener
|
||
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||
|
boolean z;
|
||
|
boolean z2 = this.c;
|
||
|
if (z2) {
|
||
|
if (!ih_(motionEvent) && a()) {
|
||
|
z = false;
|
||
|
}
|
||
|
z = true;
|
||
|
} else {
|
||
|
z = ii_(motionEvent) && c();
|
||
|
if (z) {
|
||
|
long uptimeMillis = SystemClock.uptimeMillis();
|
||
|
MotionEvent obtain = MotionEvent.obtain(uptimeMillis, uptimeMillis, 3, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 0);
|
||
|
this.a.onTouchEvent(obtain);
|
||
|
obtain.recycle();
|
||
|
z = true;
|
||
|
}
|
||
|
}
|
||
|
this.c = z;
|
||
|
return z || z2;
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.OnAttachStateChangeListener
|
||
|
public void onViewDetachedFromWindow(View view) {
|
||
|
this.c = false;
|
||
|
this.d = -1;
|
||
|
Runnable runnable = this.e;
|
||
|
if (runnable != null) {
|
||
|
this.a.removeCallbacks(runnable);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
protected boolean c() {
|
||
|
AZJ e = e();
|
||
|
if (e == null || e.j()) {
|
||
|
return true;
|
||
|
}
|
||
|
e.h();
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
protected boolean a() {
|
||
|
AZJ e = e();
|
||
|
if (e == null || !e.j()) {
|
||
|
return true;
|
||
|
}
|
||
|
e.b();
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x0017, code lost:
|
||
|
|
||
|
if (r1 != 3) goto L28;
|
||
|
*/
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private boolean ii_(android.view.MotionEvent r6) {
|
||
|
/*
|
||
|
r5 = this;
|
||
|
android.view.View r0 = r5.a
|
||
|
boolean r1 = r0.isEnabled()
|
||
|
r2 = 0
|
||
|
if (r1 != 0) goto La
|
||
|
return r2
|
||
|
La:
|
||
|
int r1 = r6.getActionMasked()
|
||
|
if (r1 == 0) goto L41
|
||
|
r3 = 1
|
||
|
if (r1 == r3) goto L3d
|
||
|
r4 = 2
|
||
|
if (r1 == r4) goto L1a
|
||
|
r6 = 3
|
||
|
if (r1 == r6) goto L3d
|
||
|
goto L6d
|
||
|
L1a:
|
||
|
int r1 = r5.d
|
||
|
int r1 = r6.findPointerIndex(r1)
|
||
|
if (r1 < 0) goto L6d
|
||
|
float r4 = r6.getX(r1)
|
||
|
float r6 = r6.getY(r1)
|
||
|
float r1 = r5.f
|
||
|
boolean r6 = a(r0, r4, r6, r1)
|
||
|
if (r6 != 0) goto L6d
|
||
|
r5.d()
|
||
|
android.view.ViewParent r6 = r0.getParent()
|
||
|
r6.requestDisallowInterceptTouchEvent(r3)
|
||
|
return r3
|
||
|
L3d:
|
||
|
r5.d()
|
||
|
goto L6d
|
||
|
L41:
|
||
|
int r6 = r6.getPointerId(r2)
|
||
|
r5.d = r6
|
||
|
java.lang.Runnable r6 = r5.e
|
||
|
if (r6 != 0) goto L52
|
||
|
o.nHL$Sts r6 = new o.nHL$Sts
|
||
|
r6.<init>(r5)
|
||
|
r5.e = r6
|
||
|
L52:
|
||
|
java.lang.Runnable r6 = r5.e
|
||
|
int r1 = r5.j
|
||
|
long r3 = (long) r1
|
||
|
r0.postDelayed(r6, r3)
|
||
|
java.lang.Runnable r6 = r5.i
|
||
|
if (r6 != 0) goto L65
|
||
|
o.nHL$HBt r6 = new o.nHL$HBt
|
||
|
r6.<init>(r5)
|
||
|
r5.i = r6
|
||
|
L65:
|
||
|
java.lang.Runnable r6 = r5.i
|
||
|
int r1 = r5.b
|
||
|
long r3 = (long) r1
|
||
|
r0.postDelayed(r6, r3)
|
||
|
L6d:
|
||
|
return r2
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: o.nHL.ii_(android.view.MotionEvent):boolean");
|
||
|
}
|
||
|
|
||
|
private void d() {
|
||
|
Runnable runnable = this.i;
|
||
|
if (runnable != null) {
|
||
|
this.a.removeCallbacks(runnable);
|
||
|
}
|
||
|
Runnable runnable2 = this.e;
|
||
|
if (runnable2 != null) {
|
||
|
this.a.removeCallbacks(runnable2);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void b() {
|
||
|
d();
|
||
|
View view = this.a;
|
||
|
if (view.isEnabled() && !view.isLongClickable() && c()) {
|
||
|
view.getParent().requestDisallowInterceptTouchEvent(true);
|
||
|
long uptimeMillis = SystemClock.uptimeMillis();
|
||
|
MotionEvent obtain = MotionEvent.obtain(uptimeMillis, uptimeMillis, 3, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, 0);
|
||
|
view.onTouchEvent(obtain);
|
||
|
obtain.recycle();
|
||
|
this.c = true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private boolean ih_(MotionEvent motionEvent) {
|
||
|
DropDownListView dropDownListView;
|
||
|
View view = this.a;
|
||
|
AZJ e = e();
|
||
|
if (e == null || !e.j() || (dropDownListView = (DropDownListView) e.it_()) == null || !dropDownListView.isShown()) {
|
||
|
return false;
|
||
|
}
|
||
|
MotionEvent obtainNoHistory = MotionEvent.obtainNoHistory(motionEvent);
|
||
|
ij_(view, obtainNoHistory);
|
||
|
ik_(dropDownListView, obtainNoHistory);
|
||
|
boolean iK_ = dropDownListView.iK_(obtainNoHistory, this.d);
|
||
|
obtainNoHistory.recycle();
|
||
|
int actionMasked = motionEvent.getActionMasked();
|
||
|
return iK_ && (actionMasked != 1 && actionMasked != 3);
|
||
|
}
|
||
|
|
||
|
private static boolean a(View view, float f, float f2, float f3) {
|
||
|
float f4 = -f3;
|
||
|
return f >= f4 && f2 >= f4 && f < ((float) (view.getRight() - view.getLeft())) + f3 && f2 < ((float) (view.getBottom() - view.getTop())) + f3;
|
||
|
}
|
||
|
|
||
|
private boolean ik_(View view, MotionEvent motionEvent) {
|
||
|
view.getLocationOnScreen(this.h);
|
||
|
motionEvent.offsetLocation(-r0[0], -r0[1]);
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
private boolean ij_(View view, MotionEvent motionEvent) {
|
||
|
view.getLocationOnScreen(this.h);
|
||
|
motionEvent.offsetLocation(r0[0], r0[1]);
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes.dex */
|
||
|
public class Sts implements Runnable {
|
||
|
final nHL d;
|
||
|
|
||
|
Sts(nHL nhl) {
|
||
|
this.d = nhl;
|
||
|
}
|
||
|
|
||
|
@Override // java.lang.Runnable
|
||
|
public final void run() {
|
||
|
ViewParent parent = this.d.a.getParent();
|
||
|
if (parent != null) {
|
||
|
parent.requestDisallowInterceptTouchEvent(true);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes.dex */
|
||
|
public class HBt implements Runnable {
|
||
|
final nHL a;
|
||
|
|
||
|
HBt(nHL nhl) {
|
||
|
this.a = nhl;
|
||
|
}
|
||
|
|
||
|
@Override // java.lang.Runnable
|
||
|
public final void run() {
|
||
|
this.a.b();
|
||
|
}
|
||
|
}
|
||
|
}
|