From 69a23f1c9ff4f0ca512cc01d6aebdd5c08cdc312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Osadnik?= Date: Mon, 27 Jan 2020 11:07:07 +0100 Subject: [PATCH] =?UTF-8?q?Remove=20blocking=20touch=20interactions=20if?= =?UTF-8?q?=20more=20than=20one=20active=20scree=E2=80=A6=20(#296)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We believe that it might be better to manage the logic of blocking interactions from JS with setNativeProps and pointerEvents. The current logic leads to some issues we're facing within React Navigation. There might be a state when more that one screen can be active. E.g. in modals we want to have two screens visible on the stack and have enabled interaction on the bottom one. New code should not give any issues, because even though we need to handle activation of each screen from JS and this will just introduce an additional native call for enabling / disabling pointer events. On iOS, we're not using React Native Screens in React Navigation for now and we'd like to focus on it later because right now we're not observing that crucial performance issues. --- android/src/main/java/com/swmansion/rnscreens/Screen.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/android/src/main/java/com/swmansion/rnscreens/Screen.java b/android/src/main/java/com/swmansion/rnscreens/Screen.java index a1011571..d399c4cb 100644 --- a/android/src/main/java/com/swmansion/rnscreens/Screen.java +++ b/android/src/main/java/com/swmansion/rnscreens/Screen.java @@ -16,7 +16,7 @@ import com.facebook.react.uimanager.PointerEvents; import com.facebook.react.uimanager.ReactPointerEventsView; import com.facebook.react.uimanager.UIManagerModule; -public class Screen extends ViewGroup implements ReactPointerEventsView { +public class Screen extends ViewGroup { public enum StackPresentation { PUSH, @@ -135,11 +135,6 @@ public class Screen extends ViewGroup implements ReactPointerEventsView { return mStackPresentation; } - @Override - public PointerEvents getPointerEvents() { - return mTransitioning ? PointerEvents.NONE : PointerEvents.AUTO; - } - @Override public void setLayerType(int layerType, @Nullable Paint paint) { // ignore - layer type is controlled by `transitioning` prop