Added color on album on artist page
This commit is contained in:
parent
f0a648e8e8
commit
7c18547731
2 changed files with 19 additions and 3 deletions
|
|
@ -114,7 +114,7 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
|||
loadAlbumCover(album, holder);
|
||||
}
|
||||
|
||||
private void setColors(int color, ViewHolder holder) {
|
||||
protected void setColors(int color, ViewHolder holder) {
|
||||
if (holder.paletteColorContainer != null) {
|
||||
holder.paletteColorContainer.setBackgroundColor(color);
|
||||
if (holder.title != null) {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@ package com.kabouzeid.gramophone.adapter.album;
|
|||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
||||
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
||||
import com.kabouzeid.gramophone.helper.HorizontalAdapterHelper;
|
||||
import com.kabouzeid.gramophone.interfaces.CabHolder;
|
||||
import com.kabouzeid.gramophone.model.Album;
|
||||
|
|
@ -19,8 +22,7 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
|
|||
public static final String TAG = AlbumAdapter.class.getSimpleName();
|
||||
|
||||
public HorizontalAlbumAdapter(@NonNull AppCompatActivity activity, ArrayList<Album> dataSet, @Nullable CabHolder cabHolder) {
|
||||
super(activity, dataSet, HorizontalAdapterHelper.LAYOUT_RES, false, cabHolder);
|
||||
usePalette = false;
|
||||
super(activity, dataSet, HorizontalAdapterHelper.LAYOUT_RES, true, cabHolder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -30,6 +32,20 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
|
|||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setColors(int color, ViewHolder holder) {
|
||||
if (holder.itemView != null) {
|
||||
CardView card=(CardView)holder.itemView;
|
||||
card.setCardBackgroundColor(color);
|
||||
if (holder.title != null) {
|
||||
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||
}
|
||||
if (holder.text != null) {
|
||||
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getAlbumText(Album album) {
|
||||
return String.valueOf(album.getYear());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue