From ddb38db93551274283a2ed5dbf3292ec38b79ffa Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Tue, 25 Nov 2014 18:01:20 +0100 Subject: [PATCH] "open with" in ContextMenu of downloaded files --- .../owncloud/android/ui/fragment/OCFileListFragment.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index 0b1059fc..981e30bd 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -248,15 +248,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()) { @@ -282,6 +276,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; -- 2.11.0