adding barebones styling to the reply box

This commit is contained in:
Adam Brown 2022-09-30 18:08:20 +01:00 committed by Adam Brown
parent 625a2f682f
commit 2486a1eef6
1 changed files with 25 additions and 5 deletions

View File

@ -38,7 +38,6 @@ import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.* import androidx.compose.ui.unit.*
import androidx.compose.ui.zIndex
import androidx.core.net.toUri import androidx.core.net.toUri
import app.dapk.st.core.Lce import app.dapk.st.core.Lce
import app.dapk.st.core.LifecycleEffect import app.dapk.st.core.LifecycleEffect
@ -637,7 +636,7 @@ private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Un
AnimatedContent( AnimatedContent(
targetState = state.reply, targetState = state.reply,
transitionSpec = { transitionSpec = {
slideIntoContainer(towards = AnimatedContentScope.SlideDirection.Up, animationSpec = tween(500)){ slideIntoContainer(towards = AnimatedContentScope.SlideDirection.Up, animationSpec = tween(500)) {
it / 2 it / 2
} }
.with(slideOutOfContainer(towards = AnimatedContentScope.SlideDirection.Down)) .with(slideOutOfContainer(towards = AnimatedContentScope.SlideDirection.Down))
@ -652,9 +651,30 @@ private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Un
} }
) { ) {
if (it is Message) { if (it is Message) {
Column(Modifier.clipToBounds()) { Column(Modifier.padding(12.dp)) {
Text(it.author.displayName ?: it.author.id.value) Column(
Text(it.content, maxLines = 2) Modifier
.fillMaxWidth()
.background(SmallTalkTheme.extendedColors.selfBubbleReplyBackground)
.padding(4.dp)
) {
val replyName = it.author.displayName ?: it.author.id.value
Text(
fontSize = 11.sp,
text = replyName,
maxLines = 1,
color = SmallTalkTheme.extendedColors.onSelfBubble
)
Text(
text = it.content,
color = SmallTalkTheme.extendedColors.onSelfBubble,
fontSize = 15.sp,
maxLines = 2,
modifier = Modifier.wrapContentSize(),
textAlign = TextAlign.Start,
)
}
} }
} }
} }