New notification icons for c2dm and default astrid

pull/14/head
Tim Su 13 years ago
parent 06330e4f45
commit 2cf0de3ac0

@ -166,9 +166,11 @@ public class C2DMReceiver extends BroadcastReceiver {
PendingIntent pendingIntent = PendingIntent.getActivity(context,
notifId, notifyIntent, 0);
int icon = calculateIcon(intent);
// create notification
NotificationManager nm = new AndroidNotificationManager(ContextManager.getContext());
Notification notification = new Notification(R.drawable.notif_pink_alarm,
Notification notification = new Notification(icon,
message, System.currentTimeMillis());
String title;
if(intent.hasExtra("title"))
@ -194,6 +196,27 @@ public class C2DMReceiver extends BroadcastReceiver {
}
}
private int calculateIcon(Intent intent) {
if(intent.hasExtra("type")) {
String type = intent.getStringExtra("type");
if("f".equals(type))
return R.drawable.notif_c2dm_done;
if("s".equals(type))
return R.drawable.notif_c2dm_assign;
if("l".equals(type))
return R.drawable.notif_c2dm_assign;
} else {
String message = intent.getStringExtra("alert");
if(message.contains(" finished "))
return R.drawable.notif_c2dm_done;
if(message.contains(" invited you to "))
return R.drawable.notif_c2dm_assign;
if(message.contains(" sent you "))
return R.drawable.notif_c2dm_assign;
}
return R.drawable.notif_c2dm_msg;
}
private Intent createTaskIntent(Intent intent) {
TodorooCursor<Task> cursor = taskService.query(
Query.select(Task.PROPERTIES).where(Task.REMOTE_ID.eq(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Loading…
Cancel
Save