Repository navigation
Conversation
…actored localized SettingsOption component within SettingsScreen.kt to be a globalized PageOption component.
…navigation to ClassReminder page and Workout Page.
…kt, which accepts a string as the title. Implemented ClassReminder UI (untoggled).
…nd DescriptionReminderSwitch.kt
…have states in the viewmodel.
# Conflicts: # app/src/main/java/com/cornellappdev/uplift/ui/MainNavigationWrapper.kt # app/src/main/java/com/cornellappdev/uplift/ui/components/reminders/goalsetting/GoalSettingHeader.kt # app/src/main/java/com/cornellappdev/uplift/ui/screens/reminders/WorkoutRemindersScreen.kt
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
caleb-bit
left a comment
There was a problem hiding this comment.
Nice work. Left some minor comments.
| val CAPACITY_REMINDERS_SELECTED_DAYS = stringSetPreferencesKey("capacityRemindersSelectedDays") | ||
| val CAPACITY_REMINDERS_SELECTED_GYMS = stringSetPreferencesKey("capacityRemindersSelectedGyms") | ||
| val CAPACITY_REMINDERS_TUTORIAL_SHOWN = booleanPreferencesKey("capacityReminderTutorialShown") | ||
| val WORKOUT_REMINDERS_TOGGLE = booleanPreferencesKey("workoutRemindersToggle") |
There was a problem hiding this comment.
Unused. Do we need this?
| }.firstOrNull() | ||
| } | ||
|
|
||
| suspend fun getPreferencesSnapshot(): Preferences { |
There was a problem hiding this comment.
Should we just be exposing all of the data like this? The point of this DataStoreRepository abstraction should be to abstract out this Preferences object. We should always try to maintain narrow interfaces.
There was a problem hiding this comment.
Can you format this file?
| lineHeight = 14.63.sp, | ||
| letterSpacing = 0.3.sp, |
There was a problem hiding this comment.
Could you double check these values with Figma? These values seem abnormal.
| import androidx.compose.material.Icon | ||
| import androidx.compose.material.Surface | ||
| import androidx.compose.material.Text |
There was a problem hiding this comment.
We should use Material 3 components.
| ) { | ||
| CapacityReminderSwitch( | ||
| DescriptionReminderSwitch( | ||
| text = "Capacity Reminders", |
There was a problem hiding this comment.
Can you format this file? Could you also extract strings?
| /** | ||
| * @param reminders: list of reminders | ||
| * @param uiState: UI state containing reminders, goal value, dialog state | ||
| * @param goalValue: the value of the goal slider | ||
| * @param onRemindersChange: callback for when reminders are changed | ||
| * @param onGoalValueChange: callback for when the goal slider value is changed | ||
| * @param onSelectedReminderChange: callback for when selected reminder changes | ||
| * @param onAddNewReminderStateChange: callback for when adding reminder state changes | ||
| * @param onDeleteDialogOpenChange: callback for when delete dialog open state changes | ||
| * @param onDeleteConfirm: callback for when delete reminder is confirmed | ||
| * @param onBackClick: callback for when the back button is clicked | ||
| * @param isOnboarding: whether the user is in onboarding | ||
| * @param onNext: callback for when the next button is clicked |
There was a problem hiding this comment.
This documentation seems unidiomatic with respect to the rest of the repo and largely redundant since the variable names are fairly self-documenting. We could probably just remove.
| onConfirm = { | ||
| selectedReminder?.let { reminder -> | ||
| onRemindersChange(reminders.filter { it != reminder }) | ||
| } | ||
| onDeleteDialogOpenChange(false) | ||
| onSelectedReminderChange(null) | ||
| onAddNewReminderStateChange(false) | ||
| onDeleteConfirm() | ||
| }, |
There was a problem hiding this comment.
Nit: Nicer to just write onConfirm = onDeleteConfirm.
| } | ||
| } | ||
|
|
||
| private fun saveRemindersToDataStore(reminders: List<Reminder>) { |
There was a problem hiding this comment.
Does it make more sense for this to be a DatastoreRepository function?
Overview
Implemented the Main Reminder page in the settings, edited the Workout Reminder Page and the Capacity Reminder page, and added navigation to them.
Changes Made
Added Reminder Option into Settings
Implemented UI for the Main Reminder Page
Edited Workout Reminders UI to save data after hitting done and deleted slider
Implemented Workout Reminders View Model (data stored locally in DatastoreRepository.kt)
Implemented navigation for Workout Reminders and Capacity Reminders
Test Coverage
These features can be manually tested.
Navigate to Profile page, then navigate to Settings page
Click on Reminders option to access the Workout Reminders page and the Capacity Reminders page
Next Steps
The Class Reminders Screen will be implemented in the next PR of this stack.
Related PRs or Issues
Reminders Pages UI [2/2] Added Class Reminders Screen https://github.com/cuappdev/uplift-android/pull/135
Screenshots
Workout Reminders Screen and Capacity Reminders Screen
Screen_recording_20261110_163223.mp4
https://www.figma.com/design/SJZ7i0N1Ly5PORfkJh7qXH/Uplift-SP26?node-id=6195-14550&t=iZS2IBggIzTXZNLn-1
Workout Reminders UI from Figma for comparison