aggiunta configurazione scanner barcode tramite preferenze app
This commit is contained in:
@@ -5,8 +5,11 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Pair;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.barcode_base_android_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.barcode_base_android_library.extension.RunnableArgs;
|
||||
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
|
||||
@@ -29,22 +32,22 @@ public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
@Override
|
||||
public boolean isRightAdapter() {
|
||||
String model = Build.MODEL;
|
||||
if(model.equalsIgnoreCase("TC700H")) {
|
||||
if (model.equalsIgnoreCase("TC700H")) {
|
||||
return true;
|
||||
} else if(model.equalsIgnoreCase("TC200J")) {
|
||||
} else if (model.equalsIgnoreCase("TC200J")) {
|
||||
return true;
|
||||
} else if(model.equalsIgnoreCase("TC210K")) {
|
||||
} else if (model.equalsIgnoreCase("TC210K")) {
|
||||
return true;
|
||||
} else if(model.equalsIgnoreCase("TC21")) {
|
||||
} else if (model.equalsIgnoreCase("TC21")) {
|
||||
return true;
|
||||
} else if(model.equalsIgnoreCase("TC20")) {
|
||||
} else if (model.equalsIgnoreCase("TC20")) {
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Runnable onDeviceReady) throws BarcodeAdapterNotFoundException {
|
||||
if(isRightAdapter()) {
|
||||
if (isRightAdapter()) {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
filter.addAction(INTENT_FILTER_STRING);
|
||||
@@ -95,8 +98,7 @@ public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
};
|
||||
|
||||
|
||||
private void dispatchEvent(Intent initiatingIntent)
|
||||
{
|
||||
private void dispatchEvent(Intent initiatingIntent) {
|
||||
|
||||
String decodedSource = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_source));
|
||||
String decodedData = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_data));
|
||||
@@ -111,4 +113,9 @@ public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
|
||||
mOnScanSuccessfull.run(barcodeScanDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeSettings(List<Pair<String, Object>> settings) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user