fixed 'connecting…' button

This commit is contained in:
Daniel Gultsch 2016-04-10 00:19:20 +02:00
parent 607b7d1593
commit 91b17c6925

View file

@ -241,12 +241,11 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
mFetchingAvatar = true; mFetchingAvatar = true;
xmppConnectionService.checkForAvatar(mAccount, mAvatarFetchCallback); xmppConnectionService.checkForAvatar(mAccount, mAvatarFetchCallback);
} }
} else {
updateSaveButton();
} }
if (mAccount != null) { if (mAccount != null) {
updateAccountInformation(false); updateAccountInformation(false);
} }
updateSaveButton();
} }
@Override @Override
@ -335,7 +334,8 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
this.mSaveButton.setText(R.string.save); this.mSaveButton.setText(R.string.save);
this.mSaveButton.setEnabled(true); this.mSaveButton.setEnabled(true);
this.mSaveButton.setTextColor(getPrimaryTextColor()); this.mSaveButton.setTextColor(getPrimaryTextColor());
} else if (mAccount != null && (mAccount.getStatus() == Account.State.CONNECTING || mFetchingAvatar)) { } else if (mAccount != null
&& (mAccount.getStatus() == Account.State.CONNECTING || mAccount.getStatus() == Account.State.REGISTRATION_SUCCESSFUL|| mFetchingAvatar)) {
this.mSaveButton.setEnabled(false); this.mSaveButton.setEnabled(false);
this.mSaveButton.setTextColor(getSecondaryTextColor()); this.mSaveButton.setTextColor(getSecondaryTextColor());
this.mSaveButton.setText(R.string.account_status_connecting); this.mSaveButton.setText(R.string.account_status_connecting);
@ -536,6 +536,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
protected void onBackendConnected() { protected void onBackendConnected() {
if (this.jidToEdit != null) { if (this.jidToEdit != null) {
this.mAccount = xmppConnectionService.findAccountByJid(jidToEdit); this.mAccount = xmppConnectionService.findAccountByJid(jidToEdit);
this.mInitMode |= this.mAccount.isOptionSet(Account.OPTION_REGISTER);
if (this.mAccount != null) { if (this.mAccount != null) {
if (this.mAccount.getPrivateKeyAlias() != null) { if (this.mAccount.getPrivateKeyAlias() != null) {
this.mPassword.setHint(R.string.authenticate_with_certificate); this.mPassword.setHint(R.string.authenticate_with_certificate);
@ -631,6 +632,8 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
if (!mInitMode) { if (!mInitMode) {
this.mAvatar.setVisibility(View.VISIBLE); this.mAvatar.setVisibility(View.VISIBLE);
this.mAvatar.setImageBitmap(avatarService().get(this.mAccount, getPixel(72))); this.mAvatar.setImageBitmap(avatarService().get(this.mAccount, getPixel(72)));
} else {
this.mAvatar.setVisibility(View.GONE);
} }
if (this.mAccount.isOptionSet(Account.OPTION_REGISTER)) { if (this.mAccount.isOptionSet(Account.OPTION_REGISTER)) {
this.mRegisterNew.setVisibility(View.VISIBLE); this.mRegisterNew.setVisibility(View.VISIBLE);