summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-04-27 19:50:22 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-04-27 19:50:22 +0200
commit95c5f0309f4d481350333a3c99666f3eda9f946c (patch)
tree7b3546c1ff7717edd551604263e427c3df3e6f7e /src/de/danoeh/antennapod
parent2e22685c79500567db453358b94a3c5a7afcfa38 (diff)
downloadAntennaPod-95c5f0309f4d481350333a3c99666f3eda9f946c.zip
Added icons to nav-items in navigation drawer
Diffstat (limited to 'src/de/danoeh/antennapod')
-rw-r--r--src/de/danoeh/antennapod/adapter/NavListAdapter.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/adapter/NavListAdapter.java b/src/de/danoeh/antennapod/adapter/NavListAdapter.java
index 084f3609f..5bdc6854e 100644
--- a/src/de/danoeh/antennapod/adapter/NavListAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/NavListAdapter.java
@@ -1,7 +1,9 @@
package de.danoeh.antennapod.adapter;
import android.content.Context;
+import android.content.res.TypedArray;
import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -23,6 +25,7 @@ public class NavListAdapter extends BaseAdapter {
public static final int[] NAV_TITLES = {R.string.new_episodes_label, R.string.queue_label, R.string.downloads_label, R.string.playback_history_label, R.string.add_feed_label};
+ private final Drawable[] drawables;
public static final int SUBSCRIPTION_OFFSET = 1 + NAV_TITLES.length;
@@ -32,6 +35,12 @@ public class NavListAdapter extends BaseAdapter {
public NavListAdapter(ItemAccess itemAccess, Context context) {
this.itemAccess = itemAccess;
this.context = context;
+
+ TypedArray ta = context.obtainStyledAttributes(new int[] {R.attr.ic_new, R.attr.stat_playlist,
+ R.attr.av_download, R.attr.device_access_time, R.attr.content_new});
+ drawables = new Drawable[] {ta.getDrawable(0), ta.getDrawable(1), ta.getDrawable(2),
+ ta.getDrawable(3), ta.getDrawable(4)};
+ ta.recycle();
}
@Override
@@ -104,12 +113,14 @@ public class NavListAdapter extends BaseAdapter {
convertView = inflater.inflate(R.layout.nav_listitem, null);
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
+ holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
convertView.setTag(holder);
} else {
holder = (NavHolder) convertView.getTag();
}
holder.title.setText(title);
+ holder.image.setImageDrawable(drawables[position]);
return convertView;
}
@@ -163,6 +174,7 @@ public class NavListAdapter extends BaseAdapter {
static class NavHolder {
TextView title;
+ ImageView image;
}
static class SectionHolder {