Piccoli fix su ITF 14 in emulazione tastiera
This commit is contained in:
parent
bb76065fc9
commit
433f04ba56
@ -95,9 +95,9 @@ dependencies {
|
||||
})
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'com.orhanobut:logger:2.2.0'
|
||||
implementation 'com.google.firebase:firebase-core:17.2.1'
|
||||
implementation 'com.google.firebase:firebase-core:17.2.2'
|
||||
implementation 'com.google.firebase:firebase-crash:16.2.1'
|
||||
implementation 'com.google.firebase:firebase-perf:19.0.3'
|
||||
implementation 'com.google.firebase:firebase-perf:19.0.5'
|
||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
|
||||
@ -11,6 +11,7 @@ import android.view.LayoutInflater;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialog;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
@ -32,7 +33,7 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
public class DialogScanArt {
|
||||
|
||||
private Context mContext;
|
||||
private Dialog mDialog;
|
||||
private BaseDialog mDialog;
|
||||
|
||||
private RunnableArgsss<DialogConsts.Results, MtbAart, Ean128Model> mOnItemChoosed;
|
||||
|
||||
@ -48,7 +49,7 @@ public class DialogScanArt {
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
DialogScanArtBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_scan_art, null, false);
|
||||
|
||||
mDialog = new Dialog(context);
|
||||
mDialog = new BaseDialog(context);
|
||||
|
||||
mDialog.setContentView(bindings.getRoot());
|
||||
|
||||
@ -73,6 +74,7 @@ public class DialogScanArt {
|
||||
.setOnScanSuccessfull(onScanSuccessfull)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(context, ex, false)));
|
||||
|
||||
mDialog.setBarcodeListener(true);
|
||||
mDialog.setOnDismissListener(dialog -> {
|
||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
||||
BarcodeManager.enable();
|
||||
|
||||
@ -110,6 +110,15 @@ public class KeyboardEmulatorBarcodeReader implements BarcodeReaderInterface {
|
||||
} catch (WrongFormatException e) {
|
||||
return BarcodeType.CODE128;
|
||||
}
|
||||
} else if (barcode.length() == 14) {
|
||||
try {
|
||||
int checksum = getEanChecksum(barcode);
|
||||
if (checksum == Integer.parseInt(barcode.substring(13))){
|
||||
return BarcodeType.INTERLEAVED_2OF5;
|
||||
}
|
||||
} catch (WrongFormatException e) {
|
||||
return BarcodeType.CODE128;
|
||||
}
|
||||
}
|
||||
return BarcodeType.CODE128;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user