From fbb7a9a298d2782bc825c74b0abae7bb832198d6 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Wed, 22 Apr 2020 16:23:57 +0200 Subject: [PATCH] Backport #1030 added copy user link --- .../kotlin/org/mariotaku/twidere/fragment/UserFragment.kt | 6 ++++++ twidere/src/main/res/menu/menu_user_profile.xml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt index 67ece98e4..170307f4f 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt @@ -1032,6 +1032,12 @@ class UserFragment : BaseFragment(), OnClickListener, OnLinkClickListener, } return true } + R.id.copy_url -> { + val uri = LinkCreator.getUserWebLink(user) + ClipboardUtils.setText(context, uri.toString()) + Toast.makeText(context, R.string.message_toast_link_copied_to_clipboard, Toast.LENGTH_SHORT).show() + return true + } R.id.qr_code -> { executeAfterFragmentResumed { val df = UserQrDialogFragment() diff --git a/twidere/src/main/res/menu/menu_user_profile.xml b/twidere/src/main/res/menu/menu_user_profile.xml index fef206041..e60e79de3 100644 --- a/twidere/src/main/res/menu/menu_user_profile.xml +++ b/twidere/src/main/res/menu/menu_user_profile.xml @@ -86,6 +86,10 @@ android:id="@id/open_in_browser" android:icon="@drawable/ic_action_web" android:title="@string/action_open_in_browser"/> +