Make loading images in main lists use the same size as in the details view, so that both uses the same cached version in Picasso's cache, so that the image is immediatelly shown when the user enters the details view.

This commit is contained in:
Synced Synapse 2015-11-02 18:24:54 +00:00
parent 37424b0303
commit fa869b854c
6 changed files with 22 additions and 14 deletions

View File

@ -227,10 +227,12 @@ public class AddonListFragment extends Fragment
this.hostManager = HostManager.getInstance(context);
// Get the art dimensions
// Use the same dimensions as in the details fragment, so that it hits Picasso's cache when
// the user transitions to that fragment, avoiding another call and imediatelly showing the image
Resources resources = context.getResources();
artWidth = (int)(resources.getDimension(R.dimen.addonlist_art_width) /
artWidth = (int)(resources.getDimension(R.dimen.addondetail_poster_width) /
UIUtils.IMAGE_RESIZE_FACTOR);
artHeight = (int)(resources.getDimension(R.dimen.addonlist_art_heigth) /
artHeight = (int)(resources.getDimension(R.dimen.addondetail_poster_heigth) /
UIUtils.IMAGE_RESIZE_FACTOR);
}

View File

@ -211,10 +211,12 @@ public class AlbumListFragment extends AbstractListFragment {
this.hostManager = HostManager.getInstance(context);
// Get the art dimensions
// Use the same dimensions as in the details fragment, so that it hits Picasso's cache when
// the user transitions to that fragment, avoiding another call and imediatelly showing the image
Resources resources = context.getResources();
artWidth = (int)(resources.getDimension(R.dimen.albumlist_art_width) /
artWidth = (int)(resources.getDimension(R.dimen.albumdetail_poster_width) /
UIUtils.IMAGE_RESIZE_FACTOR);
artHeight = (int)(resources.getDimension(R.dimen.albumlist_art_heigth) /
artHeight = (int)(resources.getDimension(R.dimen.albumdetail_poster_heigth) /
UIUtils.IMAGE_RESIZE_FACTOR);
}

View File

@ -249,10 +249,12 @@ public class MovieListFragment extends AbstractListFragment {
this.hostManager = HostManager.getInstance(context);
// Get the art dimensions
// Use the same dimensions as in the details fragment, so that it hits Picasso's cache when
// the user transitions to that fragment, avoiding another call and imediatelly showing the image
Resources resources = context.getResources();
artWidth = (int)(resources.getDimension(R.dimen.movielist_art_width) /
artWidth = (int)(resources.getDimension(R.dimen.now_playing_poster_width) /
UIUtils.IMAGE_RESIZE_FACTOR);
artHeight = (int)(resources.getDimension(R.dimen.movielist_art_heigth) /
artHeight = (int)(resources.getDimension(R.dimen.now_playing_poster_height) /
UIUtils.IMAGE_RESIZE_FACTOR);
}

View File

@ -247,10 +247,12 @@ public class TVShowListFragment extends AbstractListFragment {
this.hostManager = HostManager.getInstance(context);
// Get the art dimensions
// Use the same dimensions as in the details fragment, so that it hits Picasso's cache when
// the user transitions to that fragment, avoiding another call and imediatelly showing the image
Resources resources = context.getResources();
artWidth = (int)(resources.getDimension(R.dimen.tvshowlist_art_width) /
artWidth = (int)(resources.getDimension(R.dimen.now_playing_poster_width) /
UIUtils.IMAGE_RESIZE_FACTOR);
artHeight = (int)(resources.getDimension(R.dimen.tvshowlist_art_heigth) /
artHeight = (int)(resources.getDimension(R.dimen.now_playing_poster_height) /
UIUtils.IMAGE_RESIZE_FACTOR);
}

View File

@ -35,13 +35,13 @@
<dimen name="playlist_art_width">68dp</dimen>
<dimen name="playlist_art_heigth">86dp</dimen>
<dimen name="movielist_art_width">82dp</dimen>
<dimen name="movielist_art_width">86dp</dimen>
<dimen name="movielist_art_heigth">124dp</dimen>
<dimen name="tvshowlist_art_width">82dp</dimen>
<dimen name="tvshowlist_art_width">86dp</dimen>
<dimen name="tvshowlist_art_heigth">124dp</dimen>
<dimen name="seasonlist_art_width">82dp</dimen>
<dimen name="seasonlist_art_width">86dp</dimen>
<dimen name="seasonlist_art_heigth">124dp</dimen>
<dimen name="episodelist_art_width">134dp</dimen>

View File

@ -79,13 +79,13 @@
<dimen name="playlist_art_width">56dp</dimen>
<dimen name="playlist_art_heigth">78dp</dimen>
<dimen name="movielist_art_width">68dp</dimen>
<dimen name="movielist_art_width">72dp</dimen>
<dimen name="movielist_art_heigth">104dp</dimen>
<dimen name="tvshowlist_art_width">68dp</dimen>
<dimen name="tvshowlist_art_width">72dp</dimen>
<dimen name="tvshowlist_art_heigth">104dp</dimen>
<dimen name="seasonlist_art_width">68dp</dimen>
<dimen name="seasonlist_art_width">72dp</dimen>
<dimen name="seasonlist_art_heigth">104dp</dimen>
<dimen name="episodelist_art_width">112dp</dimen>