Fix banner scaling in game list.
-In GameListAdapter.java, the existing scaling code is unnecessary and stops Android's built in scaling from doing its job. -In gamelist...etc.xml, set the icon's width to 100 density-independent pixels (i.e. have android figure out how to make it the right size.)
This commit is contained in:
parent
fbca397c92
commit
b940e69f3b
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ListItemIcon"
|
android:id="@+id/ListItemIcon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="100dp"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
tools:src="@drawable/ic_launcher"
|
tools:src="@drawable/ic_launcher"
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,6 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
|
||||||
if (icon != null)
|
if (icon != null)
|
||||||
{
|
{
|
||||||
icon.setImageBitmap(item.getImage());
|
icon.setImageBitmap(item.getImage());
|
||||||
icon.getLayoutParams().width = (int) ((860 / context.getResources().getDisplayMetrics().density) + 0.5);
|
|
||||||
icon.getLayoutParams().height = (int)((340 / context.getResources().getDisplayMetrics().density) + 0.5);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue