Subscriptions: Show indicator only when count > 0

This commit is contained in:
Martin Fietz 2016-06-05 11:31:42 +02:00
parent 6cebc0c276
commit b9b3209878
1 changed files with 7 additions and 2 deletions

View File

@ -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)