// TODO: The string encoding should live in the core ZXing library.
private boolean encodeContents(Intent intent) {
- if (intent == null) return false;
+ if (intent == null) {
+ return false;
+ }
String type = intent.getStringExtra(Intents.Encode.TYPE);
- if (type == null || type.length() == 0) return false;
+ if (type == null || type.length() == 0) {
+ return false;
+ }
if (type.equals(Contents.Type.TEXT)) {
String string = intent.getStringExtra(Intents.Encode.DATA);
return mContents != null && mContents.length() > 0;
}
- private final static class EncodeThread extends Thread {
+ private static final class EncodeThread extends Thread {
private final String mContents;
private final Handler mHandler;
mPixelResolution = pixelResolution;
}
- public final void run() {
+ public void run() {
try {
ByteMatrix result = new MultiFormatWriter().encode(mContents, BarcodeFormat.QR_CODE,
mPixelResolution, mPixelResolution);