Adjustments to Modifiers in the Chatroom screen

This commit is contained in:
Vitor Pamplona
2023-07-21 11:21:07 -04:00
parent f56f3b6105
commit 2c82e6c447
2 changed files with 21 additions and 13 deletions

View File

@@ -19,7 +19,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
@@ -124,6 +123,10 @@ import com.vitorpamplona.amethyst.ui.screen.equalImmutableLists
import com.vitorpamplona.amethyst.ui.theme.ButtonBorder import com.vitorpamplona.amethyst.ui.theme.ButtonBorder
import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer
import com.vitorpamplona.amethyst.ui.theme.DoubleVertSpacer import com.vitorpamplona.amethyst.ui.theme.DoubleVertSpacer
import com.vitorpamplona.amethyst.ui.theme.EditFieldBorder
import com.vitorpamplona.amethyst.ui.theme.EditFieldLeadingIconModifier
import com.vitorpamplona.amethyst.ui.theme.EditFieldModifier
import com.vitorpamplona.amethyst.ui.theme.EditFieldTrailingIconModifier
import com.vitorpamplona.amethyst.ui.theme.Size25dp import com.vitorpamplona.amethyst.ui.theme.Size25dp
import com.vitorpamplona.amethyst.ui.theme.Size35dp import com.vitorpamplona.amethyst.ui.theme.Size35dp
import com.vitorpamplona.amethyst.ui.theme.SmallBorder import com.vitorpamplona.amethyst.ui.theme.SmallBorder
@@ -351,15 +354,13 @@ fun EditFieldRow(
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
onSendNewMessage: () -> Unit onSendNewMessage: () -> Unit
) { ) {
val context = LocalContext.current
Row( Row(
modifier = Modifier modifier = EditFieldModifier,
.padding(start = 10.dp, end = 10.dp, bottom = 10.dp, top = 5.dp)
.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween, horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
) { ) {
val context = LocalContext.current
MyTextField( MyTextField(
value = channelScreenModel.message, value = channelScreenModel.message,
onValueChange = { onValueChange = {
@@ -368,7 +369,7 @@ fun EditFieldRow(
keyboardOptions = KeyboardOptions.Default.copy( keyboardOptions = KeyboardOptions.Default.copy(
capitalization = KeyboardCapitalization.Sentences capitalization = KeyboardCapitalization.Sentences
), ),
shape = RoundedCornerShape(25.dp), shape = EditFieldBorder,
modifier = Modifier.weight(1f, true), modifier = Modifier.weight(1f, true),
placeholder = { placeholder = {
Text( Text(
@@ -383,18 +384,14 @@ fun EditFieldRow(
onSendNewMessage() onSendNewMessage()
}, },
isActive = channelScreenModel.message.text.isNotBlank() && !channelScreenModel.isUploadingImage, isActive = channelScreenModel.message.text.isNotBlank() && !channelScreenModel.isUploadingImage,
modifier = Modifier modifier = EditFieldTrailingIconModifier
.height(32.dp)
.padding(end = 10.dp)
) )
}, },
leadingIcon = { leadingIcon = {
UploadFromGallery( UploadFromGallery(
isUploading = channelScreenModel.isUploadingImage, isUploading = channelScreenModel.isUploadingImage,
tint = MaterialTheme.colors.placeholderText, tint = MaterialTheme.colors.placeholderText,
modifier = Modifier modifier = EditFieldLeadingIconModifier
.height(32.dp)
.padding(start = 2.dp)
) { ) {
val fileServer = if (isPrivate) { val fileServer = if (isPrivate) {
// TODO: Make private servers // TODO: Make private servers

View File

@@ -28,6 +28,7 @@ val TabRowHeight = Modifier.height(40.dp)
val SmallBorder = RoundedCornerShape(7.dp) val SmallBorder = RoundedCornerShape(7.dp)
val QuoteBorder = RoundedCornerShape(15.dp) val QuoteBorder = RoundedCornerShape(15.dp)
val ButtonBorder = RoundedCornerShape(20.dp) val ButtonBorder = RoundedCornerShape(20.dp)
val EditFieldBorder = RoundedCornerShape(25.dp)
val ChatBubbleShapeMe = RoundedCornerShape(15.dp, 15.dp, 3.dp, 15.dp) val ChatBubbleShapeMe = RoundedCornerShape(15.dp, 15.dp, 3.dp, 15.dp)
val ChatBubbleShapeThem = RoundedCornerShape(3.dp, 15.dp, 15.dp, 15.dp) val ChatBubbleShapeThem = RoundedCornerShape(3.dp, 15.dp, 15.dp, 15.dp)
@@ -118,3 +119,13 @@ val ChatHeadlineBorders = Modifier.padding(start = 12.dp, end = 12.dp, top = 10.
val VolumeBottomIconSize = Modifier.size(70.dp).padding(10.dp) val VolumeBottomIconSize = Modifier.size(70.dp).padding(10.dp)
val PinBottomIconSize = Modifier.size(70.dp).padding(10.dp) val PinBottomIconSize = Modifier.size(70.dp).padding(10.dp)
val NIP05IconSize = Modifier.size(14.dp).padding(top = 1.dp, start = 1.dp, end = 1.dp) val NIP05IconSize = Modifier.size(14.dp).padding(top = 1.dp, start = 1.dp, end = 1.dp)
val EditFieldModifier = Modifier
.padding(start = 10.dp, end = 10.dp, bottom = 10.dp, top = 5.dp)
.fillMaxWidth()
val EditFieldTrailingIconModifier = Modifier
.height(32.dp)
.padding(start = 5.dp, end = 10.dp)
val EditFieldLeadingIconModifier = Modifier
.height(32.dp)
.padding(start = 2.dp)