@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
    }
Custom Scannner Activity extending from Activity to display a custom layout form scanner view.
sample/src/main/java/example/zxing/CustomScannerActivity.java