diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/NotificationService.java | 11 | ||||
-rw-r--r-- | src/main/res/drawable-hdpi/ic_action_cancel.png | bin | 0 -> 353 bytes | |||
-rw-r--r-- | src/main/res/drawable-mdpi/ic_action_cancel.png | bin | 0 -> 272 bytes | |||
-rw-r--r-- | src/main/res/drawable-xhdpi/ic_action_cancel.png | bin | 0 -> 415 bytes | |||
-rw-r--r-- | src/main/res/drawable-xxhdpi/ic_action_cancel.png | bin | 0 -> 574 bytes | |||
-rw-r--r-- | src/main/res/values/strings.xml | 3 |
6 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 6f02fca9c..a32bb2797 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -409,13 +409,20 @@ public class NotificationService { final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mXmppConnectionService); mBuilder.setSmallIcon(R.drawable.ic_stat_communication_import_export); mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service)); - mBuilder.setContentText(mXmppConnectionService.getString(R.string.touch_to_disable)); - mBuilder.setContentIntent(createDisableForeground()); + mBuilder.setContentText(mXmppConnectionService.getString(R.string.touch_to_open_conversations)); + mBuilder.addAction(R.drawable.ic_action_cancel, + mXmppConnectionService.getString(R.string.disable_foreground_service), + createDisableForeground()); + mBuilder.setContentIntent(createOpenConversationsIntent()); mBuilder.setWhen(0); mBuilder.setPriority(NotificationCompat.PRIORITY_MIN); return mBuilder.build(); } + private PendingIntent createOpenConversationsIntent() { + return PendingIntent.getActivity(mXmppConnectionService, 0, new Intent(mXmppConnectionService,ConversationActivity.class),0); + } + public void updateErrorNotification() { final NotificationManager mNotificationManager = (NotificationManager) mXmppConnectionService.getSystemService(Context.NOTIFICATION_SERVICE); final List<Account> errors = new ArrayList<>(); diff --git a/src/main/res/drawable-hdpi/ic_action_cancel.png b/src/main/res/drawable-hdpi/ic_action_cancel.png Binary files differnew file mode 100644 index 000000000..e206f296c --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_action_cancel.png diff --git a/src/main/res/drawable-mdpi/ic_action_cancel.png b/src/main/res/drawable-mdpi/ic_action_cancel.png Binary files differnew file mode 100644 index 000000000..70e6d2d2a --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_action_cancel.png diff --git a/src/main/res/drawable-xhdpi/ic_action_cancel.png b/src/main/res/drawable-xhdpi/ic_action_cancel.png Binary files differnew file mode 100644 index 000000000..d1634205d --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_action_cancel.png diff --git a/src/main/res/drawable-xxhdpi/ic_action_cancel.png b/src/main/res/drawable-xxhdpi/ic_action_cancel.png Binary files differnew file mode 100644 index 000000000..5dc214356 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_action_cancel.png diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 54ab2c50a..883a41e77 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -357,7 +357,6 @@ <string name="smp_requested">Contact requested SMP verification</string> <string name="no_otr_session_found">No valid OTR session has been found!</string> <string name="conversations_foreground_service">Conversations</string> - <string name="touch_to_disable">Touch to disable foreground service</string> <string name="pref_keep_foreground_service">Keep service in foreground</string> <string name="pref_keep_foreground_service_summary">Prevents the operating system from killing your connection</string> <string name="choose_file">Choose file</string> @@ -441,4 +440,6 @@ <string name="video">video file</string> <string name="pdf_document">PDF document</string> <string name="received_x_file">Received %s</string> + <string name="disable_foreground_service">Disable foreground service</string> + <string name="touch_to_open_conversations">Touch to open Conversations</string> </resources> |