chore: add react-native-touch-through-view

This commit is contained in:
Kyle Fang
2019-05-12 10:03:09 +08:00
parent ec55144e77
commit 5404b766a4
7 changed files with 49 additions and 1 deletions

View File

@@ -138,6 +138,7 @@ android {
}
dependencies {
implementation project(':react-native-touch-through-view')
implementation project(':react-native-screens')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"

View File

@@ -1,9 +1,14 @@
package com.touchthroughviewissue;
import com.facebook.react.ReactActivity;
import android.view.MotionEvent;
import com.rome2rio.android.reactnativetouchthroughview.TouchThroughTouchHandlerInterface;
import com.rome2rio.android.reactnativetouchthroughview.TouchThroughTouchHandler;
public class MainActivity extends ReactActivity {
private TouchThroughTouchHandler touchThroughTouchHandler = new TouchThroughTouchHandler();
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
@@ -12,4 +17,17 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() {
return "touchThroughViewIssue";
}
public TouchThroughTouchHandler getTouchThroughTouchHandler() {
return touchThroughTouchHandler;
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
touchThroughTouchHandler.handleTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}
}

View File

@@ -3,6 +3,7 @@ package com.touchthroughviewissue;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.rome2rio.android.reactnativetouchthroughview.TouchThroughViewPackage;
import com.swmansion.rnscreens.RNScreensPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
@@ -24,6 +25,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new TouchThroughViewPackage(),
new RNScreensPackage()
);
}

View File

@@ -1,4 +1,6 @@
rootProject.name = 'touchThroughViewIssue'
include ':react-native-touch-through-view'
project(':react-native-touch-through-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-touch-through-view/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')

View File

@@ -40,6 +40,7 @@
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; };
DD926E073DA74446AF6937F8 /* libRNScreens.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B875DA35B2E04788994795BD /* libRNScreens.a */; };
9888DA302DAA485A94AD273D /* libReactNativeTouchThroughView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BFA1AE8D0C38445D98D7AB3B /* libReactNativeTouchThroughView.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -349,6 +350,8 @@
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
602DA6A1F3074A6A9160870B /* RNScreens.xcodeproj */ = {isa = PBXFileReference; name = "RNScreens.xcodeproj"; path = "../node_modules/react-native-screens/ios/RNScreens.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
B875DA35B2E04788994795BD /* libRNScreens.a */ = {isa = PBXFileReference; name = "libRNScreens.a"; path = "libRNScreens.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
CD999FC0FC11437CBE20B692 /* ReactNativeTouchThroughView.xcodeproj */ = {isa = PBXFileReference; name = "ReactNativeTouchThroughView.xcodeproj"; path = "../node_modules/react-native-touch-through-view/ios/ReactNativeTouchThroughView.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
BFA1AE8D0C38445D98D7AB3B /* libReactNativeTouchThroughView.a */ = {isa = PBXFileReference; name = "libReactNativeTouchThroughView.a"; path = "libReactNativeTouchThroughView.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -378,6 +381,7 @@
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
DD926E073DA74446AF6937F8 /* libRNScreens.a in Frameworks */,
9888DA302DAA485A94AD273D /* libReactNativeTouchThroughView.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -568,6 +572,7 @@
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
602DA6A1F3074A6A9160870B /* RNScreens.xcodeproj */,
CD999FC0FC11437CBE20B692 /* ReactNativeTouchThroughView.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
@@ -1196,10 +1201,12 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Debug;
@@ -1222,10 +1229,12 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Release;
@@ -1249,6 +1258,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Debug;
@@ -1271,6 +1281,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Release;
@@ -1301,10 +1312,12 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Debug;
@@ -1335,10 +1348,12 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Release;
@@ -1368,10 +1383,12 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Debug;
@@ -1401,10 +1418,12 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-screens/ios",
"$(SRCROOT)/../node_modules/react-native-touch-through-view/ios/**",
);
};
name = Release;

View File

@@ -9,7 +9,8 @@
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.8",
"react-native-screens": "^1.0.0-alpha.22"
"react-native-screens": "^1.0.0-alpha.22",
"react-native-touch-through-view": "^1.1.1"
},
"devDependencies": {
"@babel/core": "^7.4.4",

View File

@@ -4851,6 +4851,11 @@ react-native-screens@^1.0.0-alpha.22:
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz#7a120377b52aa9bbb94d0b8541a014026be9289b"
integrity sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA==
react-native-touch-through-view@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/react-native-touch-through-view/-/react-native-touch-through-view-1.1.1.tgz#7d9cc7b69854f36f018c00e30167519ee830c8a7"
integrity sha512-7aR/EJ8nh4rntJ4BYLbX8XyrBcXjUc7VtsTuuja5dNvIuPv2WawZjwB9VckdpVEREq2hEsXaGXhLH9L2l2Q5FA==
react-native@0.59.8:
version "0.59.8"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.8.tgz#ade4141c777c60f5ec4889d9811d0f80a9d56547"