More spacing refinements for notes.
This commit is contained in:
@@ -25,10 +25,10 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|||||||
import kotlinx.collections.immutable.ImmutableSet
|
import kotlinx.collections.immutable.ImmutableSet
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BlankNote(modifier: Modifier = Modifier, isQuote: Boolean = false, idHex: String? = null) {
|
fun BlankNote(modifier: Modifier = Modifier, showDivider: Boolean = false, idHex: String? = null) {
|
||||||
Column(modifier = modifier) {
|
Column(modifier = modifier) {
|
||||||
Row(modifier = Modifier.padding(horizontal = if (!isQuote) 12.dp else 6.dp)) {
|
Row() {
|
||||||
Column(modifier = Modifier.padding(start = if (!isQuote) 10.dp else 5.dp)) {
|
Column() {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(
|
modifier = Modifier.padding(
|
||||||
start = 20.dp,
|
start = 20.dp,
|
||||||
@@ -46,7 +46,7 @@ fun BlankNote(modifier: Modifier = Modifier, isQuote: Boolean = false, idHex: St
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isQuote) {
|
if (!showDivider) {
|
||||||
Divider(
|
Divider(
|
||||||
modifier = Modifier.padding(vertical = 10.dp),
|
modifier = Modifier.padding(vertical = 10.dp),
|
||||||
thickness = 0.25.dp
|
thickness = 0.25.dp
|
||||||
|
|||||||
@@ -356,7 +356,6 @@ private fun WatchForReports(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun NormalNote(
|
fun NormalNote(
|
||||||
baseNote: Note,
|
baseNote: Note,
|
||||||
@@ -490,19 +489,17 @@ private fun NoteWithReactions(
|
|||||||
start = if (!isBoostedNote) 12.dp else 0.dp,
|
start = if (!isBoostedNote) 12.dp else 0.dp,
|
||||||
end = if (!isBoostedNote) 12.dp else 0.dp,
|
end = if (!isBoostedNote) 12.dp else 0.dp,
|
||||||
top = if (addMarginTop && !isBoostedNote) 10.dp else 0.dp
|
top = if (addMarginTop && !isBoostedNote) 10.dp else 0.dp
|
||||||
|
// Don't add margin to the bottom because of the Divider down below
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
if (notBoostedNorQuote) {
|
if (notBoostedNorQuote) {
|
||||||
DrawAuthorImages(baseNote, accountViewModel, nav)
|
DrawAuthorImages(baseNote, accountViewModel, nav)
|
||||||
|
Spacer(modifier = Modifier.width(10.dp))
|
||||||
}
|
}
|
||||||
|
|
||||||
NoteBody(
|
NoteBody(
|
||||||
baseNote,
|
baseNote,
|
||||||
modifier = remember {
|
|
||||||
Modifier
|
|
||||||
.padding(start = if (notBoostedNorQuote) 10.dp else 0.dp)
|
|
||||||
},
|
|
||||||
isQuotedNote,
|
isQuotedNote,
|
||||||
unPackReply,
|
unPackReply,
|
||||||
makeItShort,
|
makeItShort,
|
||||||
@@ -529,7 +526,7 @@ private fun NoteWithReactions(
|
|||||||
nav
|
nav
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
if (!isQuotedNote && !isBoostedNote) {
|
if (!isQuotedNote && !isBoostedNote && baseNote.event !is RepostEvent) {
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -545,7 +542,6 @@ private fun NoteWithReactions(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun NoteBody(
|
private fun NoteBody(
|
||||||
baseNote: Note,
|
baseNote: Note,
|
||||||
modifier: Modifier,
|
|
||||||
showAuthorPicture: Boolean = false,
|
showAuthorPicture: Boolean = false,
|
||||||
unPackReply: Boolean = true,
|
unPackReply: Boolean = true,
|
||||||
makeItShort: Boolean = false,
|
makeItShort: Boolean = false,
|
||||||
@@ -555,9 +551,7 @@ private fun NoteBody(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: (String) -> Unit
|
nav: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
Column(
|
Column() {
|
||||||
modifier = modifier
|
|
||||||
) {
|
|
||||||
FirstUserInfoRow(
|
FirstUserInfoRow(
|
||||||
baseNote = baseNote,
|
baseNote = baseNote,
|
||||||
showAuthorPicture = showAuthorPicture,
|
showAuthorPicture = showAuthorPicture,
|
||||||
|
|||||||
@@ -443,7 +443,6 @@ fun NoteMaster(
|
|||||||
ReactionsRow(note, true, accountViewModel, nav)
|
ReactionsRow(note, true, accountViewModel, nav)
|
||||||
|
|
||||||
Divider(
|
Divider(
|
||||||
modifier = Modifier.padding(top = 10.dp),
|
|
||||||
thickness = 0.25.dp
|
thickness = 0.25.dp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user