Beispiel #1
0
 public void stopCamera() {
   if (mCamera != null) {
     mPreviewFrame.removeView(mPreview);
   }
   Log.d(TAG, "stopping camera");
   mCameraHandler.sendEmptyMessage(STOP_PREVIEW);
   mCameraHandler.sendEmptyMessage(RELEASE);
   mHandler.removeCallbacks(cameraFocusRunner);
   mPreviewing = false;
 }
Beispiel #2
0
 public void setFlashOn(boolean on) {
   // You have camera in your device
   if (hasCameraFlash()) {
     if (on) {
       mFlashOn = true;
       mCameraHandler.sendEmptyMessage(FLASH_ON);
     } else {
       mFlashOn = false;
       mCameraHandler.sendEmptyMessage(FLASH_OFF);
     }
   }
 }
Beispiel #3
0
 private void finishOpenCamera() {
   mPreview = new CameraSurfacePreview(mFragment.getActivity(), mCamera);
   mCameraHandler.sendEmptyMessage(SETUP);
   mPreviewing = true;
   mHandler.post(
       new Runnable() {
         public void run() {
           mPreviewFrame.addView(mPreview);
         }
       });
 }
Beispiel #4
0
 @Override
 public void run() {
   mCameraHandler.sendEmptyMessage(AUTO_FOCUS);
   mHandler.postDelayed(cameraFocusRunner, FOCUS_MILLIS);
 }
Beispiel #5
0
 public void stopScanning() {
   mCameraHandler.sendEmptyMessage(PREVIEW_OFF);
 }
Beispiel #6
0
 public void startScanning() {
   mCameraHandler.sendEmptyMessage(PREVIEW_ON);
 }