diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-07-13 19:30:22 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-07-13 19:30:22 -0400 |
commit | 0f8ed8e58ff7f9a6d72f7a17ef6428d50e899256 (patch) | |
tree | e7fce920a92f23fa81aa45836a91e24a7980b24d /app | |
parent | 6c4d7aaef3befc29f36d674b11812dbd711aa85e (diff) | |
parent | 58ebf7ed039cf79e11f7330a385db3dc631cd7af (diff) | |
download | AntennaPod-0f8ed8e58ff7f9a6d72f7a17ef6428d50e899256.zip |
Merge pull request #1008 from TomHennen/fix1007
PlaybackHistory doesn't dim played items anymore.
Diffstat (limited to 'app')
3 files changed, 13 insertions, 6 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index 1ecc45210..56e2bb1bd 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -33,13 +33,17 @@ public class FeedItemlistAdapter extends BaseAdapter { private final Context context; private boolean showFeedtitle; private int selectedItemIndex; + /** true if played items should be made partially transparent */ + private boolean makePlayedItemsTransparent; private final ActionButtonUtils actionButtonUtils; public static final int SELECTION_NONE = -1; public FeedItemlistAdapter(Context context, ItemAccess itemAccess, - ActionButtonCallback callback, boolean showFeedtitle) { + ActionButtonCallback callback, + boolean showFeedtitle, + boolean makePlayedItemsTransparent) { super(); this.callback = callback; this.context = context; @@ -47,6 +51,7 @@ public class FeedItemlistAdapter extends BaseAdapter { this.showFeedtitle = showFeedtitle; this.selectedItemIndex = SELECTION_NONE; this.actionButtonUtils = new ActionButtonUtils(context); + this.makePlayedItemsTransparent = makePlayedItemsTransparent; } @Override @@ -106,7 +111,7 @@ public class FeedItemlistAdapter extends BaseAdapter { StringBuilder buffer = new StringBuilder(item.getTitle()); if (showFeedtitle) { - buffer.append("("); + buffer.append(" ("); buffer.append(item.getFeed().getTitle()); buffer.append(")"); } @@ -117,7 +122,7 @@ public class FeedItemlistAdapter extends BaseAdapter { } else { holder.statusUnread.setVisibility(View.INVISIBLE); } - if(item.isPlayed()) { + if(item.isPlayed() && makePlayedItemsTransparent) { ViewHelper.setAlpha(convertView, 0.5f); } else { ViewHelper.setAlpha(convertView, 1.0f); @@ -180,7 +185,6 @@ public class FeedItemlistAdapter extends BaseAdapter { convertView.setVisibility(View.GONE); } return convertView; - } private final OnClickListener butActionListener = new OnClickListener() { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java index 5862e248b..17bcd7d93 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -428,7 +428,7 @@ public class ItemlistFragment extends ListFragment { setListAdapter(null); setupHeaderView(); setupFooterView(); - adapter = new FeedItemlistAdapter(getActivity(), itemAccess, new DefaultActionButtonCallback(getActivity()), false); + adapter = new FeedItemlistAdapter(getActivity(), itemAccess, new DefaultActionButtonCallback(getActivity()), false, true); setListAdapter(adapter); downloadObserver = new DownloadObserver(getActivity(), new Handler(), downloadObserverCallback); downloadObserver.onResume(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index 67f454fa0..b094133d3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -192,7 +192,10 @@ public class PlaybackHistoryFragment extends ListFragment { private void onFragmentLoaded() { if (adapter == null) { - adapter = new FeedItemlistAdapter(getActivity(), itemAccess, new DefaultActionButtonCallback(activity.get()), true); + // played items shoudln't be transparent for this fragment since, *all* items + // in this fragment will, by definition, be played. So it serves no purpose and can make + // it harder to read. + adapter = new FeedItemlistAdapter(getActivity(), itemAccess, new DefaultActionButtonCallback(activity.get()), true, false); setListAdapter(adapter); downloadObserver = new DownloadObserver(activity.get(), new Handler(), downloadObserverCallback); downloadObserver.onResume(); |