Search in sources :

Example 1 with CaptureManager

use of com.journeyapps.barcodescanner.CaptureManager in project zxing-android-embedded by journeyapps.

the class ToolbarCaptureActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.capture_appcompat);
    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    toolbar.setTitle("Scan Barcode");
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    barcodeScannerView = (DecoratedBarcodeView) findViewById(R.id.zxing_barcode_scanner);
    capture = new CaptureManager(this, barcodeScannerView);
    capture.initializeFromIntent(getIntent(), savedInstanceState);
    capture.decode();
}
Also used : CaptureManager(com.journeyapps.barcodescanner.CaptureManager) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with CaptureManager

use of com.journeyapps.barcodescanner.CaptureManager in project zxing-android-embedded by journeyapps.

the class CustomScannerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_scanner);
    barcodeScannerView = (DecoratedBarcodeView) findViewById(R.id.zxing_barcode_scanner);
    barcodeScannerView.setTorchListener(this);
    switchFlashlightButton = (Button) findViewById(R.id.switch_flashlight);
    // then remove the switch flashlight button...
    if (!hasFlash()) {
        switchFlashlightButton.setVisibility(View.GONE);
    }
    capture = new CaptureManager(this, barcodeScannerView);
    capture.initializeFromIntent(getIntent(), savedInstanceState);
    capture.decode();
}
Also used : CaptureManager(com.journeyapps.barcodescanner.CaptureManager)

Aggregations

CaptureManager (com.journeyapps.barcodescanner.CaptureManager)2 Toolbar (android.support.v7.widget.Toolbar)1