-
Notifications
You must be signed in to change notification settings - Fork 2
[Feature] 콜밴 글쓰기 위치 선택 바텀시트 추가 #1323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a42ae2a
44806ae
72cebc4
eddc809
b27151a
2eac09a
2e8892d
85098cc
2b28e78
a1558de
a331265
c3937bc
aa82678
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,225 @@ | ||||||||||||||||||||||||||||||
| package `in`.koreatech.koin.feature.callvan.ui.create.component | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import androidx.compose.animation.AnimatedVisibility | ||||||||||||||||||||||||||||||
| import androidx.compose.animation.expandVertically | ||||||||||||||||||||||||||||||
| import androidx.compose.animation.shrinkVertically | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.background | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.border | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.clickable | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Box | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Column | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.ExperimentalLayoutApi | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.FlowRow | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.PaddingValues | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxWidth | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.height | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.imePadding | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.padding | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||||||||||||||||||||||||||||||
| import androidx.compose.foundation.text.BasicTextField | ||||||||||||||||||||||||||||||
| import androidx.compose.material3.ButtonDefaults | ||||||||||||||||||||||||||||||
| import androidx.compose.material3.HorizontalDivider | ||||||||||||||||||||||||||||||
| import androidx.compose.material3.Text | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.derivedStateOf | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.getValue | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.mutableStateOf | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.remember | ||||||||||||||||||||||||||||||
| import androidx.compose.runtime.setValue | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.draw.clip | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.res.stringResource | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.tooling.preview.Preview | ||||||||||||||||||||||||||||||
| import androidx.compose.ui.unit.dp | ||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.core.designsystem.component.button.FilledButton | ||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.core.designsystem.theme.RebrandKoinTheme | ||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.feature.callvan.R | ||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.feature.callvan.model.CallvanLocationOption | ||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.feature.callvan.ui.component.CallvanBottomSheet | ||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.feature.callvan.ui.displayNameRes | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||
| fun CallvanLocationPickerBottomSheet( | ||||||||||||||||||||||||||||||
|
Check failure on line 44 in feature/callvan/src/main/java/in/koreatech/koin/feature/callvan/ui/create/component/CallvanLocationPickerBottomSheet.kt
|
||||||||||||||||||||||||||||||
| isDeparture: Boolean, | ||||||||||||||||||||||||||||||
| modifier: Modifier = Modifier, | ||||||||||||||||||||||||||||||
| initialSelection: CallvanLocationOption? = null, | ||||||||||||||||||||||||||||||
| initialCustomText: String? = null, | ||||||||||||||||||||||||||||||
| onLocationSelected: (CallvanLocationOption, String?) -> Unit = { _, _ -> }, | ||||||||||||||||||||||||||||||
| onDismiss: () -> Unit = {} | ||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] 콜백 파라미터 기본값 — 미연결 시 무음 실패 가능
기본값을 제거해서 의도적 명시를 강제하는 것을 권장합니다:
Suggested change
|
||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
|
Comment on lines
+44
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 시그니처 때문에 CI가 막히고 있습니다. 현재 Detekt가 🧰 Tools🪛 GitHub Actions: CI[error] 43-43: Detekt: The function CallvanLocationPickerBottomSheet(isDeparture: Boolean, modifier: Modifier, initialSelection: CallvanLocationOption?, initialCustomText: String?, onLocationSelected: (CallvanLocationOption, String?) -> Unit, onDismiss: () -> Unit) has too many parameters. The current threshold is set to 6. [LongParameterList] 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| var selectedLocation by remember(initialSelection) { mutableStateOf(initialSelection) } | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Info - 잘 작성된 코드] 👍
|
||||||||||||||||||||||||||||||
| var customText by remember(initialSelection, initialCustomText) { | ||||||||||||||||||||||||||||||
| mutableStateOf( | ||||||||||||||||||||||||||||||
| if (initialSelection == CallvanLocationOption.CUSTOM) initialCustomText.orEmpty() else "" | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| val isCustomSelected by remember { derivedStateOf { selectedLocation == CallvanLocationOption.CUSTOM } } | ||||||||||||||||||||||||||||||
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Trivial] 단순 동등 비교에
// 심플한 대안 (기능 동일)
val isCustomSelected = selectedLocation == CallvanLocationOption.CUSTOM
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| CallvanBottomSheet( | ||||||||||||||||||||||||||||||
| title = stringResource( | ||||||||||||||||||||||||||||||
| if (isDeparture) { | ||||||||||||||||||||||||||||||
| R.string.callvan_create_departure_picker_question | ||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||
| R.string.callvan_create_arrival_picker_question | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||
| onDismiss = onDismiss, | ||||||||||||||||||||||||||||||
| showCloseButton = true | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| Column( | ||||||||||||||||||||||||||||||
| modifier = modifier | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] Compose 컨벤션상 실제로 바텀시트 컴포넌트 특성상 외부 Option A: fun CallvanLocationPickerBottomSheet(
isDeparture: Boolean,
// modifier 파라미터 제거
initialSelection: CallvanLocationOption? = null,
...Option B:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor]
|
||||||||||||||||||||||||||||||
| .fillMaxWidth() | ||||||||||||||||||||||||||||||
| .imePadding() | ||||||||||||||||||||||||||||||
| .padding(horizontal = 32.dp, vertical = 12.dp), | ||||||||||||||||||||||||||||||
| verticalArrangement = Arrangement.spacedBy(24.dp) | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
|
Comment on lines
+71
to
+77
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] 키보드 표시 시 레이아웃 가림 —
Suggested change
|
||||||||||||||||||||||||||||||
| Column( | ||||||||||||||||||||||||||||||
| verticalArrangement = Arrangement.spacedBy(12.dp) | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| CallvanLocationChipGroup( | ||||||||||||||||||||||||||||||
| selectedLocation = selectedLocation, | ||||||||||||||||||||||||||||||
| onLocationClick = { location -> | ||||||||||||||||||||||||||||||
| selectedLocation = location | ||||||||||||||||||||||||||||||
| if (location != CallvanLocationOption.CUSTOM) customText = "" | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor]
Suggested change
|
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| CallvanCustomLocationInput( | ||||||||||||||||||||||||||||||
| visible = isCustomSelected, | ||||||||||||||||||||||||||||||
| value = customText, | ||||||||||||||||||||||||||||||
| onValueChange = { customText = it } | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| HorizontalDivider( | ||||||||||||||||||||||||||||||
| color = RebrandKoinTheme.colors.neutral300, | ||||||||||||||||||||||||||||||
| thickness = 0.5.dp | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| FilledButton( | ||||||||||||||||||||||||||||||
| text = stringResource( | ||||||||||||||||||||||||||||||
| if (isCustomSelected) { | ||||||||||||||||||||||||||||||
| R.string.callvan_create_location_picker_confirm_other | ||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||
| R.string.callvan_create_location_picker_select | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||
| onClick = { | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Trivial] 중복 null 체크 —
Suggested change
|
||||||||||||||||||||||||||||||
| selectedLocation?.let { loc -> | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Trivial] 바로 위 109번 라인에서 onClick = {
onLocationSelected(
selectedLocation!!,
if (isOtherSelected) customText.trim() else null
)
},혹은 안전하게 non-null 보장이 필요하다면 주석으로 의도를 명시해 주세요. |
||||||||||||||||||||||||||||||
| onLocationSelected(loc, if (isCustomSelected) customText.trim() else null) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| enabled = selectedLocation != null && (!isCustomSelected || customText.isNotBlank()), | ||||||||||||||||||||||||||||||
| modifier = Modifier.fillMaxWidth(), | ||||||||||||||||||||||||||||||
| shape = RebrandKoinTheme.shapes.medium, | ||||||||||||||||||||||||||||||
| textStyle = RebrandKoinTheme.typography.bold16, | ||||||||||||||||||||||||||||||
| contentPadding = PaddingValues(vertical = 10.dp), | ||||||||||||||||||||||||||||||
| colors = ButtonDefaults.buttonColors( | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor]
val buttonColors = remember {
ButtonDefaults.buttonColors(
containerColor = RebrandKoinTheme.colors.primary500,
disabledContainerColor = RebrandKoinTheme.colors.neutral400,
contentColor = RebrandKoinTheme.colors.neutral0,
disabledContentColor = RebrandKoinTheme.colors.neutral0
)
}
FilledButton(
...
colors = buttonColors
)다만 |
||||||||||||||||||||||||||||||
| containerColor = RebrandKoinTheme.colors.primary500, | ||||||||||||||||||||||||||||||
| disabledContainerColor = RebrandKoinTheme.colors.neutral400, | ||||||||||||||||||||||||||||||
| contentColor = RebrandKoinTheme.colors.neutral0, | ||||||||||||||||||||||||||||||
| disabledContentColor = RebrandKoinTheme.colors.neutral0 | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
|
Comment on lines
+116
to
+121
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor]
Suggested change
|
||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @OptIn(ExperimentalLayoutApi::class) | ||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||
| private fun CallvanLocationChipGroup( | ||||||||||||||||||||||||||||||
| selectedLocation: CallvanLocationOption?, | ||||||||||||||||||||||||||||||
| onLocationClick: (CallvanLocationOption) -> Unit = {} | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| FlowRow( | ||||||||||||||||||||||||||||||
| horizontalArrangement = Arrangement.spacedBy(12.dp), | ||||||||||||||||||||||||||||||
| verticalArrangement = Arrangement.spacedBy(8.dp) | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| CallvanLocationOption.entries.forEach { location -> | ||||||||||||||||||||||||||||||
| val isSelected = selectedLocation == location | ||||||||||||||||||||||||||||||
| Box( | ||||||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||||||
| .height(34.dp) | ||||||||||||||||||||||||||||||
| .border( | ||||||||||||||||||||||||||||||
| width = 1.dp, | ||||||||||||||||||||||||||||||
| color = if (isSelected) { | ||||||||||||||||||||||||||||||
| RebrandKoinTheme.colors.primary500 | ||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||
| RebrandKoinTheme.colors.neutral300 | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| shape = RoundedCornerShape(24.dp) | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Trivial] 하드코딩된 같은 파일 내에서 // 의도를 명확히: pill 형태의 chip shape
shape = RoundedCornerShape(percent = 50) // 또는 테마 값 사용 |
||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| .clip(RoundedCornerShape(24.dp)) | ||||||||||||||||||||||||||||||
|
Comment on lines
+149
to
+151
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Trivial] 하드코딩된
val chipShape = RoundedCornerShape(24.dp)
Box(
modifier = Modifier
.height(34.dp)
.border(width = 1.dp, color = ..., shape = chipShape)
.clip(chipShape)
...
) |
||||||||||||||||||||||||||||||
| .clickable { onLocationClick(location) } | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] 접근성(Accessibility) 시맨틱 누락
.semantics {
role = Role.Button
selected = isSelected
contentDescription = /* stringResource(location.displayNameRes()) — 이미 Text로 표시되므로 필요 시 추가 */
}
.clickable(
onClickLabel = stringResource(location.displayNameRes())
) { onLocationClick(location) } |
||||||||||||||||||||||||||||||
| .padding(horizontal = 12.dp), | ||||||||||||||||||||||||||||||
| contentAlignment = Alignment.Center | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| Text( | ||||||||||||||||||||||||||||||
| text = stringResource(location.displayNameRes()), | ||||||||||||||||||||||||||||||
| style = RebrandKoinTheme.typography.medium14, | ||||||||||||||||||||||||||||||
| color = if (isSelected) { | ||||||||||||||||||||||||||||||
| RebrandKoinTheme.colors.primary500 | ||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||
| RebrandKoinTheme.colors.neutral500 | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||
| private fun CallvanCustomLocationInput( | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Major] PR 설명에서 "출발지/도착지 모드에 따라 제목과 플레이스홀더 자동 변경"을 언급하고 있지만,
Suggested change
그리고 BasicTextField(
value = value,
onValueChange = onValueChange,
singleLine = true,
textStyle = RebrandKoinTheme.typography.regular14.copy(
color = RebrandKoinTheme.colors.neutral600
),
decorationBox = { innerTextField ->
Box(modifier = Modifier.fillMaxWidth()) {
if (value.isEmpty()) {
Text(
text = placeholder,
style = RebrandKoinTheme.typography.regular14,
color = RebrandKoinTheme.colors.neutral400
)
}
innerTextField()
}
},
modifier = Modifier...
)호출 측( |
||||||||||||||||||||||||||||||
| visible: Boolean, | ||||||||||||||||||||||||||||||
| value: String, | ||||||||||||||||||||||||||||||
| onValueChange: (String) -> Unit = {} | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] 커스텀 입력 최대 길이 제한 없음 서버 API 또는 UI 레이아웃에 따라 허용 가능한 최대 글자 수가 있을 텐데, 현재는 onValueChange = { newText ->
if (newText.length <= MAX_CUSTOM_LOCATION_LENGTH) onValueChange(newText)
},
|
||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| AnimatedVisibility( | ||||||||||||||||||||||||||||||
| visible = visible, | ||||||||||||||||||||||||||||||
| enter = expandVertically(), | ||||||||||||||||||||||||||||||
| exit = shrinkVertically() | ||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||
| BasicTextField( | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Major]
BasicTextField(
value = value,
onValueChange = onValueChange,
singleLine = true,
textStyle = RebrandKoinTheme.typography.regular14.copy(
color = RebrandKoinTheme.colors.neutral600
),
decorationBox = { innerTextField ->
Box {
if (value.isEmpty()) {
Text(
text = stringResource(R.string.callvan_create_location_custom_placeholder),
style = RebrandKoinTheme.typography.regular14,
color = RebrandKoinTheme.colors.neutral400
)
}
innerTextField()
}
},
modifier = Modifier
.fillMaxWidth()
.padding(top = 4.dp)
.border(1.dp, RebrandKoinTheme.colors.neutral300, RebrandKoinTheme.shapes.medium)
.background(RebrandKoinTheme.colors.neutral0, RebrandKoinTheme.shapes.medium)
.padding(horizontal = 20.dp, vertical = 13.dp)
)placeholder 문자열 리소스도 함께 추가해주세요. |
||||||||||||||||||||||||||||||
| value = value, | ||||||||||||||||||||||||||||||
| onValueChange = onValueChange, | ||||||||||||||||||||||||||||||
| singleLine = true, | ||||||||||||||||||||||||||||||
| textStyle = RebrandKoinTheme.typography.regular14.copy( | ||||||||||||||||||||||||||||||
| color = RebrandKoinTheme.colors.neutral600 | ||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||||||
| .fillMaxWidth() | ||||||||||||||||||||||||||||||
| .padding(top = 4.dp) | ||||||||||||||||||||||||||||||
| .clip(RebrandKoinTheme.shapes.medium) | ||||||||||||||||||||||||||||||
| .border(1.dp, RebrandKoinTheme.colors.neutral300, RebrandKoinTheme.shapes.medium) | ||||||||||||||||||||||||||||||
| .background(RebrandKoinTheme.colors.neutral0, RebrandKoinTheme.shapes.medium) | ||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] 수식어 체인에서 modifier = Modifier
.fillMaxWidth()
.padding(top = 4.dp)
.clip(RebrandKoinTheme.shapes.medium) // 컨텐츠 클리핑 추가
.border(1.dp, RebrandKoinTheme.colors.neutral300, RebrandKoinTheme.shapes.medium)
.background(RebrandKoinTheme.colors.neutral0, RebrandKoinTheme.shapes.medium)
.padding(horizontal = 20.dp, vertical = 13.dp)참고로 |
||||||||||||||||||||||||||||||
| .padding(horizontal = 20.dp, vertical = 13.dp) | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
|
Comment on lines
+181
to
+195
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Major] 현재
BasicTextField(
value = value,
onValueChange = onValueChange,
singleLine = true,
textStyle = RebrandKoinTheme.typography.regular14.copy(
color = RebrandKoinTheme.colors.neutral600
),
modifier = Modifier
.fillMaxWidth()
.padding(top = 4.dp)
.clip(RebrandKoinTheme.shapes.medium)
.border(1.dp, RebrandKoinTheme.colors.neutral300, RebrandKoinTheme.shapes.medium)
.background(RebrandKoinTheme.colors.neutral0, RebrandKoinTheme.shapes.medium)
.padding(horizontal = 20.dp, vertical = 13.dp),
decorationBox = { innerTextField ->
Box(modifier = Modifier.fillMaxWidth()) {
if (value.isEmpty()) {
Text(
text = stringResource(R.string.callvan_create_custom_location_hint),
style = RebrandKoinTheme.typography.regular14,
color = RebrandKoinTheme.colors.neutral400
)
}
innerTextField()
}
}
)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 실제로 textField 에 추가 그래픽이 없는 것 같습니다.
Comment on lines
+181
to
+195
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] 현재 소프트 키보드에 IME 액션이 설정되어 있지 않아, 사용자가 키보드의 완료/확인 버튼으로 입력을 마칠 수 없습니다. import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.ui.text.input.ImeAction
BasicTextField(
value = value,
onValueChange = onValueChange,
singleLine = true,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions(
onDone = { onImeAction() } // 상위 컴포저블에서 콜백 주입
),
textStyle = RebrandKoinTheme.typography.regular14.copy(
color = RebrandKoinTheme.colors.neutral600
),
...
) |
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Preview(showBackground = true) | ||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||
| private fun CallvanLocationPickerBottomSheetPreview() { | ||||||||||||||||||||||||||||||
| RebrandKoinTheme { | ||||||||||||||||||||||||||||||
| CallvanLocationPickerBottomSheet( | ||||||||||||||||||||||||||||||
| isDeparture = true, | ||||||||||||||||||||||||||||||
| initialSelection = CallvanLocationOption.FRONT_GATE, | ||||||||||||||||||||||||||||||
| initialCustomText = null, | ||||||||||||||||||||||||||||||
| onLocationSelected = { _, _ -> }, | ||||||||||||||||||||||||||||||
| onDismiss = {} | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| @Preview(showBackground = true) | ||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||
| private fun CallvanLocationPickerBottomSheetCustomPreview() { | ||||||||||||||||||||||||||||||
| RebrandKoinTheme { | ||||||||||||||||||||||||||||||
| CallvanLocationPickerBottomSheet( | ||||||||||||||||||||||||||||||
| isDeparture = true, | ||||||||||||||||||||||||||||||
| initialSelection = CallvanLocationOption.CUSTOM, | ||||||||||||||||||||||||||||||
| initialCustomText = "test test test", | ||||||||||||||||||||||||||||||
| onLocationSelected = { _, _ -> }, | ||||||||||||||||||||||||||||||
| onDismiss = {} | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor]
isDeparture: Boolean대신 열거형/sealed class 사용 권장Boolean파라미터는 호출부에서 의미를 파악하기 어렵고, 향후 "왕복" 같은 모드가 추가될 경우 확장이 불가능합니다.호출부에서
isDeparture = true보다mode = LocationPickerMode.DEPARTURE가 의도를 명확히 전달합니다.