diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java index 4fa683f0..491ef993 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java @@ -34,6 +34,7 @@ import org.joinmastodon.android.ui.AccountSwitcherSheet; import org.joinmastodon.android.ui.OutlineProviders; import org.joinmastodon.android.ui.utils.UiUtils; import org.joinmastodon.android.ui.views.TabBar; +import org.joinmastodon.android.utils.ObjectIdComparator; import org.parceler.Parcels; import java.util.ArrayList; @@ -321,11 +322,11 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene @SuppressLint("DefaultLocale") private void updateUnreadCount(List notifications, String marker){ - if(notifications.isEmpty() || notifications.get(0).id.compareTo(marker)<=0){ + if(notifications.isEmpty() || ObjectIdComparator.INSTANCE.compare(notifications.get(0).id, marker)<=0){ notificationsBadge.setVisibility(View.GONE); }else{ notificationsBadge.setVisibility(View.VISIBLE); - if(notifications.get(notifications.size()-1).id.compareTo(marker)>0){ + if(ObjectIdComparator.INSTANCE.compare(notifications.get(notifications.size()-1).id, marker)>0){ notificationsBadge.setText(String.format("%d+", notifications.size())); }else{ int count=0; diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index d9f093e8..4924943e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -200,7 +200,7 @@ public class NotificationsListFragment extends BaseStatusListFragment