Update app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

Co-authored-by: Tom <70907959+ZetaTom@users.noreply.github.com>
Signed-off-by: Alper Öztürk <67455295+alperozturk96@users.noreply.github.com>
This commit is contained in:
Alper Öztürk 2023-12-13 15:58:27 +01:00 committed by Alper Öztürk (Rebase PR Action)
parent ae5df18ea4
commit 7b63b1d777

View file

@ -295,17 +295,23 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
@Override
public long getItemId(int position) {
boolean isFilesEmpty = (mFiles == null || mFiles.size() <= position);
if (isFilesEmpty) {
if (shouldShowHeader()) {
if (shouldShowHeader()) {
if (position == 0) {
return headerId;
} else {
return footerId;
}
} else {
// skip header
position--;
}
if (position == mFiles.size()) {
return footerId;
} if (position < mFiles.size()) {
return mFiles.get(position).getFileId();
}
// fallback
return RecyclerView.NO_ID;
}
@Override