diff --git a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt index 44c6d592..bec34ee5 100644 --- a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt +++ b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt @@ -37,7 +37,11 @@ class DailyRoutineAddActivity : setStatusBarColorFromResource(R.color.background) dailyRoutineAddViewModel.getThemeList() - dailyRoutineAddViewModel.setThemeId(6) + dailyRoutineAddViewModel.themeList.observe(this){list -> + if(list.isNotEmpty()){ + dailyRoutineAddViewModel.setThemeId(list[0].themeId) + } + } setupAdapter() setupList() setIndicator() diff --git a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddViewModel.kt b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddViewModel.kt index 6ceac90e..7a26f678 100644 --- a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddViewModel.kt +++ b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddViewModel.kt @@ -71,7 +71,7 @@ class DailyRoutineAddViewModel @Inject constructor( fun getDailyRoutine() { viewModelScope.launch { - getRoutineDailyThemeListUseCase(themeId.value ?: 6) + getRoutineDailyThemeListUseCase(themeId.value ?: _themeList.value?.get(0)?.themeId ?: 5) .onSuccess { response -> _dailyRoutineCardThemeList.value = response }