mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
7829686a8a
commit
c3a5dcce06
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue