From 12f404246bf95e69b7baab49f1798e725d07eead Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Sat, 16 Jul 2022 00:25:35 +0800 Subject: Show the number of subscribers in SubredditAutocompleteRecyclerViewAdapter. --- .../adapters/SubredditAutocompleteRecyclerViewAdapter.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubredditAutocompleteRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubredditAutocompleteRecyclerViewAdapter.java index ac46be2b..ee1e1208 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubredditAutocompleteRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubredditAutocompleteRecyclerViewAdapter.java @@ -53,6 +53,7 @@ public class SubredditAutocompleteRecyclerViewAdapter extends RecyclerView.Adapt .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((SubredditViewHolder) holder).iconImageView); ((SubredditViewHolder) holder).subredditNameTextView.setText(subreddits.get(position).getName()); + ((SubredditViewHolder) holder).subscriberCountTextView.setText(activity.getString(R.string.subscribers_number_detail, subreddits.get(position).getNSubscribers())); } } @@ -78,6 +79,7 @@ public class SubredditAutocompleteRecyclerViewAdapter extends RecyclerView.Adapt GifImageView iconImageView; TextView subredditNameTextView; + TextView subscriberCountTextView; ImageView subscribeImageView; MaterialCheckBox checkBox; @@ -85,6 +87,7 @@ public class SubredditAutocompleteRecyclerViewAdapter extends RecyclerView.Adapt super(itemView); iconImageView = itemView.findViewById(R.id.subreddit_icon_gif_image_view_item_subreddit_listing); subredditNameTextView = itemView.findViewById(R.id.subreddit_name_text_view_item_subreddit_listing); + subscriberCountTextView = itemView.findViewById(R.id.subscriber_count_text_view_item_subreddit_listing); subscribeImageView = itemView.findViewById(R.id.subscribe_image_view_item_subreddit_listing); checkBox = itemView.findViewById(R.id.checkbox_item_subreddit_listing); @@ -92,9 +95,11 @@ public class SubredditAutocompleteRecyclerViewAdapter extends RecyclerView.Adapt checkBox.setVisibility(View.GONE); subredditNameTextView.setTextColor(customThemeWrapper.getPrimaryTextColor()); + subscriberCountTextView.setTextColor(customThemeWrapper.getSecondaryTextColor()); if (activity.typeface != null) { subredditNameTextView.setTypeface(activity.typeface); + subscriberCountTextView.setTypeface(activity.typeface); } itemView.setOnClickListener(view -> { -- cgit v1.2.3