aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-08-05 22:22:37 +0200
committerAndreas Straub <andy@strb.org>2015-08-05 22:24:13 +0200
commit34b22dea48bfc2f932bfdb27439493a71a409260 (patch)
treeb88de4ef61356c3b5f05035711bfb991501deb35 /src/main/java/eu/siacs/conversations/ui
parenta1c43d8fdfd87829a4d2d4e0d1347674f98c79ee (diff)
Improve TrustKeysActivity slider responsiveness
Slider used to skip back on drag-and-drop action. The switch doesn't trigger explicit whole UI refreshes anymore, it now directly adjusts the "done" button's locked status.
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java
index 37ddf5906..c55518579 100644
--- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java
@@ -124,9 +124,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
ownKeysToTrust.put(identityKey, isChecked);
- refreshUi();
- xmppConnectionService.updateAccountUi();
- xmppConnectionService.updateConversationUi();
+ // own fingerprints have no impact on locked status.
}
},
null
@@ -140,9 +138,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
foreignKeysToTrust.put(identityKey, isChecked);
- refreshUi();
- xmppConnectionService.updateAccountUi();
- xmppConnectionService.updateConversationUi();
+ lockOrUnlockAsNeeded();
}
},
null
@@ -161,11 +157,7 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
setFetching();
lock();
} else {
- if (!hasOtherTrustedKeys && !foreignKeysToTrust.values().contains(true)){
- lock();
- } else {
- unlock();
- }
+ lockOrUnlockAsNeeded();
setDone();
}
}
@@ -245,6 +237,14 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
mSaveButton.setTextColor(getSecondaryTextColor());
}
+ private void lockOrUnlockAsNeeded() {
+ if (!hasOtherTrustedKeys && !foreignKeysToTrust.values().contains(true)){
+ lock();
+ } else {
+ unlock();
+ }
+ }
+
private void setDone() {
mSaveButton.setText(getString(R.string.done));
}