소스 검색

Hide select and deselect all on preview and details fragments, fix #1574

This change makes select/deselect menu items invisible on fragments where they should be invisible. To do this, first was needed to "split" two different "select all" actions into different ones, so they are not overlapped. For that, one of them was changed from "action_select_all" to "action_select_all_action_menu". Second, in method filter() that decides which menu items are visible, "inSingleFileFragment" bool is pushed. This is how we decide are we under some listing, or showing single file (either details or any preview fragment).
Branko Kokanovic 7 년 전
부모
커밋
4315e6f305
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

+ 7 - 0
src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

@@ -228,6 +228,13 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
             item.setEnabled(false);
         }
 
+        // additional restriction for this fragment
+        item = menu.findItem(R.id.action_select_all);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+
         // additional restriction for this fragment
         item = menu.findItem(R.id.action_move);
         if (item != null) {