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:
Branko Kokanovic 2017-09-29 21:37:37 +02:00 committed by AndyScherzinger
parent 4315e6f305
commit 49223db14e
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 21 additions and 0 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {