-
Notifications
You must be signed in to change notification settings - Fork 0
added calendar icon and wire up availability sheet #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import com.cornellappdev.resell.android.model.core.UserInfoRepository | |
| import com.cornellappdev.resell.android.model.login.GoogleAuthRepository | ||
| import com.cornellappdev.resell.android.model.profile.ProfileRepository | ||
| import com.cornellappdev.resell.android.model.settings.BlockedUsersRepository | ||
| import com.cornellappdev.resell.android.ui.components.availability.helper.GridSelectionType | ||
| import com.cornellappdev.resell.android.ui.components.global.ResellTextButtonContainer | ||
| import com.cornellappdev.resell.android.ui.components.global.ResellTextButtonState | ||
| import com.cornellappdev.resell.android.ui.screens.root.ResellRootRoute | ||
|
|
@@ -18,7 +19,9 @@ import com.cornellappdev.resell.android.viewmodel.navigation.RootNavigationRepos | |
| import com.cornellappdev.resell.android.viewmodel.root.RootConfirmationRepository | ||
| import com.cornellappdev.resell.android.viewmodel.root.RootDialogContent | ||
| import com.cornellappdev.resell.android.viewmodel.root.RootDialogRepository | ||
| import com.cornellappdev.resell.android.viewmodel.root.RootNavigationSheetRepository | ||
| import com.cornellappdev.resell.android.viewmodel.root.RootOptionsMenuRepository | ||
| import com.cornellappdev.resell.android.viewmodel.root.RootSheet | ||
| import dagger.hilt.android.lifecycle.HiltViewModel | ||
| import kotlinx.coroutines.launch | ||
| import kotlinx.serialization.encodeToString | ||
|
|
@@ -31,8 +34,9 @@ class ProfileViewModel @Inject constructor( | |
| private val rootDialogRepository: RootDialogRepository, | ||
| private val rootConfirmationRepository: RootConfirmationRepository, | ||
| private val profileRepository: ProfileRepository, | ||
| private val userInfoRepository: UserInfoRepository | ||
| ) : ResellViewModel<ProfileViewModel.ProfileUiState>( | ||
| private val userInfoRepository: UserInfoRepository, | ||
| private val rootNavigationSheetRepository: RootNavigationSheetRepository // add this | ||
| ): ResellViewModel<ProfileViewModel.ProfileUiState>( | ||
| initialUiState = ProfileUiState( | ||
| profileTab = ProfileTab.SHOP, | ||
| loadedState = ResellApiState.Loading, | ||
|
|
@@ -86,6 +90,18 @@ class ProfileViewModel @Inject constructor( | |
| fun onSettingsPressed() { | ||
| rootNavigationRepository.navigate(ResellRootRoute.SETTINGS) | ||
| } | ||
| fun onCalendarPressed() { | ||
| rootNavigationSheetRepository.showBottomSheet( | ||
| RootSheet.Availability( | ||
| buttonString = "Propose", | ||
| title = "Availability", | ||
| description = "Propose a time to meet", | ||
| initialTimes = listOf(), | ||
| gridSelectionType = GridSelectionType.PROPOSAL, | ||
| callback = { /* TODO: handle selected times */ } | ||
| ) | ||
|
Comment on lines
+93
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At Line 101, the availability sheet’s primary action currently does nothing ( Would you like me to draft a concrete callback implementation once you confirm the intended persistence path (local state vs API update)? 🤖 Prompt for AI Agents |
||
| ) | ||
| } | ||
|
|
||
| fun onRequestPressed(request: RequestListing) { | ||
| rootNavigationRepository.navigate( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,9 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="22.666666dp" android:viewportHeight="17" android:viewportWidth="18" android:width="24dp"> | ||
|
|
||
| <path android:fillColor="#00000000" android:pathData="M13.958,2.833H4.042C3.259,2.833 2.625,3.468 2.625,4.25V14.167C2.625,14.949 3.259,15.583 4.042,15.583H13.958C14.741,15.583 15.375,14.949 15.375,14.167V4.25C15.375,3.468 14.741,2.833 13.958,2.833Z" android:strokeColor="#000000" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.2"/> | ||
|
|
||
| <path android:fillColor="#00000000" android:pathData="M11.833,1.416V4.25" android:strokeColor="#000000" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.2"/> | ||
|
|
||
| <path android:fillColor="#00000000" android:pathData="M6.167,1.416V4.25" android:strokeColor="#000000" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.2"/> | ||
|
|
||
| <path android:fillColor="#00000000" android:pathData="M2.625,7.083H15.375" android:strokeColor="#000000" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="1.2"/> | ||
|
|
||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="20dp" | ||
| android:height="19dp" | ||
| android:viewportWidth="20" | ||
| android:viewportHeight="19"> | ||
| <path | ||
| android:pathData="M3.203,18.232C1.094,18.232 0,17.148 0,15.059V3.174C0,1.084 1.094,0 3.203,0H16.641C18.75,0 19.844,1.084 19.844,3.174V15.059C19.844,17.139 18.75,18.232 16.641,18.232H3.203ZM3.174,16.318H16.65C17.471,16.318 17.93,15.889 17.93,15.039V6.016C17.93,5.156 17.471,4.736 16.65,4.736H3.174C2.363,4.736 1.914,5.156 1.914,6.016V15.039C1.914,15.889 2.363,16.318 3.174,16.318ZM8.037,8.125C7.695,8.125 7.578,8.018 7.578,7.666V7.1C7.578,6.748 7.695,6.641 8.037,6.641H8.613C8.965,6.641 9.082,6.748 9.082,7.1V7.666C9.082,8.018 8.965,8.125 8.613,8.125H8.037ZM11.24,8.125C10.889,8.125 10.771,8.018 10.771,7.666V7.1C10.771,6.748 10.889,6.641 11.24,6.641H11.807C12.158,6.641 12.275,6.748 12.275,7.1V7.666C12.275,8.018 12.158,8.125 11.807,8.125H11.24ZM14.434,8.125C14.082,8.125 13.965,8.018 13.965,7.666V7.1C13.965,6.748 14.082,6.641 14.434,6.641H15C15.352,6.641 15.469,6.748 15.469,7.1V7.666C15.469,8.018 15.352,8.125 15,8.125H14.434ZM4.844,11.269C4.502,11.269 4.385,11.162 4.385,10.811V10.244C4.385,9.893 4.502,9.785 4.844,9.785H5.42C5.771,9.785 5.889,9.893 5.889,10.244V10.811C5.889,11.162 5.771,11.269 5.42,11.269H4.844ZM8.037,11.269C7.695,11.269 7.578,11.162 7.578,10.811V10.244C7.578,9.893 7.695,9.785 8.037,9.785H8.613C8.965,9.785 9.082,9.893 9.082,10.244V10.811C9.082,11.162 8.965,11.269 8.613,11.269H8.037ZM11.24,11.269C10.889,11.269 10.771,11.162 10.771,10.811V10.244C10.771,9.893 10.889,9.785 11.24,9.785H11.807C12.158,9.785 12.275,9.893 12.275,10.244V10.811C12.275,11.162 12.158,11.269 11.807,11.269H11.24ZM14.434,11.269C14.082,11.269 13.965,11.162 13.965,10.811V10.244C13.965,9.893 14.082,9.785 14.434,9.785H15C15.352,9.785 15.469,9.893 15.469,10.244V10.811C15.469,11.162 15.352,11.269 15,11.269H14.434ZM4.844,14.414C4.502,14.414 4.385,14.307 4.385,13.955V13.389C4.385,13.037 4.502,12.93 4.844,12.93H5.42C5.771,12.93 5.889,13.037 5.889,13.389V13.955C5.889,14.307 5.771,14.414 5.42,14.414H4.844ZM8.037,14.414C7.695,14.414 7.578,14.307 7.578,13.955V13.389C7.578,13.037 7.695,12.93 8.037,12.93H8.613C8.965,12.93 9.082,13.037 9.082,13.389V13.955C9.082,14.307 8.965,14.414 8.613,14.414H8.037ZM11.24,14.414C10.889,14.414 10.771,14.307 10.771,13.955V13.389C10.771,13.037 10.889,12.93 11.24,12.93H11.807C12.158,12.93 12.275,13.037 12.275,13.389V13.955C12.275,14.307 12.158,14.414 11.807,14.414H11.24Z" | ||
| android:fillColor="#000000"/> | ||
| </vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calendar button is likely announced with the wrong accessibility label.
With
rightIcon = R.drawable.ic_calendarat Line 45, the currentProfileHeaderimplementation (seeapp/src/main/java/com/cornellappdev/resell/android/ui/components/profile/ProfileHeader.kt:73-88) still uses a hardcodedcontentDescription = "search"for the right icon. This is an accessibility defect for screen-reader users.Consider making icon descriptions configurable from
ProfileScreenor updatingProfileHeaderto use calendar-specific text in this path.Suggested direction
Then pass
"Availability"(or a string resource) fromProfileScreen.🤖 Prompt for AI Agents