Created
December 13, 2018 09:31
-
-
Save tongoclinh/00fe0d503a4e589dfad2a000195af7af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mQRSurfaceView = new SurfaceView(this); | |
| FrameLayout.LayoutParams lParams = new FrameLayout.LayoutParams( | |
| FrameLayout.LayoutParams.WRAP_CONTENT, | |
| FrameLayout.LayoutParams.WRAP_CONTENT); | |
| lParams.leftMargin = 100; | |
| lParams.topMargin = 0; | |
| lParams.gravity = Gravity.TOP | Gravity.START; | |
| mFrameLayout.addView(mQRSurfaceView, lParams); | |
| mQRSurfaceView.setZOrderOnTop(true); | |
| mQRSurfaceView.setZOrderMediaOverlay(true); | |
| mQRSurfaceView.getHolder().setFixedSize(500, 768); | |
| qrEader = new QREader.Builder(this, mQRSurfaceView, new QRDataListener() { | |
| @Override | |
| public void onDetected(final String data) { | |
| Log.d("QREader", "Value : " + data); | |
| } | |
| }).facing(QREader.BACK_CAM) | |
| .enableAutofocus(true) | |
| .height(mQRSurfaceView.getHeight()) | |
| .width(mQRSurfaceView.getWidth()) | |
| .build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment