InstabugSwipeDelegate.java
3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package com.instabug.library.interaction;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import com.instabug.library.Instabug;
public class InstabugSwipeDelegate
{
private static final int DIRECTION_DOWN = 2;
private static final int DIRECTION_LEFT = 3;
private static final int DIRECTION_RIGHT = 4;
private static final int DIRECTION_UP = 1;
private int mDirectionNeeded;
private final a mForwarder;
private boolean mGoodCycle = false;
private int mPointerCountNeeded = 0;
public InstabugSwipeDelegate(a parama, GestureConfig paramGestureConfig)
{
this.mForwarder = parama;
parama = paramGestureConfig;
if (paramGestureConfig == null) {
parama = GestureConfig.ThreeSwipeUp;
}
switch (1.a[parama.ordinal()])
{
default:
return;
case 1:
this.mDirectionNeeded = 1;
this.mPointerCountNeeded = 3;
return;
}
this.mDirectionNeeded = 3;
this.mPointerCountNeeded = 2;
}
private boolean isDirectionValid(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2)
{
boolean bool = true;
if ((paramMotionEvent1 == null) || (paramMotionEvent2 == null)) {
bool = false;
}
do
{
do
{
return bool;
switch (this.mDirectionNeeded)
{
case 2:
default:
return false;
}
} while (paramMotionEvent1.getY() > paramMotionEvent2.getY());
return false;
} while ((paramMotionEvent1.getX() > paramMotionEvent2.getX()) && (paramMotionEvent1.getX() - paramMotionEvent2.getX() >= Math.abs(paramMotionEvent1.getY() - paramMotionEvent2.getY())));
return false;
}
public void onTouchEvent(MotionEvent paramMotionEvent)
{
if (paramMotionEvent.getPointerCount() >= this.mPointerCountNeeded) {
this.mGoodCycle = true;
}
switch (paramMotionEvent.getAction() & 0xFF)
{
}
do
{
this.mForwarder.onInstabugGestureEvent(paramMotionEvent);
return;
} while (paramMotionEvent.getPointerCount() >= this.mPointerCountNeeded);
}
public static enum GestureConfig
{
ThreeSwipeUp, TwoSwipeLeft;
private GestureConfig() {}
}
public class GestureListener
extends GestureDetector.SimpleOnGestureListener
{
public GestureListener() {}
public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
{
if ((InstabugSwipeDelegate.this.isDirectionValid(paramMotionEvent1, paramMotionEvent2)) && (InstabugSwipeDelegate.this.mGoodCycle)) {
Instabug.invoke();
}
InstabugSwipeDelegate.access$102(InstabugSwipeDelegate.this, false);
return false;
}
}
public static abstract interface a
{
public abstract void onInstabugGestureEvent(MotionEvent paramMotionEvent);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/interaction/InstabugSwipeDelegate.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/