diff --git a/mobile/src/main/java/ru/omni_devel/cards/Elements.kt b/mobile/src/main/java/ru/omni_devel/cards/Elements.kt index c6f7e92..9520334 100644 --- a/mobile/src/main/java/ru/omni_devel/cards/Elements.kt +++ b/mobile/src/main/java/ru/omni_devel/cards/Elements.kt @@ -49,6 +49,7 @@ import androidx.compose.ui.Modifier.Companion import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign @@ -163,12 +164,14 @@ fun TopBar(text: String, innerPadding: PaddingValues, openMenuButton: (@Composab @Composable fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit) { val context = LocalContext.current + var menuExpanded by remember { mutableStateOf(false) } Box(modifier = Modifier.fillMaxWidth()) { Surface( modifier = Modifier .fillMaxWidth() + .height(64.dp) .pointerInput(Unit) { detectTapGestures( onTap = { @@ -181,32 +184,21 @@ fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit) { } ) }, - shape = ButtonDefaults.shape, - color = MaterialTheme.colorScheme.primaryContainer, - tonalElevation = 2.dp + shape = RoundedCornerShape(12.dp), + color = (if (cardInfo.color == null) MaterialTheme.colorScheme.primaryContainer else Color(cardInfo.color.toColorInt())).copy(0.425f), + tonalElevation = 2.dp, ) { Row( - modifier = Modifier.fillMaxWidth().height(IntrinsicSize.Min), - horizontalArrangement = Arrangement.SpaceBetween + modifier = Modifier.fillMaxSize(), + verticalAlignment = Alignment.CenterVertically ) { - Box( - modifier = Modifier - .fillMaxHeight() - .width(32.dp) - .background( - if (cardInfo.color == null) MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.625f) - else Color(cardInfo.color.toColorInt()).copy(alpha = 0.625f) - ) - ) - Text( cardInfo.name, fontSize = 16.sp, color = MaterialTheme.colorScheme.onPrimaryContainer, modifier = Modifier .padding(16.dp) - .fillMaxWidth() - .weight(1f), + .fillMaxWidth(), textAlign = TextAlign.Start ) }