[Android] Change the Game List items to be formatted similarly to how the folder browser is. Also ensure the 'no banner' icon scales down to the same size as the other banners.

This commit is contained in:
Lioncash committed 2013-08-17 13:25:40 -04:00
1 parent 1f6c63f1d8
commit a9d634086c
3 files changed
+50 -33

No files matched your search

+43 -32
View File
@@ -1,43 +1,54 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight"
android:orientation="vertical" > android:padding="3dp" >
<LinearLayout <ImageView
android:layout_width="match_parent" android:id="@+id/GameItemIcon"
android:layout_height="wrap_content" > android:layout_width="wrap_content"
android:layout_height="fill_parent"
<ImageView android:layout_alignParentTop="true"
android:id="@+id/GameItemIcon" android:layout_alignParentBottom="true"
android:layout_width="96dp" android:layout_marginRight="6dip" />
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView <TextView
android:id="@+id/GameItemTitle" android:id="@+id/GameItemSubText"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="26dip"
android:layout_marginLeft="5dip"
android:layout_marginTop="5dip"
android:singleLine="true"
android:text="@+id/TextView01"
android:textStyle="bold" />
<TextView android:layout_toRightOf="@id/GameItemIcon"
android:id="@+id/GameItemSubText" android:layout_alignParentBottom="true"
android:layout_width="wrap_content" android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:text="@+id/TextView02" />
</LinearLayout> android:singleLine="true"
android:ellipsize="marquee"/>
</LinearLayout> <TextView
android:id="@+id/GameItemTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
</LinearLayout> android:layout_toRightOf="@id/GameItemIcon"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_above="@id/GameItemSubText"
android:layout_alignWithParentIfMissing="true"
android:gravity="center_vertical"
android:textStyle="bold" />
<ImageView
android:src="@android:drawable/divider_horizontal_dark"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="2dp"
android:paddingTop="2dp" />
</RelativeLayout>
@@ -36,7 +36,7 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
if (v == null) if (v == null)
{ {
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null); v = vi.inflate(id, parent, false);
} }
final GameListItem item = items.get(position); final GameListItem item = items.get(position);
@@ -31,8 +31,14 @@ public final class GameListItem implements Comparable<GameListItem>
{ {
try try
{ {
// Open the no banner icon.
InputStream noBannerPath = ctx.getAssets().open("NoBanner.png"); InputStream noBannerPath = ctx.getAssets().open("NoBanner.png");
// Decode the bitmap.
image = BitmapFactory.decodeStream(noBannerPath); image = BitmapFactory.decodeStream(noBannerPath);
// Scale the bitmap to match other banners.
image = Bitmap.createScaledBitmap(image, 96, 32, false);
} }
catch (IOException e) catch (IOException e)
{ {