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

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

下面列出了com.google.zxing.client.android.camera.CameraManager 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: flutter_qr_reader   文件: QRCodeReaderView.java
public QRCodeReaderView(Context context, AttributeSet attrs) {
    super(context, attrs);

    if (isInEditMode()) {
        return;
    }

    if (checkCameraHardware()) {
        mCameraManager = new CameraManager(getContext());
        mCameraManager.setPreviewCallback(this);
        getHolder().addCallback(this);
        setBackCamera();
    } else {
        throw new RuntimeException("Error: Camera not found");
    }
}
 
源代码2 项目: ShareBox   文件: QRCodeReaderView.java
public QRCodeReaderView(Context context, AttributeSet attrs) {
    super(context, attrs);

    if (isInEditMode()) {
        return;
    }

    if (checkCameraHardware()) {
        mCameraManager = new CameraManager(getContext());
        mCameraManager.setPreviewCallback(this);
        getHolder().addCallback(this);
        setBackCamera();
    } else {
        throw new RuntimeException("Error: Camera not found");
    }
}
 
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();
}
 
源代码4 项目: 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();
}
 
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();
}
 
源代码6 项目: 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();
}
 
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();
}
 
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();
}
 
源代码9 项目: 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();
 }
 
源代码10 项目: 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();
}
 
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();
}
 
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);
    }
  }
}
 
源代码13 项目: ZXing-Orient   文件: 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);
    }
  }
}
 
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);
    }
  }
}
 
源代码15 项目: weex   文件: 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);
    }
  }
}
 
源代码16 项目: Study_Android_Demo   文件: 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);
    }
  }
}
 
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);
    }
  }
}
 
源代码18 项目: ProjectX   文件: ScanHandler.java
public ScanHandler(OnResultListener listener,
                   int barcodeType,
                   Map<DecodeHintType, ?> baseHints,
                   String characterSet,
                   CameraManager cameraManager, ResultPointCallback resultPointCallback) {
    this.listener = listener;
    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    decodeThread = new DecodeThread(cameraManager,
            this, barcodeType, baseHints, characterSet, resultPointCallback);
    decodeThread.start();
    state = State.SUCCESS;
    restartPreviewAndDecode();
}
 
源代码19 项目: ProjectX   文件: ZxingScanView.java
private void openDriver(SurfaceHolder surfaceHolder) {
    notifyListenerPrepareOpen();
    if (surfaceHolder == null)
        return;// 已经销毁
    if (isOpen())
        return;// 摄像头已经打开
    if (Compat.checkSelfPermission(getContext(), Manifest.permission.CAMERA)
            == PackageManager.PERMISSION_DENIED) {
        mErrorCode = ERROR_CODE_1;
        notifyListenerError();
        return;
    }
    mCameraManager = new CameraManager(getContext());
    if (mCameraId != OpenCameraInterface.NO_REQUESTED_CAMERA)
        mCameraManager.setManualCameraId(mCameraId);
    final int width = mScanWidth == ViewGroup.LayoutParams.MATCH_PARENT ? getWidth() :
            (mScanWidth > getWidth() ? getWidth() : mScanWidth);
    final int height = mScanHeight == ViewGroup.LayoutParams.MATCH_PARENT ? getHeight() :
            (mScanHeight > getHeight() ? getHeight() : mScanHeight);
    mCameraManager.setManualFramingRect(width, height);
    try {
        mCameraManager.openDriver(surfaceHolder);
        mCameraManager.startPreview();
        mScanHandler = new ScanHandler(resultListener, mBarcodeType, mBaseHints,
                mCharacterSet, mCameraManager,
                resultPointCallback);
    } catch (Exception e) {
        mErrorCode = ERROR_CODE_0;
        notifyListenerError();
        return;
    }
    mAmbientLightManager.resume();
    notifyListenerOpened();
}
 
源代码20 项目: android-apps   文件: 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();
}
 
源代码21 项目: zxingfragmentlib   文件: AmbientLightManager.java
public 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);
    }
  }
}
 
源代码22 项目: zxingfragmentlib   文件: BarCodeScannerHandler.java
BarCodeScannerHandler(BarCodeScannerFragment fragment,
                      Collection<BarcodeFormat> decodeFormats,
                      Map<DecodeHintType,?> baseHints,
                      String characterSet,
                      CameraManager cameraManager) {
    this.fragment = fragment;
    decodeThread = new DecodeThread(fragment, decodeFormats, baseHints, characterSet,
            new ViewfinderResultPointCallback(fragment.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
源代码23 项目: BarcodeEye   文件: AmbientLightManager.java
public void start(CameraManager cameraManager) {
    this.cameraManager = cameraManager;
    SharedPreferences sharedPrefs = PreferenceManager
            .getDefaultSharedPreferences(context);

    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);
    }
}
 
源代码24 项目: BarcodeEye   文件: CaptureActivity.java
@Override
protected void onResume() {
    super.onResume();

    // CameraManager must be initialized here, not in onCreate(). This is necessary because we don't
    // want to open the camera driver and measure the screen size if we're going to show the help on
    // first launch. That led to bugs where the scanning rectangle was the wrong size and partially
    // off screen.
    mCameraManager = new CameraManager(getApplication());
    mViewfinderView.setCameraManager(mCameraManager);

    mHandler = null;

    SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
    SurfaceHolder surfaceHolder = surfaceView.getHolder();
    if (mHasSurface) {
        // The activity was paused but not stopped, so the surface still exists. Therefore
        // surfaceCreated() won't be called, so init the camera here.
        initCamera(surfaceHolder);
    } else {
        // Install the callback and wait for surfaceCreated() to init the camera.
        surfaceHolder.addCallback(this);
    }

    mBeepManager.updatePrefs();
    mAmbientLightManager.start(mCameraManager);

    mInactivityTimer.onResume();
}
 
CameraManager getCameraManager() {
  return cameraManager;
}
 
源代码26 项目: appinventor-extensions   文件: ViewfinderView.java
public void setCameraManager(CameraManager cameraManager) {
  this.cameraManager = cameraManager;
}
 
源代码27 项目: ZXing-Standalone-library   文件: CaptureActivity.java
CameraManager getCameraManager() {
  return cameraManager;
}
 
源代码28 项目: ZXing-Standalone-library   文件: ViewfinderView.java
public void setCameraManager(CameraManager cameraManager) {
  this.cameraManager = cameraManager;
}
 
源代码29 项目: ZXing-Orient   文件: CaptureActivity.java
CameraManager getCameraManager() {
    return cameraManager;
}
 
源代码30 项目: ZXing-Orient   文件: ViewfinderView.java
public void setCameraManager(CameraManager cameraManager) {
  this.cameraManager = cameraManager;
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法