Skip to content

Commit

Permalink
Android: Fix cover stretching
Browse files Browse the repository at this point in the history
  • Loading branch information
zackhow committed Aug 30, 2018
1 parent b8b4e9a commit ec0e1d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -21,9 +21,10 @@ public static void loadGameBanner(ImageView imageView, GameFile gameFile)
{
Picasso.with(imageView.getContext())
.load(cover)
.fit()
.noFade()
.noPlaceholder()
.fit()
.centerInside()
.config(Bitmap.Config.ARGB_8888)
.error(R.drawable.no_banner)
.into(imageView);
Expand All @@ -32,9 +33,10 @@ else if ((cover = new File(gameFile.getCoverPath())).exists())
{
Picasso.with(imageView.getContext())
.load(cover)
.fit()
.noFade()
.noPlaceholder()
.fit()
.centerInside()
.config(Bitmap.Config.ARGB_8888)
.error(R.drawable.no_banner)
.into(imageView);
Expand All @@ -47,9 +49,10 @@ else if ((cover = new File(gameFile.getCoverPath())).exists())
{
Picasso.with(imageView.getContext())
.load(CoverHelper.buildGameTDBUrl(gameFile, CoverHelper.getRegion(gameFile)))
.fit()
.noFade()
.noPlaceholder()
.fit()
.centerInside()
.config(Bitmap.Config.ARGB_8888)
.error(R.drawable.no_banner)
.into(imageView, new Callback()
Expand All @@ -68,6 +71,8 @@ public void onError() // Second pass using US region
.load(CoverHelper.buildGameTDBUrl(gameFile, "US"))
.fit()
.noFade()
.fit()
.centerInside()
.noPlaceholder()
.config(Bitmap.Config.ARGB_8888)
.error(R.drawable.no_banner)
Expand All @@ -88,6 +93,8 @@ public void onError() // Third and last pass using EN region
.load(CoverHelper.buildGameTDBUrl(gameFile, "EN"))
.fit()
.noFade()
.fit()
.centerInside()
.noPlaceholder()
.config(Bitmap.Config.ARGB_8888)
.error(R.drawable.no_banner)
Expand Down
2 changes: 1 addition & 1 deletion Source/Android/app/src/main/res/layout/card_game.xml
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
tools:layout_width="160dp"
android:layout_height="368dp"
android:layout_height="330dp"
android:transitionName="card_game"
android:focusable="true"
android:clickable="true"
Expand Down

0 comments on commit ec0e1d2

Please sign in to comment.