Prettify scan result screen, I think
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 14 Jun 2010 10:59:24 +0000 (10:59 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 14 Jun 2010 10:59:24 +0000 (10:59 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1423 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/res/drawable/launcher_icon_large.png [new file with mode: 0644]
android/res/layout-ldpi/capture.xml
android/res/layout/capture.xml
android/src/com/google/zxing/client/android/CaptureActivity.java

diff --git a/android/res/drawable/launcher_icon_large.png b/android/res/drawable/launcher_icon_large.png
new file mode 100644 (file)
index 0000000..9497f22
Binary files /dev/null and b/android/res/drawable/launcher_icon_large.png differ
index 84ee1ef..56cf1cd 100755 (executable)
@@ -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"
                    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"/>
                   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>
index 84ee1ef..56cf1cd 100755 (executable)
@@ -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"
                    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"/>
                   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>
index d30f602..50f36f3 100755 (executable)
@@ -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);