wonsikin / react-native-barcode-builder

Component for generating barcode in react native app
Other
175 stars 116 forks source link

replace react-native-svg with ART #12

Closed koenpunt closed 7 years ago

koenpunt commented 7 years ago

since react-native ships with it's own vector drawing library, why use an external dependency?

This merge request removes react-native-svg as a dependency, and implements the rendering using React Native's ART instead.

wonsikin commented 7 years ago

You are genius. But I got some problems when I try to run the Example.

Android

In order to run on the android, I have to modify the Example/android/app/src/main/java/com/example/MainApplication.java:

   private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
     @Override
-    protected boolean getUseDeveloperSupport() {
+    public boolean getUseDeveloperSupport() {
       return BuildConfig.DEBUG;
     }

When I try to run example in the latest react native version, I got the error UnableToResolveError: Unable to resolve module AccessibilityInfo

koenpunt commented 7 years ago

Let me check, I didn't experience any issues on Android or iOS though.

koenpunt commented 7 years ago

Oh but I did only test with the version of react-native being used in the example, but that one is pretty outdated. I could update the example too?

koenpunt commented 7 years ago

Works for me on both platforms with the latest React-Native too:

koenpunt commented 7 years ago

See my latest commit for an updated Example app

koenpunt commented 7 years ago

I've now also removed the barcodes directory from the repository, and added JsBarcode as a dependency to use their encoders directly.

wonsikin commented 7 years ago

@koenpunt I do think that you are a genius.I'll check the example, if OK, I will publish this package.

koenpunt commented 7 years ago

Great 🚀 I will submit some more patches the upcoming time, particularly one for EAN(13) barcodes, since they now do not render when flat is not set to false. This went wrong also before my changes.

wonsikin commented 7 years ago

I'll appreciate your patches!