Loading app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java +11 −6 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati timelineParams.fetchingMissing = fetchingMissing; if (useCache) { if (useCache && direction != FragmentMastodonTimeline.DIRECTION.SCROLL_TOP && direction != FragmentMastodonTimeline.DIRECTION.FETCH_NEW) { getCachedConversations(direction, fetchingMissing, timelineParams); } else { getLiveConversations(direction, fetchingMissing, timelineParams, conversationToUpdate); Loading @@ -150,7 +150,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati private void getCachedConversations(FragmentMastodonTimeline.DIRECTION direction, boolean fetchingMissing, TimelinesVM.TimelineParams timelineParams) { if (direction == null) { timelinesVM.getConversations(conversationList, timelineParams) timelinesVM.getConversationsCache(conversationList, timelineParams) .observe(getViewLifecycleOwner(), conversationsCached -> { if (conversationsCached == null || conversationsCached.conversations == null || conversationsCached.conversations.size() == 0) { getLiveConversations(null, fetchingMissing, timelineParams, null); Loading Loading @@ -179,13 +179,18 @@ public class FragmentMastodonConversation extends Fragment implements Conversati } }); } else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH) { timelinesVM.getConversations(conversationList, timelineParams) timelinesVM.getConversationsCache(conversationList, timelineParams) .observe(getViewLifecycleOwner(), notificationsRefresh -> { if (notificationsRefresh == null || notificationsRefresh.conversations == null || notificationsRefresh.conversations.size() == 0) { getLiveConversations(direction, fetchingMissing, timelineParams, null); } else { if (conversationAdapter != null) { dealWithPagination(notificationsRefresh, FragmentMastodonTimeline.DIRECTION.REFRESH, true, null); } else { initializeConversationCommonView(notificationsRefresh); } } }); } } Loading app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +8 −4 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } timelineParams.excludeType = getExcludeType(); timelineParams.fetchingMissing = fetchingMissing; if (useCache) { if (useCache && direction != FragmentMastodonTimeline.DIRECTION.SCROLL_TOP && direction != FragmentMastodonTimeline.DIRECTION.FETCH_NEW) { getCachedNotifications(direction, fetchingMissing, timelineParams); } else { getLiveNotifications(direction, fetchingMissing, timelineParams, notificationToUpdate); Loading Loading @@ -430,11 +430,15 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH) { notificationsVM.getNotifications(notificationList, timelineParams) .observe(getViewLifecycleOwner(), notificationsRefresh -> { if (notificationsRefresh == null || notificationsRefresh.notifications == null || notificationsRefresh.notifications.size() == 0) { getLiveNotifications(direction, fetchingMissing, timelineParams, null); } else { if (notificationAdapter != null) { dealWithPagination(notificationsRefresh, FragmentMastodonTimeline.DIRECTION.REFRESH, true, null); } else { initializeNotificationView(notificationsRefresh); } } }); } } Loading Loading
app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonConversation.java +11 −6 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati timelineParams.fetchingMissing = fetchingMissing; if (useCache) { if (useCache && direction != FragmentMastodonTimeline.DIRECTION.SCROLL_TOP && direction != FragmentMastodonTimeline.DIRECTION.FETCH_NEW) { getCachedConversations(direction, fetchingMissing, timelineParams); } else { getLiveConversations(direction, fetchingMissing, timelineParams, conversationToUpdate); Loading @@ -150,7 +150,7 @@ public class FragmentMastodonConversation extends Fragment implements Conversati private void getCachedConversations(FragmentMastodonTimeline.DIRECTION direction, boolean fetchingMissing, TimelinesVM.TimelineParams timelineParams) { if (direction == null) { timelinesVM.getConversations(conversationList, timelineParams) timelinesVM.getConversationsCache(conversationList, timelineParams) .observe(getViewLifecycleOwner(), conversationsCached -> { if (conversationsCached == null || conversationsCached.conversations == null || conversationsCached.conversations.size() == 0) { getLiveConversations(null, fetchingMissing, timelineParams, null); Loading Loading @@ -179,13 +179,18 @@ public class FragmentMastodonConversation extends Fragment implements Conversati } }); } else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH) { timelinesVM.getConversations(conversationList, timelineParams) timelinesVM.getConversationsCache(conversationList, timelineParams) .observe(getViewLifecycleOwner(), notificationsRefresh -> { if (notificationsRefresh == null || notificationsRefresh.conversations == null || notificationsRefresh.conversations.size() == 0) { getLiveConversations(direction, fetchingMissing, timelineParams, null); } else { if (conversationAdapter != null) { dealWithPagination(notificationsRefresh, FragmentMastodonTimeline.DIRECTION.REFRESH, true, null); } else { initializeConversationCommonView(notificationsRefresh); } } }); } } Loading
app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonNotification.java +8 −4 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } timelineParams.excludeType = getExcludeType(); timelineParams.fetchingMissing = fetchingMissing; if (useCache) { if (useCache && direction != FragmentMastodonTimeline.DIRECTION.SCROLL_TOP && direction != FragmentMastodonTimeline.DIRECTION.FETCH_NEW) { getCachedNotifications(direction, fetchingMissing, timelineParams); } else { getLiveNotifications(direction, fetchingMissing, timelineParams, notificationToUpdate); Loading Loading @@ -430,11 +430,15 @@ public class FragmentMastodonNotification extends Fragment implements Notificati } else if (direction == FragmentMastodonTimeline.DIRECTION.REFRESH) { notificationsVM.getNotifications(notificationList, timelineParams) .observe(getViewLifecycleOwner(), notificationsRefresh -> { if (notificationsRefresh == null || notificationsRefresh.notifications == null || notificationsRefresh.notifications.size() == 0) { getLiveNotifications(direction, fetchingMissing, timelineParams, null); } else { if (notificationAdapter != null) { dealWithPagination(notificationsRefresh, FragmentMastodonTimeline.DIRECTION.REFRESH, true, null); } else { initializeNotificationView(notificationsRefresh); } } }); } } Loading