Commit 2ac6b4e6 authored by Sébastien Toque's avatar Sébastien Toque Committed by Edward Wang

improve colors of selected items

parent a5869ed4
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="#000000" />
<item android:state_pressed="true" android:color="#000000" />
<item android:color="#FFFFFF" />
<item android:state_selected="true" android:color="#F000" />
<item android:state_pressed="true" android:color="#F000" />
<item android:color="#F888" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="#FFFF" />
<item android:state_pressed="true" android:color="#FFFF" />
<item android:color="#FFFF" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="#FFFF" />
<item android:state_pressed="true" android:color="#FFFF" />
<item android:color="@color/orange" />
</selector>
\ No newline at end of file
......@@ -5,8 +5,8 @@
<gradient
android:angle="270"
android:centerColor="@color/orange"
android:endColor="@color/item_common"
android:startColor="@color/item_common" />
android:endColor="@color/darkorange"
android:startColor="@color/darkorange" />
</shape>
</item>
<item android:state_selected="true">
......@@ -14,8 +14,8 @@
<gradient
android:angle="270"
android:centerColor="@color/orange"
android:endColor="@color/item_common"
android:startColor="@color/item_common" />
android:endColor="@color/darkorange"
android:startColor="@color/darkorange" />
</shape>
</item>
<item>
......
......@@ -5,8 +5,8 @@
<gradient
android:angle="270"
android:centerColor="@color/orange"
android:endColor="@color/item_common"
android:startColor="@color/item_common" />
android:endColor="@color/darkorange"
android:startColor="@color/darkorange" />
</shape>
</item>
<item android:state_selected="true">
......@@ -14,8 +14,8 @@
<gradient
android:angle="270"
android:centerColor="@color/orange"
android:endColor="@color/item_common"
android:startColor="@color/item_common" />
android:endColor="@color/darkorange"
android:startColor="@color/darkorange" />
</shape>
</item>
<item>
......
......@@ -14,7 +14,7 @@
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:text="@string/title"
android:textColor="#ffffff"
android:textColor="@color/list_title"
android:textSize="20dip" />
<TextView
......@@ -25,7 +25,7 @@
android:layout_marginRight="5dip"
android:layout_marginBottom="5dip"
android:text="@string/artist"
android:textColor="#888888"
android:textColor="@color/list_subtitle"
android:textSize="14dip" />
</LinearLayout>
\ No newline at end of file
......@@ -20,7 +20,7 @@
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:text="@string/title"
android:textColor="#ffffff"
android:textColor="@color/list_title"
android:textSize="20dip" />
<TextView
......@@ -31,7 +31,7 @@
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="@string/songs"
android:textColor="#888888"
android:textColor="@color/list_subtitle"
android:textSize="14dip" />
</LinearLayout>
......
......@@ -26,7 +26,7 @@
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:text="@string/title"
android:textColor="#ffffff"
android:textColor="@color/list_title"
android:textSize="20dip" />
<TextView
......@@ -37,7 +37,7 @@
android:layout_marginLeft="15dip"
android:layout_marginRight="5dip"
android:text="@string/songs"
android:textColor="#888888"
android:textColor="@color/list_subtitle"
android:textSize="14dip" />
</LinearLayout>
......
......@@ -28,7 +28,7 @@
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:text="@string/title"
android:textColor="#ffffff"
android:textColor="@color/list_title"
android:textSize="20dip" />
<TextView
......@@ -39,7 +39,7 @@
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="@string/info"
android:textColor="#888888"
android:textColor="@color/list_subtitle"
android:textSize="14dip" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -23,14 +23,14 @@
android:ellipsize="end"
android:maxLines="2"
android:textSize="17dip"
android:textColor="@color/video_list_title"
android:textColor="@color/list_title"
android:paddingLeft="12dip" />
<TextView
android:id="@+id/ml_item_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:textColor="#888888"
android:textColor="@color/list_subtitle"
android:paddingLeft="12dip" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -5,6 +5,7 @@
<color name="item_1">#F222</color>
<color name="item_2">#F000</color>
<color name="orange">#FFF48B00</color>
<color name="darkorange">#FF824600</color>
<color name="transparent_gray">#A000</color>
</resources>
\ No newline at end of file
......@@ -28,7 +28,7 @@ import org.videolan.vlc.R;
import org.videolan.vlc.Util;
import android.content.Context;
import android.graphics.Color;
import android.content.res.ColorStateList;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -86,7 +86,10 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
Media media = getItem(position);
Util.setItemBackground(holder.layout, position);
holder.title.setText(media.getTitle());
holder.title.setTextColor(mCurrentIndex == position ? 0xFFF48B00 /* ORANGE */ : Color.WHITE);
ColorStateList titleColor = v.getResources().getColorStateList(mCurrentIndex == position
? R.color.list_title_last
: R.color.list_title);
holder.title.setTextColor(titleColor);
holder.artist.setText(media.getArtist() + " - " + media.getAlbum());
return v;
}
......
......@@ -28,9 +28,9 @@ import org.videolan.vlc.R;
import org.videolan.vlc.Util;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -151,7 +151,11 @@ public class VideoListAdapter extends ArrayAdapter<Media>
holder.thumbnail.setImageBitmap(thumbnail);
}
holder.title.setTextColor(media.getLocation().equals(mLastMRL) ? 0xFFF48B00 /* ORANGE */ : Color.WHITE);
ColorStateList titleColor = v.getResources().getColorStateList(media.getLocation().equals(mLastMRL)
? R.color.list_title_last
: R.color.list_title);
holder.title.setTextColor(titleColor);
long lastTime = media.getTime();
String text;
if (lastTime > 0) {
......
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