diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-08-30 22:35:27 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-08-30 22:35:27 +0200 |
commit | e38ef5e22dd2429e919c20cca413db711cb7b740 (patch) | |
tree | 1076e6d5e24f81d295282e1fdb75444e1874c027 /src/main/java/de/pixart/messenger/services/NotificationService.java | |
parent | bca4507864ef74ad6923f0b9f350c90f533942f4 (diff) |
bug fix in notification service
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/NotificationService.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/NotificationService.java | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java index ce151931a..c2e62fbd6 100644 --- a/src/main/java/de/pixart/messenger/services/NotificationService.java +++ b/src/main/java/de/pixart/messenger/services/NotificationService.java @@ -6,7 +6,6 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.Resources; import android.graphics.Bitmap; import android.net.Uri; import android.os.Build; @@ -327,26 +326,26 @@ public class NotificationService { } else { modifyForTextOnly(mBuilder, messages); } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - RemoteInput remoteInput = new RemoteInput.Builder("text_reply").setLabel(UIHelper.getMessageHint(mXmppConnectionService, conversation)).build(); - NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_send_text_offline, "Reply", createReplyIntent(conversation)).addRemoteInput(remoteInput).build(); - mBuilder.addAction(action); - if ((message = getFirstDownloadableMessage(messages)) != null) { - mBuilder.addAction( - Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? - R.drawable.ic_file_download_white_24dp : R.drawable.ic_action_download, - mXmppConnectionService.getResources().getString(R.string.download_x_file, - UIHelper.getFileDescriptionString(mXmppConnectionService, message)), - createDownloadIntent(message) - ); - } - } - if ((message = getFirstLocationMessage(messages)) != null) { - mBuilder.addAction(R.drawable.ic_room_white_24dp, - mXmppConnectionService.getString(R.string.show_location), - createShowLocationIntent(message)); - } - } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + RemoteInput remoteInput = new RemoteInput.Builder("text_reply").setLabel(UIHelper.getMessageHint(mXmppConnectionService, conversation)).build(); + NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_send_text_offline, "Reply", createReplyIntent(conversation)).addRemoteInput(remoteInput).build(); + mBuilder.addAction(action); + } + if ((message = getFirstDownloadableMessage(messages)) != null) { + mBuilder.addAction( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? + R.drawable.ic_file_download_white_24dp : R.drawable.ic_action_download, + mXmppConnectionService.getResources().getString(R.string.download_x_file, + UIHelper.getFileDescriptionString(mXmppConnectionService, message)), + createDownloadIntent(message) + ); + } + if ((message = getFirstLocationMessage(messages)) != null) { + mBuilder.addAction(R.drawable.ic_room_white_24dp, + mXmppConnectionService.getString(R.string.show_location), + createShowLocationIntent(message)); + } + } if (conversation.getMode() == Conversation.MODE_SINGLE) { Contact contact = conversation.getContact(); Uri systemAccount = contact.getSystemAccount(); |