Skip to content

Commit

Permalink
Change example code in Readme
Browse files Browse the repository at this point in the history
It was clear enough Imo, but some people pointed it and asked to have a
clear example.
  • Loading branch information
dlazaro66 committed Mar 29, 2017
1 parent 04cbe10 commit 20fac1f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@ Usage
public class DecoderActivity extends Activity implements OnQRCodeReadListener {

private TextView resultTextView;
private QRCodeReaderView mydecoderview;
private QRCodeReaderView qrCodeReaderView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_decoder);

mydecoderview = (QRCodeReaderView) findViewById(R.id.qrdecoderview);
mydecoderview.setOnQRCodeReadListener(this);
qrCodeReaderView = (QRCodeReaderView) findViewById(R.id.qrdecoderview);
qrCodeReaderView.setOnQRCodeReadListener(this);

// Use this function to enable/disable decoding
mydecoderview.setQRDecodingEnabled(true);
qrCodeReaderView.setQRDecodingEnabled(true);

// Use this function to change the autofocus interval (default is 5 secs)
mydecoderview.setAutofocusInterval(2000L);
qrCodeReaderView.setAutofocusInterval(2000L);

// Use this function to enable/disable Torch
mydecoderview.setTorchEnabled(true);
qrCodeReaderView.setTorchEnabled(true);

// Use this function to set front camera preview
mydecoderview.setFrontCamera();
qrCodeReaderView.setFrontCamera();

// Use this function to set back camera preview
mydecoderview.setBackCamera();
qrCodeReaderView.setBackCamera();
}

// Called when a QR is decoded
Expand Down

0 comments on commit 20fac1f

Please sign in to comment.