mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Add icons for notification list
This commit is contained in:
parent
76ee338a20
commit
7abb530207
6 changed files with 56 additions and 27 deletions
|
|
@ -12,11 +12,11 @@ public class NotificationController {
|
|||
public static List<Notification> loadNotifications() {
|
||||
List<Notification> notifications = new ArrayList<>();
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 1"));
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 2"));
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 3"));
|
||||
notifications.add(new Notification(Notification.NotificationType.edit, "notification 2"));
|
||||
notifications.add(new Notification(Notification.NotificationType.mention, "notification 3"));
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 4"));
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 5"));
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 6"));
|
||||
notifications.add(new Notification(Notification.NotificationType.edit, "notification 5"));
|
||||
notifications.add(new Notification(Notification.NotificationType.mention, "notification 6"));
|
||||
notifications.add(new Notification(Notification.NotificationType.message, "notification 7"));
|
||||
return notifications;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,10 @@ import fr.free.nrw.commons.R;
|
|||
*/
|
||||
|
||||
public class NotificationRenderer extends Renderer<Notification> {
|
||||
@BindView(R.id.tvName)
|
||||
TextView tvName;
|
||||
@BindView(R.id.tvDesc) TextView tvDesc;
|
||||
@BindView(R.id.distance) TextView distance;
|
||||
@BindView(R.id.icon)
|
||||
ImageView icon;
|
||||
@BindView(R.id.title) TextView title;
|
||||
@BindView(R.id.description) TextView description;
|
||||
@BindView(R.id.time) TextView time;
|
||||
@BindView(R.id.icon) ImageView icon;
|
||||
private NotificationClicked listener;
|
||||
|
||||
|
||||
|
|
@ -48,16 +46,19 @@ public class NotificationRenderer extends Renderer<Notification> {
|
|||
@Override
|
||||
public void render() {
|
||||
Notification notification = getContent();
|
||||
tvName.setText(notification.notificationText);
|
||||
title.setText(notification.notificationText);
|
||||
time.setText("3d");
|
||||
description.setText("Example notification description");
|
||||
switch (notification.notificationType) {
|
||||
case edit:
|
||||
icon.setImageResource(R.drawable.round_icon_unknown);
|
||||
icon.setImageResource(R.drawable.ic_edit_black_24dp);
|
||||
break;
|
||||
case message:
|
||||
icon.setImageResource(R.drawable.round_icon_unknown);
|
||||
icon.setImageResource(R.drawable.ic_message_black_24dp);
|
||||
break;
|
||||
case mention:
|
||||
icon.setImageResource(R.drawable.round_icon_unknown);
|
||||
case block:
|
||||
icon.setImageResource(R.drawable.round_icon_unknown);
|
||||
icon.setImageResource(R.drawable.ic_chat_bubble_black_24px);
|
||||
break;
|
||||
default:
|
||||
icon.setImageResource(R.drawable.round_icon_unknown);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue