Misc changes suggested by lint/code inspection

git-svn-id: https://zxing.googlecode.com/svn/trunk@2130 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-01-21 13:05:42 +00:00
parent 26f06c0ed2
commit 27194b053a
11 changed files with 18 additions and 26 deletions

View file

@ -4,7 +4,7 @@
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p><b>Barcode Scanner</b> also understands how to read two dimensional barcodes, like <em>QR
<p><strong>Barcode Scanner</strong> also understands how to read two dimensional barcodes, like <em>QR
Codes</em> and <em>Data Matrix codes</em>.
For example, the codes below contain a hyperlink to the ZXing Project home page:</p>
<p style="text-align:center">

View file

@ -4,7 +4,7 @@
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p><b>Barcode Scanner</b> uses the camera on your phone to read barcodes and look up product
<p><strong>Barcode Scanner</strong> uses the camera on your phone to read barcodes and look up product
information such as prices and reviews.</p>
<p style="text-align:center"><img src="../images/scan-example.png" alt="Scan example"></p>
<p>It also reads <strong>2D barcodes</strong> such as <em>QR Codes</em> and <em>Data Matrix</em>.

View file

@ -9,7 +9,7 @@
<p style="text-align:center">
<img src="../images/demo-yes.png" alt="Yes"/>&nbsp;&nbsp;&nbsp;<img src="../images/demo-no.png" alt="No"/>
</p>
<p><b>IMPORTANT:</b> 1D barcodes like those found on products require a phone with autofocus.
<p><strong>IMPORTANT:</strong> 1D barcodes like those found on products require a phone with autofocus.
Without it, only QR Codes and Data Matrix codes will be scannable.</p>
<p>When a barcode is read, a beep sound will play and you'll see the results of the scan, a
description of what the barcode contains, and options to take action on the contents.</p>

View file

@ -4,7 +4,7 @@
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p>In addition to <a href="about2d.html">scanning 2D barcodes</a>, <b>Barcode Scanner</b> can also
<p>In addition to <a href="about2d.html">scanning 2D barcodes</a>, <strong>Barcode Scanner</strong> can also
generate a QR Code and display it on your screen. Then you can show it to a friend, and let them
scan the barcode with their phone:</p>
<p style="text-align:center"><img src="../images/scan-from-phone.png" alt="Scan from phone"></p>

View file

@ -4,7 +4,7 @@
<link rel="stylesheet" href="../style.css" type="text/css"/>
</head>
<body>
<p><b>New in version 4.0:</b></p>
<p><strong>New in version 4.0:</strong></p>
<ul>
<li>Rewrote the camera code to use newer functionality like using the front light.</li>
<li>Wrote a new history screen.</li>

View file

@ -31,7 +31,7 @@ import java.io.IOException;
/**
* Manages beeps and vibrations for {@link CaptureActivity}.
*/
public final class BeepManager {
final class BeepManager {
private static final String TAG = BeepManager.class.getSimpleName();

View file

@ -145,7 +145,7 @@ public final class LocaleManager {
private static String doGetTLD(Map<String,String> map, Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String countryOverride = prefs.getString(PreferencesActivity.KEY_SEARCH_COUNTRY, null);
if (countryOverride != null && countryOverride.length() > 0 && !countryOverride.equals("-")) {
if (countryOverride != null && countryOverride.length() > 0 && !"-".equals(countryOverride)) {
String tld = map.get(countryOverride);
if (tld != null) {
return tld;

View file

@ -141,10 +141,11 @@ public final class ViewfinderView extends View {
paint.setAlpha(CURRENT_POINT_OPACITY / 2);
paint.setColor(resultPointColor);
synchronized (currentLast) {
float radius = POINT_SIZE / 2.0f;
for (ResultPoint point : currentLast) {
canvas.drawCircle(frameLeft + (int) (point.getX() * scaleX),
frameTop + (int) (point.getY() * scaleY),
POINT_SIZE / 2, paint);
radius, paint);
}
}
}

View file

@ -45,6 +45,12 @@ public final class AddressBookResultHandler extends ResultHandler {
new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH),
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH),
};
private static final int[] BUTTON_TEXTS = {
R.string.button_add_contact,
R.string.button_show_map,
R.string.button_dial,
R.string.button_email,
};
private final boolean[] fields;
private int buttonCount;
@ -97,19 +103,7 @@ public final class AddressBookResultHandler extends ResultHandler {
@Override
public int getButtonText(int index) {
int action = mapIndexToAction(index);
switch (action) {
case 0:
return R.string.button_add_contact;
case 1:
return R.string.button_show_map;
case 2:
return R.string.button_dial;
case 3:
return R.string.button_email;
default:
throw new ArrayIndexOutOfBoundsException();
}
return BUTTON_TEXTS[mapIndexToAction(index)];
}
@Override

View file

@ -47,10 +47,7 @@ public final class WifiResultHandler extends ResultHandler {
@Override
public int getButtonText(int index) {
if (index == 0) {
return R.string.button_wifi;
}
throw new ArrayIndexOutOfBoundsException();
return R.string.button_wifi;
}
@Override

View file

@ -38,7 +38,7 @@ import com.google.zxing.client.android.history.HistoryManager;
* @author Kamil Kaczmarczyk
* @author Sean Owen
*/
public final class BookResultInfoRetriever extends SupplementalInfoRetriever {
final class BookResultInfoRetriever extends SupplementalInfoRetriever {
private final String isbn;
private final String source;