diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | 4 | ||||
-rw-r--r-- | src/main/res/layout/activity_contact_details.xml | 40 | ||||
-rw-r--r-- | src/main/res/layout/activity_scan.xml | 2 | ||||
-rw-r--r-- | 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 @@ <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> |