diff options
author | Mario Zorz <mariozorz@gmail.com> | 2016-09-26 20:00:24 -0300 |
---|---|---|
committer | Mario Zorz <mariozorz@gmail.com> | 2016-09-26 20:00:24 -0300 |
commit | 4a8d269ca526ff3f261274a8535e53e8397fa0fe (patch) | |
tree | c33c9bf2aaa903a531142154830adc11e77cce8b | |
parent | afea67a342d4482ddef8a9535a78ea312b2a77d4 (diff) | |
download | gradle-perf-android-medium-4a8d269ca526ff3f261274a8535e53e8397fa0fe.tar.gz |
literals extracted to string constants for readability/reuse
-rw-r--r-- | WordPress/src/main/java/org/wordpress/android/GCMMessageService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/WordPress/src/main/java/org/wordpress/android/GCMMessageService.java b/WordPress/src/main/java/org/wordpress/android/GCMMessageService.java index 6d56b9cb3..de0e92aa9 100644 --- a/WordPress/src/main/java/org/wordpress/android/GCMMessageService.java +++ b/WordPress/src/main/java/org/wordpress/android/GCMMessageService.java @@ -73,6 +73,11 @@ public class GCMMessageService extends GcmListenerService { private static final String PUSH_TYPE_PUSH_AUTH = "push_auth"; private static final String PUSH_TYPE_BADGE_RESET = "badge-reset"; + private static final String KEY_CATEGORY_COMMENT_LIKE = "comment-like"; + private static final String KEY_CATEGORY_COMMENT_REPLY = "comment-reply"; + private static final String KEY_CATEGORY_COMMENT_MODERATE = "comment-moderate"; + + // Add to the analytics properties map a subset of the push notification payload. private static String[] propertiesToCopyIntoAnalytics = {PUSH_ARG_NOTE_ID, PUSH_ARG_TYPE, "blog_id", "post_id", "comment_id"}; @@ -250,7 +255,7 @@ public class GCMMessageService extends GcmListenerService { private void addCommentReplyActionForCommentNotification(NotificationCompat.Builder builder, String noteId) { // adding comment reply action Intent commentReplyIntent = getCommentActionIntent(); - commentReplyIntent.addCategory("comment-reply"); + commentReplyIntent.addCategory(KEY_CATEGORY_COMMENT_REPLY); commentReplyIntent.putExtra(NotificationsListFragment.NOTE_INSTANT_REPLY_EXTRA, true); if (noteId != null) { commentReplyIntent.putExtra(NotificationsListFragment.NOTE_ID_EXTRA, noteId); @@ -264,7 +269,7 @@ public class GCMMessageService extends GcmListenerService { private void addCommentLikeActionForCommentNotification(NotificationCompat.Builder builder, String noteId) { // adding comment like action Intent commentLikeIntent = getCommentActionIntent(); - commentLikeIntent.addCategory("comment-like"); + commentLikeIntent.addCategory(KEY_CATEGORY_COMMENT_LIKE); commentLikeIntent.putExtra(NotificationsListFragment.NOTE_INSTANT_LIKE_EXTRA, true); if (noteId != null) { commentLikeIntent.putExtra(NotificationsListFragment.NOTE_ID_EXTRA, noteId); @@ -278,7 +283,7 @@ public class GCMMessageService extends GcmListenerService { private void addCommentApproveActionForCommentNotification(NotificationCompat.Builder builder, String noteId) { // adding comment approve action Intent commentApproveIntent = getCommentActionIntent(); - commentApproveIntent.addCategory("comment-moderate"); + commentApproveIntent.addCategory(KEY_CATEGORY_COMMENT_MODERATE); commentApproveIntent.putExtra(NotificationsListFragment.NOTE_INSTANT_APPROVE_EXTRA, true); if (noteId != null) { commentApproveIntent.putExtra(NotificationsListFragment.NOTE_ID_EXTRA, noteId); |