Skip to content

Commit 47584b5

Browse files
committed
pause and resume barcode scanning when showing enter barcode dialog
1 parent d086188 commit 47584b5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ui/src/main/java/io/snabble/sdk/ui/scanner/SelfScanningView.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ private void onClickEnterBarcode() {
289289
if(productDatabase.isAvailableOffline() && productDatabase.isUpToDate()){
290290
callback.showBarcodeSearch();
291291
} else {
292+
pauseBarcodeScanner();
293+
292294
final EditText input = new EditText(getContext());
293295
MarginLayoutParams lp = new MarginLayoutParams(
294296
LinearLayout.LayoutParams.MATCH_PARENT,
@@ -307,8 +309,15 @@ public void onClick(DialogInterface dialog, int which) {
307309
}
308310
})
309311
.setNegativeButton(R.string.Snabble_Cancel, null)
312+
.setOnDismissListener(new DialogInterface.OnDismissListener() {
313+
@Override
314+
public void onDismiss(DialogInterface dialog) {
315+
resumeBarcodeScanner();
316+
}
317+
})
310318
.create()
311319
.show();
320+
312321
}
313322
}
314323
}

0 commit comments

Comments
 (0)