diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java index 549a71173d..5bd50cb960 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileActivity.java @@ -87,6 +87,7 @@ import com.owncloud.android.ui.dialog.ShareLinkToDialog; import com.owncloud.android.ui.dialog.SslUntrustedCertDialog; import com.owncloud.android.ui.fragment.FileDetailFragment; import com.owncloud.android.ui.fragment.FileDetailSharingFragment; +import com.owncloud.android.ui.fragment.OCFileListFragment; import com.owncloud.android.ui.helpers.FileOperationsHelper; import com.owncloud.android.utils.ClipboardUtil; import com.owncloud.android.utils.DisplayUtils; @@ -781,6 +782,7 @@ public abstract class FileActivity extends DrawerActivity private void onCreateShareViaLinkOperationFinish(CreateShareViaLinkOperation operation, RemoteOperationResult result) { FileDetailSharingFragment sharingFragment = getShareFileFragment(); + OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentByTag(FileDisplayActivity.TAG_LIST_OF_FILES); if (result.isSuccess()) { updateFileFromDB(); @@ -803,6 +805,10 @@ public abstract class FileActivity extends DrawerActivity if (sharingFragment != null) { sharingFragment.onUpdateShareInformation(result, file); } + + if (fileListFragment != null && file != null) { + fileListFragment.updateOCFile(file); + } } else { // Detect Failure (403) --> maybe needs password String password = operation.getPassword(); diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index 2382ac7b14..8264595b0f 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -1322,6 +1322,12 @@ public class OCFileListFragment extends ExtendedListFragment implements } } + public void updateOCFile(OCFile file) { + mAdapter.getFiles().remove(file); + mAdapter.getFiles().add(file); + mAdapter.notifyItemChanged(file); + } + private void updateLayout() { // decide grid vs list view if (isGridViewPreferred(mFile)) {