Moved 'see details' to the last position of menu
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileDisplayActivity.java
index 43efac6..1798023 100644 (file)
@@ -378,7 +378,7 @@ OnSslUntrustedCertListener, EditNameDialogListener {
         return null;
     }
 
         return null;
     }
 
-    protected FileFragment getSecondFragment() {
+    public FileFragment getSecondFragment() {
         Fragment second = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT);
         if (second != null) {
             return (FileFragment)second;
         Fragment second = getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_SECOND_FRAGMENT);
         if (second != null) {
             return (FileFragment)second;
@@ -1293,6 +1293,9 @@ OnSslUntrustedCertListener, EditNameDialogListener {
             OCFile removedFile = operation.getFile();
             FileFragment second = getSecondFragment();
             if (second != null && removedFile.equals(second.getFile())) {
             OCFile removedFile = operation.getFile();
             FileFragment second = getSecondFragment();
             if (second != null && removedFile.equals(second.getFile())) {
+                if (second instanceof PreviewMediaFragment) {
+                    ((PreviewMediaFragment)second).stopPreview(true);
+                }
                 cleanSecondFragment();
             }
             if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
                 cleanSecondFragment();
             }
             if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
@@ -1389,9 +1392,6 @@ OnSslUntrustedCertListener, EditNameDialogListener {
             
         } else {
             if (operation.transferWasRequested()) {
             
         } else {
             if (operation.transferWasRequested()) {
-                /* WIP: delete this refresh?
-                 * refreshListOfFilesFragment();
-                 */
                 onTransferStateChanged(syncedFile, true, true);
                 
             } else {
                 onTransferStateChanged(syncedFile, true, true);
                 
             } else {
@@ -1427,14 +1427,7 @@ OnSslUntrustedCertListener, EditNameDialogListener {
 
                 // Create directory
                 path += newDirectoryName + OCFile.PATH_SEPARATOR;
 
                 // 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 +1566,12 @@ OnSslUntrustedCertListener, EditNameDialogListener {
         Account account = getAccount();
         if (mDownloaderBinder != null && mDownloaderBinder.isDownloading(account, file)) {
             mDownloaderBinder.cancel(account, file);
         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);
             onTransferStateChanged(file, false, false);
 
         } else if (mUploaderBinder != null && mUploaderBinder.isUploading(account, file)) {
             mUploaderBinder.cancel(account, file);
+            refreshListOfFilesFragment();
             if (!file.fileExists()) {
                 cleanSecondFragment();
                 
             if (!file.fileExists()) {
                 cleanSecondFragment();