diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-01-29 23:28:41 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-01-29 23:28:41 +0100 |
commit | 26bc2d387f9efb4fa936b95b2c6cc26b8503757f (patch) | |
tree | 2e36b529262f3d18565c7835b4d86b477d748a0d /src/main/java/eu | |
parent | c237a550932b7e68f2f754b8fe33248ae9f0ee5c (diff) | |
parent | 48604a66201e0c0f403ba1576e35833c7407a7d0 (diff) |
Merge pull request #923 from SamWhited/material-design-icons
Start experimenting with material design icons
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/NotificationService.java | 23 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 9 |
2 files changed, 24 insertions, 8 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); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 7aa48c0c..299fb848 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -10,6 +10,7 @@ import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.IntentSender.SendIntentException; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.SystemClock; import android.provider.MediaStore; @@ -296,8 +297,12 @@ public class ConversationActivity extends XmppActivity if (this.getSelectedConversation() != null) { if (this.getSelectedConversation().getLatestMessage() .getEncryption() != Message.ENCRYPTION_NONE) { - menuSecure.setIcon(R.drawable.ic_action_secure); - } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + menuSecure.setIcon(R.drawable.ic_lock_outline_white_48dp); + } else { + menuSecure.setIcon(R.drawable.ic_action_secure); + } + } if (this.getSelectedConversation().getMode() == Conversation.MODE_MULTI) { menuContactDetails.setVisible(false); menuAttach.setVisible(false); |