From 467d7eb9a74244755ed271a418604b3a8714c314 Mon Sep 17 00:00:00 2001 From: tokugawa Date: Mon, 10 Mar 2014 08:57:43 -0400 Subject: [PATCH] Minor formatting and code cleaning --- InClass3/res/layout/grid_schema.xml | 6 +++++- InClass3/res/values/dimens.xml | 5 ++++- InClass3/res/values/integers.xml | 2 -- InClass3/src/edu/uncc/itcs4180/hw4/PhotoActivity.java | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/InClass3/res/layout/grid_schema.xml b/InClass3/res/layout/grid_schema.xml index a8d4817..1b99a6a 100644 --- a/InClass3/res/layout/grid_schema.xml +++ b/InClass3/res/layout/grid_schema.xml @@ -8,12 +8,16 @@ android:id="@+id/imageView1" android:layout_width="@dimen/image_width" android:layout_height="@dimen/image_height" + android:layout_gravity="center" + android:padding="@dimen/image_padding" android:src="@drawable/ic_launcher" /> + android:ems="10" + android:gravity="center" + android:text="@string/download_error" /> diff --git a/InClass3/res/values/dimens.xml b/InClass3/res/values/dimens.xml index 2e0e2ae..e77ff50 100644 --- a/InClass3/res/values/dimens.xml +++ b/InClass3/res/values/dimens.xml @@ -2,6 +2,9 @@ 16dp - 16dp + 16dp + 5dp + 140dp + 140dp diff --git a/InClass3/res/values/integers.xml b/InClass3/res/values/integers.xml index de02f0e..7721714 100644 --- a/InClass3/res/values/integers.xml +++ b/InClass3/res/values/integers.xml @@ -1,6 +1,4 @@ 2 - 140dp - 140dp diff --git a/InClass3/src/edu/uncc/itcs4180/hw4/PhotoActivity.java b/InClass3/src/edu/uncc/itcs4180/hw4/PhotoActivity.java index 754bbf5..bddd650 100644 --- a/InClass3/src/edu/uncc/itcs4180/hw4/PhotoActivity.java +++ b/InClass3/src/edu/uncc/itcs4180/hw4/PhotoActivity.java @@ -38,6 +38,7 @@ public class PhotoActivity extends Activity { }; int[] imageNames = {R.string.uncc, R.string.sports, R.string.ifest, R.string.commencement}; ArrayList bitmapList = new ArrayList(); + ArrayList bitmapNames = new ArrayList(); int downloadProgress; @Override @@ -101,6 +102,7 @@ public class PhotoActivity extends Activity { { //already a default picture included in grid_schema.xml, so no need to set a blank pic bitmapList.add(result); + bitmapNames.add(getString(imageNames[downloadProgress])); downloadProgress++; if(downloadProgress>=imageUrlIds.length) @@ -164,7 +166,7 @@ public class PhotoActivity extends Activity { if(bitmapList.get(position)!=null) { holder.imageView.setImageBitmap(bitmapList.get(position)); - holder.textView.setText(getString(imageNames[position])); + holder.textView.setText(bitmapNames.get(position)); } return vi;