aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-03-31 22:50:35 +0200
committerChristian Schneppe <christian@pix-art.de>2018-03-31 22:50:35 +0200
commitb11f76bea6bbed42301433ca3ec55b66b08b8942 (patch)
treee7b75d5e3da0aac3211e771122819794f517b65b
parent92a0dc50159674f1b7d17bf70f4ff26893dab627 (diff)
add scan action to contact details
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java4
-rw-r--r--src/main/res/layout/activity_contact_details.xml40
-rw-r--r--src/main/res/layout/activity_scan.xml2
-rw-r--r--src/main/res/values/strings.xml4
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 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="@dimen/card_padding_list">
+ android:orientation="vertical">
<LinearLayout
android:id="@+id/details_contact_keys"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="?android:dividerHorizontal"
android:orientation="vertical"
- android:showDividers="middle"></LinearLayout>
+ android:padding="@dimen/card_padding_list"></LinearLayout>
- <Button
- android:id="@+id/show_inactive_devices"
- style="?android:attr/borderlessButtonStyle"
+ <LinearLayout
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
+ android:layout_height="match_parent"
android:layout_marginTop="8dp"
- android:text="@string/show_inactive_devices"
- android:textColor="@color/accent" />
+ android:orientation="horizontal">
+
+ <Button
+ android:id="@+id/scan_button"
+ style="?android:attr/borderlessButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minWidth="0dp"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:text="@string/scan_qr_code"
+ android:textColor="?attr/colorAccent" />
+
+ <Button
+ android:id="@+id/show_inactive_devices"
+ style="?android:attr/borderlessButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:minWidth="0dp"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:text="@string/show_inactive_devices"
+ android:textColor="?attr/colorAccent" />
+ </LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
diff --git a/src/main/res/layout/activity_scan.xml b/src/main/res/layout/activity_scan.xml
index 0f3765b15..4bae5737e 100644
--- a/src/main/res/layout/activity_scan.xml
+++ b/src/main/res/layout/activity_scan.xml
@@ -9,7 +9,7 @@
android:layout_height="match_parent"
android:keepScreenOn="true" />
- <eu.siacs.conversations.ui.widget.ScannerView
+ <de.pixart.messenger.ui.widget.ScannerView
android:id="@+id/scan_activity_mask"
android:layout_width="match_parent"
android:layout_height="match_parent" />
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 1fd306d37..cb267033e 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -670,8 +670,8 @@
<string name="i_followed_this_link_from_a_trusted_source">I followed this link from a trusted source</string>
<string name="verifying_omemo_keys_trusted_source">You are about to verify the OMEMO keys of %1$s after clicking a link. This is only secure if you followed this link from a trusted source where only %2$s could have published this link.</string>
<string name="verify_omemo_keys">Verify OMEMO fingerprints</string>
- <string name="show_inactive_devices">Show inactive devices</string>
- <string name="hide_inactive_devices">Hide inactive devices</string>
+ <string name="show_inactive_devices">Show inactive</string>
+ <string name="hide_inactive_devices">Hide inactive</string>
<string name="reply">Reply</string>
<string name="encrypting_message">Encrypting message</string>
<string name="transcoding_video">Compressing video</string>