mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
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).
This commit is contained in:
parent
4315e6f305
commit
49223db14e
3 changed files with 21 additions and 0 deletions
|
@ -296,6 +296,13 @@ public class PreviewImageFragment extends FileFragment {
|
|||
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) {
|
||||
|
|
|
@ -388,6 +388,13 @@ public class PreviewMediaFragment extends FileFragment implements
|
|||
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) {
|
||||
|
|
|
@ -297,6 +297,13 @@ public class PreviewTextFragment extends FileFragment {
|
|||
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) {
|
||||
|
|
Loading…
Reference in a new issue