mirror of
https://bitbucket.org/HeshamTB/barcodescanner2.git
synced 2024-11-05 11:02:14 +01:00
WHITESPACE
This commit is contained in:
parent
4d2de19132
commit
ea7605f630
@ -117,7 +117,6 @@ public class MainActivity extends AppCompatActivity implements OnClickListener {
|
|||||||
//take shot of barcode 2
|
//take shot of barcode 2
|
||||||
IntentIntegrator scanIntegrator = new IntentIntegrator(this);
|
IntentIntegrator scanIntegrator = new IntentIntegrator(this);
|
||||||
scanIntegrator.initiateScan(0);
|
scanIntegrator.initiateScan(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (result.equalsIgnoreCase("member1")
|
else if (result.equalsIgnoreCase("member1")
|
||||||
@ -126,23 +125,13 @@ public class MainActivity extends AppCompatActivity implements OnClickListener {
|
|||||||
|| result.equalsIgnoreCase("member3")
|
|| result.equalsIgnoreCase("member3")
|
||||||
|| result.equalsIgnoreCase("member4")
|
|| result.equalsIgnoreCase("member4")
|
||||||
&& passed1) {
|
&& passed1) {
|
||||||
|
|
||||||
passed1 = false;
|
passed1 = false;
|
||||||
Toast toast = Toast.makeText(getApplicationContext(), "Opening lock", Toast.LENGTH_SHORT);
|
Toast toast = Toast.makeText(getApplicationContext(), "Opening lock", Toast.LENGTH_SHORT);
|
||||||
toast.show();
|
toast.show();
|
||||||
|
|
||||||
//flash LED
|
//flash LED
|
||||||
flashLightOn();
|
flashLightOn();
|
||||||
|
|
||||||
IntentIntegrator scanIntegrator = new IntentIntegrator(this);
|
IntentIntegrator scanIntegrator = new IntentIntegrator(this);
|
||||||
scanIntegrator.initiateScan(0);
|
scanIntegrator.initiateScan(0);
|
||||||
|
|
||||||
|
|
||||||
//Scan again if cont. is checked
|
|
||||||
//make flash on!
|
|
||||||
//open door
|
|
||||||
//FlashLightUtilForL flash = new FlashLightUtilForL(this);
|
|
||||||
//flash.turnOnFlashLight();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@ -170,8 +159,6 @@ public class MainActivity extends AppCompatActivity implements OnClickListener {
|
|||||||
Toast toast = Toast.makeText(getApplicationContext(),
|
Toast toast = Toast.makeText(getApplicationContext(),
|
||||||
"No scan data received!", Toast.LENGTH_SHORT);
|
"No scan data received!", Toast.LENGTH_SHORT);
|
||||||
toast.show();
|
toast.show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
@ -183,17 +170,14 @@ public class MainActivity extends AppCompatActivity implements OnClickListener {
|
|||||||
|
|
||||||
private void flashLightOn() {
|
private void flashLightOn() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
//Camera settings from https://developer.android.com/reference/android/hardware/Camera.html
|
//Camera settings from https://developer.android.com/reference/android/hardware/Camera.html
|
||||||
android.hardware.Camera.Parameters para;
|
android.hardware.Camera.Parameters para;
|
||||||
android.hardware.Camera cam = android.hardware.Camera.open(0);
|
android.hardware.Camera cam = android.hardware.Camera.open(0);
|
||||||
para = cam.getParameters();
|
para = cam.getParameters();
|
||||||
para.setFlashMode(para.FLASH_MODE_TORCH);
|
para.setFlashMode(para.FLASH_MODE_TORCH);
|
||||||
cam.setParameters(para);
|
cam.setParameters(para);
|
||||||
|
|
||||||
//Flash on
|
//Flash on
|
||||||
cam.startPreview();
|
cam.startPreview();
|
||||||
|
|
||||||
//Delay
|
//Delay
|
||||||
int dum=0;
|
int dum=0;
|
||||||
for (int i =0;i<999999;i++){
|
for (int i =0;i<999999;i++){
|
||||||
@ -212,11 +196,7 @@ public class MainActivity extends AppCompatActivity implements OnClickListener {
|
|||||||
//Flash off
|
//Flash off
|
||||||
cam.stopPreview();
|
cam.stopPreview();
|
||||||
cam.release();
|
cam.release();
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
catch (Exception e){}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user