فهرست منبع

Removed 'download' and 'open with' options from contextual menu in list of files

David A. Velasco 12 سال پیش
والد
کامیت
782186f5b1
1فایلهای تغییر یافته به همراه5 افزوده شده و 11 حذف شده
  1. 5 11
      src/com/owncloud/android/ui/fragment/OCFileListFragment.java

+ 5 - 11
src/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -187,26 +187,25 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
             
         } else {
             // contextual menu for regular files
+            
+            // new design: 'download' and 'open with' won't be available anymore in context menu
+            toHide.add(R.id.action_download_file);
+            toHide.add(R.id.action_open_file_with);
+            
             if (targetFile.isDown()) {
                 toHide.add(R.id.action_cancel_download);
                 toHide.add(R.id.action_cancel_upload);
-                toHide.add(R.id.action_download_file);
                 
             } else {
-                toHide.add(R.id.action_open_file_with);
                 toHide.add(R.id.action_sync_file);
             }
             if ( mContainerActivity.getFileDownloaderBinder().isDownloading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile)) {
-                toHide.add(R.id.action_download_file);
                 toHide.add(R.id.action_cancel_upload);
-                toDisable.add(R.id.action_open_file_with);
                 toDisable.add(R.id.action_rename_file);
                 toDisable.add(R.id.action_remove_file);
                     
             } else if ( mContainerActivity.getFileUploaderBinder().isUploading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile)) {
-                toHide.add(R.id.action_download_file);
                 toHide.add(R.id.action_cancel_download);
-                toDisable.add(R.id.action_open_file_with);
                 toDisable.add(R.id.action_rename_file);
                 toDisable.add(R.id.action_remove_file);
                     
@@ -271,11 +270,6 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName
                 confDialog.show(getFragmentManager(), FileDetailFragment.FTAG_CONFIRMATION);
                 return true;
             }
-            case R.id.action_open_file_with: {
-                mContainerActivity.openFile(mTargetFile);
-                return true;
-            }
-            case R.id.action_download_file: 
             case R.id.action_sync_file: {
                 Account account = AccountUtils.getCurrentOwnCloudAccount(getSherlockActivity());
                 RemoteOperation operation = new SynchronizeFileOperation(mTargetFile, null, mContainerActivity.getStorageManager(), account, true, false, getSherlockActivity());