Skip to content

Commit

Permalink
fix: android build
Browse files Browse the repository at this point in the history
  • Loading branch information
Tweenkie committed Dec 18, 2019
1 parent 8c16952 commit 7c52445
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 31 deletions.
3 changes: 1 addition & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
import java.util.Collections;
import java.util.List;

/**
* Created by andre on 28/11/2017.
*/

public class DocumentScannerPackage implements ReactPackage {


Expand All @@ -24,7 +20,7 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
);
}

@Override
// Deprecated in RN 0.47
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

import javax.annotation.Nullable;

/**
* Created by Andre on 29/11/2017.
*/

public class DocumentScannerViewManager extends ViewGroupManager<MainView> {

private static final String REACT_CLASS = "RNPdfScanner";
Expand All @@ -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) {
Expand Down
12 changes: 1 addition & 11 deletions android/src/main/java/com/documentscanner/views/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7c52445

Please sign in to comment.