From a4395ecd75e52756bb3c6db9f991e8ab2305df35 Mon Sep 17 00:00:00 2001 From: Eder Bastos Date: Fri, 8 May 2015 19:54:56 -0400 Subject: [PATCH] Have Picasso load images into memory at the size they will be displayed. --- Source/Android/app/build.gradle | 2 +- .../java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java | 2 ++ .../org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java | 2 ++ Source/Android/app/src/main/res/layout/card_game.xml | 1 - Source/Android/app/src/main/res/layout/dialog_game_details.xml | 1 - 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle index 0fd64d013c..ae34d82377 100644 --- a/Source/Android/app/build.gradle +++ b/Source/Android/app/build.gradle @@ -56,5 +56,5 @@ dependencies { compile 'de.hdodenhof:circleimageview:1.2.2' // For loading huge screenshots from the disk. - compile "com.squareup.picasso:picasso:2.4.0" + compile 'com.squareup.picasso:picasso:2.5.2' } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index 30bc9daad6..d868ed46de 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -64,6 +64,8 @@ public class GameAdapter extends RecyclerView.Adapter // Fill in the view contents. Picasso.with(holder.imageScreenshot.getContext()) .load(game.getScreenPath()) + .fit() + .centerCrop() .error(R.drawable.no_banner) .into(holder.imageScreenshot); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java index 19c6621345..e22b30ea18 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java @@ -84,6 +84,8 @@ public class GameDetailsDialog extends DialogFragment // Fill in the view contents. Picasso.with(imageGameScreen.getContext()) .load(getArguments().getString(ARGUMENT_GAME_SCREENSHOT_PATH)) + .fit() + .centerCrop() .noFade() .noPlaceholder() .into(imageGameScreen); diff --git a/Source/Android/app/src/main/res/layout/card_game.xml b/Source/Android/app/src/main/res/layout/card_game.xml index a89e5bdb21..e0aa7f01f4 100644 --- a/Source/Android/app/src/main/res/layout/card_game.xml +++ b/Source/Android/app/src/main/res/layout/card_game.xml @@ -15,7 +15,6 @@ android:id="@+id/image_game_screen" android:layout_width="match_parent" android:layout_height="0dp" - android:scaleType="centerCrop" android:transitionName="image_game_screen" android:layout_weight="1" tools:src="@drawable/placeholder_screenshot"/> diff --git a/Source/Android/app/src/main/res/layout/dialog_game_details.xml b/Source/Android/app/src/main/res/layout/dialog_game_details.xml index 885dc91676..a135c99c86 100644 --- a/Source/Android/app/src/main/res/layout/dialog_game_details.xml +++ b/Source/Android/app/src/main/res/layout/dialog_game_details.xml @@ -31,7 +31,6 @@ android:layout_alignParentRight="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" - android:scaleType="centerCrop" android:transitionName="image_game_screen" tools:src="@drawable/placeholder_screenshot"/>