From db4f416d4be8ba5769bef9e03cebdf2173ea2ef2 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sun, 15 Oct 2023 10:27:41 -0400 Subject: Continue implementing showing post filter usages in PostFilterPreferenceActivity. --- ...PostFilterUsageEmbeddedRecyclerViewAdapter.java | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostFilterUsageEmbeddedRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostFilterUsageEmbeddedRecyclerViewAdapter.java index 51c3fc76..050afbd2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostFilterUsageEmbeddedRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostFilterUsageEmbeddedRecyclerViewAdapter.java @@ -37,7 +37,36 @@ public class PostFilterUsageEmbeddedRecyclerViewAdapter extends RecyclerView.Ada } else if (holder.getBindingAdapterPosition() > 4) { holder.textView.setText(baseActivity.getString(R.string.post_filter_usage_embedded_more_count, postFilterUsageList.size() - 5)); } else { - holder.textView.setText(postFilterUsageList.get(holder.getBindingAdapterPosition()).nameOfUsage); + PostFilterUsage postFilterUsage = postFilterUsageList.get(holder.getBindingAdapterPosition()); + switch (postFilterUsage.usage) { + case PostFilterUsage.HOME_TYPE: + holder.textView.setText(R.string.post_filter_usage_home); + break; + case PostFilterUsage.SUBREDDIT_TYPE: + if (postFilterUsage.nameOfUsage.equals(PostFilterUsage.NO_USAGE)) { + holder.textView.setText(R.string.post_filter_usage_embedded_subreddit_all); + } else { + holder.textView.setText("r/" + postFilterUsage.nameOfUsage); + } + break; + case PostFilterUsage.USER_TYPE: + if (postFilterUsage.nameOfUsage.equals(PostFilterUsage.NO_USAGE)) { + holder.textView.setText(R.string.post_filter_usage_embedded_user_all); + } else { + holder.textView.setText("u/" + postFilterUsage.nameOfUsage); + } + break; + case PostFilterUsage.SEARCH_TYPE: + holder.textView.setText(R.string.post_filter_usage_search); + break; + case PostFilterUsage.MULTIREDDIT_TYPE: + if (postFilterUsage.nameOfUsage.equals(PostFilterUsage.NO_USAGE)) { + holder.textView.setText(R.string.post_filter_usage_embedded_multireddit_all); + } else { + holder.textView.setText(postFilterUsage.nameOfUsage); + } + break; + } } } -- cgit v1.2.3