From 778513adb8d8237646ede82df562c63c721a21ab Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Sun, 26 Mar 2023 11:07:12 -0300 Subject: [PATCH] Prevent in-app notification and snackbar from blocking gestures (#7231) --- package-lock.json | 14 +++++----- patches/react-native-navigation+7.32.1.patch | 28 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index b169dcd25..f06344b5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21595,9 +21595,9 @@ } }, "node_modules/webpack": { - "version": "5.74.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", - "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", + "version": "5.76.3", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz", + "integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==", "dev": true, "peer": true, "dependencies": { @@ -26281,7 +26281,7 @@ "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", "requires": { - "@types/react": "^18.0.15", + "@types/react": "*", "hoist-non-react-statics": "^3.3.0" } }, @@ -38203,9 +38203,9 @@ } }, "webpack": { - "version": "5.74.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", - "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", + "version": "5.76.3", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz", + "integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==", "dev": true, "peer": true, "requires": { diff --git a/patches/react-native-navigation+7.32.1.patch b/patches/react-native-navigation+7.32.1.patch index 616628d8f..c5397f409 100644 --- a/patches/react-native-navigation+7.32.1.patch +++ b/patches/react-native-navigation+7.32.1.patch @@ -162,6 +162,34 @@ index a34598c..b035a76 100644 if (navigationActivity != null) { navigationActivity.onCatalystInstanceDestroy(); } +diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/MotionEvent.kt b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/MotionEvent.kt +index a79e487..dba9b65 100644 +--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/MotionEvent.kt ++++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/MotionEvent.kt +@@ -3,11 +3,20 @@ package com.reactnativenavigation.utils + import android.graphics.Rect + import android.view.MotionEvent + import android.view.View ++import android.view.ViewGroup + + val hitRect = Rect() + + fun MotionEvent.coordinatesInsideView(view: View?): Boolean { + view ?: return false +- view.getHitRect(hitRect) +- return hitRect.contains(x.toInt(), y.toInt()) ++ val viewGroup = (view as ViewGroup).getChildAt(0) as ViewGroup ++ return if (viewGroup.childCount > 0) { ++ val content = viewGroup.getChildAt(0) ++ ++ content.getHitRect(hitRect) ++ ++ hitRect.contains(x.toInt(), y.toInt()) ++ } else { ++ false ++ } + } +\ No newline at end of file diff --git a/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java b/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java index 035ec31..630b8d4 100644 --- a/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java