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

项目:QRCodeUtility    文件:ScanFragment.java   
@Override
public void barcodeResult(BarcodeResult result) {
    if (result.getText() != null) {
        BeepManager bm = new BeepManager(getActivity());
        bm.setVibrateEnabled(true);

        if (!BEEP) {
            bm.setBeepEnabled(false);
        }

        if (!VIBRATE) {
            bm.setVibrateEnabled(false);
        }

        bm.updatePrefs();
        bm.playBeepSoundAndVibrate();

        if (imagePreview == null && SHOW_ORIGINAL_PREVIEW)
            imagePreview = result.getBitmap();

        activityHelper.launchDetailActivity(imagePreview, result.getResult(), true);
    }
}
项目:androidscan    文件:ScanHelper.java   
public ScanHelper(Activity activity, SurfaceView surfaceView) {
    this.activity = activity;
    this.capturePreview = surfaceView;
    this.hasSurface = false;
    this.mInactivityTimer = new InactivityTimer(activity);
    this.mBeepManager = new BeepManager(activity);
}
项目:privacy-friendly-qr-scanner    文件:MyCaptureFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (container == null) {
        return null;
    }

    View v;
    v = inflater.inflate(R.layout.fragment_capture, container, false);

    if (SDK_INT >= Build.VERSION_CODES.M)
        if (ContextCompat.checkSelfPermission(activity, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.CAMERA}, 0);
        }

    barcodeView = (CompoundBarcodeView) v.findViewById(R.id.barcode_scanner);

    barcodeView.setTorchListener(new CompoundBarcodeView.TorchListener() {
        @Override
        public void onTorchOn() {
            torchOn = true;
        }

        @Override
        public void onTorchOff() {
            torchOn = false;
        }
    });

    barcodeView.decodeContinuous(callback);

    beepManager = new BeepManager(getActivity());

    return v;
}
项目:zxingfragmentlib    文件:BarCodeScannerFragment.java   
@Override
public void onCreate(Bundle icicle) {
  super.onCreate(icicle);

  hasSurface = false;
  inactivityTimer = new InactivityTimer(getActivity());
  beepManager = new BeepManager(getActivity());
  ambientLightManager = new AmbientLightManager(getActivity());

  PreferenceManager.setDefaultValues(getActivity(), R.xml.preferences, false);
}