Java 类com.google.zxing.client.android.camera.CameraManager 实例源码

项目:keepass2android    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:weex-3d-map    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:androidscan    文件:ScanHelper.java   
public void onResume() {
    cameraManager = new CameraManager(activity.getApplication());

    handler = null;

    if (hasSurface) {
        // The activity was paused but not stopped, so the surface still exists. Therefore
        // surfaceCreated() won't be called, so init the camera here.
        surfaceChanged(capturePreview.getHolder());
    } else {
        // Install the callback and wait for surfaceCreated() to init the camera.
        capturePreview.getHolder().addCallback((SurfaceHolder.Callback) activity);
    }

    mInactivityTimer.onResume();
}
项目:BarcodeReaderView    文件:BarcodeReaderHandler.java   
BarcodeReaderHandler(BarcodeReaderView barcodeReaderView,
                     Collection<BarcodeFormat> decodeFormats,
                     Map<DecodeHintType, ?> baseHints,
                     String characterSet,
                     ResultPointCallback resultPointCallback,
                     CameraManager cameraManager) {
    this.barcodeReaderView = barcodeReaderView;
    decodeThread = new DecodeThread(barcodeReaderView, decodeFormats, baseHints, characterSet, resultPointCallback);
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:BarcodeReaderView    文件:BarcodeReaderView.java   
/**
 * 启动相机预览与扫描,在Activity/Fragment的onResume方法中调用。
 */
public void onResume() {
    if (checkCameraHardware()) {
        mCameraManager = new CameraManager(this);
        if (frameWidth > 0 && frameHeight > 0) {
            mCameraManager.setManualFramingRect(frameWidth, frameHeight, frameTopOffset);
        }
        SurfaceHolder surfaceHolder = getHolder();
        if (hasSurface) {
            initCamera(surfaceHolder);
        } else {
            surfaceHolder.addCallback(this);
        }
    } else {
        if (mOnBarcodeReadListener != null) {
            mOnBarcodeReadListener.onCameraNotFound();
        }
    }
}
项目:KeePass2Android    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:ZXing-Orient    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:weex-analyzer-android    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:Lokalisierung-mit-Wearables    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderView.ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:weex-3d-map    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:ZxingLite    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType, ?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
            new ViewfinderResultPointCallback(activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:Weex-TestDemo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:weex    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:sres-app    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:faims-android    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:ProjectKilo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType, ?> baseHints, String characterSet,
                       CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
            activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:Discounty    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType, ?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
            new ViewfinderResultPointCallback(activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:bushido-android-app    文件:CaptureFragmentHandler.java   
public CaptureFragmentHandler(BarcodeFragment activity,
                              Collection<BarcodeFormat> decodeFormats,
                              Map<DecodeHintType, ?> baseHints,
                              String characterSet,
                              CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:reacteu-app    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:CordovaDemo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:google-glass-share-barcode-bluetooth    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:MobilHackathon2014    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:ng-cordova-demo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:ngCordova-demo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:CordovaW8BarcodeDemo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:zxing-android-portrait    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
项目:glass-qrlens    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:Adaptilo    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType, ?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
            new ViewfinderResultPointCallback(activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:cordova-template    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:glass-barcode    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:oxPush    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:NYC-Glass-Challenge-Oct2014    文件:CaptureActivityHandler.java   
public CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
            activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:hive-ios    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
项目:MediModo-Android    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       String characterSet,
                       CameraManager cameraManager)
{
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
            new ViewfinderResultPointCallback(activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:BibSearch    文件:CaptureActivity.java   
@Override
public void onCreate(Bundle icicle) {
  super.onCreate(icicle);

  Window window = getWindow();
  window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView(R.layout.capture);

  CameraManager.init(getApplication());
  viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
  resultView = findViewById(R.id.result_view);
  statusView = (TextView) findViewById(R.id.status_view);
  handler = null;
  lastResult = null;
  hasSurface = false;
  historyManager = new HistoryManager(this);
  historyManager.trimHistory();
  inactivityTimer = new InactivityTimer(this);
  beepManager = new BeepManager(this);

  // showHelpOnFirstLaunch();
}
项目:BibSearch    文件:CaptureActivity.java   
private void initCamera(SurfaceHolder surfaceHolder) {
  try {
    CameraManager.get().openDriver(surfaceHolder);
    // Creating the handler starts the preview, which can also throw a RuntimeException.
    if (handler == null) {
      handler = new CaptureActivityHandler(this, decodeFormats, characterSet);
    }
  } catch (IOException ioe) {
    Log.w(TAG, ioe);
    displayFrameworkBugMessageAndExit();
  } catch (RuntimeException e) {
    // Barcode Scanner has seen crashes in the wild of this variety:
    // java.?lang.?RuntimeException: Fail to connect to camera service
    Log.w(TAG, "Unexpected error initializating camera", e);
    displayFrameworkBugMessageAndExit();
  }
}
项目:BarcodeEye    文件:CaptureActivityHandler.java   
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
项目:keepass2android    文件:AmbientLightManager.java   
void start(CameraManager cameraManager) {
  this.cameraManager = cameraManager;
  SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
  if (FrontLightMode.readPref(sharedPrefs) == FrontLightMode.AUTO) {
    SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    if (lightSensor != null) {
      sensorManager.registerListener(this, lightSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
  }
}
项目:weex-3d-map    文件:AmbientLightManager.java   
void start(CameraManager cameraManager) {
  this.cameraManager = cameraManager;
  SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
  if (FrontLightMode.readPref(sharedPrefs) == FrontLightMode.AUTO) {
    SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    if (lightSensor != null) {
      sensorManager.registerListener(this, lightSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
  }
}
项目:appinventor-extensions    文件:CaptureActivityHandler.java   
CaptureActivityHandler(AppInvCaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}