TouchEventDispatcher.java
3.33 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
109
110
111
112
113
114
115
116
117
118
package com.instabug.library.util;
import android.app.Activity;
import android.content.res.Resources;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import com.instabug.library.w;
public class TouchEventDispatcher
{
private final w mUserStepsTracker;
private int previousX;
private int previousY;
public TouchEventDispatcher(w paramw)
{
this.mUserStepsTracker = paramw;
}
private View findTargetView(View paramView, int paramInt1, int paramInt2)
{
Object localObject1 = null;
Object localObject2 = new int[2];
paramView.getLocationInWindow((int[])localObject2);
int i;
if ((paramInt2 >= localObject2[1]) && (paramInt1 >= localObject2[0]) && (paramInt2 <= localObject2[1] + paramView.getHeight()) && (paramInt1 <= localObject2[0] + paramView.getWidth())) {
if ((paramView instanceof ViewGroup))
{
i = 0;
localObject2 = localObject1;
if (i < ((ViewGroup)paramView).getChildCount())
{
localObject2 = ((ViewGroup)paramView).getChildAt(i);
if ((localObject2 instanceof ViewGroup))
{
localObject2 = findTargetView((ViewGroup)localObject2, paramInt1, paramInt2);
if (localObject2 == null) {
break label175;
}
localObject1 = localObject2;
}
}
}
}
label175:
for (;;)
{
localObject2 = localObject1;
if (localObject1 == null)
{
i += 1;
break;
localObject2 = findTargetView((View)localObject2, paramInt1, paramInt2);
if (localObject2 == null) {
continue;
}
localObject1 = localObject2;
continue;
}
if (localObject2 == null)
{
return paramView;
return null;
}
return (View)localObject2;
}
}
private void onViewTapped(Activity paramActivity, View paramView)
{
Object localObject3;
Object localObject1;
if (paramView != null)
{
localObject3 = null;
localObject1 = localObject3;
if (paramView.getId() <= 0) {}
}
try
{
localObject1 = paramActivity.getResources().getResourceEntryName(paramView.getId());
this.mUserStepsTracker.a(paramActivity.getClass().getName(), (String)localObject1, paramView.getClass().getName());
return;
}
catch (Exception localException)
{
for (;;)
{
InstabugSDKLogger.e(this, "Something went wrong while getting resource with id = " + paramView.getId(), localException);
Object localObject2 = localObject3;
}
}
}
public boolean dispatchTouchEvent(Activity paramActivity, MotionEvent paramMotionEvent)
{
int i = (int)paramMotionEvent.getRawX();
int j = (int)paramMotionEvent.getRawY();
if (paramMotionEvent.getAction() == 0)
{
this.previousX = i;
this.previousY = j;
}
while ((paramMotionEvent.getAction() != 1) || (this.previousX != i) || (this.previousY != j)) {
return false;
}
onViewTapped(paramActivity, findTargetView(paramActivity.getWindow().getDecorView(), i, j));
return true;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/util/TouchEventDispatcher.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/