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

How to retrieve values with multiple barcode without tocuh event? #37

Open
oumardiarra opened this issue Dec 8, 2017 · 7 comments
Open

Comments

@oumardiarra
Copy link

Hi,
Thanks for the library, it works great. Why do we need to touch the screen in order to get result from multiple barcode scanning? is there a way to get them automatically like if we have only one barcode?

Best regards....

@KingsMentor
Copy link
Owner

@oumardiarra you can achieve this by

barcodeCapture.setTouchAsCallback(false);

@oumardiarra
Copy link
Author

oumardiarra commented Dec 8, 2017

Hi @KingsMentor
thanks for the feedback. Where tu put that code. I've added it to the oncreate method like this:

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); BarcodeCapture barcodeCapture = (BarcodeCapture) getSupportFragmentManager().findFragmentById(R.id.barcode); barcodeCapture.setTouchAsCallback(false); barcodeCapture.setRetrieval(this); /* barcodeCapture.setTouchAsCallback(false);*/ }
and I'm still getting value when I only click on screen. Also I've added barcodeCapture.setShowFlash(true);
after barcode initialization but it doesn't work. Flash works only if i use it directly in fragment(app:gvb_flash="true)

@KingsMentor
Copy link
Owner

@oumardiarra don't forget to call :

barcodeCapture.refresh(true);

call that method after changing any of the barcode preferences to make sure changes is reflected.
Let me know if this resolved the issue.

@oumardiarra
Copy link
Author

@KingsMentor no, I don't have the ability to add boolean parameter to the refresh() method.
Only barcodeCapture.refresh(); and also using it , I have the same behavior. Do i have to call it before calling barcodeCapture.setRetrieval(this); or after?
Though I have tested both with same result. Seems that only Attributes on fragments works in my case but I don't have setTouchAsCallback on it.

@KingsMentor
Copy link
Owner

KingsMentor commented Dec 8, 2017

@oumardiarra update your dependency to :

compile 'xyz.belvi.mobilevision:barcodescanner:2.0.3'

// forceUpdate can be true or false
Also, call barcodeCapture.refresh(forceUpdate); only after changing the barcode properties.

@KingsMentor
Copy link
Owner

@oumardiarra confirm if the issue has been resolved.

@oumardiarra
Copy link
Author

@KingsMentor sorry for the delay. I always get values only when i click on screeen. I've updated my dependency as suggested above. Here is the code:

barcodeCapture.setSupportMultipleScan(true); barcodeCapture.setShowDrawRect(true); barcodeCapture.setTouchAsCallback(false); barcodeCapture.refresh(true);

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