Conversation
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun GoalPromptScreenPreview() { |
| @Composable | ||
| fun GoalPromptScreenPreview() { | ||
| var sliderVal by remember { mutableFloatStateOf(0f) } | ||
| GoalPromptScreen() |
There was a problem hiding this comment.
Preview has issues because of vm. Separate into Screen and something like ScreenContent which only contains the UI w/o vm and use that in preview
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| verticalArrangement = Arrangement.spacedBy(8.dp) | ||
| ) { | ||
| LogInButton { viewModel.onSignInWithGoogle() } |
There was a problem hiding this comment.
Should this be log in or next? I thought the user would login beforehand
| private val rootNavigationRepository: RootNavigationRepository, | ||
| ) : UpliftViewModel<GoalsPromptUiState>(GoalsPromptUiState()) { | ||
|
|
||
| private val _goalValue = MutableStateFlow(0f) |
There was a problem hiding this comment.
Maybe this should be part of the UiState?
There was a problem hiding this comment.
If you check UpliftViewModel there should be some function that will allow you to collect the ui state, although we need to update it to be withLifecycle
| import javax.inject.Inject | ||
|
|
||
| data class GoalsPromptUiState( | ||
| val name: String = "", |
There was a problem hiding this comment.
Why do we need name and image for this VM? I think this is just for the goal setting screen? You don't have to include the vm code in this PR per se until you work on it, but the states should match that which may be used in the screen
|
|
||
| @HiltViewModel | ||
| class GoalsPromptViewModel @Inject constructor( | ||
| private val userInfoRepository: UserInfoRepository, |
There was a problem hiding this comment.
Not sure if it makes sense to include userInfoRepository until you know you need to use its functions?
| navigateToHome() | ||
| } | ||
|
|
||
| fun onSignInWithGoogle() { |
There was a problem hiding this comment.
I think the goal setting screen should probably just be next and not log in
|
|
||
| @Composable | ||
| private fun SkipButton(onClick: () -> Unit) { | ||
| fun SkipButton(onClick: () -> Unit) { |
There was a problem hiding this comment.
I think if we are unprivating, we should probably just separate to another file in components since it will not just be used for sign in prompt screen
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun GoalPromptScreenPreview() { | ||
| var sliderVal by remember { mutableFloatStateOf(0f) } |
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.unit.sp | ||
| import androidx.credentials.Credential |
|
I took account of your changes to reuse an old screen which I did. I was successfully able to add the networking logic to enable a user to set a goal during the onboarding process, which I tested using my own account. Also removed some unused imports and deleted unused files. |

Overview
Implemented the "set your goals" page from the figma and added it to the onboarding flow. Currently, it does not upload the information to the database but that will be for future changes. I also made the base view model for the page with a few functions that will need to be updated when implementing the networking features. Finished networking for the onboarding pages allowing users to update their goals after creating their account.
Changes Made
Refactored screen to separate usage for onboarding and settings (WorkoutReminderScreen.kt)
Designed a base view model for the screen (ProfileCreationViewModel.kt)
Updated create user function to enable users to add a goal (UserInfoRepository.kt)
Made small changes in MainNavigationWrapper.kt and DatastoreRepository.kt to enable above changes
Test Coverage
I was able to manually test and am successfully able to drag the slider over and move to the next page and create a user and view their goals
Screenshots (delete if not applicable)
Goals Onboarding Screen