From 046a566ed4bf95bffac3fab41e04e0e7895a36cd Mon Sep 17 00:00:00 2001 From: masensio Date: Wed, 5 Feb 2014 10:18:46 +0100 Subject: [PATCH] OC-2822: Loading progress dialog while share link is being created. Fix a problem when the app for sharing is not selected --- src/com/owncloud/android/files/FileOperationsHelper.java | 2 ++ src/com/owncloud/android/ui/fragment/FileDetailFragment.java | 1 - src/com/owncloud/android/ui/fragment/OCFileListFragment.java | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/owncloud/android/files/FileOperationsHelper.java b/src/com/owncloud/android/files/FileOperationsHelper.java index 41e7110b63..2c42537aae 100644 --- a/src/com/owncloud/android/files/FileOperationsHelper.java +++ b/src/com/owncloud/android/files/FileOperationsHelper.java @@ -33,6 +33,7 @@ import com.owncloud.android.lib.network.webdav.WebdavUtils; import com.owncloud.android.lib.operations.common.ShareType; import com.owncloud.android.operations.CreateShareOperation; import com.owncloud.android.ui.activity.FileActivity; +import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.dialog.ActivityChooserDialog; import com.owncloud.android.utils.Log_OC; @@ -107,6 +108,7 @@ public class FileOperationsHelper { public void shareFileWithLinkToApp(OCFile file, Intent sendIntent, FileActivity callerActivity) { if (file != null) { + ((FileDisplayActivity) callerActivity).showLoadingDialog(); CreateShareOperation createShare = new CreateShareOperation(file.getRemotePath(), ShareType.PUBLIC_LINK, "", false, "", 1, sendIntent); createShare.execute(callerActivity.getStorageManager(), callerActivity, diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index acc5d63e21..216cceecf5 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -337,7 +337,6 @@ public class FileDetailFragment extends FileFragment implements switch (item.getItemId()) { case R.id.action_share_file: { FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); - activity.showLoadingDialog(); activity.getFileOperationsHelper().shareFileWithLink(getFile(), activity); return true; } diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index d96739bdf5..96aa2dc2c3 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -285,7 +285,6 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName switch (item.getItemId()) { case R.id.action_share_file: { FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); - activity.showLoadingDialog(); activity.getFileOperationsHelper().shareFileWithLink(mTargetFile, activity); return true; }