类com.google.zxing.view.ViewfinderView源码实例Demo

下面列出了怎么用com.google.zxing.view.ViewfinderView的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: QrCodeLib   文件: CaptureActivity.java
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scanner);
    CameraManager.init(getApplication());
    viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_content);
    back = (ImageButton) findViewById(R.id.btn_back);
    back.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

    btnFlash = (ImageButton) findViewById(R.id.btn_flash);
    btnFlash.setOnClickListener(flashListener);

    btnAlbum = (Button) findViewById(R.id.btn_album);
    btnAlbum.setOnClickListener(albumOnClick);

    hasSurface = false;
    inactivityTimer = new InactivityTimer(this);

}
 
源代码2 项目: vmqApk   文件: CaptureActivity.java
/**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scanner);
        //ViewUtil.addTopView(getApplicationContext(), this, R.string.scan_card);
        CameraManager.init(getApplication());
        viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_content);
        back = (ImageButton) findViewById(R.id.btn_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        btnFlash = (ImageButton) findViewById(R.id.btn_flash);
        btnFlash.setOnClickListener(flashListener);

        btnAlbum = (Button) findViewById(R.id.btn_album);
        btnAlbum.setOnClickListener(albumOnClick);

//		cancelScanButton = (Button) this.findViewById(R.id.btn_cancel_scan);
        hasSurface = false;
        inactivityTimer = new InactivityTimer(this);

    }
 
源代码3 项目: QrCodeDemo4   文件: CaptureActivity.java
/**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scanner);
        //ViewUtil.addTopView(getApplicationContext(), this, R.string.scan_card);
        CameraManager.init(getApplication());
        viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_content);
        back = (ImageButton) findViewById(R.id.btn_back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        btnFlash = (ImageButton) findViewById(R.id.btn_flash);
        btnFlash.setOnClickListener(flashListener);

        btnAlbum = (Button) findViewById(R.id.btn_album);
        btnAlbum.setOnClickListener(albumOnClick);

//		cancelScanButton = (Button) this.findViewById(R.id.btn_cancel_scan);
        hasSurface = false;
        inactivityTimer = new InactivityTimer(this);

    }
 
源代码4 项目: QrCodeLib   文件: CaptureActivity.java
public ViewfinderView getViewfinderView() {
    return viewfinderView;
}
 
源代码5 项目: vmqApk   文件: CaptureActivity.java
public ViewfinderView getViewfinderView() {
    return viewfinderView;
}
 
源代码6 项目: QrCodeDemo4   文件: CaptureActivity.java
public ViewfinderView getViewfinderView() {
    return viewfinderView;
}
 
源代码7 项目: AndroidHttpCapture   文件: QrCodeScanActivity.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.
    cameraManager = new CameraManager(getApplication());
    viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
    viewfinderView.setCameraManager(cameraManager);

    handler = null;

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

    viewfinderView.setVisibility(View.VISIBLE);

    SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
    SurfaceHolder surfaceHolder = surfaceView.getHolder();
    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.
        initCamera(surfaceHolder);
    } else {
        // Install the callback and wait for surfaceCreated() to init the
        // camera.
        surfaceHolder.addCallback(this);
    }

    decodeFormats = null;
    characterSet = null;

    playBeep = true;
    AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
    if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
        playBeep = false;
    }
    initBeepSound();
    vibrate = true;

    inactivityTimer.onResume();
}
 
源代码8 项目: AndroidHttpCapture   文件: QrCodeScanActivity.java
public ViewfinderView getViewfinderView() {
    return viewfinderView;
}
 
 类所在包
 同包方法