[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809
dswitkin at google.com
dswitkin at google.com
Wed Aug 4 01:32:36 UTC 2010
The following commit has been merged in the upstream branch:
commit 4f18dbe27f591f6818e43396aea66393e87314a7
Author: dswitkin at google.com <dswitkin at google.com@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Tue Jul 20 22:43:38 2010 +0000
Final Barcode Scanner 3.4 changes:
- Cleaned up the sharing UI
- Removed a piece of black artwork
- Fixed the Froyo bug with the Help screen appearing blank
- Made external URLs in Help launch in the Browser
- Updated some help text
git-svn-id: http://zxing.googlecode.com/svn/trunk@1491 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index e7049ce..e746bb0 100755
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -20,8 +20,8 @@ version to be published. The next versionCode will be 7, regardless of whether t
versionName is 2.31, 2.4, or 3.0. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.android"
- android:versionName="3.4 beta 3"
- android:versionCode="57"
+ android:versionName="3.4"
+ android:versionCode="58"
android:installLocation="auto">
<!-- We require Cupcake (Android 1.5) or later, but are really targeting Donut. -->
<uses-sdk android:minSdkVersion="3"
diff --git a/android/assets/html/index.html b/android/assets/html/index.html
index 4ecfd0f..71aa3a8 100644
--- a/android/assets/html/index.html
+++ b/android/assets/html/index.html
@@ -14,7 +14,7 @@
<li><a href="scanning.html">How to scan</a></li>
<li><a href="about1d.html">About 1D barcodes</a></li>
<li><a href="about2d.html">About 2D barcodes</a></li>
- <li><a href="sharing.html">How to use QR Codes to share information</a></li>
+ <li><a href="sharing.html">How to create QR Codes</a></li>
</ul>
</body>
</html>
diff --git a/android/assets/html/sharing.html b/android/assets/html/sharing.html
index 085f242..fcbb6ba 100644
--- a/android/assets/html/sharing.html
+++ b/android/assets/html/sharing.html
@@ -1,7 +1,7 @@
<html>
<head>
-<title>How to share</title>
-<link rel="stylesheet" href="style.css" type="text/css"/>
+<title>How to create QR Codes</title>
+<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
@@ -9,7 +9,9 @@
scan the barcode with their phone:</p>
<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>
+ choose whether you want to share a contact, a bookmark, an application, or the contents of the
+ clipboard. A QR Code will be generated automatically. When you're done, press Back or Home.</p>
+<p>To generate QR Codes from your computer, try the
+ <a href="http://zxing.appspot.com/generator/">ZXing QR Code Generator</a>.</p>
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/android/assets/html/style.css b/android/assets/html/style.css
index 93f769a..3143e4d 100644
--- a/android/assets/html/style.css
+++ b/android/assets/html/style.css
@@ -2,7 +2,7 @@ body {
background-color: white;
color: black;
font-family: Arial sans-serif;
- font-size: 14pt;
+ font-size: 12pt;
}
ul.touchable li {
padding-top:8px;
diff --git a/android/assets/html/whatsnew.html b/android/assets/html/whatsnew.html
index a88c86f..ec2d458 100644
--- a/android/assets/html/whatsnew.html
+++ b/android/assets/html/whatsnew.html
@@ -6,12 +6,12 @@
<body>
<p><b>New in version 3.4:</b></p>
<ul>
- <li>Added suppport for WiFi base station creditials in QR Codes.</li>
+ <li>Added support for WiFi base station credentials in QR Codes. Use the
+ <a href="http://zxing.appspot.com/generator/">ZXing QR Code Generator</a> to make one.</li>
<li>Added Code 93 support.</li>
- <li>Added recognition of 5 digit UPC/EAN extensions.</li>
<li>Added bulk scan mode to the preferences.</li>
<li>Allowed the app to be moved to the SD card on Froyo devices.</li>
- <li>Fixed a problem where scanning would not work when resuming the app.</li>
+ <li>Fixed scanning not working when resuming the app.</li>
<li>Made Calendar event parsing more lenient.</li>
<li>Fixed crashes in the QR Encoder with missing data.</li>
<li>Updated the UI appearance a bit.</li>
diff --git a/android/res/drawable/launcher_icon_large.png b/android/res/drawable/launcher_icon_large.png
deleted file mode 100644
index 9497f22..0000000
Binary files a/android/res/drawable/launcher_icon_large.png and /dev/null differ
diff --git a/android/res/layout-land/share.xml b/android/res/layout-land/share.xml
index 7a458b0..1056315 100755
--- a/android/res/layout-land/share.xml
+++ b/android/res/layout-land/share.xml
@@ -25,64 +25,58 @@
<TextView
android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
+ android:layout_height="wrap_content"
android:textColor="@color/share_text"
android:textSize="18sp"
- android:text="@string/msg_share_explanation"/>
+ android:text="@string/msg_share_explanation"
+ android:paddingBottom="24dip"/>
<LinearLayout
android:layout_width="fill_parent"
- android:layout_height="0dip"
- android:layout_weight="2"
+ android:layout_height="wrap_content"
android:background="@color/share_view"
android:orientation="horizontal">
<ImageView
- android:layout_width="0dip"
- android:layout_height="fill_parent"
- android:layout_weight="2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:scaleType="center"
android:src="@drawable/share_via_barcode"
- android:paddingRight="32dip"/>
+ android:paddingRight="24dip"/>
<LinearLayout
android:layout_width="0dip"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
- <Button android:id="@+id/contact_button"
+ <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_contact"/>
+ android:layout_height="wrap_content"
+ android:text="@string/button_share_app"/>
- <Button android:id="@+id/bookmark_button"
+ <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_bookmark"/>
+ android:layout_height="wrap_content"
+ android:text="@string/button_share_contact"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dip"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
- <Button android:id="@+id/clipboard_button"
+ <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_clipboard"/>
+ android:layout_height="wrap_content"
+ android:text="@string/button_share_bookmark"/>
- <Button android:id="@+id/app_button"
+ <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_app"/>
+ android:layout_height="wrap_content"
+ android:text="@string/button_share_clipboard"/>
</LinearLayout>
diff --git a/android/res/layout-ldpi/capture.xml b/android/res/layout-ldpi/capture.xml
index 50b3193..821de2e 100755
--- a/android/res/layout-ldpi/capture.xml
+++ b/android/res/layout-ldpi/capture.xml
@@ -58,7 +58,7 @@
android:maxHeight="150dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
- android:scaleType="fitEnd"/>
+ android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"
diff --git a/android/res/layout/capture.xml b/android/res/layout/capture.xml
index ec5a343..f79813a 100755
--- a/android/res/layout/capture.xml
+++ b/android/res/layout/capture.xml
@@ -58,7 +58,7 @@
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
- android:scaleType="fitEnd"/>
+ android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"
diff --git a/android/res/layout/share.xml b/android/res/layout/share.xml
index 3c96dde..e199b44 100755
--- a/android/res/layout/share.xml
+++ b/android/res/layout/share.xml
@@ -26,15 +26,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:textColor="@color/share_text"
android:textSize="18sp"
- android:text="@string/msg_share_explanation"/>
+ android:text="@string/msg_share_explanation"
+ android:paddingBottom="24dip"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:scaleType="center"
android:src="@drawable/share_via_barcode"
android:paddingBottom="24dip"/>
@@ -42,19 +41,18 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:orientation="horizontal"
android:paddingBottom="8dip">
- <Button android:id="@+id/contact_button"
+ <Button android:id="@+id/app_button"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
- android:text="@string/button_share_contact"/>
+ android:text="@string/button_share_app"/>
<Button android:id="@+id/bookmark_button"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/button_share_bookmark"/>
@@ -63,20 +61,19 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
android:orientation="horizontal">
- <Button android:id="@+id/clipboard_button"
+ <Button android:id="@+id/contact_button"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
- android:text="@string/button_share_clipboard"/>
+ android:text="@string/button_share_contact"/>
- <Button android:id="@+id/app_button"
+ <Button android:id="@+id/clipboard_button"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
- android:text="@string/button_share_app"/>
+ android:text="@string/button_share_clipboard"/>
</LinearLayout>
diff --git a/android/src/com/google/zxing/client/android/CaptureActivity.java b/android/src/com/google/zxing/client/android/CaptureActivity.java
index 249fd84..687be89 100755
--- a/android/src/com/google/zxing/client/android/CaptureActivity.java
+++ b/android/src/com/google/zxing/client/android/CaptureActivity.java
@@ -37,6 +37,7 @@ import android.content.pm.PackageManager;
import android.content.res.AssetFileDescriptor;
import android.content.res.Configuration;
import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
@@ -524,11 +525,11 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
ImageView barcodeImageView = (ImageView) findViewById(R.id.barcode_image_view);
if (barcode == null) {
- barcodeImageView.setImageResource(R.drawable.launcher_icon_large);
+ barcodeImageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
+ R.drawable.launcher_icon));
} else {
barcodeImageView.setImageBitmap(barcode);
}
- barcodeImageView.setVisibility(View.VISIBLE);
TextView formatTextView = (TextView) findViewById(R.id.format_text_view);
formatTextView.setText(rawResult.getBarcodeFormat().toString());
diff --git a/android/src/com/google/zxing/client/android/HelpActivity.java b/android/src/com/google/zxing/client/android/HelpActivity.java
index ab0b5b2..f658d88 100644
--- a/android/src/com/google/zxing/client/android/HelpActivity.java
+++ b/android/src/com/google/zxing/client/android/HelpActivity.java
@@ -53,7 +53,9 @@ public final class HelpActivity extends Activity {
public static final String REQUESTED_PAGE_KEY = "requested_page_key";
public static final String DEFAULT_PAGE = "index.html";
public static final String WHATS_NEW_PAGE = "whatsnew.html";
+
private static final String BASE_URL = "file:///android_asset/html/";
+ private static final String WEBVIEW_STATE_PRESENT = "webview_state_present";
private static boolean initialized = false;
private WebView webView;
@@ -88,8 +90,11 @@ public final class HelpActivity extends Activity {
webView = (WebView)findViewById(R.id.help_contents);
webView.setWebViewClient(new HelpClient());
+ // Froyo has a bug with calling onCreate() twice in a row, which causes the What's New page
+ // that's auto-loaded on first run to appear blank. As a workaround we only call restoreState()
+ // if a valid URL was loaded at the time the previous activity was torn down.
Intent intent = getIntent();
- if (icicle != null) {
+ if (icicle != null && icicle.getBoolean(WEBVIEW_STATE_PRESENT, false)) {
webView.restoreState(icicle);
} else if (intent != null) {
String page = intent.getStringExtra(REQUESTED_PAGE_KEY);
@@ -132,7 +137,11 @@ public final class HelpActivity extends Activity {
@Override
protected void onSaveInstanceState(Bundle state) {
- webView.saveState(state);
+ String url = webView.getUrl();
+ if (url != null && url.length() > 0) {
+ webView.saveState(state);
+ state.putBoolean(WEBVIEW_STATE_PRESENT, true);
+ }
}
@Override
@@ -152,5 +161,17 @@ public final class HelpActivity extends Activity {
setTitle(view.getTitle());
backButton.setEnabled(view.canGoBack());
}
+
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ if (url.startsWith("file")) {
+ // Keep local assets in this WebView.
+ return false;
+ } else {
+ // Open external URLs in Browser.
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ return true;
+ }
+ }
}
}
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list