Remove trailing whitespaces from zxing code

This commit is contained in:
Daniel Martí 2015-10-08 17:05:17 +02:00
parent 999fa6eb21
commit 42b7687cf9
2 changed files with 16 additions and 16 deletions

View File

@ -75,7 +75,7 @@ import java.util.Map;
* user was prompted to download the application. This lets the calling app potentially manage the dialog. * user was prompted to download the application. This lets the calling app potentially manage the dialog.
* In particular, ideally, the app dismisses the dialog if it's still active in its {@link Activity#onPause()} * In particular, ideally, the app dismisses the dialog if it's still active in its {@link Activity#onPause()}
* method.</p> * method.</p>
* *
* <p>You can use {@link #setTitle(String)} to customize the title of this download prompt dialog (or, use * <p>You can use {@link #setTitle(String)} to customize the title of this download prompt dialog (or, use
* {@link #setTitleByID(int)} to set the title by string resource ID.) Likewise, the prompt message, and * {@link #setTitleByID(int)} to set the title by string resource ID.) Likewise, the prompt message, and
* yes/no button labels can be changed.</p> * yes/no button labels can be changed.</p>
@ -83,7 +83,7 @@ import java.util.Map;
* <p>Finally, you can use {@link #addExtra(String, Object)} to add more parameters to the Intent used * <p>Finally, you can use {@link #addExtra(String, Object)} to add more parameters to the Intent used
* to invoke the scanner. This can be used to set additional options not directly exposed by this * to invoke the scanner. This can be used to set additional options not directly exposed by this
* simplified API.</p> * simplified API.</p>
* *
* <p>By default, this will only allow applications that are known to respond to this intent correctly * <p>By default, this will only allow applications that are known to respond to this intent correctly
* do so. The apps that are allowed to response can be set with {@link #setTargetApplications(List)}. * do so. The apps that are allowed to response can be set with {@link #setTargetApplications(List)}.
* For example, set to {@link #TARGET_BARCODE_SCANNER_ONLY} to only target the Barcode Scanner app itself.</p> * For example, set to {@link #TARGET_BARCODE_SCANNER_ONLY} to only target the Barcode Scanner app itself.</p>
@ -130,15 +130,15 @@ public class IntentIntegrator {
public static final Collection<String> DATA_MATRIX_TYPES = Collections.singleton("DATA_MATRIX"); public static final Collection<String> DATA_MATRIX_TYPES = Collections.singleton("DATA_MATRIX");
public static final Collection<String> ALL_CODE_TYPES = null; public static final Collection<String> ALL_CODE_TYPES = null;
public static final List<String> TARGET_BARCODE_SCANNER_ONLY = Collections.singletonList(BS_PACKAGE); public static final List<String> TARGET_BARCODE_SCANNER_ONLY = Collections.singletonList(BS_PACKAGE);
public static final List<String> TARGET_ALL_KNOWN = list( public static final List<String> TARGET_ALL_KNOWN = list(
BSPLUS_PACKAGE, // Barcode Scanner+ BSPLUS_PACKAGE, // Barcode Scanner+
BSPLUS_PACKAGE + ".simple", // Barcode Scanner+ Simple BSPLUS_PACKAGE + ".simple", // Barcode Scanner+ Simple
BS_PACKAGE // Barcode Scanner BS_PACKAGE // Barcode Scanner
// What else supports this intent? // What else supports this intent?
); );
private final Activity activity; private final Activity activity;
private final Fragment fragment; private final Fragment fragment;
@ -176,11 +176,11 @@ public class IntentIntegrator {
buttonNo = DEFAULT_NO; buttonNo = DEFAULT_NO;
targetApplications = TARGET_ALL_KNOWN; targetApplications = TARGET_ALL_KNOWN;
} }
public String getTitle() { public String getTitle() {
return title; return title;
} }
public void setTitle(String title) { public void setTitle(String title) {
this.title = title; this.title = title;
} }
@ -224,18 +224,18 @@ public class IntentIntegrator {
public void setButtonNoByID(int buttonNoID) { public void setButtonNoByID(int buttonNoID) {
buttonNo = activity.getString(buttonNoID); buttonNo = activity.getString(buttonNoID);
} }
public Collection<String> getTargetApplications() { public Collection<String> getTargetApplications() {
return targetApplications; return targetApplications;
} }
public final void setTargetApplications(List<String> targetApplications) { public final void setTargetApplications(List<String> targetApplications) {
if (targetApplications.isEmpty()) { if (targetApplications.isEmpty()) {
throw new IllegalArgumentException("No target applications"); throw new IllegalArgumentException("No target applications");
} }
this.targetApplications = targetApplications; this.targetApplications = targetApplications;
} }
public void setSingleTargetApplication(String targetApplication) { public void setSingleTargetApplication(String targetApplication) {
this.targetApplications = Collections.singletonList(targetApplication); this.targetApplications = Collections.singletonList(targetApplication);
} }
@ -257,7 +257,7 @@ public class IntentIntegrator {
public final AlertDialog initiateScan() { public final AlertDialog initiateScan() {
return initiateScan(ALL_CODE_TYPES, -1); return initiateScan(ALL_CODE_TYPES, -1);
} }
/** /**
* Initiates a scan for all known barcode types with the specified camera. * Initiates a scan for all known barcode types with the specified camera.
* *
@ -281,7 +281,7 @@ public class IntentIntegrator {
public final AlertDialog initiateScan(Collection<String> desiredBarcodeFormats) { public final AlertDialog initiateScan(Collection<String> desiredBarcodeFormats) {
return initiateScan(desiredBarcodeFormats, -1); return initiateScan(desiredBarcodeFormats, -1);
} }
/** /**
* Initiates a scan, using the specified camera, only for a certain set of barcode types, given as strings corresponding * Initiates a scan, using the specified camera, only for a certain set of barcode types, given as strings corresponding
* to their names in ZXing's {@code BarcodeFormat} class like "UPC_A". You can supply constants * to their names in ZXing's {@code BarcodeFormat} class like "UPC_A". You can supply constants
@ -342,7 +342,7 @@ public class IntentIntegrator {
fragment.startActivityForResult(intent, code); fragment.startActivityForResult(intent, code);
} }
} }
private String findTargetAppPackage(Intent intent) { private String findTargetAppPackage(Intent intent) {
PackageManager pm = activity.getPackageManager(); PackageManager pm = activity.getPackageManager();
List<ResolveInfo> availableApps = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); List<ResolveInfo> availableApps = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
@ -355,7 +355,7 @@ public class IntentIntegrator {
} }
return null; return null;
} }
private static boolean contains(Iterable<ResolveInfo> availableApps, String targetApp) { private static boolean contains(Iterable<ResolveInfo> availableApps, String targetApp) {
for (ResolveInfo availableApp : availableApps) { for (ResolveInfo availableApp : availableApps) {
String packageName = availableApp.activityInfo.packageName; String packageName = availableApp.activityInfo.packageName;
@ -475,7 +475,7 @@ public class IntentIntegrator {
} }
return null; return null;
} }
private static List<String> list(String... values) { private static List<String> list(String... values) {
return Collections.unmodifiableList(Arrays.asList(values)); return Collections.unmodifiableList(Arrays.asList(values));
} }

View File

@ -79,7 +79,7 @@ public final class IntentResult {
public String getErrorCorrectionLevel() { public String getErrorCorrectionLevel() {
return errorCorrectionLevel; return errorCorrectionLevel;
} }
@Override @Override
public String toString() { public String toString() {
int rawBytesLength = rawBytes == null ? 0 : rawBytes.length; int rawBytesLength = rawBytes == null ? 0 : rawBytes.length;