Skip to content

Commit b785b90

Browse files
committed
moneymong-305 feat: 장부 필수항목 텍스트 수정
1 parent 2356436 commit b785b90

2 files changed

Lines changed: 70 additions & 13 deletions

File tree

feature/ledgerdetail/src/main/java/com/moneymong/moneymong/ledgerdetail/LedgerDetailScreen.kt

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ import androidx.compose.ui.layout.ContentScale
3535
import androidx.compose.ui.platform.LocalContext
3636
import androidx.compose.ui.platform.LocalFocusManager
3737
import androidx.compose.ui.res.painterResource
38+
import androidx.compose.ui.text.SpanStyle
39+
import androidx.compose.ui.text.buildAnnotatedString
3840
import androidx.compose.ui.text.input.KeyboardType
3941
import androidx.compose.ui.text.input.TextFieldValue
42+
import androidx.compose.ui.text.withStyle
4043
import androidx.compose.ui.tooling.preview.Preview
4144
import androidx.compose.ui.unit.dp
4245
import androidx.hilt.navigation.compose.hiltViewModel
@@ -68,6 +71,7 @@ import com.moneymong.moneymong.design_system.theme.Gray03
6871
import com.moneymong.moneymong.design_system.theme.Gray06
6972
import com.moneymong.moneymong.design_system.theme.Gray10
7073
import com.moneymong.moneymong.design_system.theme.MMHorizontalSpacing
74+
import com.moneymong.moneymong.design_system.theme.Red03
7175
import com.moneymong.moneymong.design_system.theme.White
7276
import com.moneymong.moneymong.ledgerdetail.view.LedgerDetailTopbarView
7377
import org.orbitmvi.orbit.compose.collectAsState
@@ -203,7 +207,14 @@ fun LedgerDetailScreen(
203207
modifier = Modifier.fillMaxWidth(),
204208
value = state.storeNameValue,
205209
onValueChange = viewModel::onChangeStoreNameValue,
206-
title = "수입·지출 출처",
210+
title = buildAnnotatedString {
211+
append("수입·지출 출처")
212+
if (state.enabledEdit) {
213+
withStyle(SpanStyle(color = Red03)) {
214+
append("*")
215+
}
216+
}
217+
},
207218
placeholder = "",
208219
isFilled = false,
209220
isError = state.isStoreNameError,
@@ -239,7 +250,14 @@ fun LedgerDetailScreen(
239250
modifier = Modifier.fillMaxWidth(),
240251
value = state.totalPriceValue,
241252
onValueChange = viewModel::onChangeTotalPriceValue,
242-
title = "${state.fundTypeText} 금액",
253+
title = buildAnnotatedString {
254+
append("${state.fundTypeText} 금액")
255+
if (state.enabledEdit) {
256+
withStyle(SpanStyle(color = Red03)) {
257+
append("*")
258+
}
259+
}
260+
},
243261
placeholder = "",
244262
isFilled = false,
245263
isError = state.isTotalPriceError,
@@ -276,7 +294,14 @@ fun LedgerDetailScreen(
276294
modifier = Modifier.fillMaxWidth(),
277295
value = state.paymentDateValue,
278296
onValueChange = viewModel::onChangePaymentDateValue,
279-
title = "날짜",
297+
title = buildAnnotatedString {
298+
append("날짜")
299+
if (state.enabledEdit) {
300+
withStyle(SpanStyle(color = Red03)) {
301+
append("*")
302+
}
303+
}
304+
},
280305
placeholder = "2024/01/01",
281306
isFilled = false,
282307
isError = state.isPaymentDateError,
@@ -313,7 +338,14 @@ fun LedgerDetailScreen(
313338
modifier = Modifier.fillMaxWidth(),
314339
value = state.paymentTimeValue,
315340
onValueChange = viewModel::onChangePaymentTimeValue,
316-
title = "시간",
341+
title = buildAnnotatedString {
342+
append("시간")
343+
if (state.enabledEdit) {
344+
withStyle(SpanStyle(color = Red03)) {
345+
append("*")
346+
}
347+
}
348+
},
317349
placeholder = "00:00:00",
318350
isFilled = false,
319351
isError = state.isPaymentTimeError,

feature/ledgermanual/src/main/java/com/moneymong/moneymong/ledgermanual/LedgerManualScreen.kt

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import androidx.compose.runtime.mutableStateOf
3535
import androidx.compose.runtime.remember
3636
import androidx.compose.runtime.setValue
3737
import androidx.compose.ui.Alignment
38-
import androidx.compose.ui.ExperimentalComposeUiApi
3938
import androidx.compose.ui.Modifier
4039
import androidx.compose.ui.draw.clip
4140
import androidx.compose.ui.focus.onFocusChanged
@@ -76,6 +75,7 @@ import com.moneymong.moneymong.design_system.theme.Body3
7675
import com.moneymong.moneymong.design_system.theme.Gray06
7776
import com.moneymong.moneymong.design_system.theme.Gray10
7877
import com.moneymong.moneymong.design_system.theme.MMHorizontalSpacing
78+
import com.moneymong.moneymong.design_system.theme.Red03
7979
import com.moneymong.moneymong.design_system.theme.White
8080
import com.moneymong.moneymong.domain.param.ledger.FundType
8181
import com.moneymong.moneymong.ledgermanual.view.LedgerManualTopbarView
@@ -190,7 +190,12 @@ fun LedgerManualScreen(
190190
.onFocusChanged { isStoreNameFilled = !it.isFocused },
191191
value = state.storeNameValue,
192192
onValueChange = viewModel::onChangeStoreNameValue,
193-
title = "수입·지출 출처",
193+
title = buildAnnotatedString {
194+
append("수입·지출 출처")
195+
withStyle(SpanStyle(color = Red03)) {
196+
append("*")
197+
}
198+
},
194199
placeholder = "점포명을 입력해주세요",
195200
helperText = "20자 이하로 입력해주세요",
196201
maxCount = 20,
@@ -209,7 +214,12 @@ fun LedgerManualScreen(
209214
.onFocusChanged { isTotalPriceFilled = !it.isFocused },
210215
value = state.totalPriceValue,
211216
onValueChange = viewModel::onChangeTotalPriceValue,
212-
title = "금액",
217+
title = buildAnnotatedString {
218+
append("금액")
219+
withStyle(SpanStyle(color = Red03)) {
220+
append("*")
221+
}
222+
},
213223
placeholder = "거래 금액을 입력해주세요",
214224
helperText = "999,999,999,999원 이하로 입력해주세요",
215225
isFilled = isTotalPriceFilled,
@@ -223,7 +233,12 @@ fun LedgerManualScreen(
223233
)
224234
Spacer(modifier = Modifier.height(24.dp))
225235
Text(
226-
text = "거래 유형",
236+
text = buildAnnotatedString {
237+
append("거래 유형")
238+
withStyle(SpanStyle(color = Gray06)) {
239+
append("*")
240+
}
241+
},
227242
style = Body2,
228243
color = Gray06
229244
)
@@ -253,7 +268,12 @@ fun LedgerManualScreen(
253268
.onFocusChanged { isPaymentDateFilled = !it.isFocused },
254269
value = state.paymentDateValue,
255270
onValueChange = viewModel::onChangePaymentDateValue,
256-
title = "날짜",
271+
title = buildAnnotatedString {
272+
append("날짜")
273+
withStyle(SpanStyle(color = Red03)) {
274+
append("*")
275+
}
276+
},
257277
placeholder = "YYYY/MM/DD",
258278
helperText = "올바른 날짜를 입력해주세요",
259279
isFilled = isPaymentDateFilled,
@@ -273,7 +293,12 @@ fun LedgerManualScreen(
273293
.onFocusChanged { isPaymentTimeFilled = !it.isFocused },
274294
value = state.paymentTimeValue,
275295
onValueChange = viewModel::onChangePaymentTimeValue,
276-
title = "시간",
296+
title = buildAnnotatedString {
297+
append("시간")
298+
withStyle(SpanStyle(color = Red03)) {
299+
append("*")
300+
}
301+
},
277302
placeholder = "00:00:00 (24시 단위)",
278303
helperText = "올바른 시간을 입력해주세요",
279304
isFilled = isPaymentTimeFilled,
@@ -287,7 +312,7 @@ fun LedgerManualScreen(
287312
)
288313
Text(
289314
text = buildAnnotatedString {
290-
append("영수증 (선택/최대 12장)\n")
315+
append("영수증 (최대 12장)\n")
291316
withStyle(SpanStyle(color = Blue04)) {
292317
append("*지출일 경우 영수증을 꼭 제출해주세요")
293318
}
@@ -356,7 +381,7 @@ fun LedgerManualScreen(
356381
}
357382
Spacer(modifier = Modifier.height(24.dp))
358383
Text(
359-
text = "증빙 자료 (선택/최대 12장)",
384+
text = "증빙 자료 (최대 12장)",
360385
style = Body2,
361386
color = Gray06
362387
)
@@ -427,7 +452,7 @@ fun LedgerManualScreen(
427452
.onFocusChanged { isMemoFilled = !it.isFocused },
428453
value = state.memoValue,
429454
onValueChange = viewModel::onChangeMemoValue,
430-
title = "메모 (선택)",
455+
title = "메모",
431456
placeholder = "메모할 내용을 입력하세요",
432457
helperText = "300자 이하로 입력해주세요",
433458
maxCount = 300,

0 commit comments

Comments
 (0)