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

Flash nos turning off! #13

Closed
gabrielnra opened this issue Feb 23, 2017 · 10 comments
Closed

Flash nos turning off! #13

gabrielnra opened this issue Feb 23, 2017 · 10 comments

Comments

@gabrielnra
Copy link

public void flashlight(View view){
        Boolean flashIsOn = barcodeCapture.isShowFlash();
        if(!flashIsOn){
            barcodeCapture.setShowFlash(true);
        }else{
            barcodeCapture.setShowFlash(false);
        }
        barcodeCapture.refresh();
 }

I'm implementing a button inside the view that when clicked, checks the flash status and if off, turns it off and if on, turns it off.

The turning ON part is ok, but turning OFF doesn't work.

Can you help me?

@haemi
Copy link

haemi commented Mar 3, 2017

did you find a solution for this?

@haemi
Copy link

haemi commented Mar 3, 2017

the problem is here, but I don't know how I can solve that in my project yet:

BarcodeCapture:230 should NOT be

mCameraSource.setFlashMode(isShowFlash() ? Camera.Parameters.FLASH_MODE_TORCH : null);

but

mCameraSource.setFlashMode(isShowFlash() ? Camera.Parameters.FLASH_MODE_TORCH : Camera.Parameters.FLASH_MODE_OFF);

haemi pushed a commit to haemi/MobileVisionBarcodeScanner that referenced this issue Mar 6, 2017
@gabrielnra
Copy link
Author

I`m not being able to fix this. Could you?

@haemi
Copy link

haemi commented Mar 16, 2017

yes, please see my pull request

KingsMentor added a commit that referenced this issue Aug 5, 2017
fix Flash nos turning off! #13
@android-guilherme
Copy link

Waiting for that update....

KingsMentor added a commit that referenced this issue Aug 14, 2017
@KingsMentor
Copy link
Owner

@android-guilherme just push an update that fixed these issues. About to close up all issues. Will release the update afterwards.

KingsMentor added a commit that referenced this issue Aug 14, 2017
@android-guilherme
Copy link

@KingsMentor Thanks for that! Really thanks!

@KingsMentor
Copy link
Owner

KingsMentor commented Aug 14, 2017

a new released is available now.

	dependencies {
	        compile 'com.github.KingsMentor:MobileVisionBarcodeScanner:2.0.0'
	}

@android-guilherme
Copy link

@KingsMentor Yes! I'm using that now. So much better! Again, Thanks for that awesome job.

@PrashantMangale
Copy link

PrashantMangale commented Dec 8, 2017

@haemi Hello, how you initialize mCameraSource?
I am not getting how to do that. I have used previous code of @gabrielnra to on/off Flash while scan.
It takes value on/off from Shared Preferences and will call to setShowFlash() method on it with respective value true/false.
But its not working, even library is updated to latest version. Help me to solve this issue.

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

5 participants