Skip to content

Commit 0afd0d9

Browse files
committed
fix: NicknameTextField OutlinedTextField → BasicTextField로 교체
OutlinedTextField는 M3 내부 contentPadding으로 최소 높이가 56dp이지만 원본 XML AppCompatEditText는 커스텀 background로 44dp를 사용했음. height(44.dp) 강제 시 텍스트가 세로 클리핑되는 버그 수정. BasicTextField + decorationBox로 XML과 동일한 레이아웃 재현.
1 parent ebc6326 commit 0afd0d9

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

app/src/main/java/com/runnect/runnect/presentation/mypage/editname/MyPageEditNameScreen.kt

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.runnect.runnect.presentation.mypage.editname
22

33
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.border
45
import androidx.compose.foundation.clickable
56
import androidx.compose.foundation.layout.Box
67
import androidx.compose.foundation.layout.Column
@@ -14,11 +15,10 @@ import androidx.compose.foundation.layout.size
1415
import androidx.compose.foundation.layout.statusBarsPadding
1516
import androidx.compose.foundation.layout.width
1617
import androidx.compose.foundation.shape.RoundedCornerShape
18+
import androidx.compose.foundation.text.BasicTextField
1719
import androidx.compose.foundation.text.KeyboardActions
1820
import androidx.compose.foundation.text.KeyboardOptions
1921
import androidx.compose.material3.CircularProgressIndicator
20-
import androidx.compose.material3.OutlinedTextField
21-
import androidx.compose.material3.OutlinedTextFieldDefaults
2222
import androidx.compose.material3.Text
2323
import androidx.compose.runtime.Composable
2424
import androidx.compose.ui.Alignment
@@ -130,29 +130,37 @@ private fun NicknameTextField(
130130
onDone: () -> Unit,
131131
) {
132132
val textStyle = RunnectTheme.textStyle
133-
OutlinedTextField(
133+
// OutlinedTextField enforces a 56dp minimum height (M3 internal contentPadding),
134+
// which clips text inside the 44dp height the XML version used.
135+
// BasicTextField + decorationBox gives identical layout to the original AppCompatEditText.
136+
BasicTextField(
134137
value = value,
135138
onValueChange = { if (it.length <= 7) onValueChange(it) },
136139
modifier = Modifier
137140
.fillMaxWidth()
138141
.height(44.dp),
139142
textStyle = textStyle.semiBold15.copy(textAlign = TextAlign.Center, color = G1),
140-
placeholder = {
141-
Text(
142-
text = stringResource(R.string.my_page_edit_name_guide),
143-
style = textStyle.semiBold15.copy(textAlign = TextAlign.Center),
144-
color = G3,
145-
modifier = Modifier.fillMaxWidth(),
146-
)
147-
},
148143
singleLine = true,
149144
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
150145
keyboardActions = KeyboardActions(onDone = { onDone() }),
151-
shape = RoundedCornerShape(10.dp),
152-
colors = OutlinedTextFieldDefaults.colors(
153-
focusedBorderColor = M2,
154-
unfocusedBorderColor = M2,
155-
cursorColor = M1,
156-
),
146+
decorationBox = { innerTextField ->
147+
Box(
148+
modifier = Modifier
149+
.fillMaxSize()
150+
.border(width = 1.dp, color = M2, shape = RoundedCornerShape(10.dp))
151+
.padding(horizontal = 16.dp),
152+
contentAlignment = Alignment.Center,
153+
) {
154+
if (value.isEmpty()) {
155+
Text(
156+
text = stringResource(R.string.my_page_edit_name_guide),
157+
style = textStyle.semiBold15.copy(textAlign = TextAlign.Center),
158+
color = G3,
159+
modifier = Modifier.fillMaxWidth(),
160+
)
161+
}
162+
innerTextField()
163+
}
164+
},
157165
)
158166
}

0 commit comments

Comments
 (0)