From 7677e4d65cfd6bb2c2054e1d8c12edc3c367a5c6 Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Sun, 8 Oct 2023 01:07:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=8D=E5=88=B6=20UID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tieba/post/ui/page/user/UserProfilePage.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/user/UserProfilePage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/user/UserProfilePage.kt index 62593687..98ab4100 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/user/UserProfilePage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/user/UserProfilePage.kt @@ -93,6 +93,7 @@ import com.huanchengfly.tieba.post.ui.widgets.compose.states.StateScreen import com.huanchengfly.tieba.post.utils.AccountUtil.LocalAccount import com.huanchengfly.tieba.post.utils.StringUtil import com.huanchengfly.tieba.post.utils.StringUtil.getShortNumString +import com.huanchengfly.tieba.post.utils.TiebaUtil import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import kotlinx.collections.immutable.ImmutableList @@ -350,6 +351,12 @@ fun UserProfilePage( ) ) } + }, + onCopyIdClick = { + TiebaUtil.copyText( + context, + holder.get { id }.toString() + ) } ) } @@ -473,6 +480,7 @@ private fun UserProfileDetail( showBtn: Boolean = true, isSelf: Boolean = false, onBtnClick: () -> Unit = {}, + onCopyIdClick: () -> Unit = {}, ) { Column( modifier = modifier, @@ -611,7 +619,8 @@ private fun UserProfileDetail( imageVector = Icons.Outlined.ContentCopy, contentDescription = null ) - } + }, + onClick = onCopyIdClick ) if (user.get { ip_address }.isNotEmpty()) { Chip(