Skip to content

Commit 8071ea6

Browse files
committedNov 9, 2024
fix play video on last page
1 parent e2e6533 commit 8071ea6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎app/src/main/java/fr/nuage/souvenirs/view/helpers/AudioPlayer.java

+4
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,13 @@ public void onScrollChange(View view, int i, int i1, int i2, int i3) {
6969
RecyclerView.LayoutManager layoutManager = ((RecyclerView)view).getLayoutManager();
7070
if (layoutManager instanceof LinearLayoutManager) {
7171
int firstPos = ((LinearLayoutManager)layoutManager).findFirstCompletelyVisibleItemPosition();
72+
int lastPos = ((LinearLayoutManager)layoutManager).findLastCompletelyVisibleItemPosition();
7273
if (firstPos == -1) {
7374
return;
7475
}
76+
if (lastPos == albumViewModel.getSize()-1) {
77+
firstPos = lastPos;
78+
}
7579
//for audio
7680
if ((lastPosition < firstPos) || (firstPos == 0)) {
7781
PageViewModel pageViewModel = albumViewModel.getPage(firstPos);

0 commit comments

Comments
 (0)
Failed to load comments.