From ee57da5320ff97c47a6c98d36f89600d01864d1a Mon Sep 17 00:00:00 2001 From: kosyak Date: Sat, 18 May 2024 13:33:30 +0200 Subject: [PATCH] contact jid copy button --- .../eu/siacs/conversations/ui/ContactDetailsActivity.java | 3 +++ src/main/res/layout/activity_contact_details.xml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index f184358fe..fcd1cc4a0 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -67,6 +67,7 @@ import eu.siacs.conversations.ui.util.AvatarWorkerTask; import eu.siacs.conversations.ui.util.GridManager; import eu.siacs.conversations.ui.util.JidDialog; import eu.siacs.conversations.ui.util.MenuDoubleTabUtil; +import eu.siacs.conversations.ui.util.ShareUtil; import eu.siacs.conversations.ui.util.SoftKeyboardUtils; import eu.siacs.conversations.utils.AccountUtils; import eu.siacs.conversations.utils.Compatibility; @@ -514,6 +515,8 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp } binding.detailsContactjid.setText(IrregularUnicodeDetector.style(this, contact.getJid())); + binding.detailsContactjid.setOnClickListener(v -> ShareUtil.copyJidToClipboard(ContactDetailsActivity.this, contact.getJid())); + String account; if (Config.DOMAIN_LOCK != null) { account = contact.getAccount().getJid().getEscapedLocal(); diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index bf6377859..26c3d4e20 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -57,7 +57,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/account_settings_example_jabber_id" - android:textAppearance="@style/TextAppearance.Conversations.Title" /> + android:textAppearance="@style/TextAppearance.Conversations.Title" + android:drawablePadding="4dp" + app:drawableEndCompat="?attr/icon_copy_bar_small" />