mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Unshare public link in ShareFileFragment
This commit is contained in:
parent
261299cf23
commit
19cf573db0
7 changed files with 13 additions and 12 deletions
|
@ -141,7 +141,6 @@ public class FileOperationsHelper {
|
|||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Helper method to share a file via a public link. Starts a request to do it in {@link OperationsService}
|
||||
*
|
||||
* @param file The file to share.
|
||||
|
@ -268,7 +267,13 @@ public class FileOperationsHelper {
|
|||
}
|
||||
|
||||
|
||||
public void unshareFileWithLink(OCFile file) {
|
||||
/**
|
||||
* Helper method to unshare a file publicly shared via link.
|
||||
* Starts a request to do it in {@link OperationsService}
|
||||
*
|
||||
* @param file The file to unshare.
|
||||
*/
|
||||
public void unshareFileViaLink(OCFile file) {
|
||||
|
||||
// Unshare the file: Create the intent
|
||||
Intent unshareService = new Intent(mFileActivity, OperationsService.class);
|
||||
|
|
|
@ -235,7 +235,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
return true;
|
||||
}
|
||||
case R.id.action_unshare_file: {
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileViaLink(getFile());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ public class OCFileListFragment extends ExtendedListFragment
|
|||
return true;
|
||||
}
|
||||
case R.id.action_unshare_file: {
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile);
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileViaLink(mTargetFile);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_rename_file: {
|
||||
|
|
|
@ -186,11 +186,7 @@ public class ShareFileFragment extends Fragment
|
|||
((FileActivity) getActivity()).getFileOperationsHelper().shareFileViaLink(mFile);
|
||||
|
||||
} else {
|
||||
// TODO real implementation: unshare
|
||||
// collapse section
|
||||
getExpirationDateSection().setVisibility(View.GONE);
|
||||
getPasswordSection().setVisibility(View.GONE);
|
||||
getGetLinkButton().setVisibility(View.GONE);
|
||||
((FileActivity) getActivity()).getFileOperationsHelper().unshareFileViaLink(mFile);
|
||||
}
|
||||
} // else, nothing; very important, setCheched(...) is called automatically during Fragment
|
||||
// recreation on device rotations
|
||||
|
|
|
@ -294,7 +294,7 @@ public class PreviewImageFragment extends FileFragment {
|
|||
return true;
|
||||
}
|
||||
case R.id.action_unshare_file: {
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileViaLink(getFile());
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
|
|
|
@ -359,7 +359,7 @@ public class PreviewMediaFragment extends FileFragment implements
|
|||
}
|
||||
case R.id.action_unshare_file: {
|
||||
stopPreview(false);
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileViaLink(getFile());
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
|
|
|
@ -307,7 +307,7 @@ public class PreviewTextFragment extends FileFragment {
|
|||
return true;
|
||||
}
|
||||
case R.id.action_unshare_file: {
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileViaLink(getFile());
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
|
|
Loading…
Reference in a new issue