X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/c39e851f5eada08c93d3a57d41054ea112b4bfcf..cdfa6786794c470d5f064b0013a5b8b84f16be8c:/src/com/owncloud/android/ui/activity/FileDisplayActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 6cfa56c5..e299e616 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -665,6 +665,9 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener protected void onResume() { super.onResume(); Log_OC.e(TAG, "onResume() start"); + + // refresh list of files + refreshListOfFilesFragment(); // Listen for sync messages IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START); @@ -709,8 +712,6 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener mDownloadFinishReceiver = null; } - dismissLoadingDialog(); - Log_OC.d(TAG, "onPause() end"); } @@ -1430,14 +1431,20 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener */ @Override public void onTransferStateChanged(OCFile file, boolean downloading, boolean uploading) { + refreshListOfFilesFragment(); FileFragment details = getSecondFragment(); if (details != null && details instanceof FileDetailFragment && file.equals(details.getFile()) ) { if (downloading || uploading) { ((FileDetailFragment)details).updateFileDetails(file, getAccount()); } else { - ((FileDetailFragment)details).updateFileDetails(false, true); + if (!file.fileExists()) { + cleanSecondFragment(); + } else { + ((FileDetailFragment)details).updateFileDetails(false, true); + } } } + } @@ -1535,6 +1542,7 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener showDetailsIntent.putExtra(EXTRA_FILE, file); showDetailsIntent.putExtra(EXTRA_ACCOUNT, getAccount()); startActivity(showDetailsIntent); + } /** @@ -1571,22 +1579,16 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener public void cancelTransference(OCFile 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); - refreshListOfFilesFragment(); - if (!file.fileExists()) { - cleanSecondFragment(); - - } else { - onTransferStateChanged(file, false, false); - } + getFileOperationsHelper().cancelTransference(file); + if (mWaitingToPreview != null && + mWaitingToPreview.getRemotePath().equals(file.getRemotePath())) { + mWaitingToPreview = null; + } + if (mWaitingToSend != null && + mWaitingToSend.getRemotePath().equals(file.getRemotePath())) { + mWaitingToSend = null; } + onTransferStateChanged(file, false, false); } }