Эх сурвалжийг харах

Update according to review

Mario Danic 8 жил өмнө
parent
commit
767560a2e0

+ 7 - 6
src/com/owncloud/android/ui/adapter/FileListListAdapter.java

@@ -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;
         }

+ 5 - 4
src/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -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);
         }
     }
 

+ 1 - 0
src/com/owncloud/android/ui/interfaces/ExtendedListFragmentInterface.java

@@ -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