mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Merge pull request #755 from owncloud/OpenWithInContextMenu
"open with" in ContextMenu of downloaded files
This commit is contained in:
commit
0b7c37671f
1 changed files with 6 additions and 8 deletions
|
@ -257,15 +257,9 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|||
);
|
||||
mf.filter(menu);
|
||||
}
|
||||
|
||||
/// additional restrictions for this fragment
|
||||
// TODO allow in the future 'open with' for previewable files
|
||||
MenuItem item = menu.findItem(R.id.action_open_file_with);
|
||||
if (item != null) {
|
||||
item.setVisible(false);
|
||||
item.setEnabled(false);
|
||||
}
|
||||
|
||||
/// TODO break this direct dependency on FileDisplayActivity... if possible
|
||||
MenuItem item = menu.findItem(R.id.action_open_file_with);
|
||||
FileFragment frag = ((FileDisplayActivity)getSherlockActivity()).getSecondFragment();
|
||||
if (frag != null && frag instanceof FileDetailFragment &&
|
||||
frag.getFile().getFileId() == targetFile.getFileId()) {
|
||||
|
@ -291,6 +285,10 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|||
mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_open_file_with: {
|
||||
mContainerActivity.getFileOperationsHelper().openFile(mTargetFile);
|
||||
return true;
|
||||
}
|
||||
case R.id.action_unshare_file: {
|
||||
mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile);
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue