From a1f71385883a3d71ebb22ede53a2d20d1585e7a5 Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Sun, 29 Nov 2015 21:59:31 -0500 Subject: [PATCH] Switch around Album UI to use smaller art images to make it easier for transitions and image cache. Will think about where would be best to use larger images later. --- .../fragments/AlbumFragment.java | 8 +-- app/src/main/res/layout/fragment_album.xml | 50 +++++++++++++------ 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java b/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java index eaf8a5d..0711584 100644 --- a/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java +++ b/app/src/main/java/com/magnatune/eyecreate/companionformagnatune/fragments/AlbumFragment.java @@ -80,7 +80,8 @@ public class AlbumFragment extends Fragment { ListView listView = (ListView) v.findViewById(R.id.album_tracks); Album currentAlbum = db.where(Album.class).equalTo("albumsku",getArguments().getString(ARG_ALBUM_ID)).findFirst(); ((TextView)v.findViewById(R.id.album_name)).setText(currentAlbum.getAlbumname()); - Picasso.with(getActivity()).load(currentAlbum.getCover_large()).into((ImageView) v.findViewById(R.id.album_cover), new Callback() { + ((TextView)v.findViewById(R.id.artist_name)).setText(currentAlbum.getArtist().getArtistname()); + Picasso.with(getActivity()).load(currentAlbum.getCover_small()).into((ImageView) v.findViewById(R.id.album_cover), new Callback() { @Override public void onSuccess() { Palette colors = Palette.from(((BitmapDrawable) ((ImageView) v.findViewById(R.id.album_cover)).getDrawable()).getBitmap()).generate(); @@ -93,8 +94,9 @@ public class AlbumFragment extends Fragment { swatch = colors.getSwatches().get(0); } if (swatch != null) { - ((TextView)v.findViewById(R.id.album_name)).setTextColor(swatch.getTitleTextColor()); - v.findViewById(R.id.album_name).setBackgroundColor(swatch.getRgb()); + ((TextView) v.findViewById(R.id.album_name)).setTextColor(swatch.getTitleTextColor()); + ((TextView) v.findViewById(R.id.artist_name)).setTextColor(swatch.getBodyTextColor()); + v.findViewById(R.id.album_details).setBackgroundColor(swatch.getRgb()); } } diff --git a/app/src/main/res/layout/fragment_album.xml b/app/src/main/res/layout/fragment_album.xml index 5b24f31..5c1ef40 100644 --- a/app/src/main/res/layout/fragment_album.xml +++ b/app/src/main/res/layout/fragment_album.xml @@ -9,25 +9,45 @@ android:layout_height="match_parent" android:orientation="vertical"> - + android:layout_height="wrap_content" + android:orientation="horizontal"> - + + + + + + + + + + android:layout_height="wrap_content" /> \ No newline at end of file -- GitLab