diff options
author | jan_bar <[email protected]> | 2013-04-25 18:03:43 +0200 |
---|---|---|
committer | jan_bar <[email protected]> | 2013-04-25 18:03:43 +0200 |
commit | a771ad16cfade4e1f7a7c693e316188a138d7d65 (patch) | |
tree | 1f5b5dbc69839cc36b49a4b6d292becf2cb2fd8f /src | |
parent | 6aaf8143de61655c2f8b39e8a672596cdbf09bd0 (diff) |
Fixed score colors as requested
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttrss/HeadlinesFragment.java | 9 | ||||
-rw-r--r-- | src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java | 14 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index b24716b3..15bf9c0a 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -607,7 +607,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, if (tt != null) { tt.setText(Html.fromHtml(article.title)); - adjustTitleTextView(article.score, article.unread, tt, position); + adjustTitleTextView(article.score, tt, position); } TextView ft = (TextView)v.findViewById(R.id.feed_title); @@ -740,17 +740,16 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, return v; } - private void adjustTitleTextView(int score, boolean unread, TextView tv, int position) { + private void adjustTitleTextView(int score, TextView tv, int position) { int viewType = getItemViewType(position); if (origTitleColors[viewType] == null) // store original color origTitleColors[viewType] = Integer.valueOf(tv.getCurrentTextColor()); - if (score < -100) { + if (score < -500) { tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); } else if (score > 500) { - if (unread) - tv.setTextColor(titleHighScoreUnreadColor); + tv.setTextColor(titleHighScoreUnreadColor); tv.setPaintFlags(tv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); } else { tv.setTextColor(origTitleColors[viewType].intValue()); diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index 353bf517..cdb0adf3 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -453,11 +453,10 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis if (tt != null) { tt.setText(Html.fromHtml(article.getString(article.getColumnIndex("title")))); - + int scoreIndex = article.getColumnIndex("score"); - boolean unread = article.getInt(article.getColumnIndex("unread")) == 1; - if(scoreIndex >= 0) - adjustTitleTextView(article.getInt(scoreIndex), unread, tt, position); + if (scoreIndex >= 0) + adjustTitleTextView(article.getInt(scoreIndex), tt, position); } TextView ft = (TextView)v.findViewById(R.id.feed_title); @@ -596,17 +595,16 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis return v; } - private void adjustTitleTextView(int score, boolean unread, TextView tv, int position) { + private void adjustTitleTextView(int score, TextView tv, int position) { int viewType = getItemViewType(position); if (origTitleColors[viewType] == null) // store original color origTitleColors[viewType] = Integer.valueOf(tv.getCurrentTextColor()); - if (score < -100) { + if (score < -500) { tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); } else if (score > 500) { - if (unread) - tv.setTextColor(titleHighScoreUnreadColor); + tv.setTextColor(titleHighScoreUnreadColor); tv.setPaintFlags(tv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); } else { tv.setTextColor(origTitleColors[viewType].intValue()); |