Skip to content

Commit ec88aa0

Browse files
committed
fallback to android.support.v4, because react-native-gesture-handler doesn't support androidx
1 parent 33cd73e commit ec88aa0

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

Example/android/app/src/main/java/com/example/MainActivity.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.example;
22

33
import com.facebook.react.ReactActivity;
4+
import com.facebook.react.ReactActivityDelegate;
5+
import com.facebook.react.ReactRootView;
6+
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
47

58
public class MainActivity extends ReactActivity {
69

@@ -12,4 +15,14 @@ public class MainActivity extends ReactActivity {
1215
protected String getMainComponentName() {
1316
return "Example";
1417
}
18+
19+
@Override
20+
protected ReactActivityDelegate createReactActivityDelegate() {
21+
return new ReactActivityDelegate(this, getMainComponentName()) {
22+
@Override
23+
protected ReactRootView createRootView() {
24+
return new RNGestureHandlerEnabledRootView(MainActivity.this);
25+
}
26+
};
27+
}
1528
}

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"react": "^16.8.6",
1717
"react-native": "^0.59.4",
1818
"react-native-charts-wrapper": "file:../",
19-
"react-native-gesture-handler": "^1.1.0",
19+
"react-native-gesture-handler": "^1.2.1",
2020
"react-navigation": "3.8.1"
2121
},
2222
"devDependencies": {

Example/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,14 +3100,14 @@ react-lifecycles-compat@^3.0.4:
31003100
resolved "http://registry.npm.taobao.org/react-lifecycles-compat/download/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
31013101

31023102
"react-native-charts-wrapper@file:..":
3103-
version "0.5.2"
3103+
version "0.5.4"
31043104
dependencies:
31053105
prop-types "^15.5.10"
31063106
react "16.8.3"
31073107

3108-
react-native-gesture-handler@^1.1.0:
3109-
version "1.1.0"
3110-
resolved "http://registry.npm.taobao.org/react-native-gesture-handler/download/react-native-gesture-handler-1.1.0.tgz#2a7d545ad2e0ca23adce22b2af441ad360ecccee"
3108+
react-native-gesture-handler@^1.2.1:
3109+
version "1.2.1"
3110+
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.2.1.tgz#9c48fb1ab13d29cece24bbb77b1e847eebf27a2b"
31113111
dependencies:
31123112
hoist-non-react-statics "^2.3.1"
31133113
invariant "^2.2.2"

android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartGestureListener.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.github.wuxudong.rncharts.listener;
22

3-
import androidx.annotation.NonNull;
4-
3+
import android.support.annotation.NonNull;
54
import android.view.MotionEvent;
65

76
import com.facebook.react.bridge.Arguments;

android/src/main/java/com/github/wuxudong/rncharts/markers/RNRectangleMarkerView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import android.content.Context;
44
import android.graphics.drawable.Drawable;
5-
import androidx.core.content.res.ResourcesCompat;
5+
import android.support.v4.content.res.ResourcesCompat;
66
import android.text.TextUtils;
77
import android.widget.TextView;
88

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "git",
55
"url": "https://github.com/wuxudong/react-native-charts-wrapper.git"
66
},
7-
"version": "0.5.4",
7+
"version": "0.5.5",
88
"description": "A react-native charts support both android and ios.",
99
"author": "wuxudong",
1010
"license": "MIT",

0 commit comments

Comments
 (0)