mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 18:56:49 +02:00
fixing alignment of the reaction buttons
This commit is contained in:
@@ -2,6 +2,7 @@ package com.vitorpamplona.amethyst.ui.note
|
|||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.material.Icon
|
import androidx.compose.material.Icon
|
||||||
@@ -35,88 +36,87 @@ fun ReactionsRow(note: Note, account: Account, boost: (Note) -> Unit, reactTo: (
|
|||||||
if (wantsToReplyTo != null)
|
if (wantsToReplyTo != null)
|
||||||
NewPostView({ wantsToReplyTo = null }, wantsToReplyTo, account)
|
NewPostView({ wantsToReplyTo = null }, wantsToReplyTo, account)
|
||||||
|
|
||||||
Row(modifier = Modifier.padding(top = 8.dp)) {
|
Row(
|
||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween) {
|
modifier = Modifier.padding(top = 8.dp).fillMaxWidth(),
|
||||||
IconButton(
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.then(Modifier.size(24.dp)),
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
onClick = { if (account.isWriteable()) wantsToReplyTo = note }
|
) {
|
||||||
) {
|
IconButton(
|
||||||
|
modifier = Modifier.then(Modifier.size(24.dp)),
|
||||||
|
onClick = { if (account.isWriteable()) wantsToReplyTo = note }
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_comment),
|
||||||
|
null,
|
||||||
|
modifier = Modifier.size(15.dp),
|
||||||
|
tint = grayTint,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Text(
|
||||||
|
" ${showCount(note.replies?.size)}",
|
||||||
|
fontSize = 14.sp,
|
||||||
|
color = grayTint,
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
|
|
||||||
|
IconButton(
|
||||||
|
modifier = Modifier.then(Modifier.size(24.dp)),
|
||||||
|
onClick = { if (account.isWriteable()) boost(note) }
|
||||||
|
) {
|
||||||
|
if (note.isBoostedBy(account.userProfile())) {
|
||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(R.drawable.ic_comment),
|
painter = painterResource(R.drawable.ic_retweeted),
|
||||||
null,
|
null,
|
||||||
modifier = Modifier.size(15.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
tint = grayTint,
|
tint = Color.Unspecified
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(R.drawable.ic_retweet),
|
||||||
|
null,
|
||||||
|
modifier = Modifier.size(20.dp),
|
||||||
|
tint = grayTint
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(
|
|
||||||
" ${showCount(note.replies?.size)}",
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = grayTint
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
Row(
|
|
||||||
modifier = Modifier.padding(start = 40.dp),
|
Text(
|
||||||
verticalAlignment = Alignment.CenterVertically
|
" ${showCount(note.boosts?.size)}",
|
||||||
|
fontSize = 14.sp,
|
||||||
|
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f),
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
|
|
||||||
|
IconButton(
|
||||||
|
modifier = Modifier.then(Modifier.size(24.dp)),
|
||||||
|
onClick = { if (account.isWriteable()) reactTo(note) }
|
||||||
) {
|
) {
|
||||||
IconButton(
|
if (note.isReactedBy(account.userProfile())) {
|
||||||
modifier = Modifier.then(Modifier.size(24.dp)),
|
Icon(
|
||||||
onClick = { if (account.isWriteable()) boost(note) }
|
painter = painterResource(R.drawable.ic_liked),
|
||||||
) {
|
null,
|
||||||
if (note.isBoostedBy(account.userProfile())) {
|
modifier = Modifier.size(16.dp),
|
||||||
Icon(
|
tint = Color.Unspecified
|
||||||
painter = painterResource(R.drawable.ic_retweeted),
|
)
|
||||||
null,
|
} else {
|
||||||
modifier = Modifier.size(20.dp),
|
Icon(
|
||||||
tint = Color.Unspecified
|
painter = painterResource(R.drawable.ic_like),
|
||||||
)
|
null,
|
||||||
} else {
|
modifier = Modifier.size(16.dp),
|
||||||
Icon(
|
tint = grayTint
|
||||||
painter = painterResource(R.drawable.ic_retweet),
|
)
|
||||||
null,
|
|
||||||
modifier = Modifier.size(20.dp),
|
|
||||||
tint = grayTint
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(
|
|
||||||
" ${showCount(note.boosts?.size)}",
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
Row(
|
|
||||||
modifier = Modifier.padding(start = 40.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
|
||||||
IconButton(
|
|
||||||
modifier = Modifier.then(Modifier.size(24.dp)),
|
|
||||||
onClick = { if (account.isWriteable()) reactTo(note) }
|
|
||||||
) {
|
|
||||||
if (note.isReactedBy(account.userProfile())) {
|
|
||||||
Icon(
|
|
||||||
painter = painterResource(R.drawable.ic_liked),
|
|
||||||
null,
|
|
||||||
modifier = Modifier.size(16.dp),
|
|
||||||
tint = Color.Unspecified
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
Icon(
|
|
||||||
painter = painterResource(R.drawable.ic_like),
|
|
||||||
null,
|
|
||||||
modifier = Modifier.size(16.dp),
|
|
||||||
tint = grayTint
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
" ${showCount(note.reactions?.size)}",
|
" ${showCount(note.reactions?.size)}",
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f)
|
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f),
|
||||||
)
|
modifier = Modifier.weight(1f)
|
||||||
}
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(start = 40.dp),
|
modifier = Modifier.padding(start = 40.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
@@ -133,6 +133,8 @@ fun ReactionsRow(note: Note, account: Account, boost: (Note) -> Unit, reactTo: (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user