|
@@ -5,6 +5,8 @@ import android.support.annotation.VisibleForTesting;
|
5
|
5
|
import android.view.MotionEvent;
|
6
|
6
|
import android.view.ViewGroup;
|
7
|
7
|
|
|
8
|
+import com.reactnativenavigation.parse.params.Bool;
|
|
9
|
+import com.reactnativenavigation.parse.params.NullBool;
|
8
|
10
|
import com.reactnativenavigation.utils.UiUtils;
|
9
|
11
|
import com.reactnativenavigation.viewcontrollers.IReactView;
|
10
|
12
|
|
|
@@ -12,13 +14,14 @@ public class OverlayTouchDelegate {
|
12
|
14
|
private enum TouchLocation {Outside, Inside}
|
13
|
15
|
private final Rect hitRect = new Rect();
|
14
|
16
|
private IReactView reactView;
|
15
|
|
- private boolean interceptTouchOutside;
|
|
17
|
+ private Bool interceptTouchOutside = new NullBool();
|
16
|
18
|
|
17
|
19
|
public OverlayTouchDelegate(IReactView reactView) {
|
18
|
20
|
this.reactView = reactView;
|
19
|
21
|
}
|
20
|
22
|
|
21
|
23
|
public boolean onInterceptTouchEvent(MotionEvent event) {
|
|
24
|
+ if (interceptTouchOutside instanceof NullBool) return false;
|
22
|
25
|
switch (event.getActionMasked()) {
|
23
|
26
|
case MotionEvent.ACTION_DOWN:
|
24
|
27
|
return handleDown(event);
|
|
@@ -35,7 +38,7 @@ public class OverlayTouchDelegate {
|
35
|
38
|
if (location == TouchLocation.Inside) {
|
36
|
39
|
reactView.dispatchTouchEventToJs(event);
|
37
|
40
|
}
|
38
|
|
- if (interceptTouchOutside) {
|
|
41
|
+ if (interceptTouchOutside.isTrue()) {
|
39
|
42
|
return location == TouchLocation.Inside;
|
40
|
43
|
}
|
41
|
44
|
return location == TouchLocation.Outside;
|
|
@@ -48,7 +51,7 @@ public class OverlayTouchDelegate {
|
48
|
51
|
TouchLocation.Outside;
|
49
|
52
|
}
|
50
|
53
|
|
51
|
|
- public void setInterceptTouchOutside(boolean interceptTouchOutside) {
|
|
54
|
+ public void setInterceptTouchOutside(Bool interceptTouchOutside) {
|
52
|
55
|
this.interceptTouchOutside = interceptTouchOutside;
|
53
|
56
|
}
|
54
|
57
|
}
|