diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java index 10737a9a6..92ba891ff 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java @@ -39,6 +39,7 @@ import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; import app.fedilab.android.client.entities.api.Conversation; import app.fedilab.android.client.entities.api.Conversations; +import app.fedilab.android.client.entities.api.Pagination; import app.fedilab.android.client.entities.app.StatusCache; import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.FragmentPaginationBinding; @@ -89,6 +90,14 @@ public class FragmentMastodonConversation extends Fragment implements Conversati isViewInitialized = true; if (initialConversations != null && initialConversations.conversations != null && initialConversations.conversations.size() > 0) { initializeConversationCommonView(initialConversations); + } else { + Conversations conversations = new Conversations(); + if (conversationList != null && conversationList.size() > 0) { + conversations.pagination = new Pagination(); + conversations.pagination.max_id = conversationList.get(conversationList.size() - 1).id; + conversations.pagination.min_id = conversationList.get(0).id; + } + initializeConversationCommonView(conversations); } } } diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java index 6454d8197..9526a251f 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java @@ -45,6 +45,7 @@ import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; import app.fedilab.android.client.entities.api.Notification; import app.fedilab.android.client.entities.api.Notifications; +import app.fedilab.android.client.entities.api.Pagination; import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.client.entities.app.StatusCache; import app.fedilab.android.client.entities.app.Timeline; @@ -299,6 +300,14 @@ public class FragmentMastodonNotification extends Fragment implements Notificati isViewInitialized = true; if (initialNotifications != null && initialNotifications.notifications != null && initialNotifications.notifications.size() > 0) { initializeNotificationView(initialNotifications); + } else { + Notifications notifications = new Notifications(); + if (notificationList != null && notificationList.size() > 0) { + notifications.pagination = new Pagination(); + notifications.pagination.max_id = notificationList.get(notificationList.size() - 1).id; + notifications.pagination.min_id = notificationList.get(0).id; + } + initializeNotificationView(notifications); } } } diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java index aad9893e9..b98604fab 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java @@ -159,6 +159,14 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. isViewInitialized = true; if (initialStatuses != null && initialStatuses.statuses != null && initialStatuses.statuses.size() > 0) { initializeStatusesCommonView(initialStatuses); + } else { + Statuses statuses = new Statuses(); + if (timelineStatuses != null && timelineStatuses.size() > 0) { + statuses.pagination = new Pagination(); + statuses.pagination.max_id = timelineStatuses.get(timelineStatuses.size() - 1).id; + statuses.pagination.min_id = timelineStatuses.get(0).id; + } + initializeStatusesCommonView(statuses); } } if (timelineStatuses != null && timelineStatuses.size() > 0) {