From 63b60a46ae1aef830ffd96ba1bfc620796ede32e Mon Sep 17 00:00:00 2001 From: Daniele Date: Wed, 22 Sep 2021 08:38:23 +0200 Subject: [PATCH] Fixed bug in list order for new items --- .../it/danieleverducci/nextcloudmaps/model/Geofavorite.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/model/Geofavorite.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/model/Geofavorite.java index 47ee8b4..2996bb9 100644 --- a/app/src/main/java/it/danieleverducci/nextcloudmaps/model/Geofavorite.java +++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/model/Geofavorite.java @@ -148,8 +148,8 @@ public class Geofavorite implements Serializable { this.comment = comment; } - public static Comparator ByTitleAZ = (note, t1) -> note.name.compareTo(t1.name); - public static Comparator ByLastCreated = (note, t1) -> t1.id - note.id; + public static Comparator ByTitleAZ = (gf0, gf1) -> gf0.name.compareTo(gf1.name); + public static Comparator ByLastCreated = (gf0, gf1) -> (int) (gf1.dateCreated - gf0.dateCreated); public String getCoordinatesString() { return this.lat + " N, " + this.lng + " E";