Browse Source

Fixed upload of files into non-root folders
Fixed condition selecting grid or list mode - at least an image!

masensio 9 years ago
parent
commit
a818aaca47

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

@@ -620,10 +620,7 @@ public class FileDisplayActivity extends HookActivity
         String[] filePaths = data.getStringArrayExtra(UploadFilesActivity.EXTRA_CHOSEN_FILES);
         if (filePaths != null) {
             String[] remotePaths = new String[filePaths.length];
-            String remotePathBase = "";
-
-            if (!remotePathBase.endsWith(OCFile.PATH_SEPARATOR))
-                remotePathBase += OCFile.PATH_SEPARATOR;
+            String remotePathBase = getCurrentDir().getRemotePath();
             for (int j = 0; j< remotePaths.length; j++) {
                 remotePaths[j] = remotePathBase + (new File(filePaths[j])).getName();
             }

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

@@ -397,8 +397,8 @@ public class ExtendedListFragment extends Fragment
             mListFooterView.invalidate();
 
         } else {
-//            mGridView.removeFooterView(mGridFooterView);
-//            mListView.removeFooterView(mListFooterView);
+            mGridView.removeFooterView(mGridFooterView);
+            mListView.removeFooterView(mListFooterView);
         }
     }
 

+ 3 - 2
src/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -430,9 +430,10 @@ public class OCFileListFragment extends ExtendedListFragment {
             setFooterText(generateFooterText(filesCount, foldersCount));
 
             // decide grid vs list view
-            OwnCloudVersion version = AccountUtils.getServerVersion(((FileActivity)mContainerActivity).getAccount());
+            OwnCloudVersion version = AccountUtils.getServerVersion(
+                    ((FileActivity)mContainerActivity).getAccount());
             if (version != null && version.supportsRemoteThumbnails() &&
-                    imagesCount == filesCount) {
+                imagesCount > 0 && imagesCount == filesCount) {
                 switchToGridView();
             } else {
                 switchToListView();