Have Picasso load images into memory at the size they will be displayed.
This commit is contained in:
parent
a7d5084e1f
commit
a4395ecd75
|
@ -56,5 +56,5 @@ dependencies {
|
||||||
compile 'de.hdodenhof:circleimageview:1.2.2'
|
compile 'de.hdodenhof:circleimageview:1.2.2'
|
||||||
|
|
||||||
// For loading huge screenshots from the disk.
|
// For loading huge screenshots from the disk.
|
||||||
compile "com.squareup.picasso:picasso:2.4.0"
|
compile 'com.squareup.picasso:picasso:2.5.2'
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,8 @@ public class GameAdapter extends RecyclerView.Adapter<GameViewHolder>
|
||||||
// Fill in the view contents.
|
// Fill in the view contents.
|
||||||
Picasso.with(holder.imageScreenshot.getContext())
|
Picasso.with(holder.imageScreenshot.getContext())
|
||||||
.load(game.getScreenPath())
|
.load(game.getScreenPath())
|
||||||
|
.fit()
|
||||||
|
.centerCrop()
|
||||||
.error(R.drawable.no_banner)
|
.error(R.drawable.no_banner)
|
||||||
.into(holder.imageScreenshot);
|
.into(holder.imageScreenshot);
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,8 @@ public class GameDetailsDialog extends DialogFragment
|
||||||
// Fill in the view contents.
|
// Fill in the view contents.
|
||||||
Picasso.with(imageGameScreen.getContext())
|
Picasso.with(imageGameScreen.getContext())
|
||||||
.load(getArguments().getString(ARGUMENT_GAME_SCREENSHOT_PATH))
|
.load(getArguments().getString(ARGUMENT_GAME_SCREENSHOT_PATH))
|
||||||
|
.fit()
|
||||||
|
.centerCrop()
|
||||||
.noFade()
|
.noFade()
|
||||||
.noPlaceholder()
|
.noPlaceholder()
|
||||||
.into(imageGameScreen);
|
.into(imageGameScreen);
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
android:id="@+id/image_game_screen"
|
android:id="@+id/image_game_screen"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:transitionName="image_game_screen"
|
android:transitionName="image_game_screen"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:src="@drawable/placeholder_screenshot"/>
|
tools:src="@drawable/placeholder_screenshot"/>
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:transitionName="image_game_screen"
|
android:transitionName="image_game_screen"
|
||||||
tools:src="@drawable/placeholder_screenshot"/>
|
tools:src="@drawable/placeholder_screenshot"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue