Commit 6b8911a7 authored by Adrien Maglo's avatar Adrien Maglo

Sidebar: use white icons with black theme

parent ca0060f7
......@@ -40,6 +40,10 @@
<attr name="ic_pause" format="reference" />
<attr name="ic_previous" format="reference" />
<attr name="ic_next" format="reference" />
<attr name="ic_menu_video" format="reference" />
<attr name="ic_menu_audio" format="reference" />
<attr name="ic_menu_folder" format="reference" />
<attr name="ic_menu_history" format="reference" />
<attr name="mini_player_top_shadow" format="reference" />
<attr name="audio_playlist_shadow" format="reference" />
......
......@@ -59,6 +59,10 @@
<item name="ic_pause">@drawable/ic_pause</item>
<item name="ic_previous">@drawable/ic_previous</item>
<item name="ic_next">@drawable/ic_next</item>
<item name="ic_menu_video">@drawable/ic_menu_video</item>
<item name="ic_menu_audio">@drawable/ic_menu_audio</item>
<item name="ic_menu_folder">@drawable/ic_menu_folder</item>
<item name="ic_menu_history">@drawable/ic_menu_history</item>
<item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsLight</item>
</style>
......@@ -114,6 +118,10 @@
<item name="ic_pause">@drawable/ic_pause_w</item>
<item name="ic_previous">@drawable/ic_previous_w</item>
<item name="ic_next">@drawable/ic_next_w</item>
<item name="ic_menu_video">@drawable/ic_menu_video_w</item>
<item name="ic_menu_audio">@drawable/ic_menu_audio_w</item>
<item name="ic_menu_folder">@drawable/ic_menu_folder_w</item>
<item name="ic_menu_history">@drawable/ic_menu_history_w</item>
<item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsBlack</item>
</style>
......
......@@ -47,15 +47,16 @@ public class SidebarAdapter extends BaseAdapter {
static class SidebarEntry {
String id;
String name;
int drawableID;
int attributeID;
public SidebarEntry(String _id, int _name, int _drawableID) {
public SidebarEntry(String _id, int _name, int _attributeID) {
this.id = _id;
this.name = VLCApplication.getAppContext().getString(_name);
this.drawableID = _drawableID;
this.attributeID = _attributeID;
}
}
private Context mContext;
private LayoutInflater mInflater;
static final List<SidebarEntry> entries;
private HashMap<String, Fragment> mFragments;
......@@ -63,10 +64,10 @@ public class SidebarAdapter extends BaseAdapter {
static {
SidebarEntry entries2[] = {
new SidebarEntry( "video", R.string.video, R.drawable.ic_menu_video ),
new SidebarEntry( "audio", R.string.audio, R.drawable.ic_menu_audio ),
new SidebarEntry( "directories", R.string.directories, R.drawable.ic_menu_folder ),
new SidebarEntry( "history", R.string.history, R.drawable.ic_menu_history ),
new SidebarEntry( "video", R.string.video, R.attr.ic_menu_video ),
new SidebarEntry( "audio", R.string.audio, R.attr.ic_menu_audio ),
new SidebarEntry( "directories", R.string.directories, R.attr.ic_menu_folder ),
new SidebarEntry( "history", R.string.history, R.attr.ic_menu_history ),
//new SidebarEntry( "bookmarks", R.string.bookmarks, R.drawable.ic_bookmarks ),
//new SidebarEntry( "playlists", R.string.playlists, R.drawable.icon ),
};
......@@ -74,6 +75,7 @@ public class SidebarAdapter extends BaseAdapter {
}
public SidebarAdapter(Context context) {
mContext = context;
mInflater = LayoutInflater.from(context);
mFragments = new HashMap<String, Fragment>(entries.size());
}
......@@ -103,7 +105,8 @@ public class SidebarAdapter extends BaseAdapter {
}
TextView textView = (TextView)v;
textView.setText(sidebarEntry.name);
Drawable img = VLCApplication.getAppResources().getDrawable(sidebarEntry.drawableID);
Drawable img = VLCApplication.getAppResources().getDrawable(
Util.getResourceFromAttribute(mContext, sidebarEntry.attributeID));
if (img != null) {
int dp_32 = Util.convertDpToPx(32);
img.setBounds(0, 0, dp_32, dp_32);
......
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