mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 05:37:07 +00:00
Updated navigation menu on changes only
This commit is contained in:
parent
957f2be75e
commit
aa72560d15
1 changed files with 16 additions and 0 deletions
|
@ -250,11 +250,27 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
getSupportFragmentManager().addOnBackStackChangedListener(this);
|
||||
|
||||
DB.getInstance(this).account().liveAccounts(true, threading).observe(this, new Observer<List<TupleAccountEx>>() {
|
||||
private List<TupleAccountEx> last = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onChanged(@Nullable List<TupleAccountEx> accounts) {
|
||||
if (accounts == null)
|
||||
accounts = new ArrayList<>();
|
||||
|
||||
boolean changed = false;
|
||||
if (last.size() == accounts.size()) {
|
||||
for (int i = 0; i < accounts.size(); i++)
|
||||
if (!last.get(i).equals(accounts.get(i))) {
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
changed = true;
|
||||
|
||||
if (!changed)
|
||||
return;
|
||||
last = accounts;
|
||||
|
||||
ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(ActivityView.this);
|
||||
|
||||
final Collator collator = Collator.getInstance(Locale.getDefault());
|
||||
|
|
Loading…
Reference in a new issue