Merge pull request #6160 from ByteHamster/fix-empty-screen-scrolled

Fix toolbar on empty screen being set to scrolled state
This commit is contained in:
ByteHamster 2022-10-27 21:50:22 +02:00 committed by GitHub
commit a15d94c94c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ public class LiftOnScrollListener extends RecyclerView.OnScrollListener
private boolean isScrolled(RecyclerView recyclerView) {
int firstItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstVisibleItemPosition();
if (firstItem != 0) {
if (firstItem < 0) {
return false;
} else if (firstItem > 0) {
return true;
}
View firstItemView = recyclerView.getLayoutManager().findViewByPosition(firstItem);