Skip to content

Commit

Permalink
don't load new posts every time we hit the top
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Oct 18, 2023
1 parent 5db44cb commit 67cbc8a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ public void onViewCreated(View view, Bundle savedInstanceState){
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();
}
}
});
Expand Down

0 comments on commit 67cbc8a

Please sign in to comment.