From c5e84605169f72138dd56123eb1cde1e911d12d9 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 16 Mar 2023 01:02:33 +0100 Subject: [PATCH] change notification action names --- .../android/PushNotificationReceiver.java | 14 +++++++------- .../android/model/NotificationAction.java | 4 ++-- mastodon/src/main/res/values/strings_sk.xml | 5 ----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index a9175a983..776ca9fef 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -123,8 +123,8 @@ public class PushNotificationReceiver extends BroadcastReceiver{ switch (NotificationAction.values()[intent.getIntExtra("notificationAction", 0)]) { case FAVORITE -> new SetStatusFavorited(statusID, true).exec(accountID); case BOOKMARK -> new SetStatusBookmarked(statusID, true).exec(accountID); - case BOOST -> new SetStatusReblogged(notification.status.id, true, preferences.postingDefaultVisibility).exec(accountID); - case UNBOOST -> new SetStatusReblogged(notification.status.id, false, preferences.postingDefaultVisibility).exec(accountID); + case REBLOG -> new SetStatusReblogged(notification.status.id, true, preferences.postingDefaultVisibility).exec(accountID); + case UNDO_REBLOG -> new SetStatusReblogged(notification.status.id, false, preferences.postingDefaultVisibility).exec(accountID); case REPLY -> handleReplyAction(context, accountID, intent, notification, notificationId, preferences); default -> Log.w(TAG, "onReceive: Failed to get NotificationAction"); } @@ -215,15 +215,15 @@ public class PushNotificationReceiver extends BroadcastReceiver{ if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){ builder.addAction(buildReplyAction(context, id, accountID, notification)); } - builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.sk_notification_action_favorite), NotificationAction.FAVORITE)); - builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.sk_notification_action_bookmark), NotificationAction.BOOKMARK)); + builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.button_favorite), NotificationAction.FAVORITE)); + builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.add_bookmark), NotificationAction.BOOKMARK)); if(notification.status.visibility != StatusPrivacy.DIRECT) { - builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.sk_notification_action_boost), NotificationAction.BOOST)); + builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.button_reblog), NotificationAction.REBLOG)); } } case UPDATE -> { if(notification.status.reblogged) - builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.sk_notification_action_unboost), NotificationAction.UNBOOST)); + builder.addAction(buildNotificationAction(context, id, accountID, notification, context.getString(R.string.sk_undo_reblog), NotificationAction.UNDO_REBLOG)); } } } @@ -244,7 +244,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{ } private Notification.Action buildReplyAction(Context context, int notificationId, String accountID, org.joinmastodon.android.model.Notification notification){ - String replyLabel = context.getResources().getString(R.string.sk_notification_action_reply); + String replyLabel = context.getResources().getString(R.string.button_reply); RemoteInput remoteInput = new RemoteInput.Builder(ACTION_KEY_TEXT_REPLY) .setLabel(replyLabel) .build(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java b/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java index 420bb1d1a..4f43a51a8 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/NotificationAction.java @@ -2,8 +2,8 @@ package org.joinmastodon.android.model; public enum NotificationAction { FAVORITE, - BOOST, - UNBOOST, + REBLOG, + UNDO_REBLOG, BOOKMARK, REPLY, } diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index 9fbaee7c8..c485ebbb5 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -267,11 +267,6 @@ Follow from other account Followed from %s Auto-hide Compose button - Favorite - Bookmark - Boost - Unboost - Reply Successfully replied to the post by %s In reply “In reply to” line above avatar