X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/046a566ed4bf95bffac3fab41e04e0e7895a36cd..1d5087d736b823c3ce22c80975e202059c44751c:/src/com/owncloud/android/ui/fragment/FileDetailFragment.java diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 216cceec..af29cffb 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -50,11 +50,11 @@ import com.owncloud.android.files.services.FileObserverService; import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder; import com.owncloud.android.files.services.FileUploader.FileUploaderBinder; -import com.owncloud.android.lib.network.OnDatatransferProgressListener; -import com.owncloud.android.lib.operations.common.OnRemoteOperationListener; -import com.owncloud.android.lib.operations.common.RemoteOperation; -import com.owncloud.android.lib.operations.common.RemoteOperationResult; -import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; +import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; +import com.owncloud.android.lib.common.operations.OnRemoteOperationListener; +import com.owncloud.android.lib.common.operations.RemoteOperation; +import com.owncloud.android.lib.common.operations.RemoteOperationResult; +import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.operations.RemoveFileOperation; import com.owncloud.android.operations.RenameFileOperation; import com.owncloud.android.operations.SynchronizeFileOperation; @@ -186,6 +186,10 @@ public class FileDetailFragment extends FileFragment implements super.onActivityCreated(savedInstanceState); if (mAccount != null) { mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver()); + OCFile file = mStorageManager.getFileByPath(getFile().getRemotePath()); + if (file != null) { + setFile(file); + } } } @@ -310,7 +314,14 @@ public class FileDetailFragment extends FileFragment implements toHide.add(R.id.action_remove_file); } - + + // Options shareLink + if (!file.isShareByLink()) { + toHide.add(R.id.action_unshare_file); + } else { + toShow.add(R.id.action_unshare_file); + } + MenuItem item = null; for (int i : toHide) { item = menu.findItem(i); @@ -340,6 +351,11 @@ public class FileDetailFragment extends FileFragment implements activity.getFileOperationsHelper().shareFileWithLink(getFile(), activity); return true; } + case R.id.action_unshare_file: { + FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); + activity.getFileOperationsHelper().unshareFileWithLink(getFile(), activity); + return true; + } case R.id.action_open_file_with: { FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); activity.getFileOperationsHelper().openFile(getFile(), activity);