Jelajahi Sumber

Directly show loading spinner
show "no files" only if folder is known to be empty

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>

tobiasKaminsky 5 tahun lalu
induk
melakukan
6f5b671d8c

+ 2 - 1
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -1432,7 +1432,8 @@ public class FileDisplayActivity extends FileActivity
     private void setBackgroundText() {
         final OCFileListFragment ocFileListFragment = getListOfFilesFragment();
         if (ocFileListFragment != null) {
-            if (mSyncInProgress) {
+            if (mSyncInProgress ||
+                getFile().getFileLength() > 0 && getStorageManager().getFolderContent(getFile(), false).isEmpty()) {
                 ocFileListFragment.setEmptyListLoadingMessage();
             } else {
                 ocFileListFragment.setEmptyListMessage(ExtendedListFragment.SearchType.NO_SEARCH);

+ 0 - 1
src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -257,7 +257,6 @@ public class ExtendedListFragment extends Fragment implements
 
                 if (currentVisibility != oldVisibility) {
                     if (currentVisibility == View.VISIBLE) {
-
                         setEmptyListMessage(SearchType.REGULAR_FILTER);
                     } else {
                         setEmptyListMessage(SearchType.NO_SEARCH);

+ 1 - 0
src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -943,6 +943,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
                     } else {
                         // update state and view of this fragment
                         searchFragment = false;
+                        setEmptyListLoadingMessage();
                         listDirectory(file, MainApp.isOnlyOnDevice(), false);
                         // then, notify parent activity to let it update its state and view
                         mContainerActivity.onBrowsedDownTo(file);