From d9a7b78494b3ce2ab14c8f7a39573d3ceaccc64c Mon Sep 17 00:00:00 2001 From: Hatimy Ramy Date: Fri, 20 Dec 2024 05:37:51 +0100 Subject: [PATCH 1/2] feature: switch worker button is responsive --- .../uiMode/appContentUI/AppContentNavGraph.kt | 2 +- .../userModeUI/UserModeNavGraph.kt | 2 +- .../becomeWorker/UpgradeToWorkerScreen.kt | 7 +++++-- .../views/welcome/WelcomeOnBoardScreen.kt | 20 ++++++++++++++++--- .../workerMode/WorkerModeNavGraph.kt | 11 ++++++---- .../workerMode/profile/WorkerProfileScreen.kt | 5 ++++- 6 files changed, 35 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt index 65fa30fa..3534d5e9 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt @@ -118,7 +118,7 @@ fun AppContentNavGraph( workerViewModel, quickFixViewModel, chatViewModel, - categoryViewModel) + categoryViewModel, userPreferencesViewModel) } } } diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt index b5a9c23f..0ade45ed 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt @@ -381,7 +381,7 @@ fun ProfileNavHost( locationViewModel, testBitmapPP, testLocation, - workerPreferencesViewModel) + workerPreferencesViewModel, appContentNavigationActions, modeViewModel) } } } diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt index 5722f313..03eda37a 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt @@ -45,6 +45,7 @@ import com.arygm.quickfix.model.profile.ProfileViewModel import com.arygm.quickfix.model.profile.WorkerProfile import com.arygm.quickfix.model.profile.dataFields.AddOnService import com.arygm.quickfix.model.profile.dataFields.IncludedService +import com.arygm.quickfix.model.switchModes.ModeViewModel import com.arygm.quickfix.ressources.C import com.arygm.quickfix.ui.navigation.NavigationActions import com.arygm.quickfix.ui.theme.poppinsTypography @@ -76,7 +77,9 @@ fun BusinessScreen( locationViewModel: LocationViewModel, testBitmapPP: Bitmap? = null, testLocation: Location = Location(), - workerPreferencesViewModel: PreferencesViewModelWorkerProfile + workerPreferencesViewModel: PreferencesViewModelWorkerProfile, + appContentNavigationActions: NavigationActions, + modeViewModel: ModeViewModel ) { val locationWorker = remember { mutableStateOf(testLocation) } val categories = categoryViewModel.categories.collectAsState().value @@ -252,7 +255,7 @@ fun BusinessScreen( workingHours = workingHours) } 2 -> { - WelcomeOnBoardScreen(navigationActions, preferencesViewModel) + WelcomeOnBoardScreen(appContentNavigationActions, navigationActions, preferencesViewModel, modeViewModel = modeViewModel) } } } diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt index c1818a81..1af396f0 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt @@ -31,18 +31,23 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.arygm.quickfix.R import com.arygm.quickfix.model.offline.small.PreferencesViewModel +import com.arygm.quickfix.model.switchModes.AppMode +import com.arygm.quickfix.model.switchModes.ModeViewModel import com.arygm.quickfix.ressources.C import com.arygm.quickfix.ui.elements.QuickFixButton import com.arygm.quickfix.ui.navigation.NavigationActions import com.arygm.quickfix.ui.theme.poppinsTypography +import com.arygm.quickfix.ui.uiMode.appContentUI.navigation.AppContentRoute import com.arygm.quickfix.ui.uiMode.appContentUI.userModeUI.navigation.UserScreen import com.arygm.quickfix.ui.uiMode.workerMode.navigation.WorkerScreen @Composable fun WelcomeOnBoardScreen( + appContentNavigationActions: NavigationActions, navigationActions: NavigationActions, preferencesViewModel: PreferencesViewModel, - testingFlag: Boolean = false + testingFlag: Boolean = false, + modeViewModel: ModeViewModel ) { BoxWithConstraints { val widthRatio = maxWidth / 411 @@ -52,11 +57,18 @@ fun WelcomeOnBoardScreen( // If the user chooses "Switch Worker Mode," we set this to true and show a loader until // isWorker == true var isWaitingForWorkerMode by remember { mutableStateOf(false) } + var switchToWorkerProfile by remember { mutableStateOf(false) } + var switchToUserProfile by remember { mutableStateOf(false) } // When isWorker changes, if we're waiting for worker mode and it's now true, navigate LaunchedEffect(isWorker) { if (isWaitingForWorkerMode && isWorker) { - navigationActions.navigateTo(WorkerScreen.PROFILE) + if (switchToWorkerProfile) { + modeViewModel.switchMode(AppMode.WORKER) + appContentNavigationActions.navigateTo(AppContentRoute.WORKER_MODE) + } else if (switchToUserProfile) { + navigationActions.navigateTo(UserScreen.PROFILE) + } } } if (isWaitingForWorkerMode) { @@ -99,6 +111,7 @@ fun WelcomeOnBoardScreen( onClickAction = { if (!testingFlag) { isWaitingForWorkerMode = true + switchToUserProfile = true } else { navigationActions.navigateTo(UserScreen.PROFILE) } @@ -119,8 +132,9 @@ fun WelcomeOnBoardScreen( onClickAction = { if (!testingFlag) { isWaitingForWorkerMode = true + switchToWorkerProfile = true } else { - navigationActions.navigateTo(UserScreen.PROFILE) + navigationActions.navigateTo(AppContentRoute.WORKER_MODE) } }, buttonColor = colorScheme.onPrimary, diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt index 74173d20..6463552f 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt @@ -32,6 +32,7 @@ import com.arygm.quickfix.model.locations.LocationViewModel import com.arygm.quickfix.model.messaging.ChatViewModel import com.arygm.quickfix.model.offline.small.PreferencesRepositoryDataStore import com.arygm.quickfix.model.offline.small.PreferencesViewModel +import com.arygm.quickfix.model.offline.small.PreferencesViewModelUserProfile import com.arygm.quickfix.model.offline.small.PreferencesViewModelWorkerProfile import com.arygm.quickfix.model.profile.ProfileViewModel import com.arygm.quickfix.model.profile.WorkerProfileRepositoryFirestore @@ -75,7 +76,8 @@ fun WorkerModeNavGraph( workerViewModel: ProfileViewModel, quickFixViewModel: QuickFixViewModel, chatViewModel: ChatViewModel, - categoryViewModel: CategoryViewModel + categoryViewModel: CategoryViewModel, + userPreferencesViewModel: PreferencesViewModelUserProfile ) { val context = LocalContext.current val workerNavController = rememberNavController() @@ -167,7 +169,7 @@ fun WorkerModeNavGraph( accountViewModel, workerNavigationActions, rootMainNavigationActions, - workerPreferenceViewModel) + workerPreferenceViewModel, userPreferencesViewModel) } } @@ -325,7 +327,8 @@ fun ProfileNavHost( accountViewModel: AccountViewModel, workerNavigationActions: NavigationActions, rootMainNavigationActions: NavigationActions, - workerPreferenceViewModel: PreferencesViewModelWorkerProfile + workerPreferenceViewModel: PreferencesViewModelWorkerProfile, + userPreferencesViewModel: PreferencesViewModelUserProfile ) { val profileNavController = rememberNavController() val profileNavigationActions = remember { NavigationActions(profileNavController) } @@ -343,7 +346,7 @@ fun ProfileNavHost( preferencesViewModel, workerPreferenceViewModel, appContentNavigationActions, - modeViewModel) + modeViewModel, userPreferencesViewModel) } composable(WorkerScreen.ACCOUNT_CONFIGURATION) { AccountConfigurationScreen(profileNavigationActions, accountViewModel, preferencesViewModel) diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/profile/WorkerProfileScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/profile/WorkerProfileScreen.kt index 204fd321..a2790e87 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/profile/WorkerProfileScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/profile/WorkerProfileScreen.kt @@ -12,6 +12,7 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.unit.dp import com.arygm.quickfix.model.offline.small.PreferencesViewModel +import com.arygm.quickfix.model.offline.small.PreferencesViewModelUserProfile import com.arygm.quickfix.model.offline.small.PreferencesViewModelWorkerProfile import com.arygm.quickfix.model.switchModes.AppMode import com.arygm.quickfix.model.switchModes.ModeViewModel @@ -29,7 +30,8 @@ fun WorkerProfileScreen( preferencesViewModel: PreferencesViewModel, workerPreferencesViewModel: PreferencesViewModelWorkerProfile, appContentNavigationActions: NavigationActions, - modeViewModel: ModeViewModel + modeViewModel: ModeViewModel, + userPreferencesViewModel: PreferencesViewModelUserProfile ) { val isWorker by preferencesViewModel.isWorkerFlow.collectAsState(initial = false) @@ -71,6 +73,7 @@ fun WorkerProfileScreen( val screenWidth = maxWidth val screenHeight = maxHeight QuickFixProfileScreenElement( + userPreferencesViewModel = userPreferencesViewModel, modeNavigationActions = workerNavigationActions, navigationActions = navigationActions, rootMainNavigationActions = rootMainNavigationActions, From 67db34644d6271a0f3ba3db9050fff9c84f042d1 Mon Sep 17 00:00:00 2001 From: Hatimy Ramy Date: Fri, 20 Dec 2024 06:54:10 +0100 Subject: [PATCH 2/2] fix: colors dark mode log out worker mode --- .../WelcomeOnBoardUserNoModeScreenTest.kt | 20 ++- .../ui/search/SearchWorkerResultScreenTest.kt | 1 - .../ui/elements/QuickFixProfileElement.kt | 4 +- .../java/com/arygm/quickfix/ui/theme/Color.kt | 3 + .../java/com/arygm/quickfix/ui/theme/Theme.kt | 10 +- .../uiMode/appContentUI/AppContentNavGraph.kt | 3 +- .../userModeUI/UserModeNavGraph.kt | 4 +- .../userModeUI/home/HomeScreen.kt | 19 ++- .../appContentUI/userModeUI/map/MapScreen.kt | 19 +-- .../becomeWorker/UpgradeToWorkerScreen.kt | 6 +- .../views/welcome/WelcomeOnBoardScreen.kt | 23 ++-- .../workerMode/WorkerModeNavGraph.kt | 6 +- .../noModeUI/authentication/WelcomeScreen.kt | 17 ++- .../main/res/drawable/no_quickfixes_dark.xml | 127 ++++++++++++++++++ app/src/main/res/drawable/noquickfixdark.xml | 108 +++++++++++++++ 15 files changed, 322 insertions(+), 48 deletions(-) create mode 100644 app/src/main/res/drawable/no_quickfixes_dark.xml create mode 100644 app/src/main/res/drawable/noquickfixdark.xml diff --git a/app/src/androidTest/java/com/arygm/quickfix/ui/profile/becomeWorker/views/welcome/WelcomeOnBoardUserNoModeScreenTest.kt b/app/src/androidTest/java/com/arygm/quickfix/ui/profile/becomeWorker/views/welcome/WelcomeOnBoardUserNoModeScreenTest.kt index 6f36abdb..59ec0254 100644 --- a/app/src/androidTest/java/com/arygm/quickfix/ui/profile/becomeWorker/views/welcome/WelcomeOnBoardUserNoModeScreenTest.kt +++ b/app/src/androidTest/java/com/arygm/quickfix/ui/profile/becomeWorker/views/welcome/WelcomeOnBoardUserNoModeScreenTest.kt @@ -7,10 +7,12 @@ import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import com.arygm.quickfix.model.offline.small.PreferencesViewModel import com.arygm.quickfix.model.offline.small.PreferencesViewModelUserProfile +import com.arygm.quickfix.model.switchModes.ModeViewModel import com.arygm.quickfix.ressources.C import com.arygm.quickfix.ui.navigation.NavigationActions import com.arygm.quickfix.ui.profile.FakePreferencesRepository import com.arygm.quickfix.ui.theme.QuickFixTheme +import com.arygm.quickfix.ui.uiMode.appContentUI.navigation.AppContentRoute import com.arygm.quickfix.ui.uiMode.appContentUI.userModeUI.navigation.UserScreen import com.arygm.quickfix.ui.uiMode.appContentUI.userModeUI.profile.becomeWorker.views.welcome.WelcomeOnBoardScreen import com.arygm.quickfix.utils.IS_WORKER_KEY @@ -36,9 +38,11 @@ class WelcomeOnBoardUserNoModeScreenTest { // Initialize ViewModels private lateinit var preferencesViewModel: PreferencesViewModel private lateinit var userPreferencesViewModel: PreferencesViewModelUserProfile + private lateinit var modeViewModel: ModeViewModel @Before fun setup() { + modeViewModel = ModeViewModel() // Initialize Mockito mocks for NavigationActions navigationActions = mock(NavigationActions::class.java) rootMainNavigationActions = mock(NavigationActions::class.java) @@ -61,7 +65,11 @@ class WelcomeOnBoardUserNoModeScreenTest { composeTestRule.setContent { QuickFixTheme { WelcomeOnBoardScreen( - navigationActions = navigationActions, preferencesViewModel = preferencesViewModel) + navigationActions = navigationActions, + preferencesViewModel = preferencesViewModel, + modeViewModel = modeViewModel, + testingFlag = true, + appContentNavigationActions = appContentNavigationActions) } } @@ -79,7 +87,9 @@ class WelcomeOnBoardUserNoModeScreenTest { WelcomeOnBoardScreen( navigationActions = navigationActions, preferencesViewModel = preferencesViewModel, - testingFlag = true) + modeViewModel = modeViewModel, + testingFlag = true, + appContentNavigationActions = appContentNavigationActions) } } runBlocking { preferencesRepository.setPreference(IS_WORKER_KEY, true) } @@ -97,7 +107,9 @@ class WelcomeOnBoardUserNoModeScreenTest { WelcomeOnBoardScreen( navigationActions = navigationActions, preferencesViewModel = preferencesViewModel, - testingFlag = true) + modeViewModel = modeViewModel, + testingFlag = true, + appContentNavigationActions = appContentNavigationActions) } } runBlocking { preferencesRepository.setPreference(IS_WORKER_KEY, true) } @@ -105,6 +117,6 @@ class WelcomeOnBoardUserNoModeScreenTest { composeTestRule.onNodeWithTag(C.Tag.welcomeOnBoardScreenSwitchWorkerButton).performClick() // Verify navigation to UserScreen.PROFILE - verify(navigationActions).navigateTo(UserScreen.PROFILE) + verify(appContentNavigationActions).navigateTo(AppContentRoute.WORKER_MODE) } } diff --git a/app/src/androidTest/java/com/arygm/quickfix/ui/search/SearchWorkerResultScreenTest.kt b/app/src/androidTest/java/com/arygm/quickfix/ui/search/SearchWorkerResultScreenTest.kt index b0125aa8..a63fbe06 100644 --- a/app/src/androidTest/java/com/arygm/quickfix/ui/search/SearchWorkerResultScreenTest.kt +++ b/app/src/androidTest/java/com/arygm/quickfix/ui/search/SearchWorkerResultScreenTest.kt @@ -1524,7 +1524,6 @@ class SearchWorkerResultScreenTest { .filter(!hasTestTag("filter_button_Clear"))[0] .performClick() composeTestRule.waitForIdle() - // With availability cleared and no other filters applied, we should still see 2 workers composeTestRule.onNodeWithTag("worker_profiles_list").onChildren().assertCountEquals(2) } diff --git a/app/src/main/java/com/arygm/quickfix/ui/elements/QuickFixProfileElement.kt b/app/src/main/java/com/arygm/quickfix/ui/elements/QuickFixProfileElement.kt index 576e2d25..1c507c2d 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/elements/QuickFixProfileElement.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/elements/QuickFixProfileElement.kt @@ -233,7 +233,7 @@ fun QuickFixProfileScreenElement( .clip(RoundedCornerShape(buttonCornerRadius)) .testTag("AddFundsButton") .background( - color = colorScheme.onPrimary, + color = colorScheme.surface, shape = RoundedCornerShape(buttonCornerRadius)) .weight(0.35f), ) { @@ -364,7 +364,7 @@ fun QuickFixProfileScreenElement( }, shape = RoundedCornerShape(screenWidth * 0.04f), border = BorderStroke(borderStrokeWidth, colorScheme.onBackground), - colors = ButtonDefaults.buttonColors(containerColor = colorScheme.onPrimary), + colors = ButtonDefaults.buttonColors(containerColor = colorScheme.surface), modifier = Modifier.testTag("LogoutButton")) { Text( text = "Log out", diff --git a/app/src/main/java/com/arygm/quickfix/ui/theme/Color.kt b/app/src/main/java/com/arygm/quickfix/ui/theme/Color.kt index ede8182d..1172b1e3 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/theme/Color.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/theme/Color.kt @@ -72,3 +72,6 @@ val DarkTitlePrimary = Color(0xFF66001A) /* Time selector */ val TimeSelectorUnselectedContainerColor = Color(0xFFE9E0E0) + +val DarkRegisterColor = Color(0xFFB78080) +val LightRegisterColor = ButtonPrimary diff --git a/app/src/main/java/com/arygm/quickfix/ui/theme/Theme.kt b/app/src/main/java/com/arygm/quickfix/ui/theme/Theme.kt index ec0e8374..c51e3458 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/theme/Theme.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/theme/Theme.kt @@ -38,7 +38,10 @@ private val LightColorScheme = surfaceVariant = ButtonQuaternary, // Fourth button color onSurfaceVariant = TextButtonQuaternary, // Text color for the quaternary button, onSecondaryContainer = TextDisabled, - tertiaryContainer = ButtonDisabled) + tertiaryContainer = ButtonDisabled, + scrim = LightRegisterColor, + surfaceDim = DarkTextPrimary, + surfaceContainerLowest = TextButtonPrimary) private val DarkColorScheme = darkColorScheme( @@ -58,7 +61,10 @@ private val DarkColorScheme = surfaceVariant = DarkButtonQuaternary, // Fourth button color onSurfaceVariant = DarkTextButtonQuaternary, // Text color for the quaternary button onSecondaryContainer = DarkTextDisabled, - tertiaryContainer = DarkButtonDisabled) + tertiaryContainer = DarkButtonDisabled, + scrim = DarkRegisterColor, + surfaceDim = TextPrimary, + surfaceContainerLowest = TextSecondary) val poppinsFontFamily = FontFamily( Font(R.font.poppins_black, FontWeight.Black, FontStyle.Normal), diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt index 3534d5e9..70f47896 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/AppContentNavGraph.kt @@ -118,7 +118,8 @@ fun AppContentNavGraph( workerViewModel, quickFixViewModel, chatViewModel, - categoryViewModel, userPreferencesViewModel) + categoryViewModel, + userPreferencesViewModel) } } } diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt index 0ade45ed..d515d55b 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/UserModeNavGraph.kt @@ -381,7 +381,9 @@ fun ProfileNavHost( locationViewModel, testBitmapPP, testLocation, - workerPreferencesViewModel, appContentNavigationActions, modeViewModel) + workerPreferencesViewModel, + appContentNavigationActions, + modeViewModel) } } } diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/home/HomeScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/home/HomeScreen.kt index fce68223..84d3ec41 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/home/HomeScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/home/HomeScreen.kt @@ -73,6 +73,7 @@ import com.arygm.quickfix.ui.elements.QuickFixTextFieldCustom import com.arygm.quickfix.ui.elements.QuickFixesWidget import com.arygm.quickfix.ui.elements.Service import com.arygm.quickfix.ui.navigation.NavigationActions +import com.arygm.quickfix.ui.theme.BackgroundSecondary import com.arygm.quickfix.ui.theme.poppinsTypography import com.arygm.quickfix.ui.uiMode.appContentUI.userModeUI.navigation.USER_TOP_LEVEL_DESTINATIONS import com.arygm.quickfix.ui.uiMode.appContentUI.userModeUI.navigation.UserScreen @@ -285,11 +286,19 @@ fun HomeScreen( .background(colorScheme.surface), verticalArrangement = Arrangement.spacedBy((-64).dp), horizontalAlignment = Alignment.CenterHorizontally) { - Image( - painter = painterResource(id = R.drawable.noquickfix), - contentDescription = "No QuickFixes Background", - contentScale = ContentScale.Crop, - modifier = Modifier.size(180.dp).alpha(1f)) + if (colorScheme.surface == BackgroundSecondary) { + Image( + painter = painterResource(id = R.drawable.noquickfix), + contentDescription = "No QuickFixes Background", + contentScale = ContentScale.Crop, + modifier = Modifier.size(180.dp).alpha(1f)) + } else { + Image( + painter = painterResource(id = R.drawable.noquickfixdark), + contentDescription = "No QuickFixes Background", + contentScale = ContentScale.Crop, + modifier = Modifier.size(180.dp).alpha(1f)) + } Column( horizontalAlignment = Alignment.CenterHorizontally, diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/map/MapScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/map/MapScreen.kt index 4001b3ab..2c0f5870 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/map/MapScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/map/MapScreen.kt @@ -194,14 +194,6 @@ fun MapScreen( mapStyleOptions = MapStyleOptions.loadRawResourceStyle(context, currentStyle)), onMapLoaded = { isMapLoaded = true }) { filteredWorkers.forEach { profile -> - profile.location?.let { - val cityName = getCityNameFromCoordinates(it.latitude, profile.location.longitude) - if (cityName != null) { - workerAddress = cityName - } else { - workerAddress = profile.location.name - } - } profile.location ?.let { LatLng(it.latitude, it.longitude) } ?.let { rememberMarkerState(position = it) } @@ -249,6 +241,17 @@ fun MapScreen( if (isWindowVisible) { Popup(onDismissRequest = { isWindowVisible = false }, alignment = Alignment.Center) { selectedWorker?.let { + selectedWorker!!.location?.let { + val cityName = + selectedWorker!!.location?.let { it1 -> + getCityNameFromCoordinates(it.latitude, it1.longitude) + } + if (cityName != null) { + workerAddress = cityName + } else { + workerAddress = selectedWorker!!.location!!.name + } + } QuickFixSlidingWindowWorker( isVisible = isWindowVisible, onDismiss = { isWindowVisible = false }, diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt index 03eda37a..28619660 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/UpgradeToWorkerScreen.kt @@ -255,7 +255,11 @@ fun BusinessScreen( workingHours = workingHours) } 2 -> { - WelcomeOnBoardScreen(appContentNavigationActions, navigationActions, preferencesViewModel, modeViewModel = modeViewModel) + WelcomeOnBoardScreen( + appContentNavigationActions, + navigationActions, + preferencesViewModel, + modeViewModel = modeViewModel) } } } diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt index 1af396f0..fa8d6080 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/userModeUI/profile/becomeWorker/views/welcome/WelcomeOnBoardScreen.kt @@ -39,7 +39,6 @@ import com.arygm.quickfix.ui.navigation.NavigationActions import com.arygm.quickfix.ui.theme.poppinsTypography import com.arygm.quickfix.ui.uiMode.appContentUI.navigation.AppContentRoute import com.arygm.quickfix.ui.uiMode.appContentUI.userModeUI.navigation.UserScreen -import com.arygm.quickfix.ui.uiMode.workerMode.navigation.WorkerScreen @Composable fun WelcomeOnBoardScreen( @@ -57,18 +56,18 @@ fun WelcomeOnBoardScreen( // If the user chooses "Switch Worker Mode," we set this to true and show a loader until // isWorker == true var isWaitingForWorkerMode by remember { mutableStateOf(false) } - var switchToWorkerProfile by remember { mutableStateOf(false) } - var switchToUserProfile by remember { mutableStateOf(false) } + var switchToWorkerProfile by remember { mutableStateOf(false) } + var switchToUserProfile by remember { mutableStateOf(false) } // When isWorker changes, if we're waiting for worker mode and it's now true, navigate LaunchedEffect(isWorker) { if (isWaitingForWorkerMode && isWorker) { - if (switchToWorkerProfile) { - modeViewModel.switchMode(AppMode.WORKER) - appContentNavigationActions.navigateTo(AppContentRoute.WORKER_MODE) - } else if (switchToUserProfile) { - navigationActions.navigateTo(UserScreen.PROFILE) - } + if (switchToWorkerProfile) { + modeViewModel.switchMode(AppMode.WORKER) + appContentNavigationActions.navigateTo(AppContentRoute.WORKER_MODE) + } else if (switchToUserProfile) { + navigationActions.navigateTo(UserScreen.PROFILE) + } } } if (isWaitingForWorkerMode) { @@ -111,7 +110,7 @@ fun WelcomeOnBoardScreen( onClickAction = { if (!testingFlag) { isWaitingForWorkerMode = true - switchToUserProfile = true + switchToUserProfile = true } else { navigationActions.navigateTo(UserScreen.PROFILE) } @@ -132,9 +131,9 @@ fun WelcomeOnBoardScreen( onClickAction = { if (!testingFlag) { isWaitingForWorkerMode = true - switchToWorkerProfile = true + switchToWorkerProfile = true } else { - navigationActions.navigateTo(AppContentRoute.WORKER_MODE) + appContentNavigationActions.navigateTo(AppContentRoute.WORKER_MODE) } }, buttonColor = colorScheme.onPrimary, diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt index 6463552f..4ce550e9 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/appContentUI/workerMode/WorkerModeNavGraph.kt @@ -169,7 +169,8 @@ fun WorkerModeNavGraph( accountViewModel, workerNavigationActions, rootMainNavigationActions, - workerPreferenceViewModel, userPreferencesViewModel) + workerPreferenceViewModel, + userPreferencesViewModel) } } @@ -346,7 +347,8 @@ fun ProfileNavHost( preferencesViewModel, workerPreferenceViewModel, appContentNavigationActions, - modeViewModel, userPreferencesViewModel) + modeViewModel, + userPreferencesViewModel) } composable(WorkerScreen.ACCOUNT_CONFIGURATION) { AccountConfigurationScreen(profileNavigationActions, accountViewModel, preferencesViewModel) diff --git a/app/src/main/java/com/arygm/quickfix/ui/uiMode/noModeUI/authentication/WelcomeScreen.kt b/app/src/main/java/com/arygm/quickfix/ui/uiMode/noModeUI/authentication/WelcomeScreen.kt index 880501cb..a0116f35 100644 --- a/app/src/main/java/com/arygm/quickfix/ui/uiMode/noModeUI/authentication/WelcomeScreen.kt +++ b/app/src/main/java/com/arygm/quickfix/ui/uiMode/noModeUI/authentication/WelcomeScreen.kt @@ -45,7 +45,6 @@ import com.arygm.quickfix.model.profile.ProfileViewModel import com.arygm.quickfix.ui.elements.QuickFixButton import com.arygm.quickfix.ui.navigation.NavigationActions import com.arygm.quickfix.ui.navigation.RootRoute -import com.arygm.quickfix.ui.theme.ButtonPrimary import com.arygm.quickfix.ui.uiMode.noModeUI.navigation.NoModeRoute import com.arygm.quickfix.ui.uiMode.noModeUI.navigation.NoModeScreen import com.arygm.quickfix.utils.loadIsSignIn @@ -155,7 +154,7 @@ fun WelcomeScreen( painter = painterResource(id = com.arygm.quickfix.R.drawable.quickfix), contentDescription = null, contentScale = ContentScale.Crop, - colorFilter = ColorFilter.tint(colorScheme.background), + colorFilter = ColorFilter.tint(Color.White), modifier = Modifier.fillMaxWidth(0.7f) .graphicsLayer(rotationZ = 4.57f, alpha = elementsAlpha) @@ -165,7 +164,7 @@ fun WelcomeScreen( Text( text = "QuickFix", style = MaterialTheme.typography.titleLarge, - color = colorScheme.background, + color = Color.White, modifier = Modifier.padding(bottom = screenHeight * 0.01f) // Space between text and buttons .graphicsLayer(alpha = elementsAlpha) @@ -179,7 +178,7 @@ fun WelcomeScreen( }, buttonColor = MaterialTheme.colorScheme.tertiary, modifier = Modifier.graphicsLayer(alpha = elementsAlpha).testTag("logInButton"), - textColor = colorScheme.background) + textColor = colorScheme.onPrimary) QuickFixButton( buttonText = "REGISTER TO QUICKFIX", @@ -187,10 +186,10 @@ fun WelcomeScreen( targetScreen = NoModeRoute.REGISTER startAnimation = true }, - buttonColor = colorScheme.background, + buttonColor = colorScheme.surfaceDim, modifier = Modifier.graphicsLayer(alpha = elementsAlpha).testTag("RegistrationButton"), - textColor = ButtonPrimary) + textColor = colorScheme.scrim) QuickFixButton( onClickAction = { @@ -203,15 +202,15 @@ fun WelcomeScreen( launcher.launch(googleSignInClient.signInIntent) }, buttonColor = Color.Transparent, - border = BorderStroke(2.dp, colorScheme.background), + border = BorderStroke(2.dp, colorScheme.surfaceContainerLowest), modifier = Modifier.fillMaxWidth(0.8f) .graphicsLayer(alpha = elementsAlpha) .testTag("googleButton"), buttonText = "CONTINUE WITH GOOGLE", - textColor = colorScheme.background, + textColor = colorScheme.surfaceContainerLowest, leadingIcon = ImageVector.vectorResource(id = R.drawable.google), - leadingIconTint = colorScheme.background) + leadingIconTint = colorScheme.surfaceContainerLowest) } } } diff --git a/app/src/main/res/drawable/no_quickfixes_dark.xml b/app/src/main/res/drawable/no_quickfixes_dark.xml new file mode 100644 index 00000000..40295e7d --- /dev/null +++ b/app/src/main/res/drawable/no_quickfixes_dark.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/noquickfixdark.xml b/app/src/main/res/drawable/noquickfixdark.xml new file mode 100644 index 00000000..b35e17fc --- /dev/null +++ b/app/src/main/res/drawable/noquickfixdark.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +