mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
OC-2833: Access to unshare link from PreviewImageFragment
This commit is contained in:
parent
6951154b11
commit
de29fd38ce
3 changed files with 38 additions and 17 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 984cbbc124441f6dd9d5c53f5e7989be1593176f
|
||||
Subproject commit f166bcdd8b52a64c3ad0c8725ed64ba768c1eeb5
|
|
@ -246,6 +246,22 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
|
||||
// Options shareLink
|
||||
if (!getFile().isShareByLink()) {
|
||||
MenuItem item = menu.findItem(R.id.action_unshare_file);
|
||||
item.setVisible(false);
|
||||
item.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
@ -258,6 +274,11 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper
|
|||
act.getFileOperationsHelper().shareFileWithLink(getFile(), act);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_unshare_file: {
|
||||
FileActivity act = (FileActivity)getSherlockActivity();
|
||||
act.getFileOperationsHelper().unshareFileWithLink(getFile(), act);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
openFile();
|
||||
return true;
|
||||
|
@ -277,14 +298,6 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
private void seeDetails() {
|
||||
((FileFragment.ContainerActivity)getActivity()).showDetails(getFile());
|
||||
|
|
|
@ -305,6 +305,22 @@ public class PreviewMediaFragment extends FileFragment implements
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
|
||||
// Options shareLink
|
||||
if (!getFile().isShareByLink()) {
|
||||
MenuItem item = menu.findItem(R.id.action_unshare_file);
|
||||
item.setVisible(false);
|
||||
item.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
@ -340,14 +356,6 @@ public class PreviewMediaFragment extends FileFragment implements
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
private void unshareFileWithLink() {
|
||||
stopPreview(false);
|
||||
FileActivity activity = (FileActivity)((FileFragment.ContainerActivity)getActivity());
|
||||
|
|
Loading…
Reference in a new issue