Aggiornate tutte le icone del drawer e del menu principale.
This commit is contained in:
@@ -6,6 +6,8 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.plugins.barcode_base_library.extension.RunnableArgs;
|
||||
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||
@@ -13,7 +15,7 @@ import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
|
||||
public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
|
||||
private final Context mContext;
|
||||
private final AppCompatActivity mContext;
|
||||
|
||||
private static RunnableArgs<BarcodeScanDTO> mOnScanSuccessfull;
|
||||
private static RunnableArgs<Exception> mOnScanFailed;
|
||||
@@ -21,7 +23,7 @@ public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
private static final String TAG = ZebraBarcodeReader.class.getName();
|
||||
private static final String INTENT_FILTER_STRING = "it.integry.scan_filter";
|
||||
|
||||
public ZebraBarcodeReader(Context context) {
|
||||
public ZebraBarcodeReader(AppCompatActivity context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@@ -34,12 +36,14 @@ public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() throws BarcodeAdapterNotFoundException {
|
||||
public void init(Runnable onDeviceReady) throws BarcodeAdapterNotFoundException {
|
||||
if(isRightAdapter()) {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
filter.addAction(INTENT_FILTER_STRING);
|
||||
mContext.registerReceiver(myBroadcastReceiver, filter);
|
||||
|
||||
onDeviceReady.run();
|
||||
} else {
|
||||
throw new BarcodeAdapterNotFoundException(getAdapterName());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user