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 e7f08ca4..e3799a41 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.2"
- const val APP_VERSION_CODE = 42
+ const val APP_VERSION_NAME = "1.4.3"
+ const val APP_VERSION_CODE = 43
const val APP_NAME = "TiTi"
}
\ No newline at end of file
diff --git a/core/designsystem/build.gradle.kts b/core/designsystem/build.gradle.kts
index a7899da6..c7b8218f 100644
--- a/core/designsystem/build.gradle.kts
+++ b/core/designsystem/build.gradle.kts
@@ -9,6 +9,7 @@ android {
dependencies {
implementation(project(":core:util"))
+ implementation(project(":tds"))
implementation(libs.threetenabp)
}
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 f4e034ec..ed8cfbc9 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
@@ -9,9 +9,9 @@ import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.CircleShape
-import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
+import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
@@ -113,7 +113,7 @@ fun TdsIconButton(
enabled = enabled,
role = Role.Button,
interactionSource = interactionSource,
- indication = rememberRipple(
+ indication = ripple(
bounded = false,
radius = size / 2,
),
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
deleted file mode 100644
index f0124841..00000000
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsDialog.kt
+++ /dev/null
@@ -1,220 +0,0 @@
-package com.titi.app.core.designsystem.component
-
-import androidx.compose.foundation.layout.Column
-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.wrapContentHeight
-import androidx.compose.foundation.shape.RoundedCornerShape
-import androidx.compose.material3.Surface
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-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.sp
-import androidx.compose.ui.window.Dialog
-import androidx.compose.ui.window.DialogProperties
-import com.titi.app.core.designsystem.model.TdsDialogInfo
-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 TdsDialog(
- modifier: Modifier = Modifier,
- tdsDialogInfo: TdsDialogInfo,
- onShowDialog: (Boolean) -> Unit,
- bodyContent: (@Composable () -> Unit)? = null,
-) {
- Dialog(
- onDismissRequest = {
- tdsDialogInfo.onDismiss?.invoke()
- onShowDialog(false)
- },
- properties = DialogProperties(
- dismissOnBackPress = tdsDialogInfo.cancelable,
- dismissOnClickOutside = tdsDialogInfo.cancelable,
- ),
- ) {
- Surface(
- modifier = Modifier
- .fillMaxWidth()
- .wrapContentHeight(),
- shape = RoundedCornerShape(14.dp),
- color = TdsColor.ALERT_BACKGROUND.getColor(),
- ) {
- Column(
- modifier = modifier,
- horizontalAlignment = Alignment.CenterHorizontally,
- ) {
- Spacer(modifier = Modifier.height(24.dp))
-
- TdsText(
- modifier = Modifier.padding(horizontal = 12.dp),
- isNoLocale = false,
- text = tdsDialogInfo.title,
- textStyle = TdsTextStyle.EXTRA_BOLD_TEXT_STYLE,
- fontSize = 17.sp,
- color = TdsColor.TEXT,
- textAlign = TextAlign.Center,
- )
-
- tdsDialogInfo.message?.let { message ->
- Spacer(modifier = Modifier.height(8.dp))
-
- TdsText(
- modifier = Modifier.padding(horizontal = 12.dp),
- isNoLocale = false,
- text = message,
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 13.sp,
- color = TdsColor.TEXT,
- textAlign = TextAlign.Center,
- )
- }
-
- if (bodyContent != null) {
- Spacer(modifier = Modifier.height(16.dp))
-
- bodyContent()
-
- Spacer(modifier = Modifier.height(16.dp))
- }
-
- TdsDivider()
-
- when (tdsDialogInfo) {
- is TdsDialogInfo.Confirm -> {
- TdsConfirmDialogButtons(
- tdsDialogInfo = tdsDialogInfo,
- onShowDialog = onShowDialog,
- )
- }
-
- is TdsDialogInfo.Alert -> {
- TdsAlertDialogButton(
- tdsDialogInfo = tdsDialogInfo,
- onShowDialog = onShowDialog,
- )
- }
- }
- }
- }
- }
-}
-
-@Composable
-private fun TdsConfirmDialogButtons(
- tdsDialogInfo: TdsDialogInfo.Confirm,
- onShowDialog: (Boolean) -> Unit,
-) {
- Row(
- modifier = Modifier
- .fillMaxWidth()
- .height(44.dp),
- ) {
- TdsTextButton(
- modifier = Modifier.weight(1f),
- onClick = {
- tdsDialogInfo.onNegative?.invoke()
- onShowDialog(false)
- },
- text = tdsDialogInfo.negativeText,
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 17.sp,
- textColor = TdsColor.RED,
- )
-
- TdsDivider()
-
- TdsTextButton(
- modifier = Modifier.weight(1f),
- onClick = {
- tdsDialogInfo.onPositive.invoke()
- onShowDialog(false)
- },
- text = tdsDialogInfo.positiveText,
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 16.sp,
- textColor = TdsColor.BLUE,
- )
- }
-}
-
-@Composable
-private fun TdsAlertDialogButton(
- tdsDialogInfo: TdsDialogInfo.Alert,
- onShowDialog: (Boolean) -> Unit,
-) {
- TdsTextButton(
- modifier = Modifier
- .fillMaxWidth()
- .height(44.dp),
- onClick = {
- tdsDialogInfo.onConfirm?.invoke()
- onShowDialog(false)
- },
- text = tdsDialogInfo.confirmText,
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 17.sp,
- textColor = TdsColor.BLUE,
- )
-}
-
-@Preview
-@Composable
-private fun TdsConfirmDialogPreview() {
- TiTiTheme {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
- title = "새로운 기록 설정",
- message = "2023.03.10 목표시간 설정",
- cancelable = false,
- onDismiss = {},
- positiveText = "OK",
- onPositive = {},
- negativeText = "Cancel",
- onNegative = {},
- ),
- onShowDialog = {},
- bodyContent = {
- TdsText(
- text = "tdsDialogInfo.message",
- textStyle = TdsTextStyle.NORMAL_TEXT_STYLE,
- fontSize = 12.sp,
- color = TdsColor.TEXT,
- )
- },
- )
- }
-}
-
-@Preview
-@Composable
-private fun TdsAlertDialogPreview() {
- TiTiTheme {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Alert(
- title = "새로운 기록 설정",
- message = "2023.03.10 목표",
- cancelable = false,
- onDismiss = {},
- confirmText = "Confirm",
- onConfirm = {},
- ),
- onShowDialog = {},
- bodyContent = {
- TdsText(
- text = "hihi",
- textStyle = TdsTextStyle.NORMAL_TEXT_STYLE,
- fontSize = 12.sp,
- color = TdsColor.TEXT,
- )
- },
- )
- }
-}
diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsGraphContent.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsGraphContent.kt
index b397f411..69451891 100644
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsGraphContent.kt
+++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsGraphContent.kt
@@ -49,7 +49,7 @@ fun TdsGraphContent(
modifier = Modifier.wrapContentSize(),
userScrollEnabled = true,
state = pagerState,
- beyondBoundsPageCount = 3,
+ beyondViewportPageCount = 3,
) { page ->
when (page % 4) {
0 -> TdsStandardDailyGraph(
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
deleted file mode 100644
index 3c0e1164..00000000
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTextField.kt
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.titi.app.core.designsystem.component
-
-import androidx.compose.foundation.background
-import androidx.compose.foundation.border
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.width
-import androidx.compose.foundation.shape.RoundedCornerShape
-import androidx.compose.foundation.text.BasicTextField
-import androidx.compose.foundation.text.KeyboardActions
-import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.clip
-import androidx.compose.ui.graphics.SolidColor
-import androidx.compose.ui.text.input.TextFieldValue
-import androidx.compose.ui.text.style.TextAlign
-import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.TextUnit
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-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 TdsOutlinedInputTextField(
- modifier: Modifier = Modifier,
- fontSize: TextUnit,
- text: String,
- onValueChange: (String) -> Unit,
- keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
- keyboardActions: KeyboardActions = KeyboardActions.Default,
- placeHolder: (@Composable () -> Unit)? = null,
-) {
- BasicTextField(
- modifier = modifier,
- value = text,
- onValueChange = onValueChange,
- textStyle = TdsTextStyle
- .SEMI_BOLD_TEXT_STYLE
- .getTextStyle(
- isNoLocale = false,
- fontSize = fontSize,
- )
- .copy(
- color = TdsColor.TEXT.getColor(),
- textAlign = TextAlign.Center,
- ),
- keyboardOptions = keyboardOptions,
- keyboardActions = keyboardActions,
- cursorBrush = SolidColor(TdsColor.TEXT.getColor()),
- ) { innerTextField ->
- Box(
- modifier = modifier
- .border(
- width = 1.dp,
- color = TdsColor.DIVIDER.getColor(),
- shape = RoundedCornerShape(4.dp),
- )
- .clip(RoundedCornerShape(4.dp))
- .background(TdsColor.TERTIARY_BACKGROUND.getColor()),
- contentAlignment = Alignment.Center,
- ) {
- innerTextField()
- if (text.isBlank()) {
- placeHolder?.let { it() }
- }
- }
- }
-}
-
-@Composable
-fun TdsOutlinedInputTextField(
- modifier: Modifier = Modifier,
- fontSize: TextUnit,
- text: TextFieldValue,
- onValueChange: (TextFieldValue) -> Unit,
- keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
- keyboardActions: KeyboardActions = KeyboardActions.Default,
- placeHolder: (@Composable () -> Unit)? = null,
-) {
- BasicTextField(
- modifier = modifier,
- value = text,
- onValueChange = onValueChange,
- textStyle = TdsTextStyle
- .SEMI_BOLD_TEXT_STYLE
- .getTextStyle(fontSize = fontSize)
- .copy(textAlign = TextAlign.Center),
- keyboardOptions = keyboardOptions,
- keyboardActions = keyboardActions,
- cursorBrush = SolidColor(TdsColor.TEXT.getColor()),
- ) { innerTextField ->
- Box(
- modifier =
- modifier
- .border(
- width = 1.dp,
- color = TdsColor.DIVIDER.getColor(),
- shape = RoundedCornerShape(4.dp),
- )
- .clip(RoundedCornerShape(4.dp))
- .background(TdsColor.TERTIARY_BACKGROUND.getColor()),
- contentAlignment = Alignment.Center,
- ) {
- innerTextField()
- if (text.text.isBlank()) {
- placeHolder?.let { it() }
- }
- }
- }
-}
-
-@Preview
-@Composable
-private fun TdsInputTextFieldPreview() {
- TiTiTheme {
- TdsOutlinedInputTextField(
- modifier = Modifier
- .width(60.dp)
- .height(40.dp),
- text = "ABC",
- onValueChange = {},
- fontSize = 22.sp,
- )
- }
-}
diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimePicker.kt b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimePicker.kt
index 90c4a8d2..c6422a80 100644
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimePicker.kt
+++ b/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsTimePicker.kt
@@ -20,10 +20,11 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.core.util.toOnlyTime
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import java.time.LocalDateTime
@OptIn(ExperimentalMaterial3Api::class)
@@ -39,8 +40,8 @@ fun TdsTimePicker(
}
if (showTimePicker) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = "",
positiveText = stringResource(R.string.common_text_ok),
negativeText = stringResource(R.string.common_text_cancel),
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 3a483312..172a215f 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
@@ -19,9 +19,9 @@ val hgggothicssiProFontFamily =
)
val misansFontFamily =
FontFamily(
- Font(R.font.misans_normal, FontWeight.Normal),
- Font(R.font.misans_medium, FontWeight.SemiBold),
- Font(R.font.misans_semibold, FontWeight.ExtraBold),
+ Font(com.titi.app.tds.R.font.misans_normal, FontWeight.Normal),
+ Font(com.titi.app.tds.R.font.misans_medium, FontWeight.SemiBold),
+ Font(com.titi.app.tds.R.font.misans_semibold, FontWeight.ExtraBold),
)
@Immutable
diff --git a/core/designsystem/src/main/res/values-ko-rKR/strings.xml b/core/designsystem/src/main/res/values-ko-rKR/strings.xml
index 670b3fca..5af76dfd 100644
--- a/core/designsystem/src/main/res/values-ko-rKR/strings.xml
+++ b/core/designsystem/src/main/res/values-ko-rKR/strings.xml
@@ -45,8 +45,8 @@
버전 정보
최신버전
업데이트 내역
- 해당 색상을 배경색으로 설정 하시겠습니까?
- 변경 사항을 저장 하지 않고 나가시겠어요?
+ 해당 색상을 배경색으로\n설정 하시겠습니까?
+ 변경 사항을 저장 하지 않고\n나가시겠어요?
Task명을 입력해 주세요.
종료
타이머가 종료되었습니다!
diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts
index 9020b4e7..5114dfc4 100644
--- a/core/ui/build.gradle.kts
+++ b/core/ui/build.gradle.kts
@@ -8,7 +8,5 @@ android {
}
dependencies {
- implementation(project(":core:designsystem"))
-
implementation(libs.androidx.compose.navigation)
}
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 582f685c..fda49177 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
@@ -24,6 +24,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.res.stringResource
@@ -40,15 +41,16 @@ import com.github.skydoves.colorpicker.compose.ColorPickerController
import com.github.skydoves.colorpicker.compose.HsvColorPicker
import com.github.skydoves.colorpicker.compose.rememberColorPickerController
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsText
import com.titi.app.core.designsystem.extension.complementary
import com.titi.app.core.designsystem.extension.hexCode
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.core.designsystem.theme.TiTiTheme
import com.titi.app.feature.color.model.ColorUiState
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
+import com.titi.app.tds.theme.TtdsColor
@Composable
fun ColorScreen(
@@ -62,8 +64,8 @@ fun ColorScreen(
var showDialog by remember { mutableStateOf(false) }
var selectedColor by remember { mutableLongStateOf(0L) }
if (showDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(R.string.colorselector_popup_backgroundtitle),
cancelable = false,
positiveText = stringResource(id = R.string.common_text_ok),
@@ -81,8 +83,12 @@ fun ColorScreen(
Box(
modifier = Modifier
.size(40.dp)
- .border(2.dp, Color.LightGray, RoundedCornerShape(6.dp))
- .padding(2.dp)
+ .border(
+ width = 1.dp,
+ color = TtdsColor.STROKE2.getColor(),
+ shape = RoundedCornerShape(8.dp),
+ )
+ .clip(RoundedCornerShape(8.dp))
.background(Color(selectedColor)),
)
}
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 df28730d..52b8bc4f 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
@@ -53,15 +53,11 @@ import com.airbnb.mvrx.asMavericksArgs
import com.airbnb.mvrx.compose.collectAsState
import com.airbnb.mvrx.compose.mavericksViewModel
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsDivider
import com.titi.app.core.designsystem.component.TdsGraphContent
import com.titi.app.core.designsystem.component.TdsIconButton
import com.titi.app.core.designsystem.component.TdsText
-import com.titi.app.core.designsystem.component.dialog.AddTaskNameDialog
-import com.titi.app.core.designsystem.component.dialog.EditTaskNameDialog
import com.titi.app.core.designsystem.extension.getTimeString
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.core.util.toOnlyTime
@@ -70,6 +66,10 @@ import com.titi.app.feature.edit.model.DateTimeTaskHistory
import com.titi.app.feature.edit.model.EditActions
import com.titi.app.feature.edit.model.EditUiState
import com.titi.app.feature.edit.util.isTaskHistoryOverlap
+import com.titi.app.tds.component.dialog.AddTaskNameDialog
+import com.titi.app.tds.component.dialog.EditTaskNameDialog
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import java.time.LocalDate
import kotlinx.coroutines.launch
@@ -88,8 +88,8 @@ fun EditScreen(currentDate: String, onBack: () -> Unit) {
}
if (showBackDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(R.string.edit_popup_nosavetitle),
positiveText = stringResource(id = R.string.common_text_ok),
negativeText = stringResource(id = R.string.common_text_cancel),
@@ -98,9 +98,7 @@ fun EditScreen(currentDate: String, onBack: () -> Unit) {
},
),
onShowDialog = { showBackDialog = it },
- ) {
- Spacer(modifier = Modifier.height(12.dp))
- }
+ )
}
LaunchedEffect(uiState.finishEvent) {
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 e381e5ba..ed0d6ea0 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
@@ -18,14 +18,14 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsText
import com.titi.app.core.designsystem.component.TdsTimePicker
import com.titi.app.core.designsystem.extension.getTimeString
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.feature.edit.model.DateTimeTaskHistory
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import java.time.Duration
import java.time.LocalDateTime
@@ -50,8 +50,8 @@ fun EditTaskHistoryTimeDialog(
initialMinute = startLocalDateTime.minute,
)
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = (Duration.between(startLocalDateTime, endLocalDateTime).toMillis() / 1000)
.getTimeString(),
positiveText = stringResource(R.string.common_text_ok),
diff --git a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/DailyScreen.kt b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/DailyScreen.kt
index 90640456..a96007ee 100644
--- a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/DailyScreen.kt
+++ b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/DailyScreen.kt
@@ -25,9 +25,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.titi.app.core.designsystem.R
import com.titi.app.core.designsystem.component.TdsColorRow
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsGraphContent
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.model.TdsTaskData
import com.titi.app.core.designsystem.model.TdsTimeTableData
import com.titi.app.core.designsystem.theme.TdsColor
@@ -39,6 +37,8 @@ import com.titi.app.feature.log.ui.component.CalendarContent
import com.titi.app.feature.log.util.saveDailyGraph
import com.titi.app.feature.log.util.saveDailyGraphWithPermission
import com.titi.app.feature.log.util.shareDailyGraph
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import java.time.LocalDate
@Composable
@@ -79,8 +79,8 @@ fun DailyScreen(
}
if (showPermissionDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(R.string.daily_popup_savepermissiontitle),
message = stringResource(R.string.daily_popup_savepermissiondesc),
positiveText = stringResource(id = R.string.common_text_ok),
@@ -92,9 +92,7 @@ fun DailyScreen(
},
),
onShowDialog = { showPermissionDialog = it },
- ) {
- Spacer(modifier = Modifier.height(15.dp))
- }
+ )
}
Column(
diff --git a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/WeekScreen.kt b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/WeekScreen.kt
index 8e0a38d2..9915e9c1 100644
--- a/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/WeekScreen.kt
+++ b/feature/log/src/main/kotlin/com/titi/app/feature/log/ui/WeekScreen.kt
@@ -25,10 +25,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.titi.app.core.designsystem.R
import com.titi.app.core.designsystem.component.TdsColorRow
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsStandardWeekGraph
import com.titi.app.core.designsystem.extension.getWeekInformation
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.model.TdsTaskData
import com.titi.app.core.designsystem.model.TdsWeekLineChartData
import com.titi.app.core.designsystem.theme.TdsColor
@@ -40,6 +38,8 @@ import com.titi.app.feature.log.ui.component.CalendarContent
import com.titi.app.feature.log.util.saveWeekGraph
import com.titi.app.feature.log.util.saveWeekGraphWithPermission
import com.titi.app.feature.log.util.shareWeekGraph
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import java.time.LocalDate
@Composable
@@ -78,8 +78,8 @@ fun WeekScreen(
}
if (showPermissionDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(R.string.daily_popup_savepermissiontitle),
message = stringResource(R.string.daily_popup_savepermissiondesc),
positiveText = stringResource(id = R.string.common_text_ok),
@@ -91,9 +91,7 @@ fun WeekScreen(
},
),
onShowDialog = { showPermissionDialog = it },
- ) {
- Spacer(modifier = Modifier.height(15.dp))
- }
+ )
}
Column(
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 f68d9522..8fcddeda 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
@@ -42,11 +42,8 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.titi.app.core.designsystem.R
import com.titi.app.core.designsystem.component.TdsColorRow
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.component.TdsOutlinedInputTextField
import com.titi.app.core.designsystem.component.TdsTabRow
import com.titi.app.core.designsystem.component.TdsText
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.core.designsystem.theme.TiTiTheme
@@ -54,6 +51,9 @@ import com.titi.app.domain.color.model.GraphColor
import com.titi.app.feature.log.model.GraphColorUiState
import com.titi.app.feature.log.model.HomeUiState
import com.titi.app.feature.log.ui.LogViewModel
+import com.titi.app.tds.component.TtdsOutLinedTextField
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import kotlinx.coroutines.android.awaitFrame
@OptIn(ExperimentalMaterial3Api::class)
@@ -78,8 +78,8 @@ fun SettingBottomSheet(
}
if (showMonthGoalTimeDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(id = R.string.common_text_targettime),
message = stringResource(id = R.string.common_popup_setmonthtargettime),
cancelable = false,
@@ -105,10 +105,9 @@ fun SettingBottomSheet(
keyboard?.show()
}
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
.fillMaxWidth()
- .height(26.dp)
.padding(horizontal = 15.dp)
.focusRequester(monthGoalTimeFocusRequester),
keyboardOptions = KeyboardOptions(
@@ -124,26 +123,19 @@ fun SettingBottomSheet(
)
},
),
- fontSize = 17.sp,
text = goalTime,
- placeHolder = {
- TdsText(
- text = "100",
- textStyle = TdsTextStyle.NORMAL_TEXT_STYLE,
- fontSize = 17.sp,
- color = TdsColor.DIVIDER,
- )
- },
+ placeholder = "100",
onValueChange = {
goalTime = it
},
+ onClearText = { goalTime = "" },
)
}
}
if (showWeekGoalTimeDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(id = R.string.common_text_targettime),
message = stringResource(id = R.string.common_popup_setweektargettime),
cancelable = false,
@@ -169,10 +161,9 @@ fun SettingBottomSheet(
keyboard?.show()
}
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
.fillMaxWidth()
- .height(26.dp)
.padding(horizontal = 15.dp)
.focusRequester(weekGoalTimeFocusRequester),
keyboardOptions = KeyboardOptions(
@@ -188,19 +179,12 @@ fun SettingBottomSheet(
)
},
),
- fontSize = 17.sp,
text = goalTime,
- placeHolder = {
- TdsText(
- text = "30",
- textStyle = TdsTextStyle.NORMAL_TEXT_STYLE,
- fontSize = 17.sp,
- color = TdsColor.DIVIDER,
- )
- },
+ placeholder = "30",
onValueChange = {
goalTime = it
},
+ onClearText = { goalTime = "" },
)
}
}
diff --git a/feature/main/src/main/kotlin/com/titi/app/feature/main/navigation/TiTiNavHost.kt b/feature/main/src/main/kotlin/com/titi/app/feature/main/navigation/TiTiNavHost.kt
index 44340178..d19ae7f0 100644
--- a/feature/main/src/main/kotlin/com/titi/app/feature/main/navigation/TiTiNavHost.kt
+++ b/feature/main/src/main/kotlin/com/titi/app/feature/main/navigation/TiTiNavHost.kt
@@ -35,6 +35,8 @@ import com.titi.app.feature.time.navigation.navigateToTimer
import com.titi.app.feature.time.navigation.timeGraph
import com.titi.app.feature.webview.navigateToWebView
import com.titi.app.feature.webview.webViewGraph
+import java.net.URLEncoder
+import java.nio.charset.StandardCharsets
@Composable
fun TiTiNavHost(
@@ -72,7 +74,9 @@ fun TiTiNavHost(
context.startActivity(intent)
},
onNavigateToMeasure = {
- navController.navigateToMeasure(it)
+ navController.navigateToMeasure(
+ URLEncoder.encode(it, StandardCharsets.UTF_8.toString()),
+ )
},
onNavigateToDestination = {
navController.navigateToTopLevelDestination(it)
diff --git a/feature/main/src/main/kotlin/com/titi/app/feature/main/ui/main/MainActivity.kt b/feature/main/src/main/kotlin/com/titi/app/feature/main/ui/main/MainActivity.kt
index ea58e925..67b09bd6 100644
--- a/feature/main/src/main/kotlin/com/titi/app/feature/main/ui/main/MainActivity.kt
+++ b/feature/main/src/main/kotlin/com/titi/app/feature/main/ui/main/MainActivity.kt
@@ -11,6 +11,7 @@ import com.titi.app.core.designsystem.theme.TiTiTheme
import com.titi.app.core.ui.removeNotification
import com.titi.app.domain.color.usecase.GetTimeColorFlowUseCase
import com.titi.app.feature.main.navigation.TiTiApp
+import com.titi.app.tds.theme.TtdsTheme
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
@@ -43,8 +44,10 @@ class MainActivity : ComponentActivity() {
setContent {
TiTiTheme {
- viewModel.splashResultState?.let {
- TiTiApp(splashResultState = it)
+ TtdsTheme {
+ viewModel.splashResultState?.let {
+ TiTiApp(splashResultState = it)
+ }
}
}
}
diff --git a/feature/measure/src/main/kotlin/com/titi/app/feature/measure/navigation/MeasureNavigation.kt b/feature/measure/src/main/kotlin/com/titi/app/feature/measure/navigation/MeasureNavigation.kt
index 42715b0b..0f88f66b 100644
--- a/feature/measure/src/main/kotlin/com/titi/app/feature/measure/navigation/MeasureNavigation.kt
+++ b/feature/measure/src/main/kotlin/com/titi/app/feature/measure/navigation/MeasureNavigation.kt
@@ -6,6 +6,8 @@ import androidx.navigation.NavType
import androidx.navigation.compose.composable
import androidx.navigation.navArgument
import com.titi.app.feature.measure.ui.MeasuringScreen
+import java.net.URLDecoder
+import java.nio.charset.StandardCharsets
private const val MEASURE_SCREEN = "measure"
const val MEASURE_ARG = "splashResultState"
@@ -25,7 +27,15 @@ fun NavGraphBuilder.measureGraph(onFinish: (isFinish: Boolean) -> Unit) {
),
) {
MeasuringScreen(
- splashResultState = it.arguments?.getString(MEASURE_ARG, "") ?: "",
+ splashResultState = it.arguments
+ ?.getString(MEASURE_ARG, "")
+ ?.let { jsonString ->
+ URLDecoder.decode(
+ jsonString,
+ StandardCharsets.UTF_8.toString(),
+ )
+ }
+ ?: "",
onFinish = onFinish,
)
}
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 356c17bf..08300069 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
@@ -46,11 +46,9 @@ import com.airbnb.mvrx.asMavericksArgs
import com.airbnb.mvrx.compose.collectAsState
import com.airbnb.mvrx.compose.mavericksViewModel
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsFontCheckText
import com.titi.app.core.designsystem.component.TdsIconButton
import com.titi.app.core.designsystem.component.TdsTimer
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.core.ui.removeNotification
@@ -58,6 +56,8 @@ import com.titi.app.core.ui.setBrightness
import com.titi.app.core.util.fromJson
import com.titi.app.feature.measure.model.MeasuringUiState
import com.titi.app.feature.measure.model.SplashResultState
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
import org.threeten.bp.ZoneOffset
import org.threeten.bp.ZonedDateTime
@@ -172,8 +172,8 @@ fun MeasuringScreen(splashResultState: String, onFinish: (isFinish: Boolean) ->
}
if (showSetExactAlarmPermissionDialog) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(id = R.string.measure_popup_permissiontitle),
message = stringResource(id = R.string.measure_popup_permissiondesc),
positiveText = stringResource(id = R.string.common_text_ok),
@@ -191,7 +191,6 @@ fun MeasuringScreen(splashResultState: String, onFinish: (isFinish: Boolean) ->
},
),
onShowDialog = { showSetExactAlarmPermissionDialog = it },
- bodyContent = {},
)
}
diff --git a/feature/popup/src/main/kotlin/com/titi/app/feature/popup/PopUpActivity.kt b/feature/popup/src/main/kotlin/com/titi/app/feature/popup/PopUpActivity.kt
index 4699a654..1b3f2002 100644
--- a/feature/popup/src/main/kotlin/com/titi/app/feature/popup/PopUpActivity.kt
+++ b/feature/popup/src/main/kotlin/com/titi/app/feature/popup/PopUpActivity.kt
@@ -5,6 +5,7 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.titi.app.core.designsystem.theme.TiTiTheme
import com.titi.app.feature.color.ui.ColorScreen
+import com.titi.app.tds.theme.TtdsTheme
class PopUpActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@@ -14,10 +15,12 @@ class PopUpActivity : ComponentActivity() {
setContent {
TiTiTheme {
- ColorScreen(
- recordingMode = recordingMode,
- onFinish = { finish() },
- )
+ TtdsTheme {
+ ColorScreen(
+ recordingMode = recordingMode,
+ onFinish = { finish() },
+ )
+ }
}
}
}
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 fadba0c2..22e0dda3 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
@@ -1,6 +1,7 @@
package com.titi.app.feature.time.component
import androidx.compose.foundation.background
+import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -26,10 +27,10 @@ import com.skydoves.balloon.compose.Balloon
import com.skydoves.balloon.compose.rememberBalloonBuilder
import com.skydoves.balloon.compose.setBackgroundColor
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsText
-import com.titi.app.core.designsystem.theme.TdsColor
-import com.titi.app.core.designsystem.theme.TdsTextStyle
import com.titi.app.core.designsystem.theme.TiTiTheme
+import com.titi.app.tds.component.TtdsText
+import com.titi.app.tds.theme.TtdsColor
+import com.titi.app.tds.theme.TtdsTextStyle
@Composable
fun ColorSelectComponent(
@@ -53,20 +54,25 @@ fun ColorSelectComponent(
Row {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
- TdsText(
+ TtdsText(
isNoLocale = false,
text = stringResource(R.string.recordingcolorselector_text_backgroundcolor),
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
+ textStyle = TtdsTextStyle.SEMI_BOLD_TEXT_STYLE,
fontSize = 14.sp,
- color = TdsColor.TEXT,
+ color = TtdsColor.TEXT_MAIN,
)
Spacer(modifier = Modifier.height(8.dp))
Box(
modifier = Modifier
- .size(32.dp)
- .clip(RoundedCornerShape(4.dp))
+ .size(40.dp)
+ .border(
+ width = 1.dp,
+ color = TtdsColor.STROKE2.getColor(),
+ shape = RoundedCornerShape(8.dp),
+ )
+ .clip(RoundedCornerShape(8.dp))
.background(color = backgroundColor)
.clickable { onClickBackgroundColor() },
)
@@ -103,20 +109,25 @@ fun ColorSelectComponent(
},
) { balloonWindow ->
Column(horizontalAlignment = Alignment.CenterHorizontally) {
- TdsText(
+ TtdsText(
isNoLocale = false,
text = stringResource(R.string.recordingcolorselector_text_textcolor),
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
+ textStyle = TtdsTextStyle.SEMI_BOLD_TEXT_STYLE,
fontSize = 14.sp,
- color = TdsColor.TEXT,
+ color = TtdsColor.TEXT_MAIN,
)
Spacer(modifier = Modifier.height(8.dp))
Box(
modifier = Modifier
- .size(32.dp)
- .clip(RoundedCornerShape(4.dp))
+ .size(40.dp)
+ .border(
+ width = 1.dp,
+ color = TtdsColor.STROKE2.getColor(),
+ shape = RoundedCornerShape(8.dp),
+ )
+ .clip(RoundedCornerShape(8.dp))
.background(color = textColor)
.clickable { balloonWindow.showAlignBottom() },
)
diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeCheckTaskDialog.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeCheckTaskDialog.kt
index 691733ca..1c23817f 100644
--- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeCheckTaskDialog.kt
+++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeCheckTaskDialog.kt
@@ -1,24 +1,18 @@
package com.titi.app.feature.time.component
-import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.unit.dp
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.model.TdsDialogInfo
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
@Composable
fun TimeCheckTaskDialog(onShowDialog: (Boolean) -> Unit) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Alert(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Alert(
title = stringResource(id = R.string.task_popup_checktitle),
confirmText = stringResource(id = R.string.common_text_ok),
),
onShowDialog = onShowDialog,
- ) {
- Spacer(modifier = Modifier.height(5.dp))
- }
+ )
}
diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeColorDialog.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeColorDialog.kt
index 97a4fd0e..b67552ff 100644
--- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeColorDialog.kt
+++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeColorDialog.kt
@@ -1,15 +1,11 @@
package com.titi.app.feature.time.component
-import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.unit.dp
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.model.TdsDialogInfo
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
@Composable
fun TimeColorDialog(
@@ -20,8 +16,8 @@ fun TimeColorDialog(
onClickBackgroundColor: () -> Unit,
onClickTextColor: (Boolean) -> Unit,
) {
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(id = R.string.recordingcolorselector_text_customcolor),
positiveText = stringResource(id = R.string.common_text_ok),
negativeText = stringResource(id = R.string.common_text_cancel),
@@ -40,6 +36,5 @@ fun TimeColorDialog(
},
onClickTextColor = onClickTextColor,
)
- Spacer(Modifier.height(16.dp))
}
}
diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeGoalTimeEditDialog.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeGoalTimeEditDialog.kt
index ec8e3b25..1d291b09 100644
--- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeGoalTimeEditDialog.kt
+++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeGoalTimeEditDialog.kt
@@ -10,11 +10,11 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.component.TdsInputTimeTextField
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.model.TdsTime
import com.titi.app.core.util.getTimeToLong
+import com.titi.app.tds.component.TtdsInputTimeTextField
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
@Composable
fun TimeGoalTimeEditDialog(
@@ -27,8 +27,8 @@ fun TimeGoalTimeEditDialog(
var minutes by remember { mutableStateOf(currentTime.minutes.toString()) }
var seconds by remember { mutableStateOf(currentTime.seconds.toString()) }
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(R.string.modify_text_targettime),
message = stringResource(R.string.modify_text_targettimedesc, todayDate),
positiveText = stringResource(id = R.string.common_text_ok),
@@ -39,7 +39,7 @@ fun TimeGoalTimeEditDialog(
),
onShowDialog = onShowDialog,
) {
- TdsInputTimeTextField(
+ TtdsInputTimeTextField(
modifier = Modifier.padding(horizontal = 15.dp),
hour = hour,
onHourChange = { hour = it },
diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTimerDialog.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTimerDialog.kt
index 328e976f..f96fed10 100644
--- a/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTimerDialog.kt
+++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/component/TimeTimerDialog.kt
@@ -11,11 +11,11 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.component.TdsInputTimeTextField
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.util.addTimeToNow
import com.titi.app.core.util.getTimeToLong
+import com.titi.app.tds.component.TtdsInputTimeTextField
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
@Composable
fun TimeTimerDialog(onPositive: (Long) -> Unit, onShowDialog: (Boolean) -> Unit) {
@@ -24,8 +24,8 @@ fun TimeTimerDialog(onPositive: (Long) -> Unit, onShowDialog: (Boolean) -> Unit)
var seconds by remember { mutableStateOf("") }
var setTimerTime by remember { mutableLongStateOf(0) }
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(R.string.timer_text_settimertimetitle),
message = stringResource(
R.string.timer_popup_finishtime,
@@ -39,7 +39,7 @@ fun TimeTimerDialog(onPositive: (Long) -> Unit, onShowDialog: (Boolean) -> Unit)
),
onShowDialog = onShowDialog,
) {
- TdsInputTimeTextField(
+ TtdsInputTimeTextField(
modifier = Modifier.padding(horizontal = 15.dp),
hour = hour,
onHourChange = {
diff --git a/feature/time/src/main/kotlin/com/titi/app/feature/time/ui/task/TaskBottomSheet.kt b/feature/time/src/main/kotlin/com/titi/app/feature/time/ui/task/TaskBottomSheet.kt
index 316013d3..a5218b09 100644
--- a/feature/time/src/main/kotlin/com/titi/app/feature/time/ui/task/TaskBottomSheet.kt
+++ b/feature/time/src/main/kotlin/com/titi/app/feature/time/ui/task/TaskBottomSheet.kt
@@ -4,11 +4,10 @@ import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
@@ -35,15 +34,10 @@ import androidx.compose.ui.unit.sp
import com.airbnb.mvrx.compose.collectAsState
import com.airbnb.mvrx.compose.mavericksViewModel
import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
import com.titi.app.core.designsystem.component.TdsIconButton
-import com.titi.app.core.designsystem.component.TdsInputTimeTextField
import com.titi.app.core.designsystem.component.TdsTaskListItem
import com.titi.app.core.designsystem.component.TdsText
import com.titi.app.core.designsystem.component.TdsTextButton
-import com.titi.app.core.designsystem.component.dialog.AddTaskNameDialog
-import com.titi.app.core.designsystem.component.dialog.EditTaskNameDialog
-import com.titi.app.core.designsystem.model.TdsDialogInfo
import com.titi.app.core.designsystem.model.TdsTask
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle
@@ -54,6 +48,11 @@ import com.titi.app.core.designsystem.util.rememberDragDropState
import com.titi.app.core.util.getTimeToLong
import com.titi.app.domain.task.model.Task
import com.titi.app.feature.time.model.TaskUiState
+import com.titi.app.tds.component.TtdsInputTimeTextField
+import com.titi.app.tds.component.dialog.AddTaskNameDialog
+import com.titi.app.tds.component.dialog.EditTaskNameDialog
+import com.titi.app.tds.component.dialog.TtdsDialog
+import com.titi.app.tds.model.TtdsDialogInfo
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -81,9 +80,9 @@ fun TaskBottomSheet(
val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
ModalBottomSheet(
modifier = Modifier
- .fillMaxHeight(0.9f)
.fillMaxWidth()
- .navigationBarsPadding(),
+ .statusBarsPadding()
+ .padding(top = 30.dp),
onDismissRequest = onCloseBottomSheet,
sheetState = bottomSheetState,
shape = RoundedCornerShape(topStart = 8.dp, topEnd = 8.dp),
@@ -166,8 +165,8 @@ fun TaskBottomSheet(
minutes = ""
seconds = ""
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = editTask.taskName,
message = stringResource(id = R.string.tasks_popup_settasktargettime),
positiveText = stringResource(id = R.string.common_text_ok),
@@ -183,7 +182,7 @@ fun TaskBottomSheet(
showTaskTargetTimeDialog = it
},
) {
- TdsInputTimeTextField(
+ TtdsInputTimeTextField(
modifier = Modifier.padding(horizontal = 15.dp),
hour = hour,
onHourChange = { hour = it },
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index f7604055..a30a10d4 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -6,24 +6,24 @@ minSdk = "26"
agp = "8.3.2"
kotlin = "1.9.21"
coreKtx = "1.13.1"
-coroutine = "1.7.3"
+coroutine = "1.9.0-RC"
appcompat = "1.7.0"
-compose = "1.9.0"
-composeBom = "2024.06.00"
-composeRuntime = "1.6.8"
-composeNavigation = "2.7.7"
+compose = "1.9.2"
+composeBom = "2024.09.02"
+composeRuntime = "1.7.2"
+composeNavigation = "2.8.1"
androidxHiltNavigationCompose = "1.2.0"
androidxComposeCompiler = "1.5.7"
material = "1.12.0"
-material3 = "1.2.1"
+material3 = "1.3.0"
-lifecycleRuntimeCompose = "2.7.0"
-lifecycleViewmodelCompose = "2.7.0"
+lifecycleRuntimeCompose = "2.8.6"
+lifecycleViewmodelCompose = "2.8.6"
window = "1.3.0"
balloon = "1.6.4"
-monitor = "1.7.1"
+monitor = "1.7.2"
colorPicker = "1.0.5"
splashScreen = "1.1.0-rc01"
@@ -40,15 +40,15 @@ junit = "4.13.2"
androidxTestExtJunit = "1.2.1"
espresso-core = "3.6.1"
junitKtx = "1.2.1"
-material3WindowSize = "1.2.1"
+material3WindowSize = "1.3.0"
googlePlayServices = "4.4.2"
firebaseCrashlyticsPlugin = "3.0.2"
-firebaseBom = "33.1.1"
+firebaseBom = "33.3.0"
ktlint = "12.1.0"
-calendar = "2.5.0-beta01"
+calendar = "2.6.0"
lottie = "6.4.1"
[libraries]
diff --git a/release-note.txt b/release-note.txt
index a2f12fb2..08a36ca6 100644
--- a/release-note.txt
+++ b/release-note.txt
@@ -1,2 +1,3 @@
-TiTi android 1.4.2
-- fix alpha over 1f
\ No newline at end of file
+TiTi android 1.4.3
+- update dialog
+- fix task special character
\ No newline at end of file
diff --git a/tds/src/main/kotlin/com/titi/app/tds/component/TdsIcon.kt b/tds/src/main/kotlin/com/titi/app/tds/component/TdsIcon.kt
deleted file mode 100644
index 42502f0b..00000000
--- a/tds/src/main/kotlin/com/titi/app/tds/component/TdsIcon.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.titi.app.tds.component
-
-import androidx.annotation.DrawableRes
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.size
-import androidx.compose.material3.Icon
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.unit.dp
-import com.titi.app.tds.theme.TtdsColor
-
-@Composable
-fun TtdsSmallIcon(
- modifier: Modifier = Modifier,
- tint: TtdsColor = TtdsColor.PRIMARY,
- @DrawableRes icon: Int,
-) {
- Icon(
- modifier = Modifier
- .size(22.dp)
- .padding(4.dp)
- .then(modifier),
- painter = painterResource(id = icon),
- tint = tint.getColor(),
- contentDescription = null,
- )
-}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/component/TtdsButton.kt b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsButton.kt
new file mode 100644
index 00000000..63164848
--- /dev/null
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsButton.kt
@@ -0,0 +1,59 @@
+package com.titi.app.tds.component
+
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.material3.Button
+import androidx.compose.material3.ButtonDefaults
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.tooling.preview.Preview
+import com.titi.app.tds.model.TtdsButtonInfo
+import com.titi.app.tds.theme.TtdsColor
+import com.titi.app.tds.theme.TtdsTextStyle
+import com.titi.app.tds.theme.TtdsTheme
+
+@Composable
+fun TtdsTextButton(
+ modifier: Modifier = Modifier,
+ text: String,
+ buttonColor: TtdsColor,
+ textColor: TtdsColor,
+ buttonInfo: TtdsButtonInfo,
+ enabled: Boolean = true,
+ onClick: () -> Unit,
+) {
+ Button(
+ modifier = modifier.clip(buttonInfo.shape),
+ onClick = onClick,
+ enabled = enabled,
+ shape = buttonInfo.shape,
+ colors = ButtonDefaults.buttonColors(
+ containerColor = buttonColor.getColor(),
+ disabledContainerColor = buttonColor.getColor(),
+ ),
+ contentPadding = buttonInfo.paddingValues,
+ ) {
+ TtdsText(
+ isNoLocale = false,
+ text = text,
+ textStyle = TtdsTextStyle.SEMI_BOLD_TEXT_STYLE,
+ fontSize = buttonInfo.fontSize,
+ color = textColor,
+ )
+ }
+}
+
+@Preview
+@Composable
+private fun TtdsTextButtonPreview() {
+ TtdsTheme {
+ TtdsTextButton(
+ modifier = Modifier.fillMaxWidth(),
+ text = "확인",
+ buttonColor = TtdsColor.PRIMARY,
+ textColor = TtdsColor.TEXT_ACTIVE,
+ buttonInfo = TtdsButtonInfo.Small(),
+ onClick = {},
+ )
+ }
+}
diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTimeTextField.kt b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsInputTimeTextField.kt
similarity index 72%
rename from core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTimeTextField.kt
rename to tds/src/main/kotlin/com/titi/app/tds/component/TtdsInputTimeTextField.kt
index 2554d93c..e93272ea 100644
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/TdsInputTimeTextField.kt
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsInputTimeTextField.kt
@@ -1,7 +1,8 @@
-package com.titi.app.core.designsystem.component
+package com.titi.app.tds.component
+import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.text.KeyboardActions
@@ -9,7 +10,6 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
-import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusDirection
import androidx.compose.ui.focus.FocusRequester
@@ -21,18 +21,18 @@ import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
+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.sp
import androidx.core.text.isDigitsOnly
-import com.titi.app.core.designsystem.theme.TdsColor
-import com.titi.app.core.designsystem.theme.TdsTextStyle
-import com.titi.app.core.designsystem.theme.TiTiTheme
+import com.titi.app.tds.theme.TtdsColor
+import com.titi.app.tds.theme.TtdsTextStyle
+import com.titi.app.tds.theme.TtdsTheme
import kotlinx.coroutines.android.awaitFrame
-@OptIn(ExperimentalComposeUiApi::class)
@Composable
-fun TdsInputTimeTextField(
+fun TtdsInputTimeTextField(
modifier: Modifier = Modifier,
hour: String,
onHourChange: (String) -> Unit,
@@ -54,14 +54,15 @@ fun TdsInputTimeTextField(
Row(
modifier = modifier,
verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.Center,
) {
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
- .height(40.dp)
- .weight(1f)
+ .width(65.dp)
.focusRequester(hourFocus)
.focusProperties { next = minutesFocus },
text = TextFieldValue(hour, selection = TextRange(hour.length)),
+ textAlign = TextAlign.Center,
onValueChange = {
if (it.text.isDigitsOnly()) {
if (it.text.isBlank()) {
@@ -73,7 +74,6 @@ fun TdsInputTimeTextField(
}
}
},
- fontSize = 22.sp,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Decimal,
imeAction = ImeAction.Done,
@@ -83,34 +83,28 @@ fun TdsInputTimeTextField(
focusManger.moveFocus(FocusDirection.Next)
},
),
- placeHolder = {
- TdsText(
- text = "H",
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 22.sp,
- color = TdsColor.DIVIDER,
- )
- },
+ fontSize = 20.sp,
+ placeholder = "H",
)
- TdsText(
+ TtdsText(
modifier = Modifier.padding(horizontal = 3.dp),
text = ":",
- color = TdsColor.TEXT,
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
+ color = TtdsColor.TEXT_MAIN,
+ textStyle = TtdsTextStyle.SEMI_BOLD_TEXT_STYLE,
fontSize = 22.sp,
)
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
- .height(40.dp)
- .weight(1f)
+ .width(65.dp)
.focusRequester(minutesFocus)
.focusProperties {
previous = hourFocus
next = secondsFocus
},
text = TextFieldValue(minutes, selection = TextRange(minutes.length)),
+ textAlign = TextAlign.Center,
onValueChange = {
if (it.text.isDigitsOnly()) {
if (it.text.isBlank()) {
@@ -122,7 +116,6 @@ fun TdsInputTimeTextField(
}
}
},
- fontSize = 22.sp,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Decimal,
imeAction = ImeAction.Done,
@@ -132,31 +125,25 @@ fun TdsInputTimeTextField(
focusManger.moveFocus(FocusDirection.Next)
},
),
- placeHolder = {
- TdsText(
- text = "M",
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 22.sp,
- color = TdsColor.DIVIDER,
- )
- },
+ fontSize = 20.sp,
+ placeholder = "M",
)
- TdsText(
+ TtdsText(
modifier = Modifier.padding(horizontal = 3.dp),
text = ":",
- color = TdsColor.TEXT,
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
+ color = TtdsColor.TEXT_MAIN,
+ textStyle = TtdsTextStyle.SEMI_BOLD_TEXT_STYLE,
fontSize = 22.sp,
)
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
- .height(40.dp)
- .weight(1f)
+ .width(65.dp)
.focusRequester(secondsFocus)
.focusProperties { previous = minutesFocus },
text = TextFieldValue(seconds, selection = TextRange(seconds.length)),
+ textAlign = TextAlign.Center,
onValueChange = {
if (it.text.isDigitsOnly()) {
if (it.text.isBlank()) {
@@ -168,7 +155,6 @@ fun TdsInputTimeTextField(
}
}
},
- fontSize = 22.sp,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Decimal,
imeAction = ImeAction.Done,
@@ -178,25 +164,19 @@ fun TdsInputTimeTextField(
focusManger.clearFocus()
},
),
- placeHolder = {
- TdsText(
- text = "S",
- textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
- fontSize = 22.sp,
- color = TdsColor.DIVIDER,
- )
- },
+ placeholder = "S",
+ fontSize = 20.sp,
)
}
}
@Preview
@Composable
-private fun TdsInputTimeTextFieldPreview() {
- TiTiTheme {
- TdsInputTimeTextField(
- modifier = Modifier.width(150.dp),
- hour = "23",
+private fun TtdsInputTimeTextFieldPreview() {
+ TtdsTheme {
+ TtdsInputTimeTextField(
+ modifier = Modifier.fillMaxWidth(),
+ hour = "",
onHourChange = {},
minutes = "55",
onMinutesChange = {},
diff --git a/tds/src/main/kotlin/com/titi/app/tds/component/TtdsText.kt b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsText.kt
index 9a817907..2beb3b16 100644
--- a/tds/src/main/kotlin/com/titi/app/tds/component/TtdsText.kt
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsText.kt
@@ -4,6 +4,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.AnnotatedString
+import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextOverflow
@@ -14,26 +15,31 @@ import com.titi.app.tds.theme.TtdsTextStyle
@Composable
fun TtdsText(
modifier: Modifier = Modifier,
+ isNoLocale: Boolean = true,
text: String,
textStyle: TtdsTextStyle,
fontSize: TextUnit,
- color: TtdsColor,
textDecoration: TextDecoration? = null,
+ color: TtdsColor,
textAlign: TextAlign? = null,
overflow: TextOverflow = TextOverflow.Clip,
maxLines: Int = Int.MAX_VALUE,
minLines: Int = 1,
+ onTextLayout: (TextLayoutResult) -> Unit = {},
) {
Text(
- modifier = modifier,
text = text,
+ modifier = modifier,
color = color.getColor(),
- style = textStyle.getTextStyle(),
- fontSize = fontSize,
textAlign = textAlign,
overflow = overflow,
maxLines = maxLines,
minLines = minLines,
+ onTextLayout = onTextLayout,
+ style = textStyle.getTextStyle(
+ isNoLocale = isNoLocale,
+ fontSize = fontSize,
+ ),
textDecoration = textDecoration,
)
}
@@ -41,26 +47,31 @@ fun TtdsText(
@Composable
fun TtdsText(
modifier: Modifier = Modifier,
+ isNoLocale: Boolean = true,
text: AnnotatedString,
textStyle: TtdsTextStyle,
fontSize: TextUnit,
- color: TtdsColor,
textDecoration: TextDecoration? = null,
+ color: TtdsColor,
textAlign: TextAlign? = null,
overflow: TextOverflow = TextOverflow.Clip,
maxLines: Int = Int.MAX_VALUE,
minLines: Int = 1,
+ onTextLayout: (TextLayoutResult) -> Unit = {},
) {
Text(
- modifier = modifier,
text = text,
+ modifier = modifier,
color = color.getColor(),
- style = textStyle.getTextStyle(),
- fontSize = fontSize,
textAlign = textAlign,
overflow = overflow,
maxLines = maxLines,
minLines = minLines,
+ onTextLayout = onTextLayout,
+ style = textStyle.getTextStyle(
+ isNoLocale = isNoLocale,
+ fontSize = fontSize,
+ ),
textDecoration = textDecoration,
)
}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/component/TtdsTextField.kt b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsTextField.kt
new file mode 100644
index 00000000..3d0979f6
--- /dev/null
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/TtdsTextField.kt
@@ -0,0 +1,230 @@
+package com.titi.app.tds.component
+
+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.fillMaxWidth
+import androidx.compose.foundation.layout.heightIn
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.foundation.text.BasicTextField
+import androidx.compose.foundation.text.KeyboardActions
+import androidx.compose.foundation.text.KeyboardOptions
+import androidx.compose.foundation.text.input.KeyboardActionHandler
+import androidx.compose.foundation.text.input.TextFieldState
+import androidx.compose.foundation.text.input.clearText
+import androidx.compose.material3.Icon
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.input.TextFieldValue
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.TextUnit
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import com.titi.app.tds.R
+import com.titi.app.tds.theme.TtdsColor
+import com.titi.app.tds.theme.TtdsTextStyle
+import com.titi.app.tds.theme.TtdsTheme
+
+@Composable
+fun TtdsOutLinedTextField(
+ modifier: Modifier = Modifier,
+ state: TextFieldState,
+ placeholder: String,
+ keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
+ onKeyboardAction: KeyboardActionHandler? = null,
+) {
+ Row(
+ modifier = modifier
+ .heightIn(min = 42.dp)
+ .border(
+ width = 1.dp,
+ color = TtdsColor.STROKE.getColor(),
+ shape = RoundedCornerShape(6.dp),
+ )
+ .clip(RoundedCornerShape(6.dp))
+ .background(TtdsColor.BACKGROUND_TXT_FIELD.getColor())
+ .padding(10.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ Box(modifier = Modifier.weight(1f, true)) {
+ BasicTextField(
+ modifier = Modifier.fillMaxWidth(),
+ state = state,
+ textStyle = TtdsTextStyle.NORMAL_TEXT_STYLE
+ .getTextStyle(14.sp)
+ .copy(TtdsColor.TEXT_MAIN.getColor()),
+ keyboardOptions = keyboardOptions,
+ onKeyboardAction = onKeyboardAction,
+ )
+
+ if (state.text.isBlank()) {
+ TtdsText(
+ modifier = Modifier.fillMaxWidth(),
+ text = placeholder,
+ textStyle = TtdsTextStyle.NORMAL_TEXT_STYLE,
+ fontSize = 14.sp,
+ color = TtdsColor.TEXT_MUTED,
+ )
+ }
+ }
+
+ if (state.text.isNotBlank()) {
+ Icon(
+ modifier = Modifier.clickable { state.clearText() },
+ painter = painterResource(R.drawable.icon_cancel),
+ tint = TtdsColor.BTN_CANCEL.getColor(),
+ contentDescription = null,
+ )
+ }
+ }
+}
+
+@Composable
+fun TtdsOutLinedTextField(
+ modifier: Modifier = Modifier,
+ fontSize: TextUnit = 14.sp,
+ text: String,
+ placeholder: String,
+ keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
+ keyboardActions: KeyboardActions = KeyboardActions.Default,
+ textAlign: TextAlign = TextAlign.Start,
+ onValueChange: (String) -> Unit,
+ onClearText: (() -> Unit)? = null,
+) {
+ Row(
+ modifier = modifier
+ .heightIn(min = 42.dp)
+ .border(
+ width = 1.dp,
+ color = TtdsColor.STROKE.getColor(),
+ shape = RoundedCornerShape(6.dp),
+ )
+ .clip(RoundedCornerShape(6.dp))
+ .background(TtdsColor.BACKGROUND_TXT_FIELD.getColor())
+ .padding(10.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.Center,
+ ) {
+ Box(modifier = Modifier.weight(1f, true)) {
+ BasicTextField(
+ modifier = Modifier.fillMaxWidth(),
+ value = text,
+ textStyle = TtdsTextStyle.NORMAL_TEXT_STYLE
+ .getTextStyle(fontSize)
+ .copy(
+ color = TtdsColor.TEXT_MAIN.getColor(),
+ textAlign = textAlign,
+ ),
+ keyboardOptions = keyboardOptions,
+ keyboardActions = keyboardActions,
+ onValueChange = onValueChange,
+ )
+
+ if (text.isBlank()) {
+ TtdsText(
+ modifier = Modifier.fillMaxWidth(),
+ text = placeholder,
+ textStyle = TtdsTextStyle.NORMAL_TEXT_STYLE,
+ fontSize = fontSize,
+ color = TtdsColor.TEXT_MUTED,
+ textAlign = textAlign,
+ )
+ }
+ }
+
+ if (text.isNotBlank() && onClearText != null) {
+ Icon(
+ modifier = Modifier.clickable { onClearText() },
+ painter = painterResource(R.drawable.icon_cancel),
+ tint = TtdsColor.BTN_CANCEL.getColor(),
+ contentDescription = null,
+ )
+ }
+ }
+}
+
+@Composable
+fun TtdsOutLinedTextField(
+ modifier: Modifier = Modifier,
+ fontSize: TextUnit = 14.sp,
+ text: TextFieldValue,
+ placeholder: String,
+ keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
+ keyboardActions: KeyboardActions = KeyboardActions.Default,
+ textAlign: TextAlign = TextAlign.Start,
+ onValueChange: (TextFieldValue) -> Unit,
+ onClearText: (() -> Unit)? = null,
+) {
+ Row(
+ modifier = modifier
+ .heightIn(min = 42.dp)
+ .border(
+ width = 1.dp,
+ color = TtdsColor.STROKE.getColor(),
+ shape = RoundedCornerShape(6.dp),
+ )
+ .clip(RoundedCornerShape(6.dp))
+ .background(TtdsColor.BACKGROUND_TXT_FIELD.getColor())
+ .padding(10.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.Center,
+ ) {
+ Box(modifier = Modifier.weight(1f, true)) {
+ BasicTextField(
+ modifier = Modifier.fillMaxWidth(),
+ value = text,
+ textStyle = TtdsTextStyle.NORMAL_TEXT_STYLE
+ .getTextStyle(fontSize)
+ .copy(
+ color = TtdsColor.TEXT_MAIN.getColor(),
+ textAlign = textAlign,
+ ),
+ keyboardOptions = keyboardOptions,
+ keyboardActions = keyboardActions,
+ onValueChange = onValueChange,
+ )
+
+ if (text.text.isBlank()) {
+ TtdsText(
+ modifier = Modifier.fillMaxWidth(),
+ text = placeholder,
+ textStyle = TtdsTextStyle.NORMAL_TEXT_STYLE,
+ fontSize = fontSize,
+ color = TtdsColor.TEXT_MUTED,
+ textAlign = textAlign,
+ )
+ }
+ }
+
+ if (text.text.isNotBlank() && onClearText != null) {
+ Icon(
+ modifier = Modifier.clickable { onClearText() },
+ painter = painterResource(R.drawable.icon_cancel),
+ tint = TtdsColor.BTN_CANCEL.getColor(),
+ contentDescription = null,
+ )
+ }
+ }
+}
+
+@Preview
+@Composable
+private fun TtdsOutLinedTextFieldPreview() {
+ TtdsTheme {
+ TtdsOutLinedTextField(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(10.dp),
+ state = TextFieldState(),
+ placeholder = "placeholder",
+ )
+ }
+}
diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt b/tds/src/main/kotlin/com/titi/app/tds/component/dialog/AddTaskNameDialog.kt
similarity index 65%
rename from core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt
rename to tds/src/main/kotlin/com/titi/app/tds/component/dialog/AddTaskNameDialog.kt
index 78216f20..f4bc14c1 100644
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/AddTaskNameDialog.kt
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/dialog/AddTaskNameDialog.kt
@@ -1,7 +1,6 @@
-package com.titi.app.core.designsystem.component.dialog
+package com.titi.app.tds.component.dialog
import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -15,22 +14,17 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.component.TdsOutlinedInputTextField
-import com.titi.app.core.designsystem.component.TdsText
-import com.titi.app.core.designsystem.model.TdsDialogInfo
-import com.titi.app.core.designsystem.theme.TdsColor
-import com.titi.app.core.designsystem.theme.TdsTextStyle
+import com.titi.app.tds.R
+import com.titi.app.tds.component.TtdsOutLinedTextField
+import com.titi.app.tds.model.TtdsDialogInfo
import kotlinx.coroutines.android.awaitFrame
@Composable
fun AddTaskNameDialog(onPositive: (String) -> Unit, onShowDialog: (Boolean) -> Unit) {
var taskName by remember { mutableStateOf("") }
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(id = R.string.tasks_hint_newtasktitle),
message = stringResource(id = R.string.tasks_popup_newtaskdesc),
cancelable = false,
@@ -51,28 +45,21 @@ fun AddTaskNameDialog(onPositive: (String) -> Unit, onShowDialog: (Boolean) -> U
keyboard?.show()
}
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
.fillMaxWidth()
- .height(26.dp)
.padding(horizontal = 15.dp)
.focusRequester(addTaskFocusRequester),
- fontSize = 17.sp,
text = taskName,
- placeHolder = {
- TdsText(
- isNoLocale = false,
- text = stringResource(id = R.string.tasks_hint_newtasktitle),
- textStyle = TdsTextStyle.NORMAL_TEXT_STYLE,
- fontSize = 17.sp,
- color = TdsColor.DIVIDER,
- )
- },
+ placeholder = stringResource(id = R.string.tasks_hint_newtasktitle),
onValueChange = {
if (it.length <= 12) {
taskName = it
}
},
+ onClearText = {
+ taskName = ""
+ },
)
}
}
diff --git a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/EditTaskNameDialog.kt b/tds/src/main/kotlin/com/titi/app/tds/component/dialog/EditTaskNameDialog.kt
similarity index 77%
rename from core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/EditTaskNameDialog.kt
rename to tds/src/main/kotlin/com/titi/app/tds/component/dialog/EditTaskNameDialog.kt
index b6b1dfba..850663b2 100644
--- a/core/designsystem/src/main/kotlin/com/titi/app/core/designsystem/component/dialog/EditTaskNameDialog.kt
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/dialog/EditTaskNameDialog.kt
@@ -1,7 +1,6 @@
-package com.titi.app.core.designsystem.component.dialog
+package com.titi.app.tds.component.dialog
import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@@ -16,11 +15,9 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-import com.titi.app.core.designsystem.R
-import com.titi.app.core.designsystem.component.TdsDialog
-import com.titi.app.core.designsystem.component.TdsOutlinedInputTextField
-import com.titi.app.core.designsystem.model.TdsDialogInfo
+import com.titi.app.tds.R
+import com.titi.app.tds.component.TtdsOutLinedTextField
+import com.titi.app.tds.model.TtdsDialogInfo
import kotlinx.coroutines.android.awaitFrame
@Composable
@@ -41,8 +38,8 @@ fun EditTaskNameDialog(
keyboard?.show()
}
- TdsDialog(
- tdsDialogInfo = TdsDialogInfo.Confirm(
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
title = stringResource(id = R.string.tasks_popup_edittaskname),
message = stringResource(id = R.string.tasks_popup_newtaskdesc),
positiveText = stringResource(id = R.string.common_text_ok),
@@ -53,17 +50,21 @@ fun EditTaskNameDialog(
),
onShowDialog = onShowDialog,
) {
- TdsOutlinedInputTextField(
+ TtdsOutLinedTextField(
modifier = Modifier
.fillMaxWidth()
- .height(26.dp)
.padding(horizontal = 15.dp)
.focusRequester(modifyTaskNameFocusRequester),
- fontSize = 17.sp,
text = editTaskName,
onValueChange = {
- editTaskName = it
+ if (it.text.length <= 12) {
+ editTaskName = it
+ }
},
+ onClearText = {
+ editTaskName = TextFieldValue()
+ },
+ placeholder = "",
)
}
}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/component/dialog/TtdsDialog.kt b/tds/src/main/kotlin/com/titi/app/tds/component/dialog/TtdsDialog.kt
new file mode 100644
index 00000000..e79ee6e8
--- /dev/null
+++ b/tds/src/main/kotlin/com/titi/app/tds/component/dialog/TtdsDialog.kt
@@ -0,0 +1,192 @@
+package com.titi.app.tds.component.dialog
+
+import androidx.compose.foundation.layout.Column
+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.wrapContentHeight
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.Surface
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+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.sp
+import androidx.compose.ui.window.Dialog
+import androidx.compose.ui.window.DialogProperties
+import com.titi.app.tds.component.TtdsText
+import com.titi.app.tds.component.TtdsTextButton
+import com.titi.app.tds.model.TtdsButtonInfo
+import com.titi.app.tds.model.TtdsDialogInfo
+import com.titi.app.tds.theme.TtdsColor
+import com.titi.app.tds.theme.TtdsTextStyle
+import com.titi.app.tds.theme.TtdsTheme
+
+@Composable
+fun TtdsDialog(
+ modifier: Modifier = Modifier,
+ ttdsDialogInfo: TtdsDialogInfo,
+ onShowDialog: (Boolean) -> Unit,
+ bodyContent: (@Composable () -> Unit)? = null,
+) {
+ Dialog(
+ onDismissRequest = {
+ ttdsDialogInfo.onDismiss?.invoke()
+ onShowDialog(false)
+ },
+ properties = DialogProperties(
+ dismissOnBackPress = ttdsDialogInfo.cancelable,
+ dismissOnClickOutside = ttdsDialogInfo.cancelable,
+ ),
+ ) {
+ Surface(
+ modifier = modifier
+ .fillMaxWidth()
+ .wrapContentHeight(),
+ shape = RoundedCornerShape(20.dp),
+ color = TtdsColor.BACKGROUND_MAIN.getColor(),
+ ) {
+ Column(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(20.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ ) {
+ TtdsText(
+ isNoLocale = false,
+ text = ttdsDialogInfo.title,
+ textStyle = TtdsTextStyle.BOLD_TEXT_STYLE,
+ fontSize = 20.sp,
+ color = TtdsColor.TEXT_MAIN,
+ textAlign = TextAlign.Center,
+ )
+
+ ttdsDialogInfo.message?.let { message ->
+ TtdsText(
+ isNoLocale = false,
+ text = message,
+ textStyle = TtdsTextStyle.MEDIUM_TEXT_STYLE,
+ fontSize = 15.sp,
+ color = TtdsColor.TEXT_MAIN,
+ textAlign = TextAlign.Center,
+ )
+ }
+
+ if (bodyContent != null) {
+ Spacer(modifier = Modifier.height(14.dp))
+
+ bodyContent()
+ }
+
+ Spacer(modifier = Modifier.height(24.dp))
+
+ when (ttdsDialogInfo) {
+ is TtdsDialogInfo.Confirm -> {
+ TtdsConfirmDialogButtons(
+ ttdsDialogInfo = ttdsDialogInfo,
+ onShowDialog = onShowDialog,
+ )
+ }
+
+ is TtdsDialogInfo.Alert -> {
+ TtdsAlertDialogButton(
+ ttdsDialogInfo = ttdsDialogInfo,
+ onShowDialog = onShowDialog,
+ )
+ }
+ }
+ }
+ }
+ }
+}
+
+@Composable
+private fun TtdsConfirmDialogButtons(
+ ttdsDialogInfo: TtdsDialogInfo.Confirm,
+ onShowDialog: (Boolean) -> Unit,
+) {
+ Row(modifier = Modifier.fillMaxWidth()) {
+ TtdsTextButton(
+ modifier = Modifier.weight(1f),
+ text = ttdsDialogInfo.negativeText,
+ buttonColor = TtdsColor.BTN_MUTED,
+ textColor = TtdsColor.TEXT_BTN,
+ buttonInfo = TtdsButtonInfo.Small(),
+ onClick = {
+ ttdsDialogInfo.onNegative?.invoke()
+ onShowDialog(false)
+ },
+ )
+
+ Spacer(modifier = Modifier.width(14.dp))
+
+ TtdsTextButton(
+ modifier = Modifier.weight(1f),
+ text = ttdsDialogInfo.positiveText,
+ buttonColor = TtdsColor.PRIMARY,
+ textColor = TtdsColor.TEXT_ACTIVE,
+ buttonInfo = TtdsButtonInfo.Small(),
+ onClick = {
+ ttdsDialogInfo.onPositive.invoke()
+ onShowDialog(false)
+ },
+ )
+ }
+}
+
+@Composable
+private fun TtdsAlertDialogButton(
+ ttdsDialogInfo: TtdsDialogInfo.Alert,
+ onShowDialog: (Boolean) -> Unit,
+) {
+ TtdsTextButton(
+ modifier = Modifier.fillMaxWidth(),
+ text = ttdsDialogInfo.confirmText,
+ buttonColor = TtdsColor.PRIMARY,
+ textColor = TtdsColor.TEXT_ACTIVE,
+ buttonInfo = TtdsButtonInfo.Small(),
+ onClick = {
+ ttdsDialogInfo.onConfirm?.invoke()
+ onShowDialog(false)
+ },
+ )
+}
+
+@Preview
+@Composable
+private fun TtdsConfirmDialogPreview() {
+ TtdsTheme {
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Confirm(
+ title = "제목",
+ message = "메시지",
+ positiveText = "확인",
+ negativeText = "취소",
+ onPositive = {},
+ onNegative = {},
+ ),
+ onShowDialog = {},
+ )
+ }
+}
+
+@Preview
+@Composable
+private fun TtdsAlertDialogPreview() {
+ TtdsTheme {
+ TtdsDialog(
+ ttdsDialogInfo = TtdsDialogInfo.Alert(
+ title = "제목",
+ message = "메시지",
+ confirmText = "확인",
+ onConfirm = {},
+ ),
+ onShowDialog = {},
+ )
+ }
+}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/model/TtdsButtonInfo.kt b/tds/src/main/kotlin/com/titi/app/tds/model/TtdsButtonInfo.kt
new file mode 100644
index 00000000..64e58755
--- /dev/null
+++ b/tds/src/main/kotlin/com/titi/app/tds/model/TtdsButtonInfo.kt
@@ -0,0 +1,20 @@
+package com.titi.app.tds.model
+
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.unit.TextUnit
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+
+sealed interface TtdsButtonInfo {
+ val paddingValues: PaddingValues
+ val shape: Shape
+ val fontSize: TextUnit
+
+ data class Small(
+ override val paddingValues: PaddingValues = PaddingValues(12.dp, 8.dp),
+ override val shape: Shape = RoundedCornerShape(8.dp),
+ override val fontSize: TextUnit = 18.sp,
+ ) : TtdsButtonInfo
+}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/model/TtdsDialogInfo.kt b/tds/src/main/kotlin/com/titi/app/tds/model/TtdsDialogInfo.kt
new file mode 100644
index 00000000..e13325de
--- /dev/null
+++ b/tds/src/main/kotlin/com/titi/app/tds/model/TtdsDialogInfo.kt
@@ -0,0 +1,28 @@
+package com.titi.app.tds.model
+
+sealed interface TtdsDialogInfo {
+ val title: String
+ val message: String?
+ val cancelable: Boolean
+ val onDismiss: (() -> Unit)?
+
+ data class Confirm(
+ override val title: String,
+ override val message: String? = null,
+ override val cancelable: Boolean = false,
+ override val onDismiss: (() -> Unit)? = null,
+ val positiveText: String,
+ val onPositive: () -> Unit,
+ val negativeText: String,
+ val onNegative: (() -> Unit)? = null,
+ ) : TtdsDialogInfo
+
+ data class Alert(
+ override val title: String,
+ override val message: String? = null,
+ override val cancelable: Boolean = false,
+ override val onDismiss: (() -> Unit)? = null,
+ val confirmText: String,
+ val onConfirm: (() -> Unit)? = null,
+ ) : TtdsDialogInfo
+}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/theme/Color.kt b/tds/src/main/kotlin/com/titi/app/tds/theme/Color.kt
index a03564b9..44e1a6ed 100644
--- a/tds/src/main/kotlin/com/titi/app/tds/theme/Color.kt
+++ b/tds/src/main/kotlin/com/titi/app/tds/theme/Color.kt
@@ -8,26 +8,76 @@ import androidx.compose.ui.graphics.Color
data class TtdsColorsPalette(
val primary: Color = Color.Unspecified,
val text: Color = Color.Unspecified,
+ val textMain: Color = Color.Unspecified,
+ val textBtn: Color = Color.Unspecified,
+ val textActive: Color = Color.Unspecified,
+ val textMuted: Color = Color.Unspecified,
+ val btnMuted: Color = Color.Unspecified,
+ val btnCancel: Color = Color.Unspecified,
+ val stroke: Color = Color.Unspecified,
+ val stroke2: Color = Color.Unspecified,
+ val backgroundMain: Color = Color.Unspecified,
+ val backgroundTxtField: Color = Color.Unspecified,
)
val TtdsLightColorsPalette = TtdsColorsPalette(
primary = Color(0xFF007AFF),
text = Color(0xFF222222),
+ textMain = Color(0xFF222222),
+ textBtn = Color(0xFFA4A4A4),
+ textActive = Color(0xFFFFFFFF),
+ textMuted = Color(0xFFB0B0B0),
+ btnMuted = Color(0xFFF1F2F4),
+ btnCancel = Color(0xFFBFC0C3),
+ stroke = Color(0xFFF1F2F4),
+ stroke2 = Color(0xFFF1F2F4),
+ backgroundMain = Color(0xFFFFFFFF),
+ backgroundTxtField = Color(0xFFF7F8FA),
)
val TtdsDarkColorsPalette = TtdsColorsPalette(
primary = Color(0xFF0A84FF),
text = Color(0xFF222222),
+ textMain = Color(0xFFFFFFFF),
+ textBtn = Color(0xFFA4A4A4),
+ textActive = Color(0xFFFFFFFF),
+ textMuted = Color(0xFFA6A6A6),
+ btnMuted = Color(0xFF3B3B3B),
+ btnCancel = Color(0xFFFFFFFF),
+ stroke = Color(0xFF191919),
+ stroke2 = Color(0x80F1F2F4),
+ backgroundMain = Color(0xFF202021),
+ backgroundTxtField = Color(0xFF5B5B5B),
)
enum class TtdsColor {
PRIMARY,
TEXT,
+ TEXT_MAIN,
+ TEXT_BTN,
+ TEXT_ACTIVE,
+ TEXT_MUTED,
+ BTN_MUTED,
+ BTN_CANCEL,
+ STROKE,
+ STROKE2,
+ BACKGROUND_MAIN,
+ BACKGROUND_TXT_FIELD,
;
@Composable
fun getColor() = when (this) {
PRIMARY -> TtdsTheme.colors.primary
TEXT -> TtdsTheme.colors.text
+ TEXT_MAIN -> TtdsTheme.colors.textMain
+ TEXT_BTN -> TtdsTheme.colors.textBtn
+ TEXT_ACTIVE -> TtdsTheme.colors.textActive
+ TEXT_MUTED -> TtdsTheme.colors.textMuted
+ BTN_MUTED -> TtdsTheme.colors.btnMuted
+ BTN_CANCEL -> TtdsTheme.colors.btnCancel
+ STROKE -> TtdsTheme.colors.stroke
+ STROKE2 -> TtdsTheme.colors.stroke2
+ BACKGROUND_MAIN -> TtdsTheme.colors.backgroundMain
+ BACKGROUND_TXT_FIELD -> TtdsTheme.colors.backgroundTxtField
}
}
diff --git a/tds/src/main/kotlin/com/titi/app/tds/theme/Typography.kt b/tds/src/main/kotlin/com/titi/app/tds/theme/Typography.kt
index b743572c..3f388efe 100644
--- a/tds/src/main/kotlin/com/titi/app/tds/theme/Typography.kt
+++ b/tds/src/main/kotlin/com/titi/app/tds/theme/Typography.kt
@@ -6,6 +6,8 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.intl.Locale
+import androidx.compose.ui.unit.TextUnit
import com.titi.app.tds.R
val pretendardFontFamily =
@@ -15,23 +17,26 @@ val pretendardFontFamily =
Font(R.font.pretendard_semi_bold, FontWeight.SemiBold),
Font(R.font.pretendard_bold, FontWeight.Bold),
)
+val misansFontFamily =
+ FontFamily(
+ Font(R.font.misans_normal, FontWeight.Normal),
+ Font(R.font.misans_medium, FontWeight.Medium),
+ Font(R.font.misans_semibold, FontWeight.SemiBold),
+ Font(R.font.misans_semibold, FontWeight.Bold),
+ )
@Immutable
data class TtdsTypography(
val normalTextStyle: TextStyle = TextStyle(
- fontFamily = pretendardFontFamily,
fontWeight = FontWeight.Normal,
),
val mediumTextStyle: TextStyle = TextStyle(
- fontFamily = pretendardFontFamily,
fontWeight = FontWeight.Medium,
),
val semiBoldTextStyle: TextStyle = TextStyle(
- fontFamily = pretendardFontFamily,
fontWeight = FontWeight.SemiBold,
),
val boldTextStyle: TextStyle = TextStyle(
- fontFamily = pretendardFontFamily,
fontWeight = FontWeight.Bold,
),
)
@@ -44,10 +49,37 @@ enum class TtdsTextStyle {
;
@Composable
- fun getTextStyle() = when (this) {
- NORMAL_TEXT_STYLE -> TtdsTheme.textStyle.normalTextStyle
- MEDIUM_TEXT_STYLE -> TtdsTheme.textStyle.mediumTextStyle
- SEMI_BOLD_TEXT_STYLE -> TtdsTheme.textStyle.semiBoldTextStyle
- BOLD_TEXT_STYLE -> TtdsTheme.textStyle.boldTextStyle
+ fun getTextStyle(
+ fontSize: TextUnit,
+ isChinese: Boolean = false,
+ isNoLocale: Boolean = true,
+ ): TextStyle {
+ val fontFamily = when {
+ isChinese -> misansFontFamily
+ Locale.current.language == "zh" && !isNoLocale -> misansFontFamily
+ else -> pretendardFontFamily
+ }
+
+ return when (this) {
+ NORMAL_TEXT_STYLE -> TtdsTheme.textStyle.normalTextStyle.copy(
+ fontFamily = fontFamily,
+ fontSize = fontSize,
+ )
+
+ MEDIUM_TEXT_STYLE -> TtdsTheme.textStyle.mediumTextStyle.copy(
+ fontFamily = fontFamily,
+ fontSize = fontSize,
+ )
+
+ SEMI_BOLD_TEXT_STYLE -> TtdsTheme.textStyle.semiBoldTextStyle.copy(
+ fontFamily = fontFamily,
+ fontSize = fontSize,
+ )
+
+ BOLD_TEXT_STYLE -> TtdsTheme.textStyle.boldTextStyle.copy(
+ fontFamily = fontFamily,
+ fontSize = fontSize,
+ )
+ }
}
}
diff --git a/tds/src/main/res/drawable/icon_cancel.xml b/tds/src/main/res/drawable/icon_cancel.xml
new file mode 100644
index 00000000..dacc74c1
--- /dev/null
+++ b/tds/src/main/res/drawable/icon_cancel.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/core/designsystem/src/main/res/font/misans_medium.ttf b/tds/src/main/res/font/misans_medium.ttf
similarity index 100%
rename from core/designsystem/src/main/res/font/misans_medium.ttf
rename to tds/src/main/res/font/misans_medium.ttf
diff --git a/core/designsystem/src/main/res/font/misans_normal.ttf b/tds/src/main/res/font/misans_normal.ttf
similarity index 100%
rename from core/designsystem/src/main/res/font/misans_normal.ttf
rename to tds/src/main/res/font/misans_normal.ttf
diff --git a/core/designsystem/src/main/res/font/misans_semibold.ttf b/tds/src/main/res/font/misans_semibold.ttf
similarity index 100%
rename from core/designsystem/src/main/res/font/misans_semibold.ttf
rename to tds/src/main/res/font/misans_semibold.ttf
diff --git a/tds/src/main/res/values-ko-rKR/strings.xml b/tds/src/main/res/values-ko-rKR/strings.xml
new file mode 100644
index 00000000..670b3fca
--- /dev/null
+++ b/tds/src/main/res/values-ko-rKR/strings.xml
@@ -0,0 +1,73 @@
+
+
+ 누적 시간
+ 타이머
+ 총 남은시간
+ Task 남은시간
+ 스탑워치
+ 커스텀 컬러
+ 배경
+ 텍스트
+ 새로운 Task
+ 12자리 내의 새로운 Task명을 입력하세요.
+ Task명 수정
+ 목표시간 설정
+ 타이머 시간 설정
+ 목표시간 수정
+ %1$s의 목표시간을 수정해요!
+ 취소
+ 확인
+ 완료
+ 편집
+ 알람을 설정하기 위해 권한이 필요로 합니다.
+ 설정 하러 가시겠습니까?
+ 컬러
+ 그래프의 컬러를 설정합니다.
+ 컬러 방향
+ 컬러 조합의 방향을 설정합니다.
+ 목표 시간
+ 원형 프로그래스바의 목표 시간을 설정합니다.
+ Month의 목표 시간을 입력해주세요 (시간 단위)
+ Week의 목표 시간을 입력해주세요 (시간 단위)
+ 모든 사진이 갤러리에 저장되었습니다.
+ 선택된 그래프가 없습니다.
+ 기록 추가
+ Task를 선택하여 기록수정 후\nSAVE를 눌러주세요
+ 시작 시각
+ 종료 시각
+ 서비스
+ TiTi 기능들
+ 설정
+ 종료 5분전 알림
+ 종료 알림
+ 1시간단위 경과시 알림
+ 버전 및 업데이트 내역
+ 버전 정보
+ 최신버전
+ 업데이트 내역
+ 해당 색상을 배경색으로 설정 하시겠습니까?
+ 변경 사항을 저장 하지 않고 나가시겠어요?
+ Task명을 입력해 주세요.
+ 종료
+ 타이머가 종료되었습니다!
+ 5분 남았습니다.
+ 시간 경과되었습니다.
+ 사진을 저장 하기 위해서 권한이 필요로 합니다.
+ 허용하시겠습니까?
+ 갤러리에 저장이 실패하였습니다.
+ Task를 선택해 주세요.
+ Tasks를 생성해 주세요.
+ 종료예정 : %1$s
+ 알림
+ 측정이 진행 중 입니다.
+ 기록 시작!
+ 개발자
+ 새로운 기록 설정
+ Daily 수정/생성
+ 중복된 내역이 존재 합니다.
+ 언어
+ 시스템
+ 한국어
+ 영어
+ 중국어
+
\ No newline at end of file
diff --git a/tds/src/main/res/values-zh/strings.xml b/tds/src/main/res/values-zh/strings.xml
new file mode 100644
index 00000000..8f73ee31
--- /dev/null
+++ b/tds/src/main/res/values-zh/strings.xml
@@ -0,0 +1,73 @@
+
+
+ 总时间
+ 计时器
+ 目标时间
+ Task 目标时间
+ 秒表
+ 定制颜色
+ 后台
+ 文本
+ 新 Task
+ Task名称的最大长度为 12。
+ 修改 Task 名称
+ 设定目标时间
+ 定时器时间设置
+ "修改目标时间 "
+ %1$s 修改目标时间
+ 取消
+ 确认
+ 结束
+ 编辑
+ 您需要权限来设置闹钟。
+ "您要去设置吗? "
+ 颜色
+ 设置图表的颜色。
+ 颜色方向
+ 设置颜色组合的方向。
+ 目标时间
+ 设置圆形程序栏的目标时间。
+ 请输入 Month 的目标时间\n(以小时为单位)
+ 请输入 Week 的目标时间\n(以小时为单位)
+ 所有的照片都保存在画廊里了。
+ 没有选中的图表。
+ 新建记录
+ 选择 Task 修改记录后\n请按 SAVE
+ 起始时刻
+ 结束时刻
+ 服务
+ 功能
+ 设置
+ 结束前5分钟提醒
+ 结束
+ 每隔1小时提醒
+ 版本和更新历史
+ 版本信息
+ 最新版本
+ 更新细目
+ "确定要设置相应的颜色作为背景色吗? "
+ "不保存变更事项就出去吗? "
+ 请输入Task名。
+ 结束
+ "计时器已结束! "
+ 还剩5分钟。
+ 时间已经过去了。
+ 您需要一个权限来保存您的照片。
+ "允许吗? "
+ 保存到画廊失败。
+ 请选择Task。
+ 请生成Task。
+ 即将结束 : %1$s
+ 告示
+ 测量正在进行中。
+ 开始录制!
+ "开发者 "
+ 新建日志设置
+ "每日修改/创建 "
+ 重复的历史存在。
+ 语言
+ 系统
+ 韩国语
+ 英语
+ 中国话
+
\ No newline at end of file
diff --git a/tds/src/main/res/values/strings.xml b/tds/src/main/res/values/strings.xml
new file mode 100644
index 00000000..16f7941a
--- /dev/null
+++ b/tds/src/main/res/values/strings.xml
@@ -0,0 +1,78 @@
+
+
+ Timer
+ Stopwatch
+ Log
+ Setting
+
+ Sum Time
+ Timer
+ Target Time
+ Task Target Time
+ Stopwatch
+ Custom Color
+ Background
+ TextColor
+ New task
+ Task name\'s max length is 12
+ Modify tasks\'s name
+ Setting Target Time
+ Setting Timer Time
+ Edit Target Time
+ %1$s Edit the target time
+ Cancel
+ Ok
+ Done
+ Edit
+ Permission is required to set the alarm
+ Do you want to go set up?
+ Color
+ Setting the color of the graph
+ Color direction
+ Setting the direction of the color combination
+ Target Time
+ Setting the target time of Circular Progress Bar
+ Input Month\'s Target time (Hour)
+ Input Week\'s Target time (Hour)
+ All photos have been saved in the gallery.
+ No graphs selected.
+ New History
+ Select a task, Edit the record\nand press the SAVE button
+ StartAt
+ EndAt
+ Service
+ TiTi Functions
+ Setting
+ 5 minutes before end
+ Ended
+ Every 1 hour passed
+ Version And Update history
+ Version Info
+ Latest version
+ Update history
+ Do you want to set that color as the background color?
+ Would you like to leave without saving your changes?
+ Please enter a task name.
+ FINISH
+ Timer has ended!
+ Five minutes left
+ has elapsed.
+ You need permission to save your photos.
+ Do you want to allow it?
+ Saving to gallery failed.
+ Please select Task.
+ Create task
+ Finish Time : %1$s
+ Notification
+ Measurement is in progress.
+ Start Recording!
+ Developer
+ Setting New Record
+ Daily Modify/Create
+ Duplicate history exists.
+ Language
+ System
+ Korean
+ English
+ Chinese
+
\ No newline at end of file