@scrumble-nl/react-native-honeywell-scanner 1.0.67 → 1.0.69
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.
|
@@ -5,6 +5,8 @@ import android.util.Log;
|
|
|
5
5
|
import android.os.Bundle;
|
|
6
6
|
import android.app.AlertDialog;
|
|
7
7
|
import android.content.DialogInterface;
|
|
8
|
+
import android.widget.Toast;
|
|
9
|
+
import android.app.Activity;
|
|
8
10
|
|
|
9
11
|
import com.facebook.react.bridge.*;
|
|
10
12
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
@@ -93,11 +95,22 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
93
95
|
manager = aidcManager;
|
|
94
96
|
|
|
95
97
|
if (manager != null) {
|
|
96
|
-
manager.addBarcodeDeviceListener(BarcodeDeviceListener
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
manager.addBarcodeDeviceListener(new BarcodeDeviceListener() {
|
|
99
|
+
@Override
|
|
100
|
+
public void onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
|
|
101
|
+
String connected;
|
|
102
|
+
|
|
103
|
+
if (event.getConnectionStatus() == manager.BARCODE.DEVICE.DISCONNECTED) {
|
|
104
|
+
connected = "Disconnected";
|
|
105
|
+
} else {
|
|
106
|
+
connected = "Connected";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
final String message = "Scanner: " + event.getBarcodeReaderInfo().getName() + " is " + connected;
|
|
110
|
+
|
|
111
|
+
Toast.makeText(reactContext, message, Toast.LENGTH_LONG).show();
|
|
99
112
|
}
|
|
100
|
-
}
|
|
113
|
+
});
|
|
101
114
|
}
|
|
102
115
|
}
|
|
103
116
|
});
|
package/package.json
CHANGED