[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:00 UTC 2010
The following commit has been merged in the upstream branch:
commit 522c9cdbba5539c9b305babce134a76b693d0951
Author: srowen <srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Mon Jun 14 10:59:24 2010 +0000
Prettify scan result screen, I think
git-svn-id: http://zxing.googlecode.com/svn/trunk@1423 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/res/drawable/launcher_icon_large.png b/android/res/drawable/launcher_icon_large.png
new file mode 100644
index 0000000..9497f22
Binary files /dev/null and b/android/res/drawable/launcher_icon_large.png differ
diff --git a/android/res/layout-ldpi/capture.xml b/android/res/layout-ldpi/capture.xml
index 84ee1ef..56cf1cd 100755
--- a/android/res/layout-ldpi/capture.xml
+++ b/android/res/layout-ldpi/capture.xml
@@ -48,8 +48,8 @@
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="left|top">
+ android:layout_height="fill_parent"
+ android:gravity="right">
<ImageView android:id="@+id/barcode_image_view"
android:layout_width="160dip"
@@ -58,45 +58,85 @@
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
- android:scaleType="centerInside"/>
+ android:scaleType="fitEnd"/>
- <TextView android:id="@+id/format_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:text="@string/msg_default_format"
- android:textColor="@color/result_minor_text"
- android:textSize="14sp"/>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@+id/format_text_view_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msg_default_format"
+ android:textColor="@color/result_minor_text"
+ android:textStyle="bold"
+ android:textSize="14sp"
+ android:paddingRight="4dip"/>
+
+ <TextView android:id="@+id/format_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/result_minor_text"
+ android:textSize="14sp"/>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@+id/type_text_view_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msg_default_type"
+ android:textColor="@color/result_minor_text"
+ android:textStyle="bold"
+ android:textSize="14sp"
+ android:paddingRight="4dip"/>
+
+ <TextView android:id="@+id/type_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/result_minor_text"
+ android:textSize="14sp"/>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
- <TextView android:id="@+id/type_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:text="@string/msg_default_type"
- android:textColor="@color/result_minor_text"
- android:textSize="14sp"/>
+ <TextView android:id="@+id/time_text_view_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msg_default_time"
+ android:textColor="@color/result_minor_text"
+ android:textStyle="bold"
+ android:textSize="14sp"
+ android:paddingRight="4dip"/>
- <TextView android:id="@+id/time_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:text="@string/msg_default_time"
- android:textColor="@color/result_minor_text"
- android:textSize="14sp"/>
+ <TextView android:id="@+id/time_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/result_minor_text"
+ android:textSize="14sp"/>
+
+ </LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1">
+ android:layout_height="wrap_content">
<TextView android:id="@+id/contents_text_view"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="left|top"
- android:text="@string/msg_default_contents"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:textColor="@color/result_text"
+ android:textColorLink="@color/result_text"
android:textSize="22sp"
android:paddingLeft="12dip"
android:autoLink="web"/>
@@ -111,20 +151,28 @@
android:layout_height="wrap_content"
android:gravity="center">
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
</LinearLayout>
diff --git a/android/res/layout/capture.xml b/android/res/layout/capture.xml
index 84ee1ef..56cf1cd 100755
--- a/android/res/layout/capture.xml
+++ b/android/res/layout/capture.xml
@@ -48,8 +48,8 @@
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="left|top">
+ android:layout_height="fill_parent"
+ android:gravity="right">
<ImageView android:id="@+id/barcode_image_view"
android:layout_width="160dip"
@@ -58,45 +58,85 @@
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
- android:scaleType="centerInside"/>
+ android:scaleType="fitEnd"/>
- <TextView android:id="@+id/format_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:text="@string/msg_default_format"
- android:textColor="@color/result_minor_text"
- android:textSize="14sp"/>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@+id/format_text_view_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msg_default_format"
+ android:textColor="@color/result_minor_text"
+ android:textStyle="bold"
+ android:textSize="14sp"
+ android:paddingRight="4dip"/>
+
+ <TextView android:id="@+id/format_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/result_minor_text"
+ android:textSize="14sp"/>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@+id/type_text_view_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msg_default_type"
+ android:textColor="@color/result_minor_text"
+ android:textStyle="bold"
+ android:textSize="14sp"
+ android:paddingRight="4dip"/>
+
+ <TextView android:id="@+id/type_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/result_minor_text"
+ android:textSize="14sp"/>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
- <TextView android:id="@+id/type_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:text="@string/msg_default_type"
- android:textColor="@color/result_minor_text"
- android:textSize="14sp"/>
+ <TextView android:id="@+id/time_text_view_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msg_default_time"
+ android:textColor="@color/result_minor_text"
+ android:textStyle="bold"
+ android:textSize="14sp"
+ android:paddingRight="4dip"/>
- <TextView android:id="@+id/time_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left"
- android:text="@string/msg_default_time"
- android:textColor="@color/result_minor_text"
- android:textSize="14sp"/>
+ <TextView android:id="@+id/time_text_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/result_minor_text"
+ android:textSize="14sp"/>
+
+ </LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1">
+ android:layout_height="wrap_content">
<TextView android:id="@+id/contents_text_view"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:gravity="left|top"
- android:text="@string/msg_default_contents"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:textColor="@color/result_text"
+ android:textColorLink="@color/result_text"
android:textSize="22sp"
android:paddingLeft="12dip"
android:autoLink="web"/>
@@ -111,20 +151,28 @@
android:layout_height="wrap_content"
android:gravity="center">
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
- <Button android:layout_width="wrap_content"
+ <Button android:layout_width="0sp"
android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:textSize="14sp"
android:visibility="gone"/>
</LinearLayout>
diff --git a/android/src/com/google/zxing/client/android/CaptureActivity.java b/android/src/com/google/zxing/client/android/CaptureActivity.java
index d30f602..50f36f3 100755
--- a/android/src/com/google/zxing/client/android/CaptureActivity.java
+++ b/android/src/com/google/zxing/client/android/CaptureActivity.java
@@ -49,8 +49,6 @@ import android.os.Message;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.text.ClipboardManager;
-import android.text.SpannableStringBuilder;
-import android.text.style.UnderlineSpan;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
@@ -499,7 +497,7 @@ 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.zxing_icon);
+ barcodeImageView.setImageResource(R.drawable.launcher_icon_large);
} else {
barcodeImageView.setImageBitmap(barcode);
}
@@ -507,28 +505,22 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
TextView formatTextView = (TextView) findViewById(R.id.format_text_view);
formatTextView.setVisibility(View.VISIBLE);
- formatTextView.setText(getString(R.string.msg_default_format) + ": " +
- rawResult.getBarcodeFormat().toString());
+ formatTextView.setText(rawResult.getBarcodeFormat().toString());
ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);
TextView typeTextView = (TextView) findViewById(R.id.type_text_view);
typeTextView.setVisibility(View.VISIBLE);
- typeTextView.setText(getString(R.string.msg_default_type) + ": " +
- resultHandler.getType().toString());
+ typeTextView.setText(resultHandler.getType().toString());
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
String formattedTime = formatter.format(new Date(rawResult.getTimestamp()));
TextView timeTextView = (TextView) findViewById(R.id.time_text_view);
timeTextView.setVisibility(View.VISIBLE);
- timeTextView.setText(getString(R.string.msg_default_time) + ": " + formattedTime);
+ timeTextView.setText(formattedTime);
TextView contentsTextView = (TextView) findViewById(R.id.contents_text_view);
- CharSequence title = getString(resultHandler.getDisplayTitle());
- SpannableStringBuilder styled = new SpannableStringBuilder(title + "\n\n");
- styled.setSpan(new UnderlineSpan(), 0, title.length(), 0);
CharSequence displayContents = resultHandler.getDisplayContents();
- styled.append(displayContents);
- contentsTextView.setText(styled);
+ contentsTextView.setText(displayContents);
int buttonCount = resultHandler.getButtonCount();
ViewGroup buttonView = (ViewGroup) findViewById(R.id.result_button_view);
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list