summaryrefslogtreecommitdiff
path: root/Source/Android/src
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Android/src')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java17
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java20
2 files changed, 17 insertions, 20 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java
index 30796593ca..aabd4f2bc3 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListAdapter.java
@@ -7,6 +7,7 @@
package org.dolphinemu.dolphinemu.gamelist;
import android.content.Context;
+import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -75,7 +76,21 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
{
holder.title.setText(item.getName());
holder.subtitle.setText(item.getData());
- holder.icon.setImageBitmap(item.getImage());
+
+ Bitmap icon = item.getImage();
+
+ if (icon != null)
+ {
+ holder.icon.setImageBitmap(item.getImage());
+ }
+ else
+ {
+ holder.icon.setImageResource(R.drawable.no_banner);
+ }
+
+ String subtitle = String.format(context.getString(R.string.file_size_gib), item.getFilesize());
+
+ holder.subtitle.setText(subtitle);
}
// Make every other game in the list grey
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java
index 1b72da7b9b..b804337781 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListItem.java
@@ -45,25 +45,7 @@ public final class GameListItem implements Comparable<GameListItem>
if (!file.isDirectory() && !path.isEmpty())
{
int[] Banner = NativeLibrary.GetBanner(path);
- if (Banner[0] == 0)
- {
- try
- {
- // Open the no banner icon.
- InputStream noBannerPath = ctx.getAssets().open("NoBanner.png");
-
- // Decode the bitmap.
- image = BitmapFactory.decodeStream(noBannerPath);
-
- // Scale the bitmap to match other banners.
- image = Bitmap.createScaledBitmap(image, 96, 32, false);
- }
- catch (IOException e)
- {
- Log.e("GameListItem", e.toString());
- }
- }
- else
+ if (Banner[0] != 0)
{
image = Bitmap.createBitmap(Banner, 96, 32, Bitmap.Config.ARGB_8888);
}