Joint local removal of files to RemoteFileOperation to fix refresh of UI
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileDisplayActivity.java
index 43efac6..b62eb22 100644 (file)
@@ -378,7 +378,7 @@ OnSslUntrustedCertListener, EditNameDialogListener {
         return null;
     }
 
-    protected FileFragment getSecondFragment() {
+    public FileFragment getSecondFragment() {
         Fragment second = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT);
         if (second != null) {
             return (FileFragment)second;
@@ -1389,9 +1389,6 @@ OnSslUntrustedCertListener, EditNameDialogListener {
             
         } else {
             if (operation.transferWasRequested()) {
-                /* WIP: delete this refresh?
-                 * refreshListOfFilesFragment();
-                 */
                 onTransferStateChanged(syncedFile, true, true);
                 
             } else {
@@ -1427,14 +1424,7 @@ OnSslUntrustedCertListener, EditNameDialogListener {
 
                 // Create directory
                 path += newDirectoryName + OCFile.PATH_SEPARATOR;
-                RemoteOperation operation = new CreateFolderOperation(path, false, getStorageManager());
-                operation.execute(  getAccount(), 
-                        FileDisplayActivity.this, 
-                        FileDisplayActivity.this, 
-                        getHandler(),
-                        FileDisplayActivity.this);
-
-                showLoadingDialog();
+                getFileOperationsHelper().createFolder(path, false);
             }
         }
     }
@@ -1573,10 +1563,12 @@ OnSslUntrustedCertListener, EditNameDialogListener {
         Account account = getAccount();
         if (mDownloaderBinder != null && mDownloaderBinder.isDownloading(account, file)) {
             mDownloaderBinder.cancel(account, file);
+            refreshListOfFilesFragment();
             onTransferStateChanged(file, false, false);
 
         } else if (mUploaderBinder != null && mUploaderBinder.isUploading(account, file)) {
             mUploaderBinder.cancel(account, file);
+            refreshListOfFilesFragment();
             if (!file.fileExists()) {
                 cleanSecondFragment();