Skip to content

Commit

Permalink
Merge pull request #187 from TimerTiTi/release-1.4.1
Browse files Browse the repository at this point in the history
Release 1.4.1
  • Loading branch information
koreatlwls authored Sep 1, 2024
2 parents 5cce479 + 2131de8 commit b2ae7c4
Show file tree
Hide file tree
Showing 33 changed files with 172 additions and 88 deletions.
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/com/titi/common/BuildInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ fun TdsTextButton(
contentPadding = PaddingValues(12.dp, 8.dp),
) {
TdsText(
isNoLocale = false,
text = text,
textStyle = textStyle,
color = textColor,
Expand Down Expand Up @@ -85,6 +86,7 @@ fun TdsTextButton(
contentPadding = PaddingValues(12.dp, 8.dp),
) {
TdsText(
isNoLocale = false,
text = text,
textStyle = textStyle,
color = textColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ private fun TdsPieChart(
TdsTaskResultList(
modifier = Modifier.size(holeRadiusDp * 2),
taskData = currentTaskData,
isSpacing = false,
height = holeRadiusDp * 2 / 5,
colors = currentColors,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ fun TdsStandardDailyGraph(
)
.padding(2.dp),
taskData = taskData,
isSpacing = true,
leftText = "",
height = 25.dp,
colors = tdsColors.map { it.getColor() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,19 @@ fun TdsTaskListItem(
}

Column {
TdsText(
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,
)

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,
Expand All @@ -90,6 +91,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ fun TdsTaskResultList(
modifier: Modifier = Modifier,
taskData: List<TdsTaskData>,
colors: List<Color>,
isSpacing: Boolean,
leftText: String? = null,
height: Dp,
selectedIndex: Int? = null,
Expand All @@ -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}"
Expand Down Expand Up @@ -75,6 +73,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,7 +30,6 @@ fun TdsTaskResultListItem(
taskName: String,
taskTotalTime: String,
color: Color,
isSpacing: Boolean,
leftText: String? = null,
isEditMode: Boolean = false,
onClickTask: ((String) -> Unit)? = null,
Expand All @@ -57,6 +56,7 @@ fun TdsTaskResultListItem(
) {
if (leftText != null) {
TdsText(
isNoLocale = false,
text = leftText,
textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE,
fontSize = fontSize,
Expand All @@ -66,25 +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),
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,
Expand All @@ -105,7 +102,6 @@ private fun TdsTaskResultListItemPreview() {
taskName = "수업",
taskTotalTime = "5:25:30",
color = TdsColor.D1.getColor(),
isSpacing = true,
leftText = "",
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ 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

@Composable
fun TdsText(
modifier: Modifier = Modifier,
isNoLocale: Boolean = true,
text: String? = null,
textStyle: TdsTextStyle,
fontSize: TextUnit,
Expand All @@ -38,14 +40,18 @@ fun TdsText(
maxLines = maxLines,
minLines = minLines,
onTextLayout = onTextLayout,
style = textStyle.getTextStyle(fontSize),
style = textStyle.getTextStyle(
isNoLocale = isNoLocale,
fontSize = fontSize,
),
textDecoration = textDecoration,
)
}

@Composable
fun TdsText(
modifier: Modifier = Modifier,
isNoLocale: Boolean = true,
text: String? = null,
textStyle: TdsTextStyle,
fontSize: TextUnit,
Expand All @@ -66,7 +72,43 @@ fun TdsText(
maxLines = maxLines,
minLines = minLines,
onTextLayout = onTextLayout,
style = textStyle.getTextStyle(fontSize),
style = textStyle.getTextStyle(
isNoLocale = isNoLocale,
fontSize = fontSize,
),
textDecoration = textDecoration,
)
}

@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,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ fun TdsTimeTableDailyGraph(
.padding(2.dp),
taskData = taskData,
colors = tdsColors.map { it.getColor() },
isSpacing = true,
leftText = "",
height = 25.dp,
selectedIndex = selectedTaskIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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 {
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Loading

0 comments on commit b2ae7c4

Please sign in to comment.