diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt
index dbb4a20e1d..b33649a6a0 100644
--- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt
+++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt
@@ -1267,7 +1267,7 @@ private fun RenderNoteRow(
}
is BirdexEvent -> {
- RenderBirdex(baseNote, makeItShort, accountViewModel)
+ RenderBirdex(baseNote)
}
is HighlightEvent -> {
diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Birdex.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Birdex.kt
index 8346a62aed..5237134276 100644
--- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Birdex.kt
+++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Birdex.kt
@@ -34,8 +34,6 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.Note
-import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
-import com.vitorpamplona.amethyst.ui.stringRes
import com.vitorpamplona.amethyst.ui.theme.placeholderText
import com.vitorpamplona.amethyst.ui.theme.replyModifier
import com.vitorpamplona.quartz.experimental.birdstar.BirdexEvent
@@ -50,19 +48,16 @@ private const val SPECIES_PREVIEW_LIMIT = 6
* bounded regardless of how many species a Birdex holds, we show the count and a
* short preview of scientific names with a "+N more" suffix — no images, no
* expansion, no network calls. The card is identical in the feed and the opened
- * view (it ignores [makeItShort]).
+ * view, so it takes no makeItShort flag.
*/
@Composable
-fun RenderBirdex(
- baseNote: Note,
- makeItShort: Boolean,
- accountViewModel: AccountViewModel,
-) {
+fun RenderBirdex(baseNote: Note) {
val noteEvent = baseNote.event as? BirdexEvent ?: return
val names = remember(noteEvent) { noteEvent.speciesNames() }
val preview = remember(names) { names.take(SPECIES_PREVIEW_LIMIT) }
val remaining = names.size - preview.size
+ val joined = remember(preview) { preview.joinToString(", ") }
Column(MaterialTheme.colorScheme.replyModifier.padding(10.dp)) {
Text(
@@ -72,16 +67,16 @@ fun RenderBirdex(
if (preview.isNotEmpty()) {
Spacer(Modifier.height(6.dp))
- val joined = preview.joinToString(", ")
Text(
text =
if (remaining > 0) {
- stringRes(R.string.birdex_species_preview_more, joined, remaining.toString())
+ pluralStringResource(R.plurals.birdex_species_preview_more, remaining, joined, remaining)
} else {
joined
},
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.placeholderText,
+ maxLines = 2,
overflow = TextOverflow.Ellipsis,
)
}
diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt
index 689c8391a9..2de99d5f54 100644
--- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt
+++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt
@@ -772,7 +772,7 @@ private fun FullBleedNoteCompose(
} else if (noteEvent is FundraiserEvent) {
RenderFundraiser(baseNote, makeItShort = false, accountViewModel, nav)
} else if (noteEvent is BirdexEvent) {
- RenderBirdex(baseNote, makeItShort = false, accountViewModel)
+ RenderBirdex(baseNote)
} else if (noteEvent is RepostEvent || noteEvent is GenericRepostEvent) {
RenderRepost(baseNote, quotesLeft = 3, backgroundColor, accountViewModel, nav)
} else if (noteEvent is RelayDiscoveryEvent) {
diff --git a/amethyst/src/main/res/values/strings.xml b/amethyst/src/main/res/values/strings.xml
index 400852fb5f..debeb95ff7 100644
--- a/amethyst/src/main/res/values/strings.xml
+++ b/amethyst/src/main/res/values/strings.xml
@@ -3142,7 +3142,10 @@
- Birdex · %1$d species
- Birdex · %1$d species
- %1$s +%2$s more
+
+ - %1$s +%2$d more
+ - %1$s +%2$d more
+
Goal amount (sats)
100000
Describe your goal
diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/birdstar/BirdexEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/birdstar/BirdexEvent.kt
index 4b170db4b8..e147d4c556 100644
--- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/birdstar/BirdexEvent.kt
+++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/birdstar/BirdexEvent.kt
@@ -59,13 +59,12 @@ class BirdexEvent(
fun speciesNames() = tags.mapValueTagged("n") { it }
/** Number of collected species (one `n` tag per species). */
- fun speciesCount() = tags.count { it.size > 1 && it[0] == "n" }
+ fun speciesCount() = speciesNames().size
/** Publisher-provided human-readable summary, from the `alt` tag (may be null). */
fun summary() = tags.firstTagValue("alt")
companion object {
const val KIND = 12473
- const val ALT_DESCRIPTION = "A Birdex species collection"
}
}