Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4babcd9
INIT: 루틴 작성/수정 화면에 필요한 이미지/아이콘 에셋 추가
l5x5l Aug 11, 2025
6b7299c
INIT: 루틴 작성/수정 화면에 필요한 이미지/아이콘 에셋 추가
l5x5l Aug 12, 2025
747ddbd
REFACTOR: 루틴 작성/수정 화면 리디자인 UI 반영
l5x5l Aug 12, 2025
490e179
REFACTOR: 리디자인된 루틴 작성/수정 화면에 맞게 ViewModel 수정 및 세부 UI 수정
l5x5l Aug 13, 2025
62254c6
CHORE: ktlint 적용
l5x5l Aug 13, 2025
03b1bd2
FIX: ExpandableContent의 접었다 펴는 기능 수행 터치 영역을 아이콘 버튼에서 상단 전체 영역으로 수정
l5x5l Aug 13, 2025
46b315a
REFACTOR: 루틴 작성/수정 관련 API v2 반영
l5x5l Aug 17, 2025
cced6a1
CHORE: ktlint 적용
l5x5l Aug 17, 2025
a4e9670
FIX: 루틴 작성/수정 API 요청 관련 날짜 String 형식 수정 및 빈 서브루틴 이름은 요청에 미포함되도록 수정
l5x5l Aug 18, 2025
6e1cc47
FIX: 루틴 작성/수정시 반복 요일을 설정하지 않아도 등록이 가능하도록 수정, 반복 요일을 등록하지 않을 시 startDa…
l5x5l Aug 18, 2025
139fc86
Merge branch 'develop' into refactor/#98-redesign_write_routine
l5x5l Aug 18, 2025
4efe102
FIX: 루틴 리스트 화면에서 루틴 작성/수정 화면 연결 및 루틴 DTO에 시작/종료 날자 변수 추가, 루틴 단일 조회 AP…
l5x5l Aug 18, 2025
647d4ed
FIX: 루틴 수정/작성 useCase와 repository에서 시작/종료일자를 nullable하지 않도록 수정, 날자 선택…
l5x5l Aug 18, 2025
16cbba8
FIX: 루틴 수정/작성 API request의 시작/종료일자를 nullable하지 않도록 수정
l5x5l Aug 18, 2025
a0af44e
FIX: 세부 항목 수정
l5x5l Aug 19, 2025
b09b684
FIX: 세부 항목 수정
l5x5l Aug 19, 2025
5ec5940
FIX: 세부 항목 수정
l5x5l Aug 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/src/main/java/com/threegap/bitnagil/MainNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ fun MainNavHost(
val writeScreenNavArg = if (arg.isRegister) {
WriteRoutineScreenArg.Add(baseRoutineId = arg.routineId)
} else {
WriteRoutineScreenArg.Edit(routineId = arg.routineId!!)
WriteRoutineScreenArg.Edit(routineId = arg.routineId!!, updateRoutineFromNowDate = arg.isUpdateRoutineFromNowDate)
}

val viewModel = hiltViewModel<WriteRoutineViewModel, WriteRoutineViewModel.Factory> { factory ->
Expand Down Expand Up @@ -263,6 +263,18 @@ fun MainNavHost(
navigator.navController.popBackStack()
}
},
navigateToAddRoutine = {
navigator.navController.navigate(Route.WriteRoutine())
},
navigateToEditRoutine = { routineId, updateRoutineFromNowDate ->
navigator.navController.navigate(
Route.WriteRoutine(
routineId = routineId,
isRegister = false,
isUpdateRoutineFromNowDate = updateRoutineFromNowDate,
),
)
},
)
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/threegap/bitnagil/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ sealed interface Route {
data class WriteRoutine(
val routineId: String? = null,
val isRegister: Boolean = true,
val isUpdateRoutineFromNowDate: Boolean = true,
) : Route

@Serializable
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Base.Theme.Bitnagil" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Base.Theme.Bitnagil" parent="Theme.AppCompat.Light.NoActionBar" />

<style name="Theme.Bitnagil" parent="Base.Theme.Bitnagil">
<item name="android:windowIsTranslucent">true</item>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_close_circle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M16,8C16,12.418 12.418,16 8,16C3.582,16 0,12.418 0,8C0,3.582 3.582,0 8,0C12.418,0 16,3.582 16,8Z"
android:fillColor="#AEB0B6"/>
<path
android:pathData="M10.333,4.677C10.606,4.403 11.05,4.403 11.323,4.677C11.596,4.95 11.596,5.394 11.323,5.667L5.666,11.324C5.393,11.597 4.949,11.597 4.676,11.324C4.402,11.05 4.402,10.607 4.676,10.333L10.333,4.677Z"
android:fillColor="#F7F7F8"/>
<path
android:pathData="M11.323,10.333C11.596,10.607 11.596,11.05 11.323,11.324C11.05,11.597 10.606,11.597 10.333,11.324L4.676,5.667C4.402,5.394 4.402,4.95 4.676,4.677C4.949,4.403 5.393,4.403 5.666,4.677L11.323,10.333Z"
android:fillColor="#F7F7F8"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_down_arrow_20.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="21dp"
android:viewportWidth="20"
android:viewportHeight="21">
<path
android:pathData="M9.646,11.521L12.896,8.271C13.049,8.118 13.243,8.042 13.479,8.042C13.715,8.042 13.91,8.118 14.063,8.271C14.215,8.424 14.292,8.618 14.292,8.854C14.292,9.09 14.215,9.285 14.063,9.437L10.229,13.271C10.146,13.354 10.056,13.413 9.958,13.448C9.861,13.482 9.757,13.499 9.646,13.5C9.535,13.5 9.431,13.483 9.333,13.448C9.236,13.412 9.146,13.353 9.063,13.271L5.229,9.437C5.076,9.285 5,9.09 5,8.854C5,8.618 5.076,8.424 5.229,8.271C5.382,8.118 5.576,8.042 5.813,8.042C6.049,8.042 6.243,8.118 6.396,8.271L9.646,11.521Z"
android:fillColor="#46474C"/>
</vector>
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_up_arrow_20.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="21dp"
android:viewportWidth="20"
android:viewportHeight="21">
<path
android:pathData="M10.354,9.479L7.104,12.729C6.951,12.882 6.757,12.958 6.521,12.958C6.285,12.958 6.09,12.882 5.938,12.729C5.785,12.576 5.708,12.382 5.708,12.146C5.708,11.91 5.785,11.715 5.938,11.563L9.771,7.729C9.854,7.646 9.944,7.587 10.042,7.553C10.139,7.518 10.243,7.501 10.354,7.5C10.465,7.499 10.569,7.517 10.667,7.553C10.764,7.588 10.854,7.647 10.938,7.729L14.771,11.563C14.924,11.715 15,11.91 15,12.146C15,12.382 14.924,12.576 14.771,12.729C14.618,12.882 14.424,12.958 14.188,12.958C13.951,12.958 13.757,12.882 13.604,12.729L10.354,9.479Z"
android:fillColor="#46474C"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ data class RoutineDto(
val subRoutineCompleteYn: List<Boolean>,
@SerialName("recommendedRoutineType")
val recommendedRoutineType: String?,
@SerialName("routineDeletedYn")
val routineDeletedYn: Boolean,
@SerialName("routineStartDate")
val routineStartDate: String,
@SerialName("routineEndDate")
val routineEndDate: String,
)

fun RoutineDto.toDomain(): Routine =
Expand All @@ -39,4 +45,7 @@ fun RoutineDto.toDomain(): Routine =
subRoutineNames = this.subRoutineNames,
subRoutineCompleteYn = this.subRoutineCompleteYn,
recommendedRoutineType = RecommendedRoutineType.fromString(this.recommendedRoutineType),
routineDeletedYn = routineDeletedYn,
startDate = this.routineStartDate,
endDate = this.routineEndDate,
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface RoutineService {
@Query("endDate") endDate: String,
): BaseResponse<RoutinesResponseDto>

@GET("/api/v1/routines/{routineId}")
@GET("/api/v2/routines/{routineId}")
suspend fun getRoutine(
@Path("routineId") routineId: String,
): BaseResponse<RoutineDto>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
package com.threegap.bitnagil.data.writeroutine.model.request

import com.threegap.bitnagil.data.writeroutine.model.dto.SubRoutineInfosDiffDto
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class EditRoutineRequest(
@SerialName("routineId")
val routineId: String,
@SerialName("updateApplyDate")
val updateApplyDate: String,
@SerialName("routineName")
val routineName: String,
@SerialName("repeatDay")
val repeatDay: List<String>,
@SerialName("routineStartDate")
val routineStartDate: String,
@SerialName("routineEndDate")
val routineEndDate: String,
@SerialName("executionTime")
val executionTime: String,
@SerialName("subRoutineInfos")
val subRoutineInfos: List<SubRoutineInfosDiffDto>,
@SerialName("subRoutineName")
val subRoutineName: List<String>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ data class RegisterRoutineRequest(
val routineName: String,
@SerialName("repeatDay")
val repeatDay: List<String>,
@SerialName("routineStartDate")
val routineStartDate: String,
@SerialName("routineEndDate")
val routineEndDate: String,
@SerialName("executionTime")
val executionTime: String,
@SerialName("subRoutineName")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.threegap.bitnagil.data.writeroutine.repositoryImpl

import com.threegap.bitnagil.data.writeroutine.datasource.WriteRoutineDataSource
import com.threegap.bitnagil.data.writeroutine.model.dto.SubRoutineInfosDiffDto
import com.threegap.bitnagil.data.writeroutine.model.request.EditRoutineRequest
import com.threegap.bitnagil.data.writeroutine.model.request.RegisterRoutineRequest
import com.threegap.bitnagil.domain.writeroutine.model.Date
import com.threegap.bitnagil.domain.writeroutine.model.RepeatDay
import com.threegap.bitnagil.domain.writeroutine.model.SubRoutineDiff
import com.threegap.bitnagil.domain.writeroutine.model.RoutineUpdateType
import com.threegap.bitnagil.domain.writeroutine.model.Time
import com.threegap.bitnagil.domain.writeroutine.model.WriteRoutineEvent
import com.threegap.bitnagil.domain.writeroutine.repository.WriteRoutineRepository
Expand All @@ -17,11 +17,20 @@ import javax.inject.Inject
class WriteRoutineRepositoryImpl @Inject constructor(
private val writeRoutineDataSource: WriteRoutineDataSource,
) : WriteRoutineRepository {
override suspend fun registerRoutine(name: String, repeatDay: List<RepeatDay>, startTime: Time, subRoutines: List<String>): Result<Unit> {
override suspend fun registerRoutine(
name: String,
repeatDay: List<RepeatDay>,
startTime: Time,
startDate: Date,
endDate: Date,
subRoutines: List<String>,
): Result<Unit> {
val request = RegisterRoutineRequest(
routineName = name,
repeatDay = repeatDay.map { it.fullName },
executionTime = startTime.toFormattedString(),
routineStartDate = startDate.toFormattedString(),
routineEndDate = endDate.toFormattedString(),
subRoutineName = subRoutines,
)
return writeRoutineDataSource.registerRoutine(request).also {
Expand All @@ -33,19 +42,23 @@ class WriteRoutineRepositoryImpl @Inject constructor(

override suspend fun editRoutine(
routineId: String,
routineUpdateType: RoutineUpdateType,
name: String,
repeatDay: List<RepeatDay>,
startTime: Time,
subRoutines: List<SubRoutineDiff>,
startDate: Date,
endDate: Date,
subRoutines: List<String>,
): Result<Unit> {
val request = EditRoutineRequest(
routineId = routineId,
updateApplyDate = routineUpdateType.value,
routineName = name,
repeatDay = repeatDay.map { it.fullName },
executionTime = startTime.toFormattedString(),
subRoutineInfos = subRoutines.map {
SubRoutineInfosDiffDto.fromSubRoutineDiff(it)
},
routineStartDate = startDate.toFormattedString(),
routineEndDate = endDate.toFormattedString(),
subRoutineName = subRoutines,
)

return writeRoutineDataSource.editRoutine(request).also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import retrofit2.http.PATCH
import retrofit2.http.POST

interface WriteRoutineService {
@POST("/api/v1/routines")
@POST("/api/v2/routines")
suspend fun postRoutine(
@Body registerRoutineRequest: RegisterRoutineRequest,
): BaseResponse<Unit>

@PATCH("/api/v1/routines")
@PATCH("/api/v2/routines")
suspend fun patchRoutine(
@Body editRoutineRequest: EditRoutineRequest,
): BaseResponse<Unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ data class Routine(
val routineName: String,
val repeatDay: List<DayOfWeek>,
val executionTime: String,
val startDate: String,
val endDate: String,
val routineDate: String,
val routineCompleteYn: Boolean,
val routineDeletedYn: Boolean,
val subRoutineNames: List<String>,
val subRoutineCompleteYn: List<Boolean>,
val recommendedRoutineType: RecommendedRoutineType?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ data class Date(
require(month in 1..12) { "Month must be in range 1..12, but was $month" }
require(day in 1..31) { "Day must be in range 1..31, but was $day" }
}

fun toFormattedString(): String {
return "%04d-%02d-%02d".format(year, month, day)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.threegap.bitnagil.domain.writeroutine.model

enum class RoutineUpdateType(val value: String) {
Today("TODAY"), Tomorrow("TOMORROW")
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.threegap.bitnagil.domain.writeroutine.repository

import com.threegap.bitnagil.domain.writeroutine.model.Date
import com.threegap.bitnagil.domain.writeroutine.model.RepeatDay
import com.threegap.bitnagil.domain.writeroutine.model.SubRoutineDiff
import com.threegap.bitnagil.domain.writeroutine.model.RoutineUpdateType
import com.threegap.bitnagil.domain.writeroutine.model.Time
import com.threegap.bitnagil.domain.writeroutine.model.WriteRoutineEvent
import kotlinx.coroutines.flow.Flow
Expand All @@ -11,15 +12,20 @@ interface WriteRoutineRepository {
name: String,
repeatDay: List<RepeatDay>,
startTime: Time,
startDate: Date,
endDate: Date,
subRoutines: List<String>,
): Result<Unit>

suspend fun editRoutine(
routineId: String,
routineUpdateType: RoutineUpdateType,
name: String,
repeatDay: List<RepeatDay>,
startTime: Time,
subRoutines: List<SubRoutineDiff>,
startDate: Date,
endDate: Date,
subRoutines: List<String>,
): Result<Unit>

suspend fun getWriteRoutineEventFlow(): Flow<WriteRoutineEvent>
Expand Down
Loading