@@ -117,6 +117,7 @@ import com.owncloud.android.ui.asynctasks.CheckAvailableSpaceTask
117117import com.owncloud.android.ui.asynctasks.CheckAvailableSpaceTask.CheckAvailableSpaceListener
118118import com.owncloud.android.ui.asynctasks.FetchRemoteFileTask
119119import com.owncloud.android.ui.asynctasks.GetRemoteFileTask
120+ import com.owncloud.android.ui.dialog.DeleteBatchTracker
120121import com.owncloud.android.ui.dialog.SendShareDialog
121122import com.owncloud.android.ui.dialog.SendShareDialog.SendShareDialogDownloader
122123import com.owncloud.android.ui.dialog.SortingOrderDialogFragment.OnSortingOrderListener
@@ -2083,13 +2084,22 @@ class FileDisplayActivity :
20832084 }
20842085 }
20852086
2087+ val deleteBatchTracker = DeleteBatchTracker (onAllDeletesFinished = {
2088+ if (leftFragment is GalleryFragment ) {
2089+ val galleryFragment = leftFragment as GalleryFragment
2090+ galleryFragment.onRefresh()
2091+ }
2092+ })
2093+
20862094 /* *
20872095 * Updates the view associated to the activity after the finish of an operation trying to remove a file.
20882096 *
20892097 * @param operation Removal operation performed.
20902098 * @param result Result of the removal.
20912099 */
20922100 private fun onRemoveFileOperationFinish (operation : RemoveFileOperation , result : RemoteOperationResult <* >) {
2101+ deleteBatchTracker.onSingleDeleteFinished()
2102+
20932103 if (! operation.isInBackground) {
20942104 DisplayUtils .showSnackMessage(
20952105 this ,
@@ -2111,9 +2121,6 @@ class FileDisplayActivity :
21112121 val parentFile = storageManager.getFileById(removedFile.parentId)
21122122 if (parentFile != null && parentFile == getCurrentDir()) {
21132123 updateListOfFilesFragment(false )
2114- } else if (this .leftFragment is GalleryFragment ) {
2115- val galleryFragment = leftFragment as GalleryFragment
2116- galleryFragment.onRefresh()
21172124 } else if (leftFragment is OCFileListFragment &&
21182125 SearchRemoteOperation .SearchType .FAVORITE_SEARCH == leftFragment.searchEvent?.searchType
21192126 ) {
@@ -2127,7 +2134,6 @@ class FileDisplayActivity :
21272134 }
21282135 }
21292136 supportInvalidateOptionsMenu()
2130- refreshGalleryFragmentIfNeeded()
21312137 fetchRecommendedFilesIfNeeded(ignoreETag = true , currentDir)
21322138 } else {
21332139 if (result.isSslRecoverableException) {
0 commit comments