aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
index 7772adc4..9ecf7f62 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/TrustKeysActivity.java
@@ -25,6 +25,7 @@ import de.thedevstack.conversationsplus.crypto.axolotl.XmppAxolotlSession;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.entities.Contact;
import de.thedevstack.conversationsplus.entities.Conversation;
+import de.thedevstack.conversationsplus.utils.ui.TextViewUtil;
import de.thedevstack.conversationsplus.xmpp.OnKeyStatusUpdated;
import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException;
import de.thedevstack.conversationsplus.xmpp.jid.Jid;
@@ -161,8 +162,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
ownKeysCard.setVisibility(hasOwnKeys ? View.VISIBLE : View.GONE);
foreignKeys.setVisibility(hasForeignKeys ? View.VISIBLE : View.GONE);
if(hasPendingKeyFetches()) {
- setFetching();
- lock();
+ TextViewUtil.disable(this.mSaveButton, ConversationsPlusColors.secondaryText(), R.string.fetching_keys);
} else {
if (!hasForeignKeys && hasNoOtherTrustedKeys()) {
keyErrorMessageCard.setVisibility(View.VISIBLE);
@@ -178,7 +178,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
foreignKeys.setVisibility(View.GONE);
}
lockOrUnlockAsNeeded();
- setDone();
+ mSaveButton.setText(R.string.done);
}
}
@@ -305,35 +305,16 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
}
}
- private void unlock() {
- mSaveButton.setEnabled(true);
- mSaveButton.setTextColor(ConversationsPlusColors.primaryText());
- }
-
- private void lock() {
- mSaveButton.setEnabled(false);
- mSaveButton.setTextColor(ConversationsPlusColors.secondaryText());
- }
-
private void lockOrUnlockAsNeeded() {
synchronized (this.foreignKeysToTrust) {
for (Jid jid : contactJids) {
Map<String, Boolean> fingerprints = foreignKeysToTrust.get(jid);
if (hasNoOtherTrustedKeys(jid) && (fingerprints == null || !fingerprints.values().contains(true))) {
- lock();
+ TextViewUtil.disable(this.mSaveButton, ConversationsPlusColors.secondaryText());
return;
}
}
}
- unlock();
-
- }
-
- private void setDone() {
- mSaveButton.setText(getString(R.string.done));
- }
-
- private void setFetching() {
- mSaveButton.setText(getString(R.string.fetching_keys));
+ TextViewUtil.enable(this.mSaveButton, ConversationsPlusColors.primaryText());
}
}