diff options
Diffstat (limited to '')
3 files changed, 27 insertions, 7 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/action_save_customize_comment_filter_activity" + android:orderInCategory="1" + android:title="@string/action_save" + android:icon="@drawable/ic_check_circle_toolbar_24dp" + app:showAsAction="ifRoom" /> + + <item + android:id="@+id/action_save_to_database_customize_comment_filter_activity" + android:orderInCategory="2" + android:title="@string/action_save_to_database" + android:icon="@drawable/ic_save_to_database_24dp" + app:showAsAction="ifRoom" /> +</menu>
\ 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 @@ <string name="edit_post_filter_name_of_usage_info">Leave it blank to apply this post filter to all the subreddits / users / multireddits</string> <string name="comment_filter_name_hint">Comment Filter Name</string> + <string name="comment_filter_requires_a_name">What is the name of this comment filter?</string> + <string name="duplicate_comment_filter_dialog_title">\'%1$s\' Already Exists</string> + <string name="duplicate_comment_filter_dialog_message">Override it?</string> <string name="read_all_messages_time_limit">You are doing this too frequently. Try again later. This is Reddit API\'s rate limit.</string> <string name="read_all_messages_success">Read all messages successfully</string> |