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"
<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>
<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
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>
background-color: white;
color: black;
font-family: Arial sans-serif;
- font-size: 14pt;
+ font-size: 12pt;
}
ul.touchable li {
padding-top:8px;
<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>
<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>
android:maxHeight="150dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
- android:scaleType="fitEnd"/>
+ android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
- android:scaleType="fitEnd"/>
+ android:scaleType="centerInside"/>
<LinearLayout
android:orientation="horizontal"
<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"/>
<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"/>
<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>
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;
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());
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;
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);
@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
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;
+ }
+ }
}
}