Add sample Notification and Notification controller classes

This commit is contained in:
neslihanturan 2017-12-20 19:27:04 +03:00
parent 9aa15739ab
commit ddf978f8ca
2 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,26 @@
package fr.free.nrw.commons.notification;
/**
* Created by root on 18.12.2017.
*/
public class Notification {
public NotificationType notificationType;
public String notificationText;
Notification (NotificationType notificationType, String notificationText) {
this.notificationType = notificationType;
this.notificationText = notificationText;
}
public enum NotificationType {
/* Added for test purposes, needs to be rescheduled after implementing
fetching notifications from server */
edit,
mention,
message,
block;
}
}

View file

@ -0,0 +1,23 @@
package fr.free.nrw.commons.notification;
import java.util.ArrayList;
import java.util.List;
/**
* Created by root on 19.12.2017.
*/
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.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.message, "notification 7"));
return notifications;
}
}