mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +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
|
@Override
|
||||||
protected FilterResults performFiltering(CharSequence constraint) {
|
protected FilterResults performFiltering(CharSequence constraint) {
|
||||||
FilterResults results = new FilterResults();
|
FilterResults results = new FilterResults();
|
||||||
Vector<OCFile> ocFileVector = new Vector<>();
|
Vector<OCFile> filteredFiles = new Vector<>();
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(constraint)) {
|
if (!TextUtils.isEmpty(constraint)) {
|
||||||
for (int i = 0; i < mFilesAll.size(); i++) {
|
for (int i = 0; i < mFilesAll.size(); i++) {
|
||||||
OCFile currentFile = mFilesAll.get(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) &&
|
currentFile.getFileName().toLowerCase().contains(constraint) &&
|
||||||
!ocFileVector.contains(currentFile)) {
|
!filteredFiles.contains(currentFile)) {
|
||||||
ocFileVector.add(currentFile);
|
filteredFiles.add(currentFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
results.values = ocFileVector;
|
results.values = filteredFiles;
|
||||||
results.count = ocFileVector.size();
|
results.count = filteredFiles.size();
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
|
@ -524,15 +524,16 @@ public class ExtendedListFragment extends Fragment
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmptyListMessage(boolean isSearch) {
|
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(
|
setMessageForEmptyList(
|
||||||
R.string.file_list_empty_headline,
|
R.string.file_list_empty_headline,
|
||||||
R.string.file_list_empty,
|
R.string.file_list_empty,
|
||||||
R.drawable.ic_list_empty_folder
|
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
|
* @author Mario Danic
|
||||||
* Copyright (C) 2017 Mario Danic
|
* Copyright (C) 2017 Mario Danic
|
||||||
|
* Copyright (C) 2017 Nextcloud GmbH
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
Loading…
Reference in a new issue