From 55bb3dc35f40cd7cb7dbf4f0ec2d37130bf407f0 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 5 Sep 2024 11:13:52 +0200 Subject: [PATCH] fix: issues with channel name caused by textIsSelectable --- .../com/github/libretube/ui/fragments/ChannelFragment.kt | 6 ++++++ app/src/main/res/layout/fragment_channel.xml | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt index 3816a99c5..600c757ec 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt @@ -24,6 +24,7 @@ import com.github.libretube.enums.ShareObjectType import com.github.libretube.extensions.TAG import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.toID +import com.github.libretube.helpers.ClipboardHelper import com.github.libretube.helpers.ImageHelper import com.github.libretube.helpers.NavigationHelper import com.github.libretube.obj.ShareData @@ -193,6 +194,11 @@ class ChannelFragment : DynamicLayoutManagerFragment() { binding.channelCoordinator.isVisible = true binding.channelName.text = response.name + binding.channelName.setOnLongClickListener { + ClipboardHelper.save(requireContext(), text = response.name.orEmpty()) + true + } + if (response.verified) { binding.channelName .setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_verified, 0) diff --git a/app/src/main/res/layout/fragment_channel.xml b/app/src/main/res/layout/fragment_channel.xml index ce7f28757..0ddbdb4ee 100644 --- a/app/src/main/res/layout/fragment_channel.xml +++ b/app/src/main/res/layout/fragment_channel.xml @@ -67,7 +67,6 @@ android:drawablePadding="3dp" android:ellipsize="end" android:maxLines="1" - android:textIsSelectable="true" android:textSize="16sp" android:textStyle="bold" tools:text="Channel Name" />