diff options
author | Andrew Dolgov <[email protected]> | 2017-10-31 21:47:59 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-10-31 21:47:59 +0300 |
commit | a415f69c354962daf445aa34b99c7f96dda47287 (patch) | |
tree | 94b97f9ef8141a30d2d61a7ab758692cffa4199a /org.fox.ttrss/src/main | |
parent | 47376b8d47249d2c9a04f52d88e2bb93963e053e (diff) |
offline headlines: support accent color filter on buttons
Diffstat (limited to 'org.fox.ttrss/src/main')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index e58dfa2e..eca06829 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -749,12 +749,23 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis } else if (holder.feedTitleView != null) { holder.feedTitleView.setVisibility(View.GONE); } - + + TypedValue tvAccent = new TypedValue(); + m_activity.getTheme().resolveAttribute(R.attr.colorAccent, tvAccent, true); + if (holder.markedView != null) { TypedValue tv = new TypedValue(); - m_activity.getTheme().resolveAttribute(article.getInt(article.getColumnIndex("marked")) == 1 ? R.attr.ic_star : R.attr.ic_star_outline, tv, true); + + boolean marked = article.getInt(article.getColumnIndex("marked")) == 1; + + m_activity.getTheme().resolveAttribute(marked ? R.attr.ic_star : R.attr.ic_star_outline, tv, true); holder.markedView.setImageResource(tv.resourceId); + + if (marked) + holder.markedView.setColorFilter(tvAccent.data); + else + holder.markedView.setColorFilter(null); holder.markedView.setOnClickListener(new OnClickListener() { @@ -774,10 +785,18 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis if (holder.publishedView != null) { TypedValue tv = new TypedValue(); - m_activity.getTheme().resolveAttribute(article.getInt(article.getColumnIndex("published")) == 1 ? R.attr.ic_checkbox_marked : R.attr.ic_rss_box, tv, true); + + boolean published = article.getInt(article.getColumnIndex("published")) == 1; + + m_activity.getTheme().resolveAttribute(published ? R.attr.ic_checkbox_marked : R.attr.ic_rss_box, tv, true); holder.publishedView.setImageResource(tv.resourceId); - + + if (published) + holder.publishedView.setColorFilter(tvAccent.data); + else + holder.publishedView.setColorFilter(null); + holder.publishedView.setOnClickListener(new OnClickListener() { @Override |