Android: Update Picasso lib to latest version

This commit is contained in:
mahdihijazi 2018-10-27 16:05:09 +02:00
parent 0140009114
commit 1da69811b8
3 changed files with 10 additions and 10 deletions

View File

@ -96,7 +96,7 @@ dependencies {
implementation 'de.hdodenhof:circleimageview:2.1.0' implementation 'de.hdodenhof:circleimageview:2.1.0'
// For loading huge screenshots from the disk. // For loading huge screenshots from the disk.
implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.squareup.picasso:picasso:2.71828'
// Allows FRP-style asynchronous operations in Android. // Allows FRP-style asynchronous operations in Android.
implementation 'io.reactivex:rxandroid:1.2.1' implementation 'io.reactivex:rxandroid:1.2.1'

View File

@ -67,7 +67,7 @@ public final class GameDetailsDialog extends DialogFragment
}); });
// Fill in the view contents. // Fill in the view contents.
Picasso.with(imageGameScreen.getContext()) Picasso.get()
.load(getArguments().getString(gameFile.getScreenshotPath())) .load(getArguments().getString(gameFile.getScreenshotPath()))
.fit() .fit()
.centerCrop() .centerCrop()

View File

@ -19,7 +19,7 @@ public class PicassoUtils
File cover = new File(gameFile.getCustomCoverPath()); File cover = new File(gameFile.getCustomCoverPath());
if (cover.exists()) if (cover.exists())
{ {
Picasso.with(imageView.getContext()) Picasso.get()
.load(cover) .load(cover)
.noFade() .noFade()
.noPlaceholder() .noPlaceholder()
@ -31,7 +31,7 @@ public class PicassoUtils
} }
else if ((cover = new File(gameFile.getCoverPath())).exists()) else if ((cover = new File(gameFile.getCoverPath())).exists())
{ {
Picasso.with(imageView.getContext()) Picasso.get()
.load(cover) .load(cover)
.noFade() .noFade()
.noPlaceholder() .noPlaceholder()
@ -47,7 +47,7 @@ public class PicassoUtils
*/ */
else else
{ {
Picasso.with(imageView.getContext()) Picasso.get()
.load(CoverHelper.buildGameTDBUrl(gameFile, CoverHelper.getRegion(gameFile))) .load(CoverHelper.buildGameTDBUrl(gameFile, CoverHelper.getRegion(gameFile)))
.noFade() .noFade()
.noPlaceholder() .noPlaceholder()
@ -65,9 +65,9 @@ public class PicassoUtils
} }
@Override @Override
public void onError() // Second pass using US region public void onError(Exception ex) // Second pass using US region
{ {
Picasso.with(imageView.getContext()) Picasso.get()
.load(CoverHelper.buildGameTDBUrl(gameFile, "US")) .load(CoverHelper.buildGameTDBUrl(gameFile, "US"))
.fit() .fit()
.noFade() .noFade()
@ -87,9 +87,9 @@ public class PicassoUtils
} }
@Override @Override
public void onError() // Third and last pass using EN region public void onError(Exception ex) // Third and last pass using EN region
{ {
Picasso.with(imageView.getContext()) Picasso.get()
.load(CoverHelper.buildGameTDBUrl(gameFile, "EN")) .load(CoverHelper.buildGameTDBUrl(gameFile, "EN"))
.fit() .fit()
.noFade() .noFade()
@ -110,7 +110,7 @@ public class PicassoUtils
} }
@Override @Override
public void onError() public void onError(Exception ex)
{ {
} }
}); });