From 4edaeaaf0bd74dd24be40bd4163199143cf474c0 Mon Sep 17 00:00:00 2001 From: koreatlwls Date: Sun, 1 Sep 2024 22:11:28 +0900 Subject: [PATCH 1/5] update : snackbar animation spec --- .../app/tds/component/TtdsSnackBarHost.kt | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/tds/src/main/kotlin/com/titi/app/tds/component/TtdsSnackBarHost.kt b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsSnackBarHost.kt index 82094319..ec8c873a 100644 --- a/tds/src/main/kotlin/com/titi/app/tds/component/TtdsSnackBarHost.kt +++ b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsSnackBarHost.kt @@ -2,7 +2,8 @@ package com.titi.app.tds.component import androidx.compose.animation.core.Animatable import androidx.compose.animation.core.AnimationSpec -import androidx.compose.animation.core.LinearEasing +import androidx.compose.animation.core.EaseIn +import androidx.compose.animation.core.spring import androidx.compose.animation.core.tween import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.offset @@ -212,7 +213,7 @@ internal fun TtdsSnackbarDuration.toMillis( val original = when (this) { TtdsSnackbarDuration.Indefinite -> Long.MAX_VALUE TtdsSnackbarDuration.Long -> 10000L - TtdsSnackbarDuration.Short -> 4000L + TtdsSnackbarDuration.Short -> 2500L } if (accessibilityManager == null) { return original @@ -242,21 +243,18 @@ private fun TtdsSlideInSlideOutVertically( keys.filterNotNull().mapTo(state.items) { key -> TtdsSlideInSlideOutVerticallyAnimationItem(key) { children -> val isVisible = key == current - val duration = if (isVisible) { - TTDS_SNACKBAR_SLIDE_IN_VERTICALLY_MILLIS + + val slideAnimationSpec: AnimationSpec = if (isVisible) { + spring() } else { - TTDS_SNACKBAR_SLIDE_OUT_VERTICALLY_MILLIS + tween( + durationMillis = 500, + easing = EaseIn, + ) } - val delay = TTDS_SNACKBAR_SLIDE_OUT_VERTICALLY_MILLIS + - TTDS_SNACKBAR_IN_BETWEEN_DELAY_MILLIS - val animationDelay = if (isVisible && keys.filterNotNull().size != 1) delay else 0 val offsetY = animatedOffsetY( - animation = tween( - easing = LinearEasing, - delayMillis = animationDelay, - durationMillis = duration, - ), + animation = slideAnimationSpec, visible = isVisible, endDp = current?.visuals?.targetDpFromTop ?: 40.dp, onAnimationFinish = { @@ -332,7 +330,3 @@ private fun animatedOffsetY( return offsetY.asState() } - -private const val TTDS_SNACKBAR_SLIDE_IN_VERTICALLY_MILLIS = 150 -private const val TTDS_SNACKBAR_SLIDE_OUT_VERTICALLY_MILLIS = 75 -private const val TTDS_SNACKBAR_IN_BETWEEN_DELAY_MILLIS = 0 From f8ea3bc3ca7a79544e6c515600b7cb2b4f0758d4 Mon Sep 17 00:00:00 2001 From: koreatlwls Date: Sun, 1 Sep 2024 23:17:20 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat=20:=20=EC=A4=91=EA=B5=AD=EC=96=B4=20?= =?UTF-8?q?=ED=8F=B0=ED=8A=B8=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/core/designsystem/component/TdsButton.kt | 2 ++ .../app/core/designsystem/component/TdsDialog.kt | 2 ++ .../core/designsystem/component/TdsInputTextField.kt | 5 ++++- .../core/designsystem/component/TdsTaskListItem.kt | 3 +++ .../core/designsystem/component/TdsTaskResultList.kt | 1 + .../designsystem/component/TdsTaskResultListItem.kt | 2 ++ .../titi/app/core/designsystem/component/TdsText.kt | 12 ++++++++++-- .../titi/app/core/designsystem/component/TdsTimer.kt | 6 ++++++ .../component/dialog/AddTaskNameDialog.kt | 1 + .../titi/app/core/designsystem/theme/Typography.kt | 8 ++++---- core/designsystem/src/main/res/values-zh/strings.xml | 4 ++-- .../main/kotlin/com/titi/app/core/util/TimeUtil.kt | 2 +- .../com/titi/app/feature/color/ui/ColorScreen.kt | 2 ++ .../com/titi/app/feature/edit/ui/EditScreen.kt | 7 ++++++- .../app/feature/edit/ui/EditTaskHistoryTimeDialog.kt | 2 ++ .../feature/log/ui/component/SettingBottomSheet.kt | 6 ++++++ .../titi/app/feature/measure/ui/MeasuringScreen.kt | 1 + .../app/feature/setting/ui/FeaturesListScreen.kt | 1 + .../com/titi/app/feature/setting/ui/SettingScreen.kt | 7 +++++++ .../titi/app/feature/setting/ui/UpdatesListScreen.kt | 1 + .../feature/time/component/ColorSelectComponent.kt | 2 ++ .../feature/time/component/TimeButtonComponent.kt | 3 +-- .../app/feature/time/component/TimeTaskComponent.kt | 2 ++ .../com/titi/app/feature/webview/WebViewScreen.kt | 1 + 24 files changed, 70 insertions(+), 13 deletions(-) diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsButton.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsButton.kt index fbf9a476..f4e034ec 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsButton.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsButton.kt @@ -53,6 +53,7 @@ fun TdsTextButton( contentPadding = PaddingValues(12.dp, 8.dp), ) { TdsText( + isNoLocale = false, text = text, textStyle = textStyle, color = textColor, @@ -85,6 +86,7 @@ fun TdsTextButton( contentPadding = PaddingValues(12.dp, 8.dp), ) { TdsText( + isNoLocale = false, text = text, textStyle = textStyle, color = textColor, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsDialog.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsDialog.kt index d8b019a7..f0124841 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsDialog.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsDialog.kt @@ -55,6 +55,7 @@ fun TdsDialog( TdsText( modifier = Modifier.padding(horizontal = 12.dp), + isNoLocale = false, text = tdsDialogInfo.title, textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE, fontSize = 17.sp, @@ -67,6 +68,7 @@ fun TdsDialog( TdsText( modifier = Modifier.padding(horizontal = 12.dp), + isNoLocale = false, text = message, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 13.sp, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTextField.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTextField.kt index 7430d34a..3c0e1164 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTextField.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTextField.kt @@ -40,7 +40,10 @@ fun TdsOutlinedInputTextField( onValueChange = onValueChange, textStyle = TdsTextStyle .SEMI_BOLD_TEXT_STYLE - .getTextStyle(fontSize = fontSize) + .getTextStyle( + isNoLocale = false, + fontSize = fontSize, + ) .copy( color = TdsColor.TEXT.getColor(), textAlign = TextAlign.Center, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt index 61f883d7..52aa13db 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt @@ -69,6 +69,7 @@ fun TdsTaskListItem( Column { TdsText( + isNoLocale = false, text = tdsTask.taskName, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 20.sp, @@ -80,6 +81,7 @@ fun TdsTaskListItem( AnimatedVisibility(visible = tdsTask.isTaskTargetTimeOn) { Row(modifier = Modifier.padding(top = 4.dp)) { TdsText( + isNoLocale = false, text = stringResource(R.string.tasks_popup_settasktargettime) + " : ${tdsTask.taskTargetTime.getTimeString()}", textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, @@ -90,6 +92,7 @@ fun TdsTaskListItem( Spacer(modifier = Modifier.width(8.dp)) TdsText( + isNoLocale = false, modifier = Modifier.clickable { onEdit() }, text = stringResource(R.string.common_text_edit), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt index b9a73658..95aefa71 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt @@ -75,6 +75,7 @@ fun TdsTaskResultList( .fillMaxWidth() .padding(top = 8.dp) .clickable { onClickAddTask?.invoke() }, + isNoLocale = false, text = "+ " + stringResource(R.string.editdaily_button_appendnewhistory), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, color = TdsColor.TEXT, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt index ff55eb09..aebc2df0 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt @@ -57,6 +57,7 @@ fun TdsTaskResultListItem( ) { if (leftText != null) { TdsText( + isNoLocale = false, text = leftText, textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE, fontSize = fontSize, @@ -71,6 +72,7 @@ fun TdsTaskResultListItem( .widthIn(max = 100.dp) .background(color = color.copy(alpha = 0.5f)) .padding(padding), + isNoLocale = false, text = taskName, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = fontSize, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt index e6877c6f..ede630a4 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt @@ -18,6 +18,7 @@ import com.titi.app.core.designsystem.theme.TiTiTheme @Composable fun TdsText( modifier: Modifier = Modifier, + isNoLocale: Boolean = true, text: String? = null, textStyle: TdsTextStyle, fontSize: TextUnit, @@ -38,7 +39,10 @@ fun TdsText( maxLines = maxLines, minLines = minLines, onTextLayout = onTextLayout, - style = textStyle.getTextStyle(fontSize), + style = textStyle.getTextStyle( + isNoLocale = isNoLocale, + fontSize = fontSize, + ), textDecoration = textDecoration, ) } @@ -46,6 +50,7 @@ fun TdsText( @Composable fun TdsText( modifier: Modifier = Modifier, + isNoLocale: Boolean = true, text: String? = null, textStyle: TdsTextStyle, fontSize: TextUnit, @@ -66,7 +71,10 @@ fun TdsText( maxLines = maxLines, minLines = minLines, onTextLayout = onTextLayout, - style = textStyle.getTextStyle(fontSize), + style = textStyle.getTextStyle( + isNoLocale = isNoLocale, + fontSize = fontSize, + ), textDecoration = textDecoration, ) } diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimer.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimer.kt index c36b88f7..a6a3fab5 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimer.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimer.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.min @@ -120,6 +121,7 @@ fun TdsTimer( Spacer(modifier = Modifier.weight(2f)) TdsText( + isNoLocale = false, text = stringResource(R.string.recording_text_sumtime), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = subTextSize.sp, @@ -139,6 +141,7 @@ fun TdsTimer( Spacer(modifier = Modifier.weight(2f)) TdsText( + isNoLocale = false, text = if (recordingMode == 1) { stringResource(R.string.common_button_timer) } else { @@ -153,6 +156,7 @@ fun TdsTimer( if (isFinish) { TdsText( + isNoLocale = false, modifier = clickStopStartModifier, text = stringResource(id = R.string.timer_text_finish), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, @@ -189,6 +193,7 @@ fun TdsTimer( } else { stringResource(id = R.string.recording_text_targettime) }, + isNoLocale = false, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = subTextSize.sp, color = fontColor, @@ -220,6 +225,7 @@ fun TdsTimer( textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = subTextSize.sp, color = fontColor, + textAlign = TextAlign.Center, ) Spacer(modifier = Modifier.weight(2f)) diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt index fc2acf35..78216f20 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt @@ -61,6 +61,7 @@ fun AddTaskNameDialog(onPositive: (String) -> Unit, onShowDialog: (Boolean) -> U text = taskName, placeHolder = { TdsText( + isNoLocale = false, text = stringResource(id = R.string.tasks_hint_newtasktitle), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, fontSize = 17.sp, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt index 81b43ea9..3dc310ff 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt @@ -50,9 +50,9 @@ enum class TdsTextStyle { ; @Composable - fun getTextStyle(fontSize: TextUnit) = when (this) { + fun getTextStyle(fontSize: TextUnit, isNoLocale: Boolean = true) = when (this) { NORMAL_TEXT_STYLE -> { - val fontFamily = if (Locale.current.language == "zh") { + val fontFamily = if (Locale.current.language == "zh" && !isNoLocale) { misansFontFamily } else { hgggothicssiProFontFamily @@ -60,7 +60,7 @@ enum class TdsTextStyle { TiTiTheme.textStyle.normalTextStyle.copy(fontFamily = fontFamily, fontSize = fontSize) } SEMI_BOLD_TEXT_STYLE -> { - val fontFamily = if (Locale.current.language == "zh") { + val fontFamily = if (Locale.current.language == "zh" && !isNoLocale) { misansFontFamily } else { hgggothicssiProFontFamily @@ -68,7 +68,7 @@ enum class TdsTextStyle { TiTiTheme.textStyle.semiBoldTextStyle.copy(fontFamily = fontFamily, fontSize = fontSize) } EXTRA_BOLD_TEXT_STYLE -> { - val fontFamily = if (Locale.current.language == "zh") { + val fontFamily = if (Locale.current.language == "zh" && !isNoLocale) { misansFontFamily } else { hgggothicssiProFontFamily diff --git a/core/designsystem/src/main/res/values-zh/strings.xml b/core/designsystem/src/main/res/values-zh/strings.xml index 3cd6d171..8f73ee31 100644 --- a/core/designsystem/src/main/res/values-zh/strings.xml +++ b/core/designsystem/src/main/res/values-zh/strings.xml @@ -27,8 +27,8 @@ 设置颜色组合的方向。 目标时间 设置圆形程序栏的目标时间。 - 请输入 Month 的目标时间\\n(以小时为单位) - 请输入 Week 的目标时间\\n(以小时为单位) + 请输入 Month 的目标时间\n(以小时为单位) + 请输入 Week 的目标时间\n(以小时为单位) 所有的照片都保存在画廊里了。 没有选中的图表。 新建记录 diff --git a/core/util/src/main/kotlin/com/titi/app/core/util/TimeUtil.kt b/core/util/src/main/kotlin/com/titi/app/core/util/TimeUtil.kt index 8e909a4e..4d488ce8 100644 --- a/core/util/src/main/kotlin/com/titi/app/core/util/TimeUtil.kt +++ b/core/util/src/main/kotlin/com/titi/app/core/util/TimeUtil.kt @@ -15,7 +15,7 @@ fun String.parseZoneDateTime(): String { fun addTimeToNow(time: Long): String { val now = ZonedDateTime.now() val interval = Duration.ofSeconds(time) - return now.plus(interval).format(DateTimeFormatter.ofPattern("hh.mm a")) + return now.plus(interval).format(DateTimeFormatter.ofPattern("HH.mm")) } fun getTimeToLong(hour: String, minutes: String, seconds: String): Long { diff --git a/feature/color/src/main/kotlin/com/titi/app/feature/color/ui/ColorScreen.kt b/feature/color/src/main/kotlin/com/titi/app/feature/color/ui/ColorScreen.kt index 59bf73aa..582f685c 100644 --- a/feature/color/src/main/kotlin/com/titi/app/feature/color/ui/ColorScreen.kt +++ b/feature/color/src/main/kotlin/com/titi/app/feature/color/ui/ColorScreen.kt @@ -264,6 +264,7 @@ private fun ColorButtons( onClick = { onClickCancel() }, ) { TdsText( + isNoLocale = false, text = stringResource(id = R.string.common_text_cancel), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, fontSize = 16.sp, @@ -280,6 +281,7 @@ private fun ColorButtons( onClick = { onClickConfirm() }, ) { TdsText( + isNoLocale = false, text = stringResource(id = R.string.common_text_ok), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, fontSize = 16.sp, diff --git a/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditScreen.kt b/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditScreen.kt index fd8b7e2b..df28730d 100644 --- a/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditScreen.kt +++ b/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditScreen.kt @@ -17,6 +17,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape @@ -259,6 +260,7 @@ private fun EditScreen(uiState: EditUiState, onEditActions: (EditActions) -> Uni contentAlignment = Alignment.Center, ) { TdsText( + isNoLocale = false, text = stringResource(R.string.editdaily_text_infohowtoeditdaily), color = TdsColor.TEXT, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, @@ -402,6 +404,7 @@ private fun EditTaskContent( shape = RoundedCornerShape(4.dp), ) .padding(4.dp), + isNoLocale = false, text = taskName.ifEmpty { stringResource(R.string.edit_text_notaskname) }, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 17.sp, @@ -502,6 +505,7 @@ private fun EditTaskContent( Spacer(modifier = Modifier.width(4.dp)) TdsText( + isNoLocale = false, text = stringResource( R.string.editdaily_button_appendnewhistory, ), @@ -517,7 +521,7 @@ private fun EditTaskContent( TdsText( modifier = Modifier .width(75.dp) - .height(25.dp) + .wrapContentHeight() .background( color = if (taskHistories.isEmpty() || taskName.isEmpty()) { TdsColor.GROUPED_BACKGROUND.getColor() @@ -532,6 +536,7 @@ private fun EditTaskContent( onEditActions(EditActions.Updates.Done) } }, + isNoLocale = false, text = stringResource(R.string.common_text_ok), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, textAlign = TextAlign.Center, diff --git a/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditTaskHistoryTimeDialog.kt b/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditTaskHistoryTimeDialog.kt index 3f8ac702..e381e5ba 100644 --- a/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditTaskHistoryTimeDialog.kt +++ b/feature/edit/src/main/kotlin/com/titi/app/feature/edit/ui/EditTaskHistoryTimeDialog.kt @@ -72,6 +72,7 @@ fun EditTaskHistoryTimeDialog( Row { Column(horizontalAlignment = Alignment.CenterHorizontally) { TdsText( + isNoLocale = false, text = stringResource(R.string.editdaily_text_startat), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, color = TdsColor.TEXT, @@ -99,6 +100,7 @@ fun EditTaskHistoryTimeDialog( Column(horizontalAlignment = Alignment.CenterHorizontally) { TdsText( + isNoLocale = false, text = stringResource(R.string.editdaily_text_endat), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, color = TdsColor.TEXT, diff --git a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/component/SettingBottomSheet.kt b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/component/SettingBottomSheet.kt index dfe918cd..f68d9522 100644 --- a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/component/SettingBottomSheet.kt +++ b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/component/SettingBottomSheet.kt @@ -279,6 +279,7 @@ private fun SettingBottomSheetContent( .padding(vertical = 10.dp), ) { TdsText( + isNoLocale = false, text = stringResource(id = R.string.colorselector_text_color), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 16.sp, @@ -288,6 +289,7 @@ private fun SettingBottomSheetContent( Spacer(modifier = Modifier.height(4.dp)) TdsText( + isNoLocale = false, text = stringResource(id = R.string.colorselector_text_setgraphcolor), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, fontSize = 14.sp, @@ -308,6 +310,7 @@ private fun SettingBottomSheetContent( .padding(vertical = 10.dp), ) { TdsText( + isNoLocale = false, text = stringResource(id = R.string.colorselector_text_colordirectiontitle), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 16.sp, @@ -317,6 +320,7 @@ private fun SettingBottomSheetContent( Spacer(modifier = Modifier.height(4.dp)) TdsText( + isNoLocale = false, text = stringResource(id = R.string.colorselector_text_colordirectiondesc), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, fontSize = 14.sp, @@ -373,6 +377,7 @@ private fun SettingBottomSheetContent( .padding(vertical = 10.dp), ) { TdsText( + isNoLocale = false, text = stringResource(id = R.string.common_text_targettime), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 16.sp, @@ -382,6 +387,7 @@ private fun SettingBottomSheetContent( Spacer(modifier = Modifier.height(4.dp)) TdsText( + isNoLocale = false, text = stringResource(id = R.string.logsetting_text_dailytargettimedesc), textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, fontSize = 14.sp, diff --git a/feature/measure/src/main/kotlin/com/titi/app/feature/measure/ui/MeasuringScreen.kt b/feature/measure/src/main/kotlin/com/titi/app/feature/measure/ui/MeasuringScreen.kt index d0a7194f..6b66977c 100644 --- a/feature/measure/src/main/kotlin/com/titi/app/feature/measure/ui/MeasuringScreen.kt +++ b/feature/measure/src/main/kotlin/com/titi/app/feature/measure/ui/MeasuringScreen.kt @@ -247,6 +247,7 @@ private fun MeasuringScreen( Spacer(modifier = Modifier.weight(1f)) TdsText( + isNoLocale = false, modifier = Modifier.padding(vertical = 24.dp), text = uiState.recordTimes.currentTask?.taskName, textStyle = TdsTextStyle.NORMAL_TEXT_STYLE, diff --git a/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/FeaturesListScreen.kt b/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/FeaturesListScreen.kt index 5a8e306a..25d483ac 100644 --- a/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/FeaturesListScreen.kt +++ b/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/FeaturesListScreen.kt @@ -72,6 +72,7 @@ fun FeaturesListScreen( }, title = { TdsText( + isNoLocale = false, text = stringResource(R.string.settings_button_functions), textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE, fontSize = 24.sp, diff --git a/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/SettingScreen.kt b/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/SettingScreen.kt index 7af4bc97..a216b639 100644 --- a/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/SettingScreen.kt +++ b/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/SettingScreen.kt @@ -215,6 +215,7 @@ private fun SettingScreen( private fun SettingServiceSection(onSettingActions: (SettingActions) -> Unit) { TdsText( modifier = Modifier.padding(start = 16.dp), + isNoLocale = false, text = stringResource(R.string.settings_text_servicesection), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, @@ -245,6 +246,7 @@ private fun SettingNotificationSection( ) { TdsText( modifier = Modifier.padding(start = 16.dp), + isNoLocale = false, text = stringResource(R.string.setting_text_notification), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, @@ -323,6 +325,7 @@ private fun SettingLanguageSection( ) { TdsText( modifier = Modifier.padding(start = 16.dp), + isNoLocale = false, text = stringResource(R.string.setting_text_language), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, @@ -403,6 +406,7 @@ private fun SettingVersionSection( ) { TdsText( modifier = Modifier.padding(start = 16.dp), + isNoLocale = false, text = stringResource(R.string.settings_text_versionsection), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, @@ -475,6 +479,7 @@ internal fun ListContent( ) { Column(modifier = Modifier.weight(1f)) { TdsText( + isNoLocale = false, text = title, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 17.sp, @@ -485,6 +490,7 @@ internal fun ListContent( description?.let { TdsText( + isNoLocale = false, text = it, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 11.sp, @@ -503,6 +509,7 @@ internal fun DeveloperSection(onSettingActions: (SettingActions) -> Unit) { TdsText( modifier = Modifier.padding(start = 16.dp), + isNoLocale = false, text = stringResource(R.string.setting_text_develop), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, diff --git a/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/UpdatesListScreen.kt b/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/UpdatesListScreen.kt index a274c103..3b596902 100644 --- a/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/UpdatesListScreen.kt +++ b/feature/setting/src/main/kotlin/com/titi/app/feature/setting/ui/UpdatesListScreen.kt @@ -93,6 +93,7 @@ fun UpdatesListScreen(onNavigateUp: () -> Unit) { }, title = { TdsText( + isNoLocale = false, text = stringResource(R.string.settings_button_updatehistory), textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE, fontSize = 24.sp, diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/ColorSelectComponent.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/ColorSelectComponent.kt index 838ddeeb..fadba0c2 100644 --- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/ColorSelectComponent.kt +++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/ColorSelectComponent.kt @@ -54,6 +54,7 @@ fun ColorSelectComponent( Row { Column(horizontalAlignment = Alignment.CenterHorizontally) { TdsText( + isNoLocale = false, text = stringResource(R.string.recordingcolorselector_text_backgroundcolor), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, @@ -103,6 +104,7 @@ fun ColorSelectComponent( ) { balloonWindow -> Column(horizontalAlignment = Alignment.CenterHorizontally) { TdsText( + isNoLocale = false, text = stringResource(R.string.recordingcolorselector_text_textcolor), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 14.sp, diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeButtonComponent.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeButtonComponent.kt index 9969d389..063d5db3 100644 --- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeButtonComponent.kt +++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeButtonComponent.kt @@ -34,8 +34,7 @@ fun TimeButtonComponent( size = 50.dp, ) { Icon( - painter = - painterResource(id = R.drawable.edit_record_icon), + painter = painterResource(id = R.drawable.edit_record_icon), contentDescription = "addRecord", tint = tintColor, ) diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTaskComponent.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTaskComponent.kt index 21910c15..5164557f 100644 --- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTaskComponent.kt +++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTaskComponent.kt @@ -29,6 +29,7 @@ fun TimeTaskComponent( contentPadding = PaddingValues(horizontal = 25.dp, vertical = 10.dp), ) { TdsText( + isNoLocale = false, text = stringResource(R.string.tasks_text_createtask), textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 18.sp, @@ -43,6 +44,7 @@ fun TimeTaskComponent( contentPadding = PaddingValues(horizontal = 25.dp, vertical = 10.dp), ) { TdsText( + isNoLocale = false, text = taskName, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 18.sp, diff --git a/feature/webview/src/main/kotlin/com/titi/app/feature/webview/WebViewScreen.kt b/feature/webview/src/main/kotlin/com/titi/app/feature/webview/WebViewScreen.kt index ca1fc79c..62d77a66 100644 --- a/feature/webview/src/main/kotlin/com/titi/app/feature/webview/WebViewScreen.kt +++ b/feature/webview/src/main/kotlin/com/titi/app/feature/webview/WebViewScreen.kt @@ -46,6 +46,7 @@ fun WebViewScreen(title: String, url: String, onNavigateUp: () -> Unit) { }, title = { TdsText( + isNoLocale = false, text = title, textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE, fontSize = 24.sp, From b127f96210362d71663ac6a4eed7655b3511082e Mon Sep 17 00:00:00 2001 From: koreatlwls Date: Sun, 1 Sep 2024 23:45:14 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat=20:=20=EC=A4=91=EA=B5=AD=EC=96=B4=20?= =?UTF-8?q?=EC=9E=88=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=EC=A4=91=EA=B5=AD?= =?UTF-8?q?=EC=96=B4=20=ED=8F=B0=ED=8A=B8=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/TdsPieChart.kt | 1 - .../component/TdsStandardDailyGraph.kt | 1 - .../component/TdsStandardWeekGraph.kt | 1 - .../designsystem/component/TdsTaskListItem.kt | 5 +- .../component/TdsTaskResultList.kt | 2 - .../component/TdsTaskResultListItem.kt | 36 ++++++------- .../core/designsystem/component/TdsText.kt | 34 ++++++++++++ .../component/TdsTimeTableDailyGraph.kt | 1 - .../designsystem/extension/CharExtensions.kt | 10 ++++ .../app/core/designsystem/theme/Typography.kt | 53 ++++++++++--------- .../com/titi/app/feature/log/ui/HomeScreen.kt | 2 - .../app/feature/measure/ui/MeasuringScreen.kt | 5 +- .../time/component/TimeTaskComponent.kt | 4 +- 13 files changed, 94 insertions(+), 61 deletions(-) create mode 100644 core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/extension/CharExtensions.kt diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsPieChart.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsPieChart.kt index 2e168941..b0797ae7 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsPieChart.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsPieChart.kt @@ -129,7 +129,6 @@ private fun TdsPieChart( TdsTaskResultList( modifier = Modifier.size(holeRadiusDp * 2), taskData = currentTaskData, - isSpacing = false, height = holeRadiusDp * 2 / 5, colors = currentColors, ) diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardDailyGraph.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardDailyGraph.kt index 22d2e5a0..98f04efb 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardDailyGraph.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardDailyGraph.kt @@ -147,7 +147,6 @@ fun TdsStandardDailyGraph( ) .padding(2.dp), taskData = taskData, - isSpacing = true, leftText = "✔", height = 25.dp, colors = tdsColors.map { it.getColor() }, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardWeekGraph.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardWeekGraph.kt index d535bb53..b6656752 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardWeekGraph.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsStandardWeekGraph.kt @@ -170,7 +170,6 @@ fun TdsStandardWeekGraph( .padding(2.dp) .padding(horizontal = 6.dp), taskData = topLevelTaskData, - isSpacing = true, leftText = "Top", height = 25.dp, colors = tdsColors.map { it.getColor() }, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt index 52aa13db..d70c5840 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskListItem.kt @@ -68,12 +68,11 @@ fun TdsTaskListItem( } Column { - TdsText( - isNoLocale = false, + TdsFontCheckText( text = tdsTask.taskName, textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, fontSize = 20.sp, - color = TdsColor.TEXT, + color = TdsColor.TEXT.getColor(), maxLines = 1, overflow = TextOverflow.Ellipsis, ) diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt index 95aefa71..1030f45d 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultList.kt @@ -26,7 +26,6 @@ fun TdsTaskResultList( modifier: Modifier = Modifier, taskData: List, colors: List, - isSpacing: Boolean, leftText: String? = null, height: Dp, selectedIndex: Int? = null, @@ -45,7 +44,6 @@ fun TdsTaskResultList( taskName = pie.key, taskTotalTime = pie.value, color = colors[index % colors.size], - isSpacing = isSpacing, leftText = when (leftText) { null -> null "Top" -> "Top${index + 1}" diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt index aebc2df0..36c4e868 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTaskResultListItem.kt @@ -4,13 +4,13 @@ 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.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width -import androidx.compose.foundation.layout.widthIn import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -30,7 +30,6 @@ fun TdsTaskResultListItem( taskName: String, taskTotalTime: String, color: Color, - isSpacing: Boolean, leftText: String? = null, isEditMode: Boolean = false, onClickTask: ((String) -> Unit)? = null, @@ -67,26 +66,22 @@ fun TdsTaskResultListItem( Spacer(modifier = Modifier.width(5.dp)) } - TdsText( - modifier = Modifier - .widthIn(max = 100.dp) - .background(color = color.copy(alpha = 0.5f)) - .padding(padding), - isNoLocale = false, - text = taskName, - textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, - fontSize = fontSize, - color = TdsColor.TEXT, - overflow = TextOverflow.Ellipsis, - maxLines = 1, - ) - - if (isSpacing) { - Spacer(modifier = Modifier.weight(1f)) - } else { - Spacer(modifier = Modifier.width(3.dp)) + Box(modifier = Modifier.weight(1f)) { + TdsFontCheckText( + modifier = Modifier + .background(color = color.copy(alpha = 0.5f)) + .padding(padding), + text = taskName, + textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE, + fontSize = fontSize, + color = TdsColor.TEXT.getColor(), + overflow = TextOverflow.Ellipsis, + maxLines = 1, + ) } + Spacer(modifier = Modifier.width(3.dp)) + TdsText( text = taskTotalTime, textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE, @@ -107,7 +102,6 @@ private fun TdsTaskResultListItemPreview() { taskName = "수업", taskTotalTime = "5:25:30", color = TdsColor.D1.getColor(), - isSpacing = true, leftText = "✔", ) } diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt index ede630a4..1dd314cb 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsText.kt @@ -11,6 +11,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.sp +import com.titi.app.core.designsystem.extension.isChineseCharacter import com.titi.app.core.designsystem.theme.TdsColor import com.titi.app.core.designsystem.theme.TdsTextStyle import com.titi.app.core.designsystem.theme.TiTiTheme @@ -79,6 +80,39 @@ fun TdsText( ) } +@Composable +fun TdsFontCheckText( + modifier: Modifier = Modifier, + text: String? = null, + textStyle: TdsTextStyle, + fontSize: TextUnit, + textDecoration: TextDecoration? = null, + color: Color, + textAlign: TextAlign? = null, + overflow: TextOverflow = TextOverflow.Clip, + maxLines: Int = Int.MAX_VALUE, + minLines: Int = 1, + onTextLayout: (TextLayoutResult) -> Unit = {}, +) { + val isContainsChinese = text?.any { it.isChineseCharacter() } ?: false + + Text( + text = text ?: "", + modifier = modifier, + color = color, + textAlign = textAlign, + overflow = overflow, + maxLines = maxLines, + minLines = minLines, + onTextLayout = onTextLayout, + style = textStyle.getTextStyle( + isChinese = isContainsChinese, + fontSize = fontSize, + ), + textDecoration = textDecoration, + ) +} + @Preview @Composable private fun TdsTextPreview() { diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimeTableDailyGraph.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimeTableDailyGraph.kt index c5e751af..acccc64f 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimeTableDailyGraph.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimeTableDailyGraph.kt @@ -183,7 +183,6 @@ fun TdsTimeTableDailyGraph( .padding(2.dp), taskData = taskData, colors = tdsColors.map { it.getColor() }, - isSpacing = true, leftText = "✔", height = 25.dp, selectedIndex = selectedTaskIndex, diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/extension/CharExtensions.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/extension/CharExtensions.kt new file mode 100644 index 00000000..a1a56272 --- /dev/null +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/extension/CharExtensions.kt @@ -0,0 +1,10 @@ +package com.titi.app.core.designsystem.extension + +fun Char.isChineseCharacter(): Boolean { + val ub = Character.UnicodeBlock.of(this) + return ub === Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || + ub === Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || + ub === Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B || + ub === Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || + ub === Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT +} diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt index 3dc310ff..3a483312 100644 --- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt +++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/theme/Typography.kt @@ -50,33 +50,38 @@ enum class TdsTextStyle { ; @Composable - fun getTextStyle(fontSize: TextUnit, isNoLocale: Boolean = true) = when (this) { - NORMAL_TEXT_STYLE -> { - val fontFamily = if (Locale.current.language == "zh" && !isNoLocale) { - misansFontFamily - } else { - hgggothicssiProFontFamily - } - TiTiTheme.textStyle.normalTextStyle.copy(fontFamily = fontFamily, fontSize = fontSize) + fun getTextStyle( + fontSize: TextUnit, + isChinese: Boolean = false, + isNoLocale: Boolean = true, + ): TextStyle { + val fontFamily = when { + isChinese -> misansFontFamily + Locale.current.language == "zh" && !isNoLocale -> misansFontFamily + else -> hgggothicssiProFontFamily } - SEMI_BOLD_TEXT_STYLE -> { - val fontFamily = if (Locale.current.language == "zh" && !isNoLocale) { - misansFontFamily - } else { - hgggothicssiProFontFamily + + return when (this) { + NORMAL_TEXT_STYLE -> { + TiTiTheme.textStyle.normalTextStyle.copy( + fontFamily = fontFamily, + fontSize = fontSize, + ) } - TiTiTheme.textStyle.semiBoldTextStyle.copy(fontFamily = fontFamily, fontSize = fontSize) - } - EXTRA_BOLD_TEXT_STYLE -> { - val fontFamily = if (Locale.current.language == "zh" && !isNoLocale) { - misansFontFamily - } else { - hgggothicssiProFontFamily + + SEMI_BOLD_TEXT_STYLE -> { + TiTiTheme.textStyle.semiBoldTextStyle.copy( + fontFamily = fontFamily, + fontSize = fontSize, + ) + } + + EXTRA_BOLD_TEXT_STYLE -> { + TiTiTheme.textStyle.extraBoldTextStyle.copy( + fontFamily = fontFamily, + fontSize = fontSize, + ) } - TiTiTheme.textStyle.extraBoldTextStyle.copy( - fontFamily = fontFamily, - fontSize = fontSize, - ) } } } diff --git a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/HomeScreen.kt b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/HomeScreen.kt index aa31283c..28068619 100644 --- a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/HomeScreen.kt +++ b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/HomeScreen.kt @@ -153,7 +153,6 @@ private fun TotalCard(totalData: HomeUiState.TotalData, tdsColors: List Date: Sun, 1 Sep 2024 23:48:23 +0900 Subject: [PATCH 4/5] update : version code --- build-logic/src/main/kotlin/com/titi/common/BuildInfo.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-logic/src/main/kotlin/com/titi/common/BuildInfo.kt b/build-logic/src/main/kotlin/com/titi/common/BuildInfo.kt index 2aeed66f..f82b8554 100644 --- a/build-logic/src/main/kotlin/com/titi/common/BuildInfo.kt +++ b/build-logic/src/main/kotlin/com/titi/common/BuildInfo.kt @@ -9,7 +9,7 @@ object BuildType { object AppConfig { const val APP_ID = "com.titi.app" - const val APP_VERSION_NAME = "1.4.0" - const val APP_VERSION_CODE = 40 + const val APP_VERSION_NAME = "1.4.1" + const val APP_VERSION_CODE = 41 const val APP_NAME = "TiTi" } \ No newline at end of file From 2131de88427d2eb138f695abec0822c5ac66cfe9 Mon Sep 17 00:00:00 2001 From: koreatlwls Date: Sun, 1 Sep 2024 23:48:53 +0900 Subject: [PATCH 5/5] docs : release-note --- release-note.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release-note.txt b/release-note.txt index eec84856..2f9a5ac4 100644 --- a/release-note.txt +++ b/release-note.txt @@ -1,3 +1,3 @@ -TiTi android 1.4.0 -- Setting Screen Ver.3 -- Bug share picture \ No newline at end of file +TiTi android 1.4.1 +- Chinese font +- Animation spec \ No newline at end of file