Skip to content

Commit f949d56

Browse files
committed
add draft support for public chat screen
1 parent 2bc2890 commit f949d56

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomMessageCompose.kt

+3
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ private fun MessageBubbleLines(
455455
bubbleSize = bubbleSize,
456456
availableBubbleSize = availableBubbleSize,
457457
firstColumn = {
458+
if (baseNote.isDraft()) {
459+
DisplayDraftChat()
460+
}
458461
IncognitoBadge(baseNote)
459462
ChatTimeAgo(baseNote)
460463
RelayBadgesHorizontal(baseNote, accountViewModel, nav = nav)

app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt

+14
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.ChannelHeader
115115
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
116116
import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer
117117
import com.vitorpamplona.amethyst.ui.theme.DoubleVertSpacer
118+
import com.vitorpamplona.amethyst.ui.theme.Font12SP
118119
import com.vitorpamplona.amethyst.ui.theme.HalfDoubleVertSpacer
120+
import com.vitorpamplona.amethyst.ui.theme.HalfEndPadding
119121
import com.vitorpamplona.amethyst.ui.theme.HalfPadding
120122
import com.vitorpamplona.amethyst.ui.theme.HalfStartPadding
121123
import com.vitorpamplona.amethyst.ui.theme.Size25dp
@@ -1128,6 +1130,18 @@ fun DisplayDraft() {
11281130
)
11291131
}
11301132

1133+
@Composable
1134+
fun DisplayDraftChat() {
1135+
Text(
1136+
"Draft",
1137+
color = MaterialTheme.colorScheme.placeholderText,
1138+
modifier = HalfEndPadding,
1139+
fontWeight = FontWeight.Bold,
1140+
fontSize = Font12SP,
1141+
maxLines = 1,
1142+
)
1143+
}
1144+
11311145
@Composable
11321146
fun FirstUserInfoRow(
11331147
baseNote: Note,

app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ChannelScreen.kt

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ fun PrepareChannelViewModels(
208208
val channelScreenModel: NewPostViewModel = viewModel()
209209
channelScreenModel.accountViewModel = accountViewModel
210210
channelScreenModel.account = accountViewModel.account
211+
channelScreenModel.originalNote = LocalCache.getNoteIfExists(baseChannel.idHex)
211212

212213
ChannelScreen(
213214
channel = baseChannel,

app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ val Size40dp = 40.dp
9292
val Size55dp = 55.dp
9393
val Size75dp = 75.dp
9494

95+
val HalfEndPadding = Modifier.padding(end = 5.dp)
9596
val HalfStartPadding = Modifier.padding(start = 5.dp)
9697
val StdStartPadding = Modifier.padding(start = 10.dp)
9798
val StdTopPadding = Modifier.padding(top = 10.dp)

0 commit comments

Comments
 (0)