Fixed edge case

pull/169/head
M66B 5 years ago
parent a5ec0f9f0f
commit 3447bf0236

@ -159,7 +159,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
ivState.setImageResource(R.drawable.baseline_close_24);
else
ivState.setImageResource(R.drawable.baseline_cloud_off_24);
ivState.setVisibility(account.synchronize ? View.VISIBLE : View.INVISIBLE);
ivState.setVisibility(account.synchronize || account.state != null ? View.VISIBLE : View.INVISIBLE);
tvHost.setText(String.format("%s:%d", account.host, account.port));
tvLast.setText(context.getString(R.string.title_last_connected,

@ -265,6 +265,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
" stop=" + prev.canRun() +
" start=" + current.canRun() +
" changed=" + !prev.accountState.equals(current.accountState) +
" enabled=" + current.accountState.synchronize +
" state=" + current.accountState.state +
" type=" + prev.networkState.getType() + "/" + current.networkState.getType());
if (prev.canRun())

@ -53,6 +53,6 @@ public class TupleAccountState extends EntityAccount {
}
boolean shouldRun(boolean enabled) {
return (isEnabled(enabled) || operations > 0);
return (isEnabled(enabled) || (operations > 0 && synchronize));
}
}

Loading…
Cancel
Save