Commit 2792575e authored by Adrien Maglo's avatar Adrien Maglo

Styles: replace colors by attributes

parent a0cd36e8
......@@ -25,6 +25,7 @@ import java.util.List;
import org.videolan.libvlc.Media;
import org.videolan.vlc.R;
import org.videolan.vlc.Util;
import org.videolan.vlc.widget.AudioPlaylistItemViewGroup;
import android.content.Context;
......@@ -45,9 +46,11 @@ public class AudioPlaylistAdapter extends ArrayAdapter<Media> {
private ArrayList<Media> mMediaList;
private int mCurrentIndex;
private Context mContext;
public AudioPlaylistAdapter(Context context) {
super(context, 0);
mContext = context;
mMediaList = new ArrayList<Media>();
mCurrentIndex = -1;
}
......@@ -106,8 +109,8 @@ public class AudioPlaylistAdapter extends ArrayAdapter<Media> {
holder.title.setText(title);
ColorStateList titleColor = v.getResources().getColorStateList(mCurrentIndex == position
? R.color.list_title_last
: R.color.list_title);
? Util.getResourceFromAttribute(mContext, R.attr.list_title_last)
: Util.getResourceFromAttribute(mContext, R.attr.list_title));
holder.title.setTextColor(titleColor);
holder.artist.setText(artist);
holder.position = position;
......
......@@ -51,10 +51,12 @@ public class VideoListAdapter extends ArrayAdapter<Media>
private int mSortDirection = 1;
private int mSortBy = SORT_BY_TITLE;
private boolean mListMode = false;
private Context mContext;
private VideoGridFragment mFragment;
public VideoListAdapter(Context context, VideoGridFragment fragment) {
super(context, 0);
mContext = context;
mFragment = fragment;
}
......@@ -179,7 +181,8 @@ public class VideoListAdapter extends ArrayAdapter<Media>
holder.thumbnail.setImageBitmap(thumbnail);
/* Color state */
ColorStateList titleColor = v.getResources().getColorStateList(R.color.list_title);
ColorStateList titleColor = v.getResources().getColorStateList(
Util.getResourceFromAttribute(mContext, R.attr.list_title));
holder.title.setTextColor(titleColor);
if (media instanceof MediaGroup)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment