don't load new posts every time we hit the top

This commit is contained in:
sk 2023-10-19 01:06:03 +02:00
parent 5db44cbf9d
commit 67cbc8aff2
1 changed files with 2 additions and 3 deletions

View File

@ -74,9 +74,8 @@ public class HomeTimelineFragment extends StatusListFragment {
list.addOnScrollListener(new RecyclerView.OnScrollListener(){
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy){
if(parent!=null && list.getChildAdapterPosition(list.getChildAt(0))<=getMainAdapterOffset()){
if(parent.isNewPostsBtnShown()) parent.hideNewPostsButton();
else if(!dataLoading && GlobalUserPreferences.loadNewPosts) loadNewPosts();
if(parent!=null && parent.isNewPostsBtnShown() && list.getChildAdapterPosition(list.getChildAt(0))<=getMainAdapterOffset()){
parent.hideNewPostsButton();
}
}
});