diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java index 20e21b8b..38fd8a43 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java @@ -890,6 +890,13 @@ public class ComposeAdapter extends RecyclerView.Adapter implements Filterable { private final List tags; private final List tempTags; private final List suggestions; + private final Context context; private final Filter searchFilter = new Filter() { @Override @@ -75,6 +80,7 @@ public class TagsSearchAdapter extends ArrayAdapter implements Filterable { public TagsSearchAdapter(Context context, List tags) { super(context, android.R.layout.simple_list_item_1, tags); + this.context = context; this.tags = tags; this.tempTags = new ArrayList<>(tags); this.suggestions = new ArrayList<>(tags); @@ -110,6 +116,21 @@ public class TagsSearchAdapter extends ArrayAdapter implements Filterable { holder = (TagSearchViewHolder) convertView.getTag(); } holder.binding.tagName.setText(String.format("#%s", tag.name)); + List historyList = tag.history; + + int stat = 0; + + if (historyList != null) { + for (History history : historyList) { + stat += Integer.parseInt(history.accounts); + } + } + if(stat > 0 ) { + holder.binding.tagCount.setText("(" + context.getString(R.string.talking_about, stat) + ")"); + holder.binding.tagCount.setVisibility(View.VISIBLE); + } else { + holder.binding.tagCount.setVisibility(View.GONE); + } return holder.view; } diff --git a/app/src/main/res/layouts/mastodon/layout/drawer_tag_search.xml b/app/src/main/res/layouts/mastodon/layout/drawer_tag_search.xml index f7b4be74..e5bd49ef 100644 --- a/app/src/main/res/layouts/mastodon/layout/drawer_tag_search.xml +++ b/app/src/main/res/layouts/mastodon/layout/drawer_tag_search.xml @@ -15,6 +15,7 @@ see --> + +