diff --git a/android/build.gradle b/android/build.gradle index ef35911..3d9411b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -30,6 +30,5 @@ android { dependencies { implementation project(':openCVLibrary310') - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.facebook.react:react-native:0.19.+' + implementation 'com.facebook.react:react-native:+' } diff --git a/android/src/main/java/com/documentscanner/DocumentScannerModule.java b/android/src/main/java/com/documentscanner/DocumentScannerModule.java index 73ca48a..bdbdc12 100755 --- a/android/src/main/java/com/documentscanner/DocumentScannerModule.java +++ b/android/src/main/java/com/documentscanner/DocumentScannerModule.java @@ -4,10 +4,9 @@ import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; - -/** - * Created by andre on 28/11/2017. - */ +import com.facebook.react.uimanager.NativeViewHierarchyManager; +import com.facebook.react.uimanager.UIBlock; +import com.facebook.react.uimanager.UIManagerModule; public class DocumentScannerModule extends ReactContextBaseJavaModule{ diff --git a/android/src/main/java/com/documentscanner/DocumentScannerPackage.java b/android/src/main/java/com/documentscanner/DocumentScannerPackage.java index 6ec6d14..2478193 100755 --- a/android/src/main/java/com/documentscanner/DocumentScannerPackage.java +++ b/android/src/main/java/com/documentscanner/DocumentScannerPackage.java @@ -10,10 +10,6 @@ import java.util.Collections; import java.util.List; -/** - * Created by andre on 28/11/2017. - */ - public class DocumentScannerPackage implements ReactPackage { @@ -24,7 +20,7 @@ public List createNativeModules(ReactApplicationContext reactConte ); } - @Override + // Deprecated in RN 0.47 public List> createJSModules() { return Collections.emptyList(); } diff --git a/android/src/main/java/com/documentscanner/DocumentScannerViewManager.java b/android/src/main/java/com/documentscanner/DocumentScannerViewManager.java index c1defbd..968ade1 100755 --- a/android/src/main/java/com/documentscanner/DocumentScannerViewManager.java +++ b/android/src/main/java/com/documentscanner/DocumentScannerViewManager.java @@ -13,10 +13,6 @@ import javax.annotation.Nullable; -/** - * Created by Andre on 29/11/2017. - */ - public class DocumentScannerViewManager extends ViewGroupManager { private static final String REACT_CLASS = "RNPdfScanner"; @@ -29,11 +25,7 @@ public String getName() { @Override protected MainView createViewInstance(final ThemedReactContext reactContext) { - // OpenNoteCameraView view = new OpenNoteCameraView(reactContext, -1, - // reactContext.getCurrentActivity()); - MainView.createInstance(reactContext, (Activity) reactContext.getBaseContext()); - - view = MainView.getInstance(); + view = new MainView(reactContext, (Activity) reactContext.getBaseContext()); view.setOnProcessingListener(new OpenNoteCameraView.OnProcessingListener() { @Override public void onProcessingChange(WritableMap data) { diff --git a/android/src/main/java/com/documentscanner/views/MainView.java b/android/src/main/java/com/documentscanner/views/MainView.java index f0bc886..75913f2 100755 --- a/android/src/main/java/com/documentscanner/views/MainView.java +++ b/android/src/main/java/com/documentscanner/views/MainView.java @@ -14,17 +14,7 @@ public class MainView extends FrameLayout { private OpenNoteCameraView view; - public static MainView instance = null; - - public static MainView getInstance() { - return instance; - } - - public static void createInstance(Context context, Activity activity) { - instance = new MainView(context, activity); - } - - private MainView(Context context, Activity activity) { + public MainView(Context context, Activity activity) { super(context); LayoutInflater lf = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);