1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-19 05:38:31 +00:00

Revert "Small behavior improvement"

This reverts commit a390d525ae.
This commit is contained in:
M66B 2019-01-31 13:52:25 +00:00
parent a49f5f940f
commit dd888c475c

View file

@ -124,9 +124,9 @@ public class FragmentMessages extends FragmentBase {
private boolean autonext;
private boolean addresses;
private Long primary = null;
private long primary = -1;
private boolean outbox = false;
private Boolean connected = null;
private boolean connected = false;
private boolean searching = false;
private AdapterMessage adapter;
private boolean animate = true;
@ -1398,8 +1398,7 @@ public class FragmentMessages extends FragmentBase {
public void onChanged(EntityAccount account) {
long primary = (account == null ? -1 : account.id);
boolean connected = (account != null && "connected".equals(account.state));
if (FragmentMessages.this.primary == null || FragmentMessages.this.connected == null ||
FragmentMessages.this.primary != primary || FragmentMessages.this.connected != connected) {
if (FragmentMessages.this.primary != primary || FragmentMessages.this.connected != connected) {
FragmentMessages.this.primary = primary;
FragmentMessages.this.connected = connected;
getActivity().invalidateOptionsMenu();
@ -1652,10 +1651,8 @@ public class FragmentMessages extends FragmentBase {
menu.findItem(R.id.menu_search).setVisible(viewType != AdapterMessage.ViewType.SEARCH);
menu.findItem(R.id.menu_folders).setVisible(primary == null || primary >= 0);
menu.findItem(R.id.menu_folders).setEnabled(primary != null);
menu.findItem(R.id.menu_folders).setIcon(
connected != null && connected ? R.drawable.baseline_folder_24 : R.drawable.baseline_folder_open_24);
menu.findItem(R.id.menu_folders).setVisible(primary >= 0);
menu.findItem(R.id.menu_folders).setIcon(connected ? R.drawable.baseline_folder_24 : R.drawable.baseline_folder_open_24);
menu.findItem(R.id.menu_sort_on).setVisible(!selection &&
(viewType == AdapterMessage.ViewType.UNIFIED || viewType == AdapterMessage.ViewType.FOLDER));