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'
|
||||
|
||||
// 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.
|
||||
Picasso.with(holder.imageScreenshot.getContext())
|
||||
.load(game.getScreenPath())
|
||||
.fit()
|
||||
.centerCrop()
|
||||
.error(R.drawable.no_banner)
|
||||
.into(holder.imageScreenshot);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue