diff options
author | iNPUTmice <daniel@gultsch.de> | 2015-04-14 15:00:49 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2015-04-14 15:00:49 +0200 |
commit | 261b505f066b90ef346c529afea50f8285ddfd7d (patch) | |
tree | 9537342f218def54ecb99f0bf5849ab588b18944 /src | |
parent | 2f24b093093296ca6f4f90fbcf664b050a8b03fc (diff) |
always show save button when account info was modified. fixes #918
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 27dfc492..dbad9e00 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -67,7 +67,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate @Override public void onClick(final View v) { - if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED) { + if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !accountInfoEdited()) { mAccount.setOption(Account.OPTION_DISABLED, false); xmppConnectionService.updateAccount(mAccount); return; @@ -237,7 +237,11 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate } protected void updateSaveButton() { - if (mAccount != null && (mAccount.getStatus() == Account.State.CONNECTING || mFetchingAvatar)) { + if (accountInfoEdited() && jidToEdit != null) { + this.mSaveButton.setText(R.string.save); + this.mSaveButton.setEnabled(true); + this.mSaveButton.setTextColor(getPrimaryTextColor()); + } else if (mAccount != null && (mAccount.getStatus() == Account.State.CONNECTING || mFetchingAvatar)) { this.mSaveButton.setEnabled(false); this.mSaveButton.setTextColor(getSecondaryTextColor()); this.mSaveButton.setText(R.string.account_status_connecting); @@ -265,9 +269,9 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate } protected boolean accountInfoEdited() { - return (!this.mAccount.getJid().toBareJid().toString().equals( - this.mAccountJid.getText().toString())) - || (!this.mAccount.getPassword().equals( + return this.mAccount != null && (!this.mAccount.getJid().toBareJid().toString().equals( + this.mAccountJid.getText().toString()) + || !this.mAccount.getPassword().equals( this.mPassword.getText().toString())); } |