aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-03-20 20:25:30 +0100
committerChristian Schneppe <christian@pix-art.de>2018-03-20 20:25:30 +0100
commit149875654ca0f6e5f4cb51ccb564f637b11f9c9d (patch)
tree08a590415bf31a670d6ec9b5116a545cef863eb9 /src/main/java/de/pixart/messenger/ui
parent1eb3d7c971d9a8b8316f533eb454a2427bef455b (diff)
create dedicated button to enable undecided accounts
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/OmemoActivity.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/OmemoActivity.java b/src/main/java/de/pixart/messenger/ui/OmemoActivity.java
index e304a64ee..95b521086 100644
--- a/src/main/java/de/pixart/messenger/ui/OmemoActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/OmemoActivity.java
@@ -1,7 +1,6 @@
package de.pixart.messenger.ui;
-import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
@@ -11,6 +10,7 @@ import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.View;
import android.widget.CompoundButton;
+import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -131,6 +131,7 @@ public abstract class OmemoActivity extends XmppActivity {
View view = getLayoutInflater().inflate(R.layout.contact_key, keys, false);
TextView key = view.findViewById(R.id.key);
TextView keyType = view.findViewById(R.id.key_type);
+ ImageButton enableUndecided = view.findViewById(R.id.button_enable_device);
if (Config.X509_VERIFICATION && status.getTrust() == FingerprintStatus.Trust.VERIFIED_X509) {
key.setOnClickListener(v -> showX509Certificate(account, fingerprint));
keyType.setOnClickListener(v -> showX509Certificate(account, fingerprint));
@@ -160,12 +161,13 @@ public abstract class OmemoActivity extends XmppActivity {
trustToggle.setVisibility(View.VISIBLE);
trustToggle.setOnCheckedChangeListener(onCheckedChangeListener);
if (status.getTrust() == FingerprintStatus.Trust.UNDECIDED && undecidedNeedEnablement) {
- trustToggle.setOnClickListener(v -> {
+ enableUndecided.setVisibility(View.VISIBLE);
+ enableUndecided.setOnClickListener(v -> {
account.getAxolotlService().setFingerprintTrust(fingerprint, FingerprintStatus.createActive(false));
- v.setEnabled(true);
- v.setOnClickListener(null);
+ enableUndecided.setVisibility(View.GONE);
+ trustToggle.setVisibility(View.VISIBLE);
});
- trustToggle.setEnabled(false);
+ trustToggle.setVisibility(View.GONE);
} else {
trustToggle.setOnClickListener(null);
trustToggle.setEnabled(true);