aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
index 9a616414..33b73a32 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/EditAccountActivity.java
@@ -51,6 +51,7 @@ import de.thedevstack.conversationsplus.services.XmppConnectionService.OnCaptcha
import de.thedevstack.conversationsplus.ui.adapter.KnownHostsAdapter;
import de.thedevstack.conversationsplus.utils.CryptoHelper;
import de.thedevstack.conversationsplus.utils.UIHelper;
+import de.thedevstack.conversationsplus.utils.ui.TextViewUtil;
import de.thedevstack.conversationsplus.xml.Element;
import de.thedevstack.conversationsplus.xmpp.OnKeyStatusUpdated;
import de.thedevstack.conversationsplus.xmpp.XmppConnection;
@@ -335,26 +336,18 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
protected void updateSaveButton() {
if (accountInfoEdited() && !mInitMode) {
- this.mSaveButton.setText(R.string.save);
- this.mSaveButton.setEnabled(true);
- this.mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
+ TextViewUtil.enable(mSaveButton, ConversationsPlusColors.primaryText(), R.string.save);
} else if (mAccount != null && (mAccount.getStatus() == Account.State.CONNECTING || mFetchingAvatar)) {
- this.mSaveButton.setEnabled(false);
- this.mSaveButton.setTextColor(ConversationsPlusColors.secondaryText());
- this.mSaveButton.setText(R.string.account_status_connecting);
+ TextViewUtil.disable(mSaveButton, ConversationsPlusColors.secondaryText(), R.string.account_status_connecting);
} else if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !mInitMode) {
- this.mSaveButton.setEnabled(true);
- this.mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
- this.mSaveButton.setText(R.string.enable);
+ TextViewUtil.enable(mSaveButton, ConversationsPlusColors.primaryText(), R.string.enable);
} else {
- this.mSaveButton.setEnabled(true);
- this.mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
+ TextViewUtil.enable(mSaveButton, ConversationsPlusColors.primaryText());
if (!mInitMode) {
if (mAccount != null && mAccount.isOnlineAndConnected()) {
this.mSaveButton.setText(R.string.save);
if (!accountInfoEdited()) {
- this.mSaveButton.setEnabled(false);
- this.mSaveButton.setTextColor(ConversationsPlusColors.secondaryText());
+ TextViewUtil.disable(mSaveButton, ConversationsPlusColors.secondaryText());
}
} else {
this.mSaveButton.setText(R.string.connect);
@@ -552,8 +545,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
getActionBar().setDisplayShowHomeEnabled(false);
getActionBar().setHomeButtonEnabled(false);
}
- this.mCancelButton.setEnabled(false);
- this.mCancelButton.setTextColor(ConversationsPlusColors.secondaryText());
+ TextViewUtil.disable(mCancelButton, ConversationsPlusColors.secondaryText());
}
if (Config.DOMAIN_LOCK == null) {
final KnownHostsAdapter mKnownHostsAdapter = new KnownHostsAdapter(this,