@@ -6,16 +6,21 @@ import androidx.compose.foundation.clickable
66import androidx.compose.foundation.layout.Arrangement
77import androidx.compose.foundation.layout.Box
88import androidx.compose.foundation.layout.Column
9+ import androidx.compose.foundation.layout.PaddingValues
910import androidx.compose.foundation.layout.Row
1011import androidx.compose.foundation.layout.Spacer
1112import androidx.compose.foundation.layout.fillMaxWidth
1213import androidx.compose.foundation.layout.padding
14+ import androidx.compose.foundation.lazy.LazyRow
1315import androidx.compose.foundation.shape.RoundedCornerShape
16+ import androidx.compose.material3.ButtonColors
17+ import androidx.compose.material3.ButtonDefaults
1418import androidx.compose.material3.DropdownMenu
1519import androidx.compose.material3.DropdownMenuItem
1620import androidx.compose.material3.HorizontalDivider
1721import androidx.compose.material3.Icon
1822import androidx.compose.material3.MaterialTheme
23+ import androidx.compose.material3.OutlinedButton
1924import androidx.compose.material3.Text
2025import androidx.compose.material3.TextButton
2126import androidx.compose.runtime.Composable
@@ -44,6 +49,9 @@ import site.remlit.snowdrop.ThreadRoute
4449import site.remlit.snowdrop.component.dropdown.DangerDropdownItem
4550import site.remlit.snowdrop.model.Status
4651import site.remlit.snowdrop.model.Account
52+ import site.remlit.snowdrop.model.Emoji
53+ import site.remlit.snowdrop.util.BoostColor
54+ import site.remlit.snowdrop.util.LikeColor
4755import site.remlit.snowdrop.util.LocalNavController
4856import site.remlit.snowdrop.util.WarningColor25
4957import site.remlit.snowdrop.util.atRoute
@@ -113,10 +121,12 @@ fun Status(status: Status) {
113121 @Composable
114122 fun FooterButton (
115123 onClick : () -> Unit ,
124+ colors : ButtonColors ? = null,
116125 content : @Composable () -> Unit
117126 ) {
118127 TextButton (
119128 onClick = onClick,
129+ colors = colors ? : ButtonDefaults .textButtonColors()
120130 ) {
121131 Row (
122132 verticalAlignment = Alignment .CenterVertically ,
@@ -312,6 +322,33 @@ fun Status(status: Status) {
312322 MiniStatus (realStatus.quotedStatus!! )
313323 }
314324
325+ /*
326+ * Reactions
327+ */
328+ if (! realStatus.reactions.isEmpty()) {
329+ LazyRow (
330+ horizontalArrangement = Arrangement .spacedBy(5 .dp)
331+ ) {
332+ realStatus.reactions.forEach {
333+ item {
334+ OutlinedButton (
335+ onClick = {},
336+ contentPadding = PaddingValues (horizontal = 10 .dp, vertical = 10 .dp)
337+ ) {
338+ Row (
339+ horizontalArrangement = Arrangement .spacedBy(5 .dp),
340+ verticalAlignment = Alignment .CenterVertically
341+ ) {
342+ val emoji = it.toEmoji()
343+ if (emoji != null ) Emoji (emoji) else Text (it.name)
344+ Text (" ${it.count} " )
345+ }
346+ }
347+ }
348+ }
349+ }
350+ }
351+
315352 /*
316353 * Footer
317354 */
@@ -333,7 +370,12 @@ fun Status(status: Status) {
333370 Text (realStatus.repliesCount.toFormatShort())
334371 }
335372
336- FooterButton (onClick = { }) {
373+ FooterButton (
374+ onClick = { },
375+ colors = if (realStatus.reblogged) ButtonDefaults .textButtonColors(
376+ contentColor = BoostColor
377+ ) else null
378+ ) {
337379 if (isMine || realStatus.visibility == " public" || realStatus.visibility == " unlisted" ) {
338380 if (realStatus.reblogged) Icon (
339381 painterResource(Res .drawable.icon_repeat_24px),
@@ -354,11 +396,16 @@ fun Status(status: Status) {
354396 }
355397 }
356398
357- FooterButton (onClick = { }) {
399+ FooterButton (
400+ onClick = { },
401+ colors = if (realStatus.favourited) ButtonDefaults .textButtonColors(
402+ contentColor = LikeColor
403+ ) else null
404+ ) {
358405 if (realStatus.favourited) Icon (
359406 painterResource(Res .drawable.icon_star_filled_24px),
360407 null ,
361- tint = MaterialTheme .colorScheme.primary
408+ tint = LikeColor
362409 ) else Icon (
363410 painterResource(Res .drawable.icon_star_24px),
364411 null
@@ -369,11 +416,7 @@ fun Status(status: Status) {
369416 }
370417
371418 FooterButton (onClick = { }) {
372- if (realStatus.favourited) Icon (
373- painterResource(Res .drawable.icon_add_24px),
374- null ,
375- tint = MaterialTheme .colorScheme.primary
376- ) else Icon (
419+ Icon (
377420 painterResource(Res .drawable.icon_add_24px),
378421 null
379422 )
0 commit comments