diff options
author | Andrew Dolgov <[email protected]> | 2015-06-04 23:44:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-06-04 23:44:26 +0300 |
commit | c30f85616e61c0cafda7a353f18df1ed0e95be68 (patch) | |
tree | c6c80691681d276179593f2fe0f3a6d5dd2c469f /org.fox.ttrss/src/main/java/org | |
parent | 8c6d767190071487df97b47ef552669df36f1256 (diff) |
add various per-feed icons for the conns/feeds sidebar
Diffstat (limited to 'org.fox.ttrss/src/main/java/org')
3 files changed, 56 insertions, 0 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index 4f2f72ee..89bffbd7 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -13,6 +13,7 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.widget.SwipeRefreshLayout; import android.util.Log; +import android.util.TypedValue; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; @@ -25,6 +26,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -466,6 +468,16 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt } + ImageView icon = (ImageView) v.findViewById(R.id.icon); + + if (icon != null) { + TypedValue tv = new TypedValue(); + + m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true); + icon.setImageResource(tv.resourceId); + + } + TextView tt = (TextView) v.findViewById(R.id.title); if (tt != null) { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java index 97a96490..e01b4eed 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java @@ -14,6 +14,7 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.widget.SwipeRefreshLayout; import android.util.Log; +import android.util.TypedValue; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; @@ -26,6 +27,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -645,6 +647,36 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi } + ImageView icon = (ImageView) v.findViewById(R.id.icon); + + if (icon != null) { + TypedValue tv = new TypedValue(); + + if (feed.id == 0 && !feed.is_cat) { + m_activity.getTheme().resolveAttribute(R.attr.ic_archive, tv, true); + icon.setImageResource(tv.resourceId); + } else if (feed.id == -1 && !feed.is_cat) { + m_activity.getTheme().resolveAttribute(R.attr.ic_star, tv, true); + icon.setImageResource(tv.resourceId); + } else if (feed.id == -2 && !feed.is_cat) { + m_activity.getTheme().resolveAttribute(R.attr.ic_checkbox_marked, tv, true); + icon.setImageResource(tv.resourceId); + } else if (feed.id == -3 && !feed.is_cat) { + m_activity.getTheme().resolveAttribute(R.attr.ic_coffee, tv, true); + icon.setImageResource(tv.resourceId); + } else if (feed.id == -4 && !feed.is_cat) { + m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true); + icon.setImageResource(tv.resourceId); + } else if (feed.is_cat) { + m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true); + icon.setImageResource(tv.resourceId); + } else { + m_activity.getTheme().resolveAttribute(R.attr.ic_rss_box, tv, true); + icon.setImageResource(tv.resourceId); + } + + } + TextView tt = (TextView) v.findViewById(R.id.title); if (tt != null) { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java index 88abf0f5..fd0da9d6 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java @@ -12,6 +12,7 @@ import android.provider.BaseColumns; import android.support.v4.widget.SimpleCursorAdapter; import android.support.v4.widget.SwipeRefreshLayout; import android.util.Log; +import android.util.TypedValue; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; @@ -23,6 +24,7 @@ import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -282,6 +284,16 @@ public class OfflineFeedCategoriesFragment extends BaseFeedlistFragment implemen } + ImageView icon = (ImageView) v.findViewById(R.id.icon); + + if (icon != null) { + TypedValue tv = new TypedValue(); + + m_activity.getTheme().resolveAttribute(R.attr.ic_folder_outline, tv, true); + icon.setImageResource(tv.resourceId); + + } + TextView tt = (TextView) v.findViewById(R.id.title); if (tt != null) { |