<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
<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>
<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">
<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>
<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>
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;
<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>
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>
</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>
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"/>
<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>
<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>
<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>
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;
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;
private CaptureActivityHandler handler;
private ViewfinderView viewfinderView;
- private View statusView;
private View resultView;
private MediaPlayer mediaPlayer;
private Result lastResult;
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;
historyManager.trimHistory();
showHelpOnFirstLaunch();
+
+ Toast.makeText(this, R.string.msg_default_status, Toast.LENGTH_LONG).show();
}
@Override
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();
// 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);
// 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);
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;
}