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.
This commit is contained in:
@@ -80,7 +80,8 @@ public class AlbumFragment extends Fragment {
|
|||||||
ListView listView = (ListView) v.findViewById(R.id.album_tracks);
|
ListView listView = (ListView) v.findViewById(R.id.album_tracks);
|
||||||
Album currentAlbum = db.where(Album.class).equalTo("albumsku",getArguments().getString(ARG_ALBUM_ID)).findFirst();
|
Album currentAlbum = db.where(Album.class).equalTo("albumsku",getArguments().getString(ARG_ALBUM_ID)).findFirst();
|
||||||
((TextView)v.findViewById(R.id.album_name)).setText(currentAlbum.getAlbumname());
|
((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
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Palette colors = Palette.from(((BitmapDrawable) ((ImageView) v.findViewById(R.id.album_cover)).getDrawable()).getBitmap()).generate();
|
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);
|
swatch = colors.getSwatches().get(0);
|
||||||
}
|
}
|
||||||
if (swatch != null) {
|
if (swatch != null) {
|
||||||
((TextView)v.findViewById(R.id.album_name)).setTextColor(swatch.getTitleTextColor());
|
((TextView) v.findViewById(R.id.album_name)).setTextColor(swatch.getTitleTextColor());
|
||||||
v.findViewById(R.id.album_name).setBackgroundColor(swatch.getRgb());
|
((TextView) v.findViewById(R.id.artist_name)).setTextColor(swatch.getBodyTextColor());
|
||||||
|
v.findViewById(R.id.album_details).setBackgroundColor(swatch.getRgb());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,25 +9,45 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/album_details"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/album_cover"
|
android:id="@+id/album_cover"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:layout_weight="2">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/album_name"
|
android:id="@+id/album_name"
|
||||||
android:paddingLeft="5dp"
|
android:layout_width="wrap_content"
|
||||||
android:paddingRight="5dp"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:layout_width="match_parent"
|
android:textStyle="bold" />
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/artist_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
android:id="@+id/album_tracks"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:id="@+id/album_tracks"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
Reference in New Issue
Block a user