diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-10-15 14:27:41 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-10-15 14:27:41 +0000 |
commit | db4f416d4be8ba5769bef9e03cebdf2173ea2ef2 (patch) | |
tree | 2523b22b4c6fd74e6c69337c6996fead3f468f1e /app/src/main/java/ml | |
parent | 70c2d571ce113d912bfc04cd86af36f602528740 (diff) | |
download | infinity-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/src/main/java/ml')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostFilterUsageEmbeddedRecyclerViewAdapter.java | 31 |
1 files changed, 30 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; + } } } |