Misc improvements: bigger scanner on tablets, anti-aliased drawing, escape HTML in product results, ITF-14 allows 48 digits

git-svn-id: https://zxing.googlecode.com/svn/trunk@1903 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-09-10 20:30:01 +00:00
parent 7829686a8a
commit c3a5dcce06
4 changed files with 13 additions and 5 deletions

View file

@ -60,7 +60,7 @@ public final class ViewfinderView extends View {
super(context, attrs);
// Initialize these once for performance rather than calling them every time in onDraw().
paint = new Paint();
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
Resources resources = getResources();
maskColor = resources.getColor(R.color.viewfinder_mask);
resultColor = resources.getColor(R.color.result_view);

View file

@ -45,8 +45,8 @@ public final class CameraManager {
private static final int MIN_FRAME_WIDTH = 240;
private static final int MIN_FRAME_HEIGHT = 240;
private static final int MAX_FRAME_WIDTH = 480;
private static final int MAX_FRAME_HEIGHT = 360;
private static final int MAX_FRAME_WIDTH = 600;
private static final int MAX_FRAME_HEIGHT = 400;
private static CameraManager cameraManager;

View file

@ -18,6 +18,7 @@ package com.google.zxing.client.android.result.supplement;
import android.content.Context;
import android.os.Handler;
import android.text.Html;
import android.widget.TextView;
import com.google.zxing.client.android.R;
import com.google.zxing.client.android.history.HistoryManager;
@ -59,8 +60,15 @@ final class ProductResultInfoRetriever extends SupplementalInfoRetriever {
Matcher matcher = PRODUCT_NAME_PRICE_PATTERN.matcher(content);
if (matcher.find()) {
append(productID, source, new String[] { matcher.group(1), matcher.group(2) }, uri);
append(productID,
source,
new String[] { unescapeHTML(matcher.group(1)), unescapeHTML(matcher.group(2)) },
uri);
}
}
private static String unescapeHTML(String raw) {
return Html.fromHtml(raw).toString();
}
}

View file

@ -50,7 +50,7 @@ public final class ITFReader extends OneDReader {
private static final int W = 3; // Pixel width of a wide line
private static final int N = 1; // Pixed width of a narrow line
private static final int[] DEFAULT_ALLOWED_LENGTHS = { 44, 24, 20, 18, 16, 14, 12, 10, 8, 6 };
private static final int[] DEFAULT_ALLOWED_LENGTHS = { 48, 44, 24, 20, 18, 16, 14, 12, 10, 8, 6 };
// Stores the actual narrow line width of the image being decoded.
private int narrowLineWidth = -1;