mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
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:
parent
ae5df18ea4
commit
7b63b1d777
1 changed files with 13 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue