Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompoundBarcodeView.pause() causes the semi transparent frame to disappear #130

Closed
emanuelthedude opened this issue Feb 3, 2016 · 2 comments
Assignees

Comments

@emanuelthedude
Copy link

Hi,

I wan't to achieve a continuous scan that stands still for 2 seconds if barcode was found. Therefore I use the BarcodeCallback and call compoundBarcodeView.pause() then wait 2 seconds and call compoundBarcodeView.resume() because I don't know any other option.

What happens is the following

  • continous scan
  • sill image full screen (with no semi transparent frame)
  • still image with frame
  • continous scan

I'd like to have it like this

  • continuous scan
  • still image with frame
  • continuous scan

This is the code I use in the callback

private BarcodeCallback callback = new BarcodeCallback() {
private long lastTimestamp = 0;

    @Override
    public void barcodeResult(BarcodeResult result) {
        String scannedCode = null;

        if (result != null) {
            scannedCode = result.getText();

            if (scannedCode != null) {
                mBarcodeScannerView.pause();

                if(System.currentTimeMillis() - lastTimestamp < DELAY) {
                    // Too soon after the last barcode - ignore.
                    return;
                }
                lastTimestamp = System.currentTimeMillis();
                mBarcodeScannerView.resume();
            }
        }
        handleScan(scannedCode);
    }

    @Override
    public void possibleResultPoints(List<ResultPoint> resultPoints) { /* do nothing */ }
};
@rkistner
Copy link
Member

rkistner commented Feb 3, 2016

Will work on this for the next release.

@emanuelthedude
Copy link
Author

As a workaround I took the ViewfinderView and made it invisible (gone). With this way I also got rid of the laser which i wanted anyway. Then I created a View by myself. This view never gets distracted.

CompoundBarcodeView.getViewFinder().setVisibility(View.GONE);

I leave this ticket open so you can close it @rkistner if you have fixed the ViewFinderView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants