Use fitcenter to scale images

This commit is contained in:
Jimmy Shih
2013-08-20 11:32:15 -07:00
parent f29cf16e13
commit 7a8a95853e
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -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" />
</LinearLayout>
<TableLayout
android:layout_height="wrap_content"
@@ -31,7 +31,7 @@ limitations under the License.
android:id="@+id/marker_detail_waypoint_photo"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:scaleType="fitStart" />
android:scaleType="fitCenter" />
<TextView
android:id="@+id/marker_detail_waypoint_name"
style="@style/TextLarge.WithTopMargin" />
@@ -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