Compare commits

...

4 Commits

Author SHA1 Message Date
Vitor Pamplona
fe9e85c282 v0.58.2 2023-06-14 20:58:51 -04:00
Vitor Pamplona
01ac90fbec BugFix for active like all the time 2023-06-14 20:55:46 -04:00
Vitor Pamplona
dc079941e7 v0.58.1 2023-06-14 20:28:47 -04:00
Vitor Pamplona
9a7a94cb77 Cropping long reactions to two chars for emojis 2023-06-14 20:27:46 -04:00
4 changed files with 12 additions and 6 deletions

View File

@@ -13,8 +13,8 @@ android {
applicationId "com.vitorpamplona.amethyst"
minSdk 26
targetSdk 33
versionCode 207
versionName "0.58.0"
versionCode 209
versionName "0.58.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

View File

@@ -178,6 +178,12 @@ fun RenderLikeGallery(
likeEvents.isNotEmpty()
}
val shortReaction by remember {
derivedStateOf {
reactionType.take(2)
}
}
if (isNotEmpty) {
Row(remember { Modifier.fillMaxWidth() }) {
Box(
@@ -192,7 +198,7 @@ fun RenderLikeGallery(
.align(Alignment.TopEnd)
}
when (reactionType) {
when (shortReaction) {
"+" -> Icon(
painter = painterResource(R.drawable.ic_liked),
null,
@@ -200,7 +206,7 @@ fun RenderLikeGallery(
tint = Color.Unspecified
)
"-" -> Text(text = "\uD83D\uDC4E", modifier = modifier)
else -> Text(text = reactionType, modifier = modifier)
else -> Text(text = shortReaction, modifier = modifier)
}
}

View File

@@ -511,7 +511,7 @@ fun LikeIcon(baseNote: Note, iconSize: Dp = 20.dp, grayTint: Color, loggedIn: Us
launch(Dispatchers.Default) {
val newReactionType = reactionsState?.note?.isReactedBy(loggedIn)
if (reactionType != newReactionType) {
reactionType = newReactionType
reactionType = newReactionType?.take(2) ?: "+"
}
}
}

View File

@@ -64,7 +64,7 @@ class UpdateReactionTypeViewModel(val account: Account) : ViewModel() {
}
fun addChoice() {
val newValue = nextChoice.text.trim()
val newValue = nextChoice.text.trim().take(2)
reactionSet = reactionSet + newValue
nextChoice = TextFieldValue("")