code cleanup

This commit is contained in:
Daniel Gultsch 2015-07-17 23:58:53 +02:00
parent c3584a6db7
commit aa1b9de20c

View File

@ -52,7 +52,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
break; break;
} }
final Switch tglAccountState = (Switch) view.findViewById(R.id.tgl_account_status); final Switch tglAccountState = (Switch) view.findViewById(R.id.tgl_account_status);
final boolean isDisabled = (account.getStatus() == Account.State.DISABLED) ? true : false; final boolean isDisabled = (account.getStatus() == Account.State.DISABLED);
tglAccountState.setOnCheckedChangeListener(null); tglAccountState.setOnCheckedChangeListener(null);
tglAccountState.setChecked(!isDisabled); tglAccountState.setChecked(!isDisabled);
tglAccountState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { tglAccountState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {