diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java index 385a1acb..b07ded75 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java @@ -34,11 +34,18 @@ public class HomeTimelineFragment extends StatusListFragment{ @Override protected void doLoadData(int offset, int count){ - new GetHomeTimeline(null, null, count) + String maxID; + if(offset>0 && !preloadedData.isEmpty()) + maxID=preloadedData.get(preloadedData.size()-1).id; + else if(offset>0 && !data.isEmpty()) + maxID=data.get(data.size()-1).id; + else + maxID=null; + new GetHomeTimeline(maxID, null, count) .setCallback(new SimpleCallback<>(this){ @Override public void onSuccess(List result){ - onDataLoaded(result, false); + onDataLoaded(result, !result.isEmpty()); } }) .exec(accountID);