mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Add sample Notification and Notification controller classes
This commit is contained in:
parent
9aa15739ab
commit
ddf978f8ca
2 changed files with 49 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue