Browse Source

Show empty message if no results

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 3 years ago
parent
commit
3584b90bc6

+ 4 - 0
src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -301,6 +301,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
         }
     }
 
+    public boolean isEmpty() {
+        return mFiles.size() == 0;
+    }
+
     @NonNull
     @Override
     public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

+ 4 - 0
src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java

@@ -148,6 +148,10 @@ public class GalleryFragment extends OCFileListFragment {
         photoSearchQueryRunning = false;
         mAdapter.notifyDataSetChanged();
 
+        if (mAdapter.isEmpty()) {
+            setEmptyListMessage(ExtendedListFragment.SearchType.GALLERY_SEARCH);
+        }
+
         if (emptySearch && getAdapter().getItemCount() > 0) {
             Log_OC.d(this, "End gallery search");
             return;