mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
Fixed height for group name editing
This commit is contained in:
parent
6e1fa1b257
commit
2fa433585a
@ -7,9 +7,13 @@ import androidx.compose.foundation.layout.Arrangement
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.heightIn
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
@ -150,9 +154,8 @@ fun EditGroup(
|
|||||||
// Group name title
|
// Group name title
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.animateContentSize()
|
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(LocalDimensions.current.smallSpacing),
|
.heightIn(min = 72.dp),
|
||||||
horizontalArrangement = Arrangement.spacedBy(
|
horizontalArrangement = Arrangement.spacedBy(
|
||||||
LocalDimensions.current.xxxsSpacing,
|
LocalDimensions.current.xxxsSpacing,
|
||||||
Alignment.CenterHorizontally
|
Alignment.CenterHorizontally
|
||||||
@ -160,7 +163,9 @@ fun EditGroup(
|
|||||||
verticalAlignment = CenterVertically,
|
verticalAlignment = CenterVertically,
|
||||||
) {
|
) {
|
||||||
if (editingName != null) {
|
if (editingName != null) {
|
||||||
IconButton(onClick = onEditNameCancelClicked) {
|
IconButton(
|
||||||
|
modifier = Modifier.size(LocalDimensions.current.spacing),
|
||||||
|
onClick = onEditNameCancelClicked) {
|
||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(R.drawable.ic_x),
|
painter = painterResource(R.drawable.ic_x),
|
||||||
contentDescription = stringResource(R.string.AccessibilityId_cancel),
|
contentDescription = stringResource(R.string.AccessibilityId_cancel),
|
||||||
@ -169,23 +174,30 @@ fun EditGroup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
SessionOutlinedTextField(
|
SessionOutlinedTextField(
|
||||||
modifier = Modifier.width(180.dp),
|
modifier = Modifier.widthIn(
|
||||||
|
min = LocalDimensions.current.mediumSpacing,
|
||||||
|
max = 240.dp
|
||||||
|
),
|
||||||
text = editingName,
|
text = editingName,
|
||||||
onChange = onEditingNameValueChanged,
|
onChange = onEditingNameValueChanged,
|
||||||
textStyle = LocalType.current.h8,
|
textStyle = LocalType.current.h8,
|
||||||
|
singleLine = true,
|
||||||
innerPadding = PaddingValues(
|
innerPadding = PaddingValues(
|
||||||
horizontal = LocalDimensions.current.spacing,
|
horizontal = LocalDimensions.current.spacing,
|
||||||
vertical = LocalDimensions.current.smallSpacing
|
vertical = LocalDimensions.current.smallSpacing
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
IconButton(onClick = onEditNameConfirmed) {
|
IconButton(
|
||||||
|
modifier = Modifier.size(LocalDimensions.current.spacing),
|
||||||
|
onClick = onEditNameConfirmed) {
|
||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(R.drawable.check),
|
painter = painterResource(R.drawable.check),
|
||||||
contentDescription = stringResource(R.string.AccessibilityId_confirm),
|
contentDescription = stringResource(R.string.AccessibilityId_confirm),
|
||||||
tint = LocalColors.current.text,
|
tint = LocalColors.current.text,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = groupName,
|
text = groupName,
|
||||||
|
@ -40,6 +40,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.TextUnit
|
import androidx.compose.ui.unit.TextUnit
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.max
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.ui.theme.LocalDimensions
|
import org.thoughtcrime.securesms.ui.theme.LocalDimensions
|
||||||
@ -51,6 +52,7 @@ import org.thoughtcrime.securesms.ui.theme.textSecondary
|
|||||||
import org.thoughtcrime.securesms.ui.contentDescription
|
import org.thoughtcrime.securesms.ui.contentDescription
|
||||||
import org.thoughtcrime.securesms.ui.theme.LocalType
|
import org.thoughtcrime.securesms.ui.theme.LocalType
|
||||||
import org.thoughtcrime.securesms.ui.theme.bold
|
import org.thoughtcrime.securesms.ui.theme.bold
|
||||||
|
import kotlin.math.sin
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
@ -98,6 +100,7 @@ fun SessionOutlinedTextField(
|
|||||||
error: String? = null,
|
error: String? = null,
|
||||||
isTextErrorColor: Boolean = error != null,
|
isTextErrorColor: Boolean = error != null,
|
||||||
enabled: Boolean = true,
|
enabled: Boolean = true,
|
||||||
|
singleLine: Boolean = false,
|
||||||
) {
|
) {
|
||||||
BasicTextField(
|
BasicTextField(
|
||||||
value = text,
|
value = text,
|
||||||
@ -113,6 +116,7 @@ fun SessionOutlinedTextField(
|
|||||||
onSearch = { onContinue() },
|
onSearch = { onContinue() },
|
||||||
onSend = { onContinue() },
|
onSend = { onContinue() },
|
||||||
),
|
),
|
||||||
|
singleLine = singleLine,
|
||||||
decorationBox = { innerTextField ->
|
decorationBox = { innerTextField ->
|
||||||
Column(modifier = Modifier.animateContentSize()) {
|
Column(modifier = Modifier.animateContentSize()) {
|
||||||
Box(
|
Box(
|
||||||
|
Loading…
Reference in New Issue
Block a user