From b11f76bea6bbed42301433ca3ec55b66b08b8942 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 31 Mar 2018 22:50:35 +0200 Subject: add scan action to contact details --- .../messenger/ui/ContactDetailsActivity.java | 4 +++ src/main/res/layout/activity_contact_details.xml | 40 ++++++++++++++++------ src/main/res/layout/activity_scan.xml | 2 +- src/main/res/values/strings.xml | 4 +-- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index d4b3218ee..bb0e668d6 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -594,6 +594,10 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp } else { binding.showInactiveDevices.setVisibility(View.GONE); } + binding.scanButton.setVisibility(hasKeys ? View.VISIBLE : View.GONE); + if (hasKeys) { + binding.scanButton.setOnClickListener((v) -> ScanActivity.scan(this)); + } if (Config.supportOpenPgp() && contact.getPgpKeyId() != 0) { hasKeys = true; View view = inflater.inflate(R.layout.contact_key, binding.detailsContactKeys, false); diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index ef8fe4134..1cf0bdb08 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -217,26 +217,44 @@ + android:orientation="vertical"> + android:padding="@dimen/card_padding_list"> -