From b9b3209878a059c972876d56dc02449a9e09a534 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 5 Jun 2016 11:31:42 +0200 Subject: [PATCH] Subscriptions: Show indicator only when count > 0 --- .../danoeh/antennapod/adapter/SubscriptionsAdapter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java index 736988802..3d259c285 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java @@ -102,8 +102,13 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI holder.feedTitle.setText(feed.getTitle()); holder.feedTitle.setVisibility(View.VISIBLE); - holder.count.setPrimaryText(String.valueOf(itemAccess.getFeedCounter(feed.getId()))); - holder.count.setVisibility(View.VISIBLE); + int count = itemAccess.getFeedCounter(feed.getId()); + if(count > 0) { + holder.count.setPrimaryText(String.valueOf(itemAccess.getFeedCounter(feed.getId()))); + holder.count.setVisibility(View.VISIBLE); + } else { + holder.count.setVisibility(View.GONE); + } Glide.with(mainActivityRef.get()) .load(feed.getImageLocation()) .error(R.color.light_gray)