Skip to content

Commit

Permalink
Merge pull request #128 from TimerTiTi/126-release-103
Browse files Browse the repository at this point in the history
release-1.0.3
  • Loading branch information
koreatlwls authored May 19, 2024
2 parents e20c0f3 + b7604f4 commit 6f37114
Show file tree
Hide file tree
Showing 90 changed files with 2,367 additions and 1,044 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ dependencies {
implementation(project(":data:sleep:impl"))
implementation(project(":data:alarm:impl"))
implementation(project(":data:graph:impl"))
implementation(project(":data:notification:impl"))

implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
Expand Down
5 changes: 4 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@
-keepclassmembers class * {
@com.squareup.moshi.FromJson <methods>;
@com.squareup.moshi.ToJson <methods>;
}
}

-keepattributes Signature
-keepclassmembers class com.titi.app.feature.setting.model.** {*;}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
android:label="${appName}"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/Theme.TiTi"
tools:targetApi="31">

Expand Down
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.0.2"
const val APP_VERSION_CODE = 23
const val APP_VERSION_NAME = "1.0.3"
const val APP_VERSION_CODE = 25
const val APP_NAME = "TiTi"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ fun TdsStandardDailyGraph(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
val size = maxWidth.coerceAtMost(345.dp)
val size = maxWidth.coerceAtMost(365.dp)

OutlinedCard(
modifier = Modifier
.createCaptureImageModifier(picture = picture)
.size(size),
.size(size)
.padding(10.dp),
shape = RoundedCornerShape(size * 0.07),
colors = CardDefaults.cardColors(containerColor = TdsColor.BACKGROUND.getColor()),
border = BorderStroke(
Expand Down Expand Up @@ -203,8 +204,8 @@ fun TdsStandardDailyGraph(
Box(
modifier = Modifier
.offset(
x = -size / 2 + 26.dp,
y = -size * 0.38 + 33.dp,
x = -size / 2 + 36.dp,
y = -size * 0.38 + 43.dp,
),
) {
TdsToggleIconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ fun TdsTaskProgressDailyGraph(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
val size = maxWidth.coerceAtMost(345.dp)
val size = maxWidth.coerceAtMost(365.dp)

OutlinedCard(
modifier = Modifier
.createCaptureImageModifier(picture = picture)
.size(size),
.size(size)
.padding(10.dp),
shape = RoundedCornerShape(size * 0.07),
colors = CardDefaults.cardColors(containerColor = TdsColor.BACKGROUND.getColor()),
border = BorderStroke(
Expand Down Expand Up @@ -84,8 +85,8 @@ fun TdsTaskProgressDailyGraph(
Box(
modifier = Modifier
.offset(
x = -size / 2 + 26.dp,
y = -size * 0.49 + 26.dp,
x = -size / 2 + 36.dp,
y = -size * 0.49 + 36.dp,
),
) {
TdsToggleIconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ fun TdsTimeLineDailyGraph(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
val size = maxWidth.coerceAtMost(345.dp)
val size = maxWidth.coerceAtMost(365.dp)

OutlinedCard(
modifier = Modifier
.createCaptureImageModifier(picture = picture)
.size(size),
.size(size)
.padding(10.dp),
shape = RoundedCornerShape(size * 0.07),
colors = CardDefaults.cardColors(containerColor = TdsColor.BACKGROUND.getColor()),
border = BorderStroke(
Expand Down Expand Up @@ -147,8 +148,8 @@ fun TdsTimeLineDailyGraph(
Box(
modifier = Modifier
.offset(
x = -size / 2 + 26.dp,
y = -size * 0.49 + 26.dp,
x = -size / 2 + 36.dp,
y = -size * 0.49 + 36.dp,
),
) {
TdsToggleIconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun TdsTimeTable(
mutableStateOf("0")
}
var fontSize by remember {
mutableStateOf(14.sp)
mutableStateOf(7.sp)
}
val textStyle = TdsTextStyle
.SEMI_BOLD_TEXT_STYLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ fun TdsTimeTableDailyGraph(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
val size = maxWidth.coerceAtMost(345.dp)
val size = maxWidth.coerceAtMost(365.dp)

OutlinedCard(
modifier = Modifier
.createCaptureImageModifier(picture = picture)
.size(size),
.size(size)
.padding(10.dp),
shape = RoundedCornerShape(size * 0.07),
colors = CardDefaults.cardColors(containerColor = TdsColor.BACKGROUND.getColor()),
border = BorderStroke(
Expand Down Expand Up @@ -216,8 +217,8 @@ fun TdsTimeTableDailyGraph(
Box(
modifier = Modifier
.offset(
x = -size / 2 + 26.dp,
y = -size * 0.38 + 33.dp,
x = -size / 2 + 36.dp,
y = -size * 0.38 + 43.dp,
),
) {
TdsToggleIconButton(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.titi.app.core.designsystem.navigation

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.systemBarsIgnoringVisibility
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.titi.app.core.designsystem.component.TdsText
import com.titi.app.core.designsystem.theme.TdsColor
import com.titi.app.core.designsystem.theme.TdsTextStyle

@OptIn(ExperimentalLayoutApi::class)
@Composable
fun TdsBottomNavigationBar(
currentTopLevelDestination: TopLevelDestination,
bottomNavigationColor: Long,
onNavigateToDestination: (TopLevelDestination) -> Unit,
) {
Row(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.windowInsetsPadding(
WindowInsets.systemBarsIgnoringVisibility.only(
WindowInsetsSides.Bottom + WindowInsetsSides.Horizontal,
),
)
.selectableGroup()
.background(Color(bottomNavigationColor)),
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
TopLevelDestination.entries.forEach { destination ->
val selected = currentTopLevelDestination == destination
TdsBottomNavigationBarItem(
selected = selected,
onClick = { onNavigateToDestination(destination) },
icon = {
Icon(
painter = painterResource(id = destination.iconResourceId),
contentDescription = stringResource(id = destination.titleTextId),
tint = if (selected) {
TdsColor.TEXT.getColor()
} else {
TdsColor.LIGHT_GRAY.getColor()
},
)
},
label = {
TdsText(
text = stringResource(id = destination.titleTextId),
textStyle = TdsTextStyle.SEMI_BOLD_TEXT_STYLE,
fontSize = 16.sp,
color = if (selected) {
TdsColor.TEXT.getColor()
} else {
TdsColor.LIGHT_GRAY.getColor()
},
)
},
)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.titi.app.core.designsystem.component
package com.titi.app.core.designsystem.navigation

import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Column
Expand All @@ -16,7 +16,7 @@ import androidx.compose.ui.semantics.Role
import androidx.compose.ui.unit.dp

@Composable
fun RowScope.TdsNavigationBarItem(
fun RowScope.TdsBottomNavigationBarItem(
selected: Boolean,
onClick: () -> Unit,
icon: @Composable () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.titi.app.feature.main.navigation
package com.titi.app.core.designsystem.navigation

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
Expand All @@ -20,4 +20,8 @@ enum class TopLevelDestination(
titleTextId = R.string.bottom_log_text,
iconResourceId = R.drawable.log_icon,
),
SETTING(
titleTextId = R.string.bottom_setting_text,
iconResourceId = R.drawable.setting_icon,
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ data class TdsColorsPalette(
val textColor: Color = Color.Unspecified,
val backgroundColor: Color = Color.Unspecified,
val secondaryBackgroundColor: Color = Color.Unspecified,
val groupedBackgroundColor: Color = Color.Unspecified,
val switchBackgroundColor: Color = Color.Unspecified,
val alertBackgroundColor: Color = Color.Unspecified,
val tertiaryBackgroundColor: Color = Color.Unspecified,
Expand Down Expand Up @@ -52,7 +53,8 @@ val TdsLightColorsPalette = TdsColorsPalette(
d12 = Color(0xFF928AEA),
textColor = Color(0xFF000000),
backgroundColor = Color(0xFFFFFFFF),
secondaryBackgroundColor = Color(0xFFF2F2F7),
secondaryBackgroundColor = Color(0xFFFFFFFF),
groupedBackgroundColor = Color(0xFFF2F2F7),
switchBackgroundColor = Color(0xFFE9E9EB),
alertBackgroundColor = Color(0xD1EEEEEE),
tertiaryBackgroundColor = Color(0xFFFFFFFF),
Expand Down Expand Up @@ -85,6 +87,7 @@ val TdsDarkColorsPalette = TdsColorsPalette(
textColor = Color(0xFFFFFFFF),
backgroundColor = Color(0xFF000000),
secondaryBackgroundColor = Color(0xFF1C1C1E),
groupedBackgroundColor = Color(0xFF000000),
switchBackgroundColor = Color(0xFF39393D),
alertBackgroundColor = Color(0xD12B2B2B),
tertiaryBackgroundColor = Color(0xFF2C2C2E),
Expand Down Expand Up @@ -118,6 +121,7 @@ enum class TdsColor {
TEXT,
BACKGROUND,
SECONDARY_BACKGROUND,
GROUPED_BACKGROUND,
SWITCH_BACKGROUND,
ALERT_BACKGROUND,
TERTIARY_BACKGROUND,
Expand Down Expand Up @@ -154,6 +158,7 @@ enum class TdsColor {
TEXT -> TiTiTheme.colors.textColor
BACKGROUND -> TiTiTheme.colors.backgroundColor
SECONDARY_BACKGROUND -> TiTiTheme.colors.secondaryBackgroundColor
GROUPED_BACKGROUND -> TiTiTheme.colors.groupedBackgroundColor
SWITCH_BACKGROUND -> TiTiTheme.colors.switchBackgroundColor
ALERT_BACKGROUND -> TiTiTheme.colors.alertBackgroundColor
TERTIARY_BACKGROUND -> TiTiTheme.colors.tertiaryBackgroundColor
Expand Down
13 changes: 0 additions & 13 deletions core/designsystem/src/main/res/drawable/add_record_icon.xml

This file was deleted.

14 changes: 14 additions & 0 deletions core/designsystem/src/main/res/drawable/edit_record_icon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="34dp"
android:viewportWidth="30"
android:viewportHeight="34">
<path
android:pathData="M21,27.59H9C8.503,27.59 8.1,27.187 8.1,26.69V23.69C8.1,23.451 8.195,23.222 8.364,23.053L16.515,14.902L16.52,14.897L16.535,14.882C16.667,14.75 16.801,14.616 16.925,14.51C17.063,14.393 17.247,14.26 17.49,14.181C17.822,14.073 18.178,14.073 18.51,14.181C18.753,14.26 18.937,14.393 19.075,14.51C19.199,14.615 19.333,14.749 19.464,14.881L20.807,16.223C20.939,16.355 21.073,16.49 21.179,16.614C21.296,16.752 21.43,16.936 21.509,17.18C21.616,17.511 21.616,17.868 21.509,18.199C21.43,18.443 21.296,18.627 21.179,18.765C21.073,18.889 20.939,19.023 20.807,19.155L14.173,25.789H21C21.497,25.789 21.9,26.192 21.9,26.69C21.9,27.187 21.497,27.59 21,27.59ZM17.976,15.988L18,15.965L18.024,15.988C18.076,16.038 18.135,16.097 18.21,16.173L19.515,17.477C19.591,17.553 19.65,17.613 19.701,17.665L19.725,17.69L19.701,17.714C19.653,17.764 19.595,17.821 19.523,17.893L19.516,17.901L18,19.417L16.273,17.69L17.785,16.178L17.788,16.174L17.789,16.173C17.865,16.098 17.924,16.038 17.976,15.988ZM15,18.962L16.727,20.69L11.627,25.789L9.9,25.789V24.062L15,18.962Z"
android:fillColor="#3F405F"
android:fillType="evenOdd"/>
<path
android:pathData="M9,1C9,0.448 8.552,0 8,0C7.448,0 7,0.448 7,1V3.5L6.558,3.5C5.614,3.5 4.844,3.5 4.22,3.551C3.574,3.604 2.996,3.716 2.457,3.99C1.61,4.422 0.922,5.11 0.49,5.957C0.216,6.496 0.104,7.074 0.051,7.72C-0,8.344 -0,9.114 0,10.058V26.942C-0,27.887 -0,28.656 0.051,29.28C0.104,29.926 0.216,30.504 0.49,31.043C0.922,31.889 1.609,32.578 2.457,33.01C2.995,33.284 3.573,33.396 4.218,33.449C4.842,33.5 5.61,33.5 6.552,33.5H23.448C24.39,33.5 25.158,33.5 25.781,33.449C26.426,33.396 27.004,33.284 27.542,33.01C28.388,32.579 29.078,31.89 29.51,31.043C29.784,30.504 29.896,29.927 29.949,29.282C30,28.659 30,27.891 30,26.948V10.052C30,9.11 30,8.342 29.949,7.718C29.896,7.073 29.784,6.495 29.51,5.957C29.078,5.109 28.388,4.421 27.542,3.99C27.003,3.716 26.425,3.604 25.78,3.551C25.156,3.5 24.387,3.5 23.442,3.5L23,3.5V1C23,0.448 22.552,0 22,0C21.448,0 21,0.448 21,1V3.5H9V1ZM2,12.5H28V26.906C28,27.901 27.999,28.587 27.956,29.119C27.913,29.64 27.835,29.925 27.728,30.135C27.489,30.605 27.105,30.988 26.634,31.228C26.424,31.335 26.139,31.413 25.618,31.456C25.086,31.499 24.4,31.5 23.405,31.5H6.595C5.6,31.5 4.914,31.499 4.381,31.456C3.86,31.413 3.574,31.335 3.365,31.228C2.895,30.989 2.512,30.606 2.272,30.135C2.166,29.925 2.087,29.639 2.044,29.117C2.001,28.584 2,27.897 2,26.9V12.5Z"
android:fillColor="#3F405F"
android:fillType="evenOdd"/>
</vector>
5 changes: 3 additions & 2 deletions core/designsystem/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<string name="bottom_timer_text">Timer</string>
<string name="bottom_stopwatch_text">Stopwatch</string>
<string name="bottom_log_text">Log</string>
<string name="bottom_setting_text">Setting</string>

<string name="sum_time" translatable="false">누적 시간</string>
<string name="timer" translatable="false">타이머</string>
Expand All @@ -24,8 +25,8 @@
<string name="background">배경</string>
<string name="text">텍스트</string>
<string name="setting_background_text">해당 색상을 배경색으로 설정하시겠습니까?</string>
<string name="add_daily_title">새로운 기록 설정</string>
<string name="add_daily_message">%1$s 목표시간 설정</string>
<string name="edit_daily_title">목표시간 수정</string>
<string name="edit_daily_message">%1$s의 목표시간을 수정해요!</string>
<string name="set_timer_time_title">타이머 시간 설정</string>
<string name="set_timer_time_message">종료예정 : %1$s</string>
<string name="daily_task_check_title">Task와 Daily를 확인해주세요.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,7 @@ interface DailyRepository {

suspend fun getDailies(startDateTime: String, endDateTime: String): List<DailyRepositoryModel>?

fun getDateDailyFlow(
startDateTime: String = LocalDate
.now()
.minusDays(1)
.atStartOfDay(ZoneOffset.systemDefault())
.withZoneSameInstant(ZoneOffset.UTC)
.toString(),
endDateTime: String = LocalDate
.now()
.atTime(23, 59, 59)
.atZone(ZoneId.systemDefault())
.withZoneSameInstant(ZoneOffset.UTC)
.toString(),
): Flow<DailyRepositoryModel?>
fun getLastDailyFlow(): Flow<DailyRepositoryModel?>

suspend fun getAllDailies(): List<DailyRepositoryModel>?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ internal interface DailyDao {
)
suspend fun getWeekDaily(startDateTime: String, endDateTime: String): List<DailyEntity>?

@Query(
"SELECT * FROM dailies " +
" WHERE datetime(day) " +
"BETWEEN datetime(:startDateTime) AND datetime(:endDateTime) ORDER BY id desc LIMIT 1",
)
fun getDateDailyFlow(startDateTime: String, endDateTime: String): Flow<DailyEntity?>
@Query("SELECT * FROM dailies ORDER BY id desc LIMIT 1")
fun getLastDailyFlow(): Flow<DailyEntity?>

@Query("SELECT * FROM dailies")
suspend fun getAllDailies(): List<DailyEntity>?
Expand Down
Loading

0 comments on commit 6f37114

Please sign in to comment.