mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-19 05:38:31 +00:00
parent
a49f5f940f
commit
dd888c475c
1 changed files with 5 additions and 8 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue