From ec88aa0cbb9aa03e8713573d2e296d2f6f3c939c Mon Sep 17 00:00:00 2001 From: xudong82113 Date: Tue, 21 May 2019 15:04:52 +0800 Subject: [PATCH] fallback to android.support.v4, because react-native-gesture-handler doesn't support androidx --- .../app/src/main/java/com/example/MainActivity.java | 13 +++++++++++++ Example/package.json | 2 +- Example/yarn.lock | 8 ++++---- .../rncharts/listener/RNOnChartGestureListener.java | 3 +-- .../rncharts/markers/RNRectangleMarkerView.java | 2 +- package.json | 2 +- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Example/android/app/src/main/java/com/example/MainActivity.java b/Example/android/app/src/main/java/com/example/MainActivity.java index f55db7644..0b452364a 100644 --- a/Example/android/app/src/main/java/com/example/MainActivity.java +++ b/Example/android/app/src/main/java/com/example/MainActivity.java @@ -1,6 +1,9 @@ package com.example; import com.facebook.react.ReactActivity; +import com.facebook.react.ReactActivityDelegate; +import com.facebook.react.ReactRootView; +import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; public class MainActivity extends ReactActivity { @@ -12,4 +15,14 @@ public class MainActivity extends ReactActivity { protected String getMainComponentName() { return "Example"; } + + @Override + protected ReactActivityDelegate createReactActivityDelegate() { + return new ReactActivityDelegate(this, getMainComponentName()) { + @Override + protected ReactRootView createRootView() { + return new RNGestureHandlerEnabledRootView(MainActivity.this); + } + }; + } } diff --git a/Example/package.json b/Example/package.json index bc45823c6..234522f9d 100644 --- a/Example/package.json +++ b/Example/package.json @@ -16,7 +16,7 @@ "react": "^16.8.6", "react-native": "^0.59.4", "react-native-charts-wrapper": "file:../", - "react-native-gesture-handler": "^1.1.0", + "react-native-gesture-handler": "^1.2.1", "react-navigation": "3.8.1" }, "devDependencies": { diff --git a/Example/yarn.lock b/Example/yarn.lock index a36bc9b94..046fff03b 100644 --- a/Example/yarn.lock +++ b/Example/yarn.lock @@ -3100,14 +3100,14 @@ react-lifecycles-compat@^3.0.4: resolved "http://registry.npm.taobao.org/react-lifecycles-compat/download/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" "react-native-charts-wrapper@file:..": - version "0.5.2" + version "0.5.4" dependencies: prop-types "^15.5.10" react "16.8.3" -react-native-gesture-handler@^1.1.0: - version "1.1.0" - resolved "http://registry.npm.taobao.org/react-native-gesture-handler/download/react-native-gesture-handler-1.1.0.tgz#2a7d545ad2e0ca23adce22b2af441ad360ecccee" +react-native-gesture-handler@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.2.1.tgz#9c48fb1ab13d29cece24bbb77b1e847eebf27a2b" dependencies: hoist-non-react-statics "^2.3.1" invariant "^2.2.2" diff --git a/android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartGestureListener.java b/android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartGestureListener.java index 9d3171f3d..314371c46 100644 --- a/android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartGestureListener.java +++ b/android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartGestureListener.java @@ -1,7 +1,6 @@ package com.github.wuxudong.rncharts.listener; -import androidx.annotation.NonNull; - +import android.support.annotation.NonNull; import android.view.MotionEvent; import com.facebook.react.bridge.Arguments; diff --git a/android/src/main/java/com/github/wuxudong/rncharts/markers/RNRectangleMarkerView.java b/android/src/main/java/com/github/wuxudong/rncharts/markers/RNRectangleMarkerView.java index 2569a601b..1c1915eae 100644 --- a/android/src/main/java/com/github/wuxudong/rncharts/markers/RNRectangleMarkerView.java +++ b/android/src/main/java/com/github/wuxudong/rncharts/markers/RNRectangleMarkerView.java @@ -2,7 +2,7 @@ import android.content.Context; import android.graphics.drawable.Drawable; -import androidx.core.content.res.ResourcesCompat; +import android.support.v4.content.res.ResourcesCompat; import android.text.TextUtils; import android.widget.TextView; diff --git a/package.json b/package.json index 78c02821f..7eca0f73f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "git", "url": "https://github.com/wuxudong/react-native-charts-wrapper.git" }, - "version": "0.5.4", + "version": "0.5.5", "description": "A react-native charts support both android and ios.", "author": "wuxudong", "license": "MIT",