From 8a1aefeda7fb16729e4290ed743442d53bda3aa0 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 21 Jun 2024 13:31:48 -0400 Subject: [PATCH] Adds an option to change reactions from the popup --- .../com/vitorpamplona/amethyst/ui/note/Icons.kt | 17 ++++++++++++++++- .../amethyst/ui/note/ReactionsRow.kt | 10 +++++++++- app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/Icons.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/Icons.kt index 905f36d81..46107c4f0 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/Icons.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/Icons.kt @@ -31,6 +31,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material.icons.automirrored.filled.OpenInNew import androidx.compose.material.icons.automirrored.filled.VolumeOff import androidx.compose.material.icons.automirrored.filled.VolumeUp +import androidx.compose.material.icons.filled.AddReaction import androidx.compose.material.icons.filled.Bolt import androidx.compose.material.icons.filled.Cancel import androidx.compose.material.icons.filled.Clear @@ -44,6 +45,7 @@ import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.filled.PushPin import androidx.compose.material.icons.filled.Report import androidx.compose.material.icons.filled.Share +import androidx.compose.material.icons.outlined.AddReaction import androidx.compose.material.icons.outlined.ArrowForwardIos import androidx.compose.material.icons.outlined.Bolt import androidx.compose.material.icons.outlined.PlayCircle @@ -164,7 +166,20 @@ fun LikedIcon( ) { Icon( imageVector = Liked, - stringRes(id = R.string.like_description), + contentDescription = stringRes(id = R.string.like_description), + modifier = modifier, + tint = tint, + ) +} + +@Composable +fun ChangeReactionIcon( + modifier: Modifier, + tint: Color = Color.Unspecified, +) { + Icon( + imageVector = Icons.Outlined.AddReaction, + contentDescription = stringRes(id = R.string.change_reaction), modifier = modifier, tint = tint, ) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index b37b34612..26c4416e5 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -822,7 +822,6 @@ fun BoostText( SlidingAnimationCount(boostState, grayTint, accountViewModel) } -@OptIn(ExperimentalFoundationApi::class) @Composable fun LikeReaction( baseNote: Note, @@ -1367,6 +1366,10 @@ fun ReactionChoicePopupContent( toRemove = toRemove, ) } + + ClickableBox(modifier = reactionBox, onClick = onChangeAmount) { + ChangeReactionIcon(modifier = Size20Modifier, MaterialTheme.colorScheme.placeholderText) + } } } } @@ -1389,6 +1392,11 @@ fun ReactionChoicePopupPeeview() { "\uD83D\uDE31", "+", "-", + "\uD83C\uDF89", + "\uD83E\uDD14", + "\uD83D\uDE31", + "\uD83E\uDD14", + "\uD83D\uDE31", ), onClick = {}, onChangeAmount = {}, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b3e0e6f41..1130f841e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -785,6 +785,8 @@ Like Zap + Change Quick Reactions + Profile Picture of %1$s Relay %1$s Expand relay list