Fix unread notifications

This commit is contained in:
Grishka 2023-06-12 18:54:46 +03:00
parent 14bbe1ffef
commit aa9caefed1
2 changed files with 4 additions and 3 deletions

View File

@ -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<Notification> 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;

View File

@ -200,7 +200,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
}
}
}
});
}, 0);
}
@Override