[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809
srowen
srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:03 UTC 2010
The following commit has been merged in the upstream branch:
commit fa9bfee1b50468fdced440e323c6ffe7cb53b12e
Author: srowen <srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Tue Jun 15 13:04:18 2010 +0000
Rest of cosmetic changes -- simpler, black theme with easier-to-touch buttons and consistent sizing, icons
git-svn-id: http://zxing.googlecode.com/svn/trunk@1426 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/assets/html/about1d.html b/android/assets/html/about1d.html
index 992f3ba..a733fca 100644
--- a/android/assets/html/about1d.html
+++ b/android/assets/html/about1d.html
@@ -1,11 +1,13 @@
<html>
+<head>
<title>About 1D barcodes</title>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+</head>
<body>
-<link rel="StyleSheet" href="style.css" type="text/css">
<p>Traditional barcodes, such as those printed on product packaging, are also known as <em>one
dimensional barcodes</em>. There are several types commonly used, including UPC and EAN. Most look
similar to this:</p>
-<center><p><img src="../images/big-1d.png"></p></center>
+<p style="text-align:center"><img src="../images/big-1d.png"></p>
<p>These 1D barcodes contain a unique code which typically describes a product, like a CD or a book.
You can look this code up on the internet to find prices, reviews, and more.</p>
<p>If you scan a book, you can also search the contents of the book for a word or phrase, and find
diff --git a/android/assets/html/about2d.html b/android/assets/html/about2d.html
index 59133d5..224234f 100644
--- a/android/assets/html/about2d.html
+++ b/android/assets/html/about2d.html
@@ -1,13 +1,15 @@
<html>
+<head>
<title>About 2D barcodes</title>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+</head>
<body>
-<link rel="StyleSheet" href="style.css" type="text/css">
<p><b>Barcode Scanner</b> also understands how to read two dimensional barcodes, called <em>QR
Codes</em>. For example, the QR Code below contains a hyperlink to the ZXing Project home page:</p>
-<center><p><img src="../images/big-qr.png"></p></center>
+<p style="text-align:center"><img src="../images/big-qr.png" alt="QR code"></p>
<p>You can also represent contact information in a QR Code, and put it on a business card or web
site. When you scan it, the results screen provides a choice of actions:</p>
-<center><p><img src="../images/contact-results-screen.jpg"></p></center>
+<p style="text-align:center"><img src="../images/contact-results-screen.jpg" alt="Contact results screen"></p>
<p>Besides URLs and contact info, QR Codes can also contain:</p>
<ul>
<li>Calendar events, which you can add to your Calendar</li>
diff --git a/android/assets/html/index.html b/android/assets/html/index.html
index d301a07..4ecfd0f 100644
--- a/android/assets/html/index.html
+++ b/android/assets/html/index.html
@@ -1,10 +1,12 @@
<html>
+<head>
<title>Barcode Scanner Help</title>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+</head>
<body>
-<link rel="StyleSheet" href="style.css" type="text/css">
<p><b>Barcode Scanner</b> uses the camera on your phone to read barcodes and look up product
information such as prices and reviews.</p>
-<center><p><img src="../images/scan-example.png"></p></center>
+<p style="text-align:center"><img src="../images/scan-example.png" alt="Scan example"></p>
<p>It also reads <strong>2D barcodes</strong>, called <em>QR Codes</em>, which can contain links to
web sites, contact information such as phone numbers and email addresses, map locations and more.</p>
<ul class="touchable">
diff --git a/android/assets/html/scanning.html b/android/assets/html/scanning.html
index db51779..1f6a549 100644
--- a/android/assets/html/scanning.html
+++ b/android/assets/html/scanning.html
@@ -1,19 +1,21 @@
<html>
+<head>
<title>How to scan</title>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+</head>
<body>
-<link rel="StyleSheet" href="style.css" type="text/css">
<p>Barcode Scanner continuously scans a square region shown on your screen — just line up the
phone so the barcode is completely inside the viewfinder rectangle:</p>
-<center><p>
- <img src="../images/demo-yes.png"> <img src="../images/demo-no.png">
-</p></center>
+<p style="text-align:center">
+ <img src="../images/demo-yes.png" alt="Yes"/> <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.
Without it, only QR 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>
<p>If you're having trouble scanning, make sure to hold the phone steady. If the camera is unable to
focus, try moving the phone further or closer from the barcode.</p>
-<ul>
+<ul class="touchable">
<li><a href="about1d.html">About 1D barcodes</a></li>
<li><a href="about2d.html">About 2D barcodes</a></li>
</ul>
diff --git a/android/assets/html/sharing.html b/android/assets/html/sharing.html
index e90bb96..085f242 100644
--- a/android/assets/html/sharing.html
+++ b/android/assets/html/sharing.html
@@ -1,11 +1,13 @@
<html>
+<head>
<title>How to share</title>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+</head>
<body>
-<link rel="StyleSheet" href="style.css" type="text/css">
<p>In addition to <a href="about2d.html">scanning 2D barcodes</a>, <b>Barcode Scanner</b> 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>
-<center><p><img src="../images/scan-from-phone.png"></p></center>
+<center><p><img src="../images/scan-from-phone.png" alt="Scan from phone"></p></center>
<p>To use this feature, press the Menu button from the main scanning screen, and tap Share. Then
choose whether you want to share a contact, a bookmark, or the contents of the clipboard. A QR
Code will be generated automatically. When you're done, press Back or Home.</p>
diff --git a/android/assets/html/style.css b/android/assets/html/style.css
index 6b65f70..4a0e7a5 100644
--- a/android/assets/html/style.css
+++ b/android/assets/html/style.css
@@ -1,8 +1,11 @@
body {
- background-color: white;
- color: black;
- font-family: arial;
- font-size: 16;
+ background-color: black;
+ color: white;
+ font-family: Arial sans-serif;
+ font-size: 14pt;
+}
+a:link, a:visited, a:active {
+ color: white;
}
ul.touchable li {
padding-top:8px;
diff --git a/android/assets/html/whatsnew.html b/android/assets/html/whatsnew.html
index 994b1f2..52b1caf 100644
--- a/android/assets/html/whatsnew.html
+++ b/android/assets/html/whatsnew.html
@@ -1,7 +1,9 @@
<html>
+<head>
<title>What's new in this version</title>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+</head>
<body>
-<link rel="StyleSheet" href="style.css" type="text/css">
<p><b>New in version 3.31:</b></p>
<ul>
<li>Fixed a bug which caused some devices not to scan from time to time.</li>
diff --git a/android/assets/images/contact-results-screen.jpg b/android/assets/images/contact-results-screen.jpg
index 5c31f5b..3b2fa9d 100644
Binary files a/android/assets/images/contact-results-screen.jpg and b/android/assets/images/contact-results-screen.jpg differ
diff --git a/android/res/drawable/zxing_icon.png b/android/res/drawable/zxing_icon.png
deleted file mode 100755
index ee33194..0000000
Binary files a/android/res/drawable/zxing_icon.png and /dev/null differ
diff --git a/android/res/layout-land/share.xml b/android/res/layout-land/share.xml
index 5056498..5aefb29 100755
--- a/android/res/layout-land/share.xml
+++ b/android/res/layout-land/share.xml
@@ -18,70 +18,73 @@
android:id="@+id/encode_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
+ android:gravity="center"
android:background="@color/share_view"
android:orientation="vertical"
android:padding="16dip">
<TextView
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="left"
+ android:layout_height="0dip"
+ android:layout_weight="1"
android:textColor="@color/share_text"
- android:textSize="14sp"
- android:text="@string/msg_share_explanation"
- android:paddingBottom="32dip"/>
+ android:textSize="22sp"
+ android:text="@string/msg_share_explanation"/>
<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_height="0dip"
+ android:layout_weight="2"
android:background="@color/share_view"
- android:orientation="horizontal"
- android:layout_gravity="center">
+ android:orientation="horizontal">
<ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="0dip"
+ android:layout_height="fill_parent"
+ android:layout_weight="3"
android:scaleType="center"
android:src="@drawable/share_via_barcode"
android:paddingRight="32dip"/>
- <TableLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
- <TableRow>
-
- <Button android:id="@+id/contact_button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/button_share_contact"
- android:minWidth="90dip"/>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
- <Button android:id="@+id/bookmark_button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/button_share_bookmark"
- android:minWidth="90dip"/>
+ <Button android:id="@+id/contact_button"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/button_share_contact"/>
- </TableRow>
+ <Button android:id="@+id/bookmark_button"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/button_share_bookmark"/>
- <TableRow>
+ </LinearLayout>
- <Button android:id="@+id/clipboard_button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/button_share_clipboard"
- android:minWidth="90dip"/>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
- <Button android:id="@+id/app_button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/button_share_app"
- android:minWidth="90dip"/>
+ <Button android:id="@+id/clipboard_button"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/button_share_clipboard"/>
- </TableRow>
+ <Button android:id="@+id/app_button"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/button_share_app"/>
- </TableLayout>
+ </LinearLayout>
</LinearLayout>
diff --git a/android/res/layout/capture.xml b/android/res/layout/capture.xml
index 56cf1cd..90818ae 100755
--- a/android/res/layout/capture.xml
+++ b/android/res/layout/capture.xml
@@ -179,38 +179,4 @@
</LinearLayout>
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@color/transparent">
-
- <FrameLayout
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_weight="1"
- android:background="@color/transparent"/>
-
- <LinearLayout android:id="@+id/status_view"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:background="@color/status_view"
- android:baselineAligned="false"
- android:padding="4dip">
-
- <TextView android:id="@+id/status_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left|center_vertical"
- android:layout_weight="1"
- android:text="@string/msg_default_status"
- android:textColor="@color/status_text"
- android.textSize="14sp"/>
-
- </LinearLayout>
-
- </LinearLayout>
-
</FrameLayout>
diff --git a/android/res/layout/share.xml b/android/res/layout/share.xml
index 86aae4f..27ddc42 100755
--- a/android/res/layout/share.xml
+++ b/android/res/layout/share.xml
@@ -18,23 +18,23 @@
android:id="@+id/encode_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
+ android:gravity="center"
android:background="@color/share_view"
android:orientation="vertical"
android:padding="16dip">
<TextView
- android:layout_width="fill_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="left"
+ android:layout_weight="1"
android:textColor="@color/share_text"
- android:textSize="14sp"
- android:text="@string/msg_share_explanation"
- android:paddingBottom="24dip"/>
+ android:textSize="22sp"
+ android:text="@string/msg_share_explanation"/>
<ImageView
- android:layout_width="fill_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center"
+ android:layout_weight="1"
android:scaleType="center"
android:src="@drawable/share_via_barcode"
android:paddingBottom="24dip"/>
@@ -42,23 +42,20 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_weight="0"
- android:layout_gravity="center"
+ android:layout_weight="1"
android:orientation="horizontal"
- android:gravity="center"
- android:weightSum="1"
android:paddingBottom="8dip">
<Button android:id="@+id/contact_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="0.4"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
android:text="@string/button_share_contact"/>
<Button android:id="@+id/bookmark_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="0.4"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
android:text="@string/button_share_bookmark"/>
</LinearLayout>
@@ -66,21 +63,19 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_weight="0"
- android:orientation="horizontal"
- android:gravity="center"
- android:weightSum="1">
+ android:layout_weight="1"
+ android:orientation="horizontal">
<Button android:id="@+id/clipboard_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="0.4"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
android:text="@string/button_share_clipboard"/>
<Button android:id="@+id/app_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="0.4"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
android:text="@string/button_share_app"/>
</LinearLayout>
diff --git a/android/res/values/colors.xml b/android/res/values/colors.xml
index 1872d5b..91279b6 100755
--- a/android/res/values/colors.xml
+++ b/android/res/values/colors.xml
@@ -31,8 +31,8 @@
<color name="sbc_layout_view">#ffffffff</color>
<color name="sbc_page_number_text">#ff000000</color>
<color name="sbc_snippet_text">#ff4b4b4b</color>
- <color name="share_text">#ff000000</color>
- <color name="share_view">#ffffffff</color>
+ <color name="share_text">#ffffffff</color>
+ <color name="share_view">#ff000000</color>
<color name="status_view">#50000000</color>
<color name="status_text">#ffffffff</color>
<color name="transparent">#00000000</color>
diff --git a/android/src/com/google/zxing/client/android/CaptureActivity.java b/android/src/com/google/zxing/client/android/CaptureActivity.java
index 94c5463..2154a88 100755
--- a/android/src/com/google/zxing/client/android/CaptureActivity.java
+++ b/android/src/com/google/zxing/client/android/CaptureActivity.java
@@ -17,6 +17,7 @@
package com.google.zxing.client.android;
import android.util.TypedValue;
+import android.widget.Toast;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.google.zxing.ResultPoint;
@@ -51,7 +52,6 @@ import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.text.ClipboardManager;
import android.util.Log;
-import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
@@ -136,7 +136,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
private CaptureActivityHandler handler;
private ViewfinderView viewfinderView;
- private View statusView;
private View resultView;
private MediaPlayer mediaPlayer;
private Result lastResult;
@@ -182,7 +181,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
CameraManager.init(getApplication());
viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
resultView = findViewById(R.id.result_view);
- statusView = findViewById(R.id.status_view);
handler = null;
lastResult = null;
hasSurface = false;
@@ -190,6 +188,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
historyManager.trimHistory();
showHelpOnFirstLaunch();
+
+ Toast.makeText(this, R.string.msg_default_status, Toast.LENGTH_LONG).show();
}
@Override
@@ -395,7 +395,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(R.string.title_about) + versionName);
builder.setMessage(getString(R.string.msg_about) + "\n\n" + getString(R.string.zxing_url));
- builder.setIcon(R.drawable.zxing_icon);
+ builder.setIcon(R.drawable.launcher_icon);
builder.setPositiveButton(R.string.button_open_browser, aboutListener);
builder.setNegativeButton(R.string.button_cancel, null);
builder.show();
@@ -492,7 +492,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
// Put up our own UI for how to handle the decoded contents.
private void handleDecodeInternally(Result rawResult, Bitmap barcode) {
- statusView.setVisibility(View.GONE);
viewfinderView.setVisibility(View.GONE);
resultView.setVisibility(View.VISIBLE);
@@ -554,12 +553,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
// barcode was found (e.g. contact info) rather than the full contents, which they won't
// have time to read.
ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);
- TextView textView = (TextView) findViewById(R.id.status_text_view);
- textView.setGravity(Gravity.CENTER);
- textView.setTextSize(18.0f);
- textView.setText(getString(resultHandler.getDisplayTitle()));
-
- statusView.setBackgroundColor(getResources().getColor(R.color.transparent));
+ Toast.makeText(this, resultHandler.getDisplayTitle(), Toast.LENGTH_SHORT).show();
if (copyToClipboard) {
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
@@ -693,14 +687,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
private void resetStatusView() {
resultView.setVisibility(View.GONE);
- statusView.setVisibility(View.VISIBLE);
- statusView.setBackgroundColor(getResources().getColor(R.color.status_view));
viewfinderView.setVisibility(View.VISIBLE);
-
- TextView textView = (TextView) findViewById(R.id.status_text_view);
- textView.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
- textView.setTextSize(14.0f);
- textView.setText(R.string.msg_default_status);
lastResult = null;
}
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list