Ditch ugly "unknown" icon for standard project icon; tighten up barcode image view settings a little, I believe, by putting them in capture.xml and in dip units

git-svn-id: https://zxing.googlecode.com/svn/trunk@1265 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2010-03-30 18:33:11 +00:00
parent cb247250ac
commit 02a8b98862
4 changed files with 10 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

View file

@ -54,6 +54,8 @@
<ImageView android:id="@+id/barcode_image_view"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:maxWidth="160dip"
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
android:scaleType="centerInside"/>

View file

@ -52,8 +52,10 @@
android:gravity="left|top">
<ImageView android:id="@+id/barcode_image_view"
android:layout_width="wrap_content"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:maxWidth="160dip"
android:maxHeight="160dip"
android:layout_marginBottom="4dip"
android:adjustViewBounds="true"
android:scaleType="centerInside"/>

View file

@ -38,7 +38,6 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
@ -88,7 +87,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
private static final int HELP_ID = Menu.FIRST + 3;
private static final int ABOUT_ID = Menu.FIRST + 4;
private static final int MAX_RESULT_IMAGE_SIZE = 150;
private static final long INTENT_RESULT_DURATION = 1500L;
private static final float BEEP_VOLUME = 0.10f;
private static final long VIBRATE_DURATION = 200L;
@ -460,14 +458,13 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
viewfinderView.setVisibility(View.GONE);
resultView.setVisibility(View.VISIBLE);
if (barcode == null) {
barcode = ((BitmapDrawable) getResources().getDrawable(R.drawable.unknown_barcode)).getBitmap();
}
ImageView barcodeImageView = (ImageView) findViewById(R.id.barcode_image_view);
if (barcode == null) {
barcodeImageView.setImageResource(R.drawable.zxing_icon);
} else {
barcodeImageView.setImageBitmap(barcode);
}
barcodeImageView.setVisibility(View.VISIBLE);
barcodeImageView.setMaxWidth(MAX_RESULT_IMAGE_SIZE);
barcodeImageView.setMaxHeight(MAX_RESULT_IMAGE_SIZE);
barcodeImageView.setImageBitmap(barcode);
TextView formatTextView = (TextView) findViewById(R.id.format_text_view);
formatTextView.setVisibility(View.VISIBLE);