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: https://zxing.googlecode.com/svn/trunk@1491 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin@google.com 2010-07-20 22:43:38 +00:00
parent f53c7573db
commit e95e16698a
12 changed files with 76 additions and 61 deletions

View file

@ -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"

View file

@ -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>

View file

@ -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>
</html>

View file

@ -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;

View file

@ -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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

View file

@ -25,65 +25,59 @@
<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/app_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button_share_app"/>
<Button android:id="@+id/contact_button"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/button_share_contact"/>
<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"/>
</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/bookmark_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button_share_bookmark"/>
<Button android:id="@+id/clipboard_button"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/button_share_clipboard"/>
<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"/>
</LinearLayout>
</LinearLayout>

View file

@ -58,7 +58,7 @@
android:maxHeight="150dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
android:scaleType="fitEnd"/>
android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"

View file

@ -58,7 +58,7 @@
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
android:scaleType="fitEnd"/>
android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"

View file

@ -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,21 +61,20 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<Button android:id="@+id/contact_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/button_share_contact"/>
<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_clipboard"/>
<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"/>
</LinearLayout>
</LinearLayout>

View file

@ -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());

View file

@ -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;
}
}
}
}