diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonBase.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonBase.kt index 1fc2ab9f..361b124f 100644 --- a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonBase.kt +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonBase.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -132,7 +133,9 @@ private fun Modifier.buttonContainer( config: PrezelButtonDefault, ): Modifier = this - .clip(shape = config.shape) + .then( + config.textButtonHeight?.let { Modifier.height(it) } ?: Modifier, + ).clip(shape = config.shape) .background(color = config.backgroundColor(enabled = enabled)) .then( if (config.hasBorder) { diff --git a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonDefaults.kt b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonDefaults.kt index 5be2c220..1bb13264 100644 --- a/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonDefaults.kt +++ b/Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/actions/button/config/PrezelButtonDefaults.kt @@ -28,6 +28,7 @@ data class PrezelButtonDefault( val contentPadding: PaddingValues, val iconSpacing: Dp, val iconSize: Dp, + val textButtonHeight: Dp?, ) { val hasBorder: Boolean = borderWidth > 0.dp @@ -66,6 +67,7 @@ object PrezelButtonDefaults { contentPadding: PaddingValues = getContentPadding(size = size, isIconOnly = isIconOnly), iconSpacing: Dp = getIconSpacing(size = size), iconSize: Dp = getIconSize(size = size), + textButtonHeight: Dp? = if (isIconOnly) null else getTextButtonHeight(size = size), ) = PrezelButtonDefault( contentColor = contentColor, disabledContentColor = disabledContentColor, @@ -79,8 +81,17 @@ object PrezelButtonDefaults { contentPadding = contentPadding, iconSpacing = iconSpacing, iconSize = iconSize, + textButtonHeight = textButtonHeight, ) + @Composable + private fun getTextButtonHeight(size: ButtonSize): Dp = + when (size) { + ButtonSize.XSMALL -> 28.dp + ButtonSize.SMALL -> 36.dp + ButtonSize.REGULAR -> 48.dp + } + @Composable private fun getContentColor( type: ButtonType, diff --git a/Prezel/core/model/src/main/java/com/team/prezel/core/model/profile/Nickname.kt b/Prezel/core/model/src/main/java/com/team/prezel/core/model/profile/Nickname.kt index 15a3e54b..055c8565 100644 --- a/Prezel/core/model/src/main/java/com/team/prezel/core/model/profile/Nickname.kt +++ b/Prezel/core/model/src/main/java/com/team/prezel/core/model/profile/Nickname.kt @@ -23,6 +23,8 @@ value class Nickname private constructor( companion object { const val MAX_LENGTH = 10 private const val MIN_LENGTH = 2 + private const val DIGIT_START = '0'.code + private const val DIGIT_END = '9'.code private const val LATIN_UPPERCASE_START = 'A'.code private const val LATIN_UPPERCASE_END = 'Z'.code private const val LATIN_LOWERCASE_START = 'a'.code @@ -46,7 +48,8 @@ value class Nickname private constructor( } private fun isAllowedCodePoint(codePoint: Int): Boolean = - codePoint in LATIN_UPPERCASE_START..LATIN_UPPERCASE_END || + codePoint in DIGIT_START..DIGIT_END || + codePoint in LATIN_UPPERCASE_START..LATIN_UPPERCASE_END || codePoint in LATIN_LOWERCASE_START..LATIN_LOWERCASE_END || Character.UnicodeScript.of(codePoint) == Character.UnicodeScript.HANGUL } diff --git a/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/ProfileScreen.kt b/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/ProfileScreen.kt index ab4e9c29..e0fc6b68 100644 --- a/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/ProfileScreen.kt +++ b/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/ProfileScreen.kt @@ -120,7 +120,7 @@ private fun ProfileScreen( ) PrezelButtonArea( - showBackground = true, + showBackground = false, modifier = Modifier.advancedImePadding(), mainButton = { modifier -> PrezelButton( diff --git a/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/component/NicknameTextField.kt b/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/component/NicknameTextField.kt index 2cc650f0..f3f2f583 100644 --- a/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/component/NicknameTextField.kt +++ b/Prezel/feature/profile/impl/src/main/java/com/team/prezel/feature/profile/impl/component/NicknameTextField.kt @@ -13,6 +13,7 @@ import com.team.prezel.core.designsystem.component.textfield.PrezelTextField import com.team.prezel.core.designsystem.component.textfield.PrezelTextFieldStatus import com.team.prezel.core.designsystem.preview.BasicPreview import com.team.prezel.core.designsystem.theme.PrezelTheme +import com.team.prezel.core.model.profile.Nickname import com.team.prezel.feature.profile.impl.R import com.team.prezel.feature.profile.impl.model.NicknameValidationState @@ -29,6 +30,7 @@ internal fun NicknameTextField( label = stringResource(R.string.feature_profile_impl_nickname_text_field_label), placeholder = stringResource(R.string.feature_profile_impl_nickname_text_field_placeholder), status = nicknameValidationState.toNicknameStatus(), + maxLength = Nickname.MAX_LENGTH, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Text, ),