aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostFilterUsageEmbeddedRecyclerViewAdapter.java31
-rw-r--r--app/src/main/res/values/strings.xml3
2 files changed, 33 insertions, 1 deletions
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;
+ }
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 44534471..7cab6989 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1145,10 +1145,13 @@
<string name="post_filter_usage_home">Home</string>
<string name="post_filter_usage_subreddit">Subreddit: %1$s</string>
<string name="post_filter_usage_subreddit_all">Subreddit</string>
+ <string name="post_filter_usage_embedded_subreddit_all">All subreddits</string>
<string name="post_filter_usage_user">User: %1$s</string>
<string name="post_filter_usage_user_all">User</string>
+ <string name="post_filter_usage_embedded_user_all">All users</string>
<string name="post_filter_usage_multireddit">MultiReddit: %1$s</string>
<string name="post_filter_usage_multireddit_all">MultiReddit</string>
+ <string name="post_filter_usage_embedded_multireddit_all">All Multireddits</string>
<string name="post_filter_usage_search">Search</string>
<string name="subreddit">Subreddit</string>
<string name="user">User</string>