fix gaps not showing time

closes sk22#889
This commit is contained in:
sk
2023-10-27 16:14:16 +02:00
parent 4cab916957
commit 375b5b3133

View File

@@ -64,16 +64,14 @@ public class GapStatusDisplayItem extends StatusDisplayItem{
} }
top.setClickable(!item.loading); top.setClickable(!item.loading);
bottom.setClickable(!item.loading); bottom.setClickable(!item.loading);
StatusDisplayItem next=item.parentFragment instanceof StatusListFragment Status next=!(item.parentFragment instanceof StatusListFragment) ? null : getNextVisibleDisplayItem(i->{
? getNextVisibleDisplayItem(i->{ Status s=((StatusListFragment) item.parentFragment).getStatusByID(i.parentID);
Status s=((StatusListFragment) item.parentFragment).getStatusByID(i.parentID); return s!=null && !s.fromStatusCreated;
return s!=null && !s.fromStatusCreated; })
}).orElse(null) .map(i->((StatusListFragment) item.parentFragment).getStatusByID(i.parentID))
: null; .orElse(null);
bottom.setVisibility(next==null ? View.GONE : View.VISIBLE); bottom.setVisibility(next==null ? View.GONE : View.VISIBLE);
Instant dateBelow=next instanceof HeaderStatusDisplayItem h ? h.status.createdAt Instant dateBelow=next!=null ? next.createdAt : null;
: next instanceof ReblogOrReplyLineStatusDisplayItem l ? l.status.createdAt
: null;
String text=dateBelow!=null && item.status.createdAt!=null && dateBelow.isBefore(item.status.createdAt) String text=dateBelow!=null && item.status.createdAt!=null && dateBelow.isBefore(item.status.createdAt)
? UiUtils.formatPeriodBetween(item.parentFragment.getContext(), dateBelow, item.status.createdAt) ? UiUtils.formatPeriodBetween(item.parentFragment.getContext(), dateBelow, item.status.createdAt)
: null; : null;