mirror of
https://github.com/mastodon/mastodon-android.git
synced 2024-12-22 14:44:21 +01:00
Load more of the home timeline on scroll
This commit is contained in:
parent
b3a99e0764
commit
13665a11ca
@ -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<Status> result){
|
||||
onDataLoaded(result, false);
|
||||
onDataLoaded(result, !result.isEmpty());
|
||||
}
|
||||
})
|
||||
.exec(accountID);
|
||||
|
Loading…
Reference in New Issue
Block a user