浏览代码

Fixed: hide all the actions for single file when none of them is selected in the landscape view

David A. Velasco 12 年之前
父节点
当前提交
850d7a115d
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      src/com/owncloud/android/ui/fragment/FileDetailFragment.java

+ 11 - 1
src/com/owncloud/android/ui/fragment/FileDetailFragment.java

@@ -321,7 +321,7 @@ public class FileDetailFragment extends SherlockFragment implements
             toShow.add(R.id.action_open_file_with);
             toShow.add(R.id.action_sync_file);
             
-        } else {
+        } else if (mFile != null) {
             toHide.add(R.id.action_open_file_with);
             toHide.add(R.id.action_cancel_download);
             toHide.add(R.id.action_cancel_upload);
@@ -330,6 +330,16 @@ public class FileDetailFragment extends SherlockFragment implements
             toShow.add(R.id.action_rename_file);
             toShow.add(R.id.action_remove_file);
             toShow.add(R.id.action_download_file);
+            
+        } else {
+            toHide.add(R.id.action_open_file_with);
+            toHide.add(R.id.action_cancel_download);
+            toHide.add(R.id.action_cancel_upload);
+            toHide.add(R.id.action_sync_file);
+            toHide.add(R.id.action_download_file);
+            toHide.add(R.id.action_rename_file);
+            toHide.add(R.id.action_remove_file);
+            
         }
 
         MenuItem item = null;