mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Add date with year parameter to Notification class, because we will use it on comparasion of dates
This commit is contained in:
parent
0ef52659b3
commit
a759741c86
2 changed files with 12 additions and 2 deletions
|
|
@ -11,13 +11,15 @@ public class Notification {
|
||||||
public String description;
|
public String description;
|
||||||
public String link;
|
public String link;
|
||||||
public String iconUrl;
|
public String iconUrl;
|
||||||
|
public String dateWithYear;
|
||||||
|
|
||||||
public Notification(NotificationType notificationType, String notificationText, String date, String description, String link, String iconUrl) {
|
public Notification(NotificationType notificationType, String notificationText, String date, String description, String link, String iconUrl, String dateWithYear) {
|
||||||
this.notificationType = notificationType;
|
this.notificationType = notificationType;
|
||||||
this.notificationText = notificationText;
|
this.notificationText = notificationText;
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.link = link;
|
this.link = link;
|
||||||
this.iconUrl = iconUrl;
|
this.iconUrl = iconUrl;
|
||||||
|
this.dateWithYear = dateWithYear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ public class NotificationUtils {
|
||||||
notificationText = getWelcomeMessage(context, document);
|
notificationText = getWelcomeMessage(context, document);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return new Notification(type, notificationText, getTimestamp(document), description, link, iconUrl);
|
return new Notification(type, notificationText, getTimestamp(document), description, link, iconUrl, getTimestampWithYear(document));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getNotificationText(Node document) {
|
private static String getNotificationText(Node document) {
|
||||||
|
|
@ -247,6 +247,14 @@ public class NotificationUtils {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getTimestampWithYear(Node document) {
|
||||||
|
Element timestampElement = (Element) getNode(document, "timestamp");
|
||||||
|
if (timestampElement != null) {
|
||||||
|
return timestampElement.getAttribute("utcunix");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
private static String getNotificationDescription(Node document) {
|
private static String getNotificationDescription(Node document) {
|
||||||
Element titleElement = (Element) getNode(document, "title");
|
Element titleElement = (Element) getNode(document, "title");
|
||||||
if (titleElement != null) {
|
if (titleElement != null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue