DragStartHelper.java
2.61 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
package android.support.v13.view;
import android.annotation.TargetApi;
import android.graphics.Point;
import android.support.annotation.RequiresApi;
import android.support.v4.view.MotionEventCompat;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
@TargetApi(13)
@RequiresApi(13)
public class DragStartHelper
{
private final View a;
private final OnDragStartListener b;
private int c;
private int d;
private boolean e;
private final View.OnLongClickListener f = new View.OnLongClickListener()
{
public final boolean onLongClick(View paramAnonymousView)
{
return DragStartHelper.this.onLongClick(paramAnonymousView);
}
};
private final View.OnTouchListener g = new View.OnTouchListener()
{
public final boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
{
return DragStartHelper.this.onTouch(paramAnonymousView, paramAnonymousMotionEvent);
}
};
public DragStartHelper(View paramView, OnDragStartListener paramOnDragStartListener)
{
this.a = paramView;
this.b = paramOnDragStartListener;
}
public void attach()
{
this.a.setOnLongClickListener(this.f);
this.a.setOnTouchListener(this.g);
}
public void detach()
{
this.a.setOnLongClickListener(null);
this.a.setOnTouchListener(null);
}
public void getTouchPosition(Point paramPoint)
{
paramPoint.set(this.c, this.d);
}
public boolean onLongClick(View paramView)
{
return this.b.onDragStart(paramView, this);
}
public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
{
int i = (int)paramMotionEvent.getX();
int j = (int)paramMotionEvent.getY();
switch (paramMotionEvent.getAction())
{
default:
case 0:
case 2:
do
{
return false;
this.c = i;
this.d = j;
return false;
} while ((!MotionEventCompat.isFromSource(paramMotionEvent, 8194)) || ((MotionEventCompat.getButtonState(paramMotionEvent) & 0x1) == 0) || (this.e) || ((this.c == i) && (this.d == j)));
this.c = i;
this.d = j;
this.e = this.b.onDragStart(paramView, this);
return this.e;
}
this.e = false;
return false;
}
public static abstract interface OnDragStartListener
{
public abstract boolean onDragStart(View paramView, DragStartHelper paramDragStartHelper);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v13/view/DragStartHelper.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/