aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-10-15 14:27:41 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-10-15 14:27:41 +0000
commitdb4f416d4be8ba5769bef9e03cebdf2173ea2ef2 (patch)
tree2523b22b4c6fd74e6c69337c6996fead3f468f1e /app
parent70c2d571ce113d912bfc04cd86af36f602528740 (diff)
downloadinfinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.tar
infinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.tar.gz
infinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.tar.bz2
infinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.tar.lz
infinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.tar.xz
infinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.tar.zst
infinity-for-reddit-db4f416d4be8ba5769bef9e03cebdf2173ea2ef2.zip
Continue implementing showing post filter usages in PostFilterPreferenceActivity.
Diffstat (limited to 'app')
-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>