From 2af02771d10546fc52711208871face9dc29d854 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:24:42 -0400 Subject: Continue adding comment filter. --- .../activities/CustomizeCommentFilterActivity.java | 14 +++++++------- .../main/res/menu/customize_comment_filter_activity.xml | 17 +++++++++++++++++ app/src/main/res/values/strings.xml | 3 +++ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/menu/customize_comment_filter_activity.xml (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java index 6b07e1df..6a3e0644 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeCommentFilterActivity.java @@ -176,9 +176,9 @@ public class CustomizeCommentFilterActivity extends BaseActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { - getMenuInflater().inflate(R.menu.customize_post_filter_activity, menu); + getMenuInflater().inflate(R.menu.customize_comment_filter_activity, menu); if (fromSettings) { - menu.findItem(R.id.action_save_customize_post_filter_activity).setVisible(false); + menu.findItem(R.id.action_save_customize_comment_filter_activity).setVisible(false); } applyMenuItemTheme(menu); return true; @@ -189,7 +189,7 @@ public class CustomizeCommentFilterActivity extends BaseActivity { if (item.getItemId() == android.R.id.home) { finish(); return true; - } else if (item.getItemId() == R.id.action_save_customize_post_filter_activity) { + } else if (item.getItemId() == R.id.action_save_customize_comment_filter_activity) { try { constructCommentFilter(); Intent returnIntent = new Intent(); @@ -201,14 +201,14 @@ public class CustomizeCommentFilterActivity extends BaseActivity { } return true; - } else if (item.getItemId() == R.id.action_save_to_database_customize_post_filter_activity) { + } else if (item.getItemId() == R.id.action_save_to_database_customize_comment_filter_activity) { try { constructCommentFilter(); if (!commentFilter.name.equals("")) { saveCommentFilter(originalName); } else { - Toast.makeText(CustomizeCommentFilterActivity.this, R.string.post_filter_requires_a_name, Toast.LENGTH_LONG).show(); + Toast.makeText(CustomizeCommentFilterActivity.this, R.string.comment_filter_requires_a_name, Toast.LENGTH_LONG).show(); } } catch (PatternSyntaxException e) { Toast.makeText(this, R.string.invalid_regex, Toast.LENGTH_SHORT).show(); @@ -231,8 +231,8 @@ public class CustomizeCommentFilterActivity extends BaseActivity { @Override public void duplicate() { new MaterialAlertDialogBuilder(CustomizeCommentFilterActivity.this, R.style.MaterialAlertDialogTheme) - .setTitle(getString(R.string.duplicate_post_filter_dialog_title, commentFilter.name)) - .setMessage(R.string.duplicate_post_filter_dialog_message) + .setTitle(getString(R.string.duplicate_comment_filter_dialog_title, commentFilter.name)) + .setMessage(R.string.duplicate_comment_filter_dialog_message) .setPositiveButton(R.string.override, (dialogInterface, i) -> saveCommentFilter(commentFilter.name)) .setNegativeButton(R.string.cancel, null) .show(); diff --git a/app/src/main/res/menu/customize_comment_filter_activity.xml b/app/src/main/res/menu/customize_comment_filter_activity.xml new file mode 100644 index 00000000..8d947f81 --- /dev/null +++ b/app/src/main/res/menu/customize_comment_filter_activity.xml @@ -0,0 +1,17 @@ + +
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fbd5f4f0..863c9ba9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1158,6 +1158,9 @@