11package com.threegap.bitnagil.presentation.routinelist.model
22
33import android.os.Parcelable
4+ import androidx.compose.runtime.Composable
5+ import androidx.compose.ui.graphics.Color
6+ import com.threegap.bitnagil.designsystem.BitnagilTheme
7+ import com.threegap.bitnagil.designsystem.R
48import com.threegap.bitnagil.domain.routine.model.DayOfWeek
59import com.threegap.bitnagil.domain.routine.model.RecommendedRoutineType
610import com.threegap.bitnagil.domain.routine.model.Routine
@@ -22,8 +26,31 @@ fun Routine.toUiModel(): RoutineUiModel =
2226 routineId = this .routineId,
2327 routineName = this .routineName,
2428 repeatDay = this .repeatDay,
25- executionTime = this .executionTime ,
29+ executionTime = this .formattedExecutionTime ,
2630 routineDate = this .routineDate,
2731 subRoutineNames = this .subRoutineNames,
2832 recommendedRoutineType = this .recommendedRoutineType,
2933 )
34+
35+ fun RecommendedRoutineType.getIcon (): Int =
36+ when (this ) {
37+ RecommendedRoutineType .OUTING -> R .drawable.ic_outside
38+ RecommendedRoutineType .WAKE_UP -> R .drawable.ic_wakeup
39+ RecommendedRoutineType .CONNECT -> R .drawable.ic_connect
40+ RecommendedRoutineType .REST -> R .drawable.ic_rest
41+ RecommendedRoutineType .GROW -> R .drawable.ic_grow
42+ RecommendedRoutineType .PERSONALIZED -> R .drawable.ic_shine
43+ RecommendedRoutineType .OUTING_REPORT -> R .drawable.ic_shine
44+ }
45+
46+ @Composable
47+ fun RecommendedRoutineType.getColor (): Color =
48+ when (this ) {
49+ RecommendedRoutineType .OUTING -> BitnagilTheme .colors.skyBlue10
50+ RecommendedRoutineType .WAKE_UP -> BitnagilTheme .colors.orange25
51+ RecommendedRoutineType .CONNECT -> BitnagilTheme .colors.purple10
52+ RecommendedRoutineType .REST -> BitnagilTheme .colors.green10
53+ RecommendedRoutineType .GROW -> BitnagilTheme .colors.pink10
54+ RecommendedRoutineType .PERSONALIZED -> BitnagilTheme .colors.yellow10
55+ RecommendedRoutineType .OUTING_REPORT -> BitnagilTheme .colors.yellow10
56+ }
0 commit comments