|
|
@ -945,23 +945,22 @@ public class FragmentAccount extends FragmentEx {
|
|
|
|
|
|
|
|
|
|
|
|
color = (account == null || account.color == null ? Color.TRANSPARENT : account.color);
|
|
|
|
color = (account == null || account.color == null ? Color.TRANSPARENT : account.color);
|
|
|
|
|
|
|
|
|
|
|
|
if (account == null)
|
|
|
|
new SimpleTask<EntityAccount>() {
|
|
|
|
new SimpleTask<Integer>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected EntityAccount onLoad(Context context, Bundle args) {
|
|
|
|
protected Integer onLoad(Context context, Bundle args) {
|
|
|
|
return DB.getInstance(context).account().getPrimaryAccount();
|
|
|
|
return DB.getInstance(context).account().getSynchronizingAccountCount();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onLoaded(Bundle args, Integer count) {
|
|
|
|
protected void onLoaded(Bundle args, EntityAccount primary) {
|
|
|
|
cbPrimary.setChecked(count == 0);
|
|
|
|
cbPrimary.setChecked(primary == null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
|
|
|
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.load(FragmentAccount.this, new Bundle());
|
|
|
|
}.load(FragmentAccount.this, new Bundle());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
int provider = savedInstanceState.getInt("provider");
|
|
|
|
int provider = savedInstanceState.getInt("provider");
|
|
|
|
spProvider.setTag(provider);
|
|
|
|
spProvider.setTag(provider);
|
|
|
|