@scrumble-nl/react-native-honeywell-scanner 1.0.79 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,6 @@ import android.os.Bundle;
|
|
|
6
6
|
import android.app.AlertDialog;
|
|
7
7
|
import android.content.DialogInterface;
|
|
8
8
|
import android.widget.Toast;
|
|
9
|
-
import android.app.Activity;
|
|
10
9
|
|
|
11
10
|
import com.facebook.react.bridge.*;
|
|
12
11
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
@@ -90,9 +89,21 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
90
89
|
@Override
|
|
91
90
|
public void onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
|
|
92
91
|
if (event.getConnectionStatus() == manager.BARCODE_DEVICE_CONNECTED) {
|
|
93
|
-
|
|
92
|
+
UiThreadUil.runOnUiThread(new Runnable() {
|
|
93
|
+
@Override
|
|
94
|
+
public void run() {
|
|
95
|
+
Toast.makeText(reactContext, "Device connected", Toast.LENGTH_LONG).show();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
reader = manager.createBarcodeReader(event.getBarcodeReaderInfo().getName());
|
|
94
99
|
} else {
|
|
95
|
-
|
|
100
|
+
UiThreadUil.runOnUiThread(new Runnable() {
|
|
101
|
+
@Override
|
|
102
|
+
public void run() {
|
|
103
|
+
Toast.makeText(reactContext, "Internal scanner", Toast.LENGTH_LONG).show();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
reader = manager.createBarcodeReader();
|
|
96
107
|
}
|
|
97
108
|
|
|
98
109
|
if (reader != null) {
|
|
@@ -125,15 +136,6 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
125
136
|
// manager = aidcManager;
|
|
126
137
|
// reader = manager.createBarcodeReader();
|
|
127
138
|
//
|
|
128
|
-
// List<BarcodeReaderInfo> mBarcodeList = manager.listConnectedBarcodeDevices();
|
|
129
|
-
// WritableMap params = Arguments.createMap();
|
|
130
|
-
//
|
|
131
|
-
// for (BarcodeReaderInfo temp : mBarcodeList) {
|
|
132
|
-
// params.putString("name", temp.getName());
|
|
133
|
-
// }
|
|
134
|
-
//
|
|
135
|
-
// callBack.invoke(params);
|
|
136
|
-
//
|
|
137
139
|
// if (reader != null) {
|
|
138
140
|
// reader.addBarcodeListener(HoneywellScannerModule.this);
|
|
139
141
|
// try {
|
|
@@ -157,6 +159,7 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
157
159
|
@ReactMethod
|
|
158
160
|
public void stopReader(Promise promise) {
|
|
159
161
|
if (reader != null) {
|
|
162
|
+
reader.release();
|
|
160
163
|
reader.close();
|
|
161
164
|
}
|
|
162
165
|
if (manager != null) {
|
package/package.json
CHANGED