aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2015-01-21 23:00:35 -0500
committerSam Whited <sam@samwhited.com>2015-01-29 15:28:26 -0500
commit48604a66201e0c0f403ba1576e35833c7407a7d0 (patch)
tree2e36b529262f3d18565c7835b4d86b477d748a0d /src/main/java/eu/siacs/conversations/services
parentc237a550932b7e68f2f754b8fe33248ae9f0ee5c (diff)
Use Material Design Icons on API 21+
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 894af421..2ea0904f 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -270,7 +270,8 @@ public class NotificationService {
}
if ((message = getFirstDownloadableMessage(messages)) != null) {
mBuilder.addAction(
- R.drawable.ic_action_download,
+ 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)
@@ -446,18 +447,24 @@ public class NotificationService {
public Notification createForegroundNotification() {
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_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);
+ final int cancelIcon;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mBuilder.setCategory(Notification.CATEGORY_SERVICE);
+ mBuilder.setSmallIcon(R.drawable.ic_import_export_white_48dp);
+ cancelIcon = R.drawable.ic_cancel_white_24dp;
+ } else {
+ mBuilder.setSmallIcon(R.drawable.ic_stat_communication_import_export);
+ cancelIcon = R.drawable.ic_action_cancel;
}
+ mBuilder.addAction(cancelIcon,
+ mXmppConnectionService.getString(R.string.disable_foreground_service),
+ createDisableForeground());
setNotificationColor(mBuilder);
return mBuilder.build();
}
@@ -487,7 +494,11 @@ public class NotificationService {
}
mBuilder.setOngoing(true);
//mBuilder.setLights(0xffffffff, 2000, 4000);
- mBuilder.setSmallIcon(R.drawable.ic_stat_alert_warning);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ mBuilder.setSmallIcon(R.drawable.ic_warning_white_36dp);
+ } else {
+ mBuilder.setSmallIcon(R.drawable.ic_stat_alert_warning);
+ }
final TaskStackBuilder stackBuilder = TaskStackBuilder.create(mXmppConnectionService);
stackBuilder.addParentStack(ConversationActivity.class);