private void setupSurfaceView() {
        if (useTextureView) {
            textureView = new TextureView(getContext());
            textureView.setSurfaceTextureListener(surfaceTextureListener());
            addView(textureView);
        } else {
            surfaceView = new SurfaceView(getContext());
            surfaceView.getHolder().addCallback(surfaceCallback);
            addView(surfaceView);
        }
    }
Initialize from XML attributes.

@param attrs the attributes
zxing-android-embedded/src/com/journeyapps/barcodescanner/CameraPreview.java