From 4cd81f194cba196319d6971c2e9a389d59117b35 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Fri, 9 Sep 2022 10:01:50 +0200 Subject: [PATCH] Copy content to clipboard on long click on an item --- .../devices/v2/details/SessionDetailsContentItem.kt | 7 ++----- .../devices/v2/details/SessionDetailsController.kt | 7 ------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/details/SessionDetailsContentItem.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/details/SessionDetailsContentItem.kt index 665ba5126c..0363e320cd 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/details/SessionDetailsContentItem.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/details/SessionDetailsContentItem.kt @@ -24,6 +24,7 @@ import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R import im.vector.app.core.epoxy.VectorEpoxyHolder import im.vector.app.core.epoxy.VectorEpoxyModel +import im.vector.app.core.extensions.copyOnLongClick @EpoxyModelClass abstract class SessionDetailsContentItem : VectorEpoxyModel(R.layout.item_session_details_content) { @@ -37,15 +38,11 @@ abstract class SessionDetailsContentItem : VectorEpoxyModel() { - var callback: Callback? = null - - interface Callback { - fun onItemLongClicked(content: String) - } - override fun buildModels(data: DeviceInfo?) { data?.let { info -> val hasSectionSession = hasSectionSession(data) @@ -65,7 +59,6 @@ class SessionDetailsController @Inject constructor( private fun buildContentItem(@StringRes titleResId: Int, value: String, hasDivider: Boolean) { val host = this - // TODO bind the longClickListener to copy the description to the clipboard sessionDetailsContentItem { id(titleResId) title(host.stringProvider.getString(titleResId))