mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 21:55:13 +00:00
Setup: small behavior improvement
This commit is contained in:
parent
5830fe6d62
commit
ac544f0506
1 changed files with 21 additions and 2 deletions
|
@ -552,8 +552,27 @@ public class FragmentSetup extends FragmentBase {
|
|||
db.identity().liveComposableIdentities().observe(getViewLifecycleOwner(), new Observer<List<TupleIdentityEx>>() {
|
||||
@Override
|
||||
public void onChanged(@Nullable List<TupleIdentityEx> identities) {
|
||||
boolean done = (identities != null && identities.size() > 0);
|
||||
tvNoComposable.setVisibility(done ? View.GONE : View.VISIBLE);
|
||||
Bundle args = new Bundle();
|
||||
|
||||
new SimpleTask<List<EntityAccount>>() {
|
||||
@Override
|
||||
protected List<EntityAccount> onExecute(Context context, Bundle args) throws Throwable {
|
||||
DB db = DB.getInstance(context);
|
||||
return db.account().getSynchronizingAccounts();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, List<EntityAccount> accounts) {
|
||||
boolean done = ((accounts == null || accounts.size() == 0) ||
|
||||
(identities != null && identities.size() > 0));
|
||||
tvNoComposable.setVisibility(done ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
// Ignored
|
||||
}
|
||||
}.execute(FragmentSetup.this, args, "setup:accounts");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue