mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Update according to review
This commit is contained in:
parent
8d09630eb1
commit
767560a2e0
3 changed files with 13 additions and 10 deletions
|
@ -477,21 +477,22 @@ public class FileListListAdapter extends BaseAdapter {
|
|||
@Override
|
||||
protected FilterResults performFiltering(CharSequence constraint) {
|
||||
FilterResults results = new FilterResults();
|
||||
Vector<OCFile> ocFileVector = new Vector<>();
|
||||
Vector<OCFile> filteredFiles = new Vector<>();
|
||||
|
||||
if (!TextUtils.isEmpty(constraint)) {
|
||||
for (int i = 0; i < mFilesAll.size(); i++) {
|
||||
OCFile currentFile = mFilesAll.get(i);
|
||||
if (currentFile.getRemotePath().replace(currentFile.getFileName(), "").equals(currentDirectory.getRemotePath()) &&
|
||||
if (currentFile.getRemotePath().replace(currentFile.getFileName(), "")
|
||||
.equals(currentDirectory.getRemotePath()) &&
|
||||
currentFile.getFileName().toLowerCase().contains(constraint) &&
|
||||
!ocFileVector.contains(currentFile)) {
|
||||
ocFileVector.add(currentFile);
|
||||
!filteredFiles.contains(currentFile)) {
|
||||
filteredFiles.add(currentFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
results.values = ocFileVector;
|
||||
results.count = ocFileVector.size();
|
||||
results.values = filteredFiles;
|
||||
results.count = filteredFiles.size();
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
|
@ -524,15 +524,16 @@ public class ExtendedListFragment extends Fragment
|
|||
}
|
||||
|
||||
public void setEmptyListMessage(boolean isSearch) {
|
||||
if (!isSearch) {
|
||||
if (isSearch) {
|
||||
setMessageForEmptyList(R.string.file_list_empty_headline_search,
|
||||
R.string.file_list_empty_search, R.drawable.ic_search_light_grey);
|
||||
|
||||
} else {
|
||||
setMessageForEmptyList(
|
||||
R.string.file_list_empty_headline,
|
||||
R.string.file_list_empty,
|
||||
R.drawable.ic_list_empty_folder
|
||||
);
|
||||
} else {
|
||||
setMessageForEmptyList(R.string.file_list_empty_headline_search,
|
||||
R.string.file_list_empty_search, R.drawable.ic_search_light_grey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic
|
||||
* Copyright (C) 2017 Nextcloud GmbH
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
Loading…
Reference in a new issue