From 7a8a95853eac443cd21c31b09c2e3675d05d56bd Mon Sep 17 00:00:00 2001 From: Jimmy Shih Date: Tue, 20 Aug 2013 11:32:15 -0700 Subject: [PATCH] Use fitcenter to scale images --- MyTracks/res/layout/list_item.xml | 2 +- MyTracks/res/layout/marker_detail_fragment.xml | 2 +- .../google/android/apps/mytracks/util/ListItemUtils.java | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MyTracks/res/layout/list_item.xml b/MyTracks/res/layout/list_item.xml index a9d419c92..44037c377 100644 --- a/MyTracks/res/layout/list_item.xml +++ b/MyTracks/res/layout/list_item.xml @@ -73,7 +73,7 @@ limitations under the License. android:layout_marginLeft="8dp" android:layout_weight="1" android:layout_width="0dp" - android:scaleType="fitStart" /> + android:scaleType="fitCenter" /> + android:scaleType="fitCenter" /> diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/ListItemUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/ListItemUtils.java index d895f94fa..c4efb3ec1 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/util/ListItemUtils.java +++ b/MyTracks/src/com/google/android/apps/mytracks/util/ListItemUtils.java @@ -94,9 +94,10 @@ public class ListItemUtils { } else { photo.setVisibility(View.VISIBLE); Display defaultDisplay = activity.getWindowManager().getDefaultDisplay(); - // Set the initial width to 35% of the display width - int width = (int) (defaultDisplay.getWidth() * .35); - PhotoUtils.setImageVew(photo, Uri.parse(photoUrl), width, 0); + // Set the initial width to 33% of the display width. + int width = (int) (defaultDisplay.getWidth() * .33); + int height = 0; + PhotoUtils.setImageVew(photo, Uri.parse(photoUrl), width, height); } // Set date/time