Unshare public link in ShareFileFragment

This commit is contained in:
David A. Velasco 2015-11-03 17:07:34 +01:00
parent 261299cf23
commit 19cf573db0
7 changed files with 13 additions and 12 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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: {

View 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

View file

@ -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: {

View file

@ -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: {

View file

@ -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: {