From e59f5898e2ad58c09aa7304c03ae33991964bfac Mon Sep 17 00:00:00 2001 From: Farhan Arshad Date: Wed, 17 Apr 2024 13:51:40 +0500 Subject: [PATCH] fix: openedx theme breaking changes --- .../openedx/auth/presentation/ui/AuthUI.kt | 8 ++-- .../auth/presentation/ui/CheckboxField.kt | 2 +- .../auth/presentation/ui/SocialAuthView.kt | 16 +++---- .../dialog/appreview/AppReviewUI.kt | 7 ++- .../global/app_upgrade/AppUpdateUI.kt | 8 ++-- .../settings/VideoQualityFragment.kt | 2 +- .../java/org/openedx/core/ui/ComposeCommon.kt | 43 ++++++++++--------- .../org/openedx/core/ui/theme/AppColors.kt | 15 +++++-- .../java/org/openedx/core/ui/theme/Theme.kt | 34 ++++++++++----- .../org/openedx/core/ui/theme/Colors.kt | 39 ++++++++++++----- .../presentation/ChapterEndFragmentDialog.kt | 20 ++++----- .../outline/CourseOutlineFragment.kt | 4 +- .../course/presentation/ui/CourseUI.kt | 14 +++--- .../course/presentation/ui/CourseVideosUI.kt | 4 +- .../unit/NotSupportedUnitFragment.kt | 4 +- .../presentation/DashboardFragment.kt | 4 +- .../threads/DiscussionThreadsFragment.kt | 4 +- .../delete/DeleteProfileFragment.kt | 2 +- .../presentation/edit/EditProfileFragment.kt | 10 ++--- .../profile/compose/ProfileView.kt | 2 +- .../settings/video/VideoSettingsFragment.kt | 6 +-- .../profile/presentation/ui/ProfileUI.kt | 2 +- .../whatsnew/presentation/ui/WhatsNewUI.kt | 16 +++---- 23 files changed, 152 insertions(+), 114 deletions(-) diff --git a/auth/src/main/java/org/openedx/auth/presentation/ui/AuthUI.kt b/auth/src/main/java/org/openedx/auth/presentation/ui/AuthUI.kt index ca98f8fb7..d3d092567 100644 --- a/auth/src/main/java/org/openedx/auth/presentation/ui/AuthUI.kt +++ b/auth/src/main/java/org/openedx/auth/presentation/ui/AuthUI.kt @@ -302,11 +302,11 @@ fun InputRegistrationField( } val isSingleLine = registrationField.type != RegistrationFieldType.TEXTAREA val helperTextColor = if (registrationField.errorInstructions.isEmpty()) { - MaterialTheme.appColors.primary + MaterialTheme.appColors.textSecondary } else if (isErrorShown) { MaterialTheme.appColors.error } else { - MaterialTheme.appColors.textFieldHint + MaterialTheme.appColors.textSecondary } val helperText = if (registrationField.errorInstructions.isEmpty()) { registrationField.instructions @@ -381,11 +381,11 @@ fun SelectableRegisterField( onClick: (String, List) -> Unit ) { val helperTextColor = if (registrationField.errorInstructions.isEmpty()) { - MaterialTheme.appColors.primary + MaterialTheme.appColors.textSecondary } else if (isErrorShown) { MaterialTheme.appColors.error } else { - MaterialTheme.appColors.textFieldHint + MaterialTheme.appColors.textSecondary } val helperText = if (registrationField.errorInstructions.isEmpty()) { registrationField.instructions diff --git a/auth/src/main/java/org/openedx/auth/presentation/ui/CheckboxField.kt b/auth/src/main/java/org/openedx/auth/presentation/ui/CheckboxField.kt index 5ff1b4b6e..b134cb59a 100644 --- a/auth/src/main/java/org/openedx/auth/presentation/ui/CheckboxField.kt +++ b/auth/src/main/java/org/openedx/auth/presentation/ui/CheckboxField.kt @@ -31,7 +31,7 @@ internal fun CheckboxField( checked = checkedState, colors = CheckboxDefaults.colors( checkedColor = MaterialTheme.appColors.primary, - uncheckedColor = MaterialTheme.appColors.primary + uncheckedColor = MaterialTheme.appColors.textFieldText ), onCheckedChange = { checkedState = it diff --git a/auth/src/main/java/org/openedx/auth/presentation/ui/SocialAuthView.kt b/auth/src/main/java/org/openedx/auth/presentation/ui/SocialAuthView.kt index b206868b4..028439290 100644 --- a/auth/src/main/java/org/openedx/auth/presentation/ui/SocialAuthView.kt +++ b/auth/src/main/java/org/openedx/auth/presentation/ui/SocialAuthView.kt @@ -45,9 +45,9 @@ internal fun SocialAuthView( .testTag("btn_google_auth") .padding(top = 24.dp) .fillMaxWidth(), - backgroundColor = MaterialTheme.appColors.buttonSecondaryBackground, - borderColor = MaterialTheme.appColors.textFieldBorder, - textColor = Color.Black, + backgroundColor = MaterialTheme.appColors.authGoogleButtonBackground, + borderColor = MaterialTheme.appColors.primary, + textColor = Color.Unspecified, onClick = { onEvent(AuthType.GOOGLE) } @@ -62,8 +62,8 @@ internal fun SocialAuthView( modifier = Modifier .testTag("txt_google_auth") .padding(start = 10.dp), - color = Color.Black, - text = stringResource(id = stringRes) + text = stringResource(id = stringRes), + color = MaterialTheme.appColors.primaryButtonBorderedText, ) } } @@ -88,13 +88,13 @@ internal fun SocialAuthView( Icon( painter = painterResource(id = R.drawable.ic_auth_facebook), contentDescription = null, - tint = MaterialTheme.appColors.onSecondary, + tint = MaterialTheme.appColors.primaryButtonText, ) Text( modifier = Modifier .testTag("txt_facebook_auth") .padding(start = 10.dp), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, text = stringResource(id = stringRes) ) } @@ -126,7 +126,7 @@ internal fun SocialAuthView( modifier = Modifier .testTag("txt_microsoft_auth") .padding(start = 10.dp), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, text = stringResource(id = stringRes) ) } diff --git a/core/src/main/java/org/openedx/core/presentation/dialog/appreview/AppReviewUI.kt b/core/src/main/java/org/openedx/core/presentation/dialog/appreview/AppReviewUI.kt index 7dcd18c22..b924cd543 100644 --- a/core/src/main/java/org/openedx/core/presentation/dialog/appreview/AppReviewUI.kt +++ b/core/src/main/java/org/openedx/core/presentation/dialog/appreview/AppReviewUI.kt @@ -180,7 +180,7 @@ fun FeedbackDialog( colors = TextFieldDefaults.outlinedTextFieldColors( backgroundColor = MaterialTheme.appColors.cardViewBackground, unfocusedBorderColor = MaterialTheme.appColors.textFieldBorder, - textColor = MaterialTheme.appColors.textFieldHint + textColor = MaterialTheme.appColors.textFieldText ), ) @@ -320,8 +320,8 @@ fun DefaultTextButton( val textColor: Color val backgroundColor: Color if (isEnabled) { - textColor = MaterialTheme.appColors.buttonText - backgroundColor = MaterialTheme.appColors.buttonBackground + textColor = MaterialTheme.appColors.primaryButtonText + backgroundColor = MaterialTheme.appColors.primaryButtonBackground } else { textColor = MaterialTheme.appColors.inactiveButtonText backgroundColor = MaterialTheme.appColors.inactiveButtonBackground @@ -345,7 +345,6 @@ fun DefaultTextButton( ) { Text( text = text, - color = MaterialTheme.appColors.onSecondary, style = MaterialTheme.appTypography.labelLarge ) } diff --git a/core/src/main/java/org/openedx/core/presentation/global/app_upgrade/AppUpdateUI.kt b/core/src/main/java/org/openedx/core/presentation/global/app_upgrade/AppUpdateUI.kt index 9a32b4123..3f8dd6fa9 100644 --- a/core/src/main/java/org/openedx/core/presentation/global/app_upgrade/AppUpdateUI.kt +++ b/core/src/main/java/org/openedx/core/presentation/global/app_upgrade/AppUpdateUI.kt @@ -275,7 +275,7 @@ fun TransparentTextButton( ) { Text( modifier = Modifier.testTag("txt_secondary"), - color = MaterialTheme.appColors.textPrimary, + color = MaterialTheme.appColors.textAccent, style = MaterialTheme.appTypography.labelLarge, text = text ) @@ -292,7 +292,7 @@ fun DefaultTextButton( .testTag("btn_primary") .height(42.dp), colors = ButtonDefaults.buttonColors( - backgroundColor = MaterialTheme.appColors.textPrimary + backgroundColor = MaterialTheme.appColors.primaryButtonBackground ), elevation = null, shape = MaterialTheme.appShapes.navigationButtonShape, @@ -305,7 +305,7 @@ fun DefaultTextButton( Text( modifier = Modifier.testTag("txt_primary"), text = text, - color = MaterialTheme.appColors.buttonText, + color = MaterialTheme.appColors.primaryButtonText, style = MaterialTheme.appTypography.labelLarge ) } @@ -401,4 +401,4 @@ private fun AppUpgradeRecommendDialogPreview() { onUpdateClick = {} ) } -} \ No newline at end of file +} diff --git a/core/src/main/java/org/openedx/core/presentation/settings/VideoQualityFragment.kt b/core/src/main/java/org/openedx/core/presentation/settings/VideoQualityFragment.kt index f1c92f4c8..e26d882eb 100644 --- a/core/src/main/java/org/openedx/core/presentation/settings/VideoQualityFragment.kt +++ b/core/src/main/java/org/openedx/core/presentation/settings/VideoQualityFragment.kt @@ -233,7 +233,7 @@ private fun QualityOption( Text( modifier = Modifier.testTag("txt_video_quality_description_${title.tagId()}"), text = description, - color = MaterialTheme.appColors.textPrimary, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelMedium ) } diff --git a/core/src/main/java/org/openedx/core/ui/ComposeCommon.kt b/core/src/main/java/org/openedx/core/ui/ComposeCommon.kt index cfbace5c8..8f1a87817 100644 --- a/core/src/main/java/org/openedx/core/ui/ComposeCommon.kt +++ b/core/src/main/java/org/openedx/core/ui/ComposeCommon.kt @@ -219,11 +219,12 @@ fun SearchBar( } }, colors = TextFieldDefaults.outlinedTextFieldColors( - textColor = MaterialTheme.appColors.textFieldText, - backgroundColor = MaterialTheme.appColors.textFieldBackground, - focusedBorderColor = MaterialTheme.appColors.textFieldBorder, - cursorColor = MaterialTheme.appColors.textFieldText, - leadingIconColor = MaterialTheme.appColors.textFieldText + textColor = MaterialTheme.appColors.textPrimary, + backgroundColor = if (isFocused) MaterialTheme.appColors.background else MaterialTheme.appColors.textFieldBackground, + focusedBorderColor = MaterialTheme.appColors.primary, + unfocusedBorderColor = MaterialTheme.appColors.textFieldBorder, + cursorColor = MaterialTheme.appColors.primary, + leadingIconColor = MaterialTheme.appColors.textPrimary ), placeholder = { Text( @@ -231,7 +232,7 @@ fun SearchBar( .testTag("txt_search_placeholder") .fillMaxWidth(), text = label, - color = MaterialTheme.appColors.textFieldHint, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.bodyMedium ) }, @@ -240,7 +241,7 @@ fun SearchBar( modifier = Modifier.padding(start = 16.dp), imageVector = Icons.Filled.Search, contentDescription = null, - tint = if (isFocused) MaterialTheme.appColors.textFieldText else MaterialTheme.appColors.textFieldHint + tint = if (isFocused) MaterialTheme.appColors.primary else MaterialTheme.appColors.onSurface ) }, trailingIcon = { @@ -310,18 +311,18 @@ fun SearchBarStateless( } }, colors = TextFieldDefaults.outlinedTextFieldColors( - textColor = MaterialTheme.appColors.textFieldText, - backgroundColor = MaterialTheme.appColors.textFieldBackground, - focusedBorderColor = MaterialTheme.appColors.textFieldBorder, + textColor = MaterialTheme.appColors.textPrimary, + backgroundColor = if (isFocused) MaterialTheme.appColors.background else MaterialTheme.appColors.textFieldBackground, + focusedBorderColor = MaterialTheme.appColors.primary, unfocusedBorderColor = MaterialTheme.appColors.textFieldBorder, - cursorColor = MaterialTheme.appColors.textFieldText, - leadingIconColor = MaterialTheme.appColors.textFieldText + cursorColor = MaterialTheme.appColors.primary, + leadingIconColor = MaterialTheme.appColors.textPrimary ), placeholder = { Text( modifier = Modifier.fillMaxWidth(), text = label, - color = MaterialTheme.appColors.textFieldText, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.bodyMedium ) }, @@ -330,7 +331,7 @@ fun SearchBarStateless( modifier = Modifier.padding(start = 16.dp), imageVector = Icons.Filled.Search, contentDescription = null, - tint = if (isFocused) MaterialTheme.appColors.textFieldText else MaterialTheme.appColors.textFieldHint + tint = if (isFocused) MaterialTheme.appColors.primary else MaterialTheme.appColors.onSurface ) }, trailingIcon = { @@ -1022,8 +1023,8 @@ fun OpenEdXSecondaryButton( text = text, onClick = onClick, enabled = enabled, - textColor = MaterialTheme.appColors.onSecondary, - backgroundColor = MaterialTheme.appColors.secondary, + textColor = MaterialTheme.appColors.primaryButtonText, + backgroundColor = MaterialTheme.appColors.secondaryButtonBackground, content = content ) } @@ -1034,8 +1035,8 @@ fun OpenEdXButton( text: String = "", onClick: () -> Unit, enabled: Boolean = true, - textColor: Color = MaterialTheme.appColors.onSecondary, - backgroundColor: Color = MaterialTheme.appColors.secondary, + textColor: Color = MaterialTheme.appColors.primaryButtonText, + backgroundColor: Color = MaterialTheme.appColors.primaryButtonBackground, content: (@Composable RowScope.() -> Unit)? = null ) { Button( @@ -1076,9 +1077,9 @@ fun OpenEdXSecondaryOutlinedButton( text = text, onClick = onClick, enabled = enabled, - textColor = MaterialTheme.appColors.secondary, - backgroundColor = MaterialTheme.appColors.onSecondary, - borderColor = MaterialTheme.appColors.buttonBorder, + textColor = MaterialTheme.appColors.secondaryButtonBorderedText, + backgroundColor = MaterialTheme.appColors.secondaryButtonBorderedBackground, + borderColor = MaterialTheme.appColors.secondaryButtonBorder, content = content ) } diff --git a/core/src/main/java/org/openedx/core/ui/theme/AppColors.kt b/core/src/main/java/org/openedx/core/ui/theme/AppColors.kt index 62a339e84..f460ef6b4 100644 --- a/core/src/main/java/org/openedx/core/ui/theme/AppColors.kt +++ b/core/src/main/java/org/openedx/core/ui/theme/AppColors.kt @@ -21,9 +21,16 @@ data class AppColors( val textFieldText: Color, val textFieldHint: Color, - val buttonBackground: Color, - val buttonSecondaryBackground: Color, - val buttonText: Color, + val primaryButtonBackground: Color, + val primaryButtonText: Color, + val primaryButtonBorder: Color, + val primaryButtonBorderedText: Color, + + val secondaryButtonBackground: Color, + val secondaryButtonText: Color, + val secondaryButtonBorder: Color, + val secondaryButtonBorderedBackground: Color, + val secondaryButtonBorderedText: Color, val cardViewBackground: Color, val cardViewBorder: Color, @@ -36,7 +43,6 @@ data class AppColors( val info_variant: Color, val onWarning: Color, val onInfo: Color, - val buttonBorder: Color, val rateStars: Color, val inactiveButtonBackground: Color, @@ -50,6 +56,7 @@ data class AppColors( val datesSectionBarNextWeek: Color, val datesSectionBarUpcoming: Color, + val authGoogleButtonBackground: Color, val authFacebookButtonBackground: Color, val authMicrosoftButtonBackground: Color, diff --git a/core/src/main/java/org/openedx/core/ui/theme/Theme.kt b/core/src/main/java/org/openedx/core/ui/theme/Theme.kt index 0d56aba59..f0c771770 100644 --- a/core/src/main/java/org/openedx/core/ui/theme/Theme.kt +++ b/core/src/main/java/org/openedx/core/ui/theme/Theme.kt @@ -40,9 +40,16 @@ private val DarkColorPalette = AppColors( textFieldText = dark_text_field_text, textFieldHint = dark_text_field_hint, - buttonBackground = dark_button_background, - buttonSecondaryBackground = dark_button_secondary_background, - buttonText = dark_button_text, + primaryButtonBackground = dark_primary_button_background, + primaryButtonText = dark_primary_button_text, + primaryButtonBorder = dark_primary_button_border, + primaryButtonBorderedText = dark_primary_button_bordered_text, + + secondaryButtonBackground = dark_secondary_button_background, + secondaryButtonText = dark_secondary_button_text, + secondaryButtonBorder = dark_secondary_button_border, + secondaryButtonBorderedBackground = dark_secondary_button_bordered_background, + secondaryButtonBorderedText = dark_secondary_button_bordered_text, cardViewBackground = dark_card_view_background, cardViewBorder = dark_card_view_border, @@ -56,11 +63,10 @@ private val DarkColorPalette = AppColors( info_variant = dark_info_variant, onWarning = dark_onWarning, onInfo = dark_onInfo, - buttonBorder = dark_button_border, rateStars = dark_rate_stars, inactiveButtonBackground = dark_inactive_button_background, - inactiveButtonText = dark_button_text, + inactiveButtonText = dark_primary_button_text, accessGreen = dark_access_green, @@ -70,6 +76,7 @@ private val DarkColorPalette = AppColors( datesSectionBarNextWeek = dark_dates_section_bar_next_week, datesSectionBarUpcoming = dark_dates_section_bar_upcoming, + authGoogleButtonBackground = dark_auth_google_button_background, authFacebookButtonBackground = dark_auth_facebook_button_background, authMicrosoftButtonBackground = dark_auth_microsoft_button_background, @@ -109,9 +116,16 @@ private val LightColorPalette = AppColors( textFieldText = light_text_field_text, textFieldHint = light_text_field_hint, - buttonBackground = light_button_background, - buttonSecondaryBackground = light_button_secondary_background, - buttonText = light_button_text, + primaryButtonBackground = light_primary_button_background, + primaryButtonText = light_primary_button_text, + primaryButtonBorder = light_primary_button_border, + primaryButtonBorderedText = light_primary_button_bordered_text, + + secondaryButtonBackground = light_secondary_button_background, + secondaryButtonText = light_secondary_button_text, + secondaryButtonBorder = light_secondary_button_border, + secondaryButtonBorderedBackground = light_secondary_button_bordered_background, + secondaryButtonBorderedText = light_secondary_button_bordered_text, cardViewBackground = light_card_view_background, cardViewBorder = light_card_view_border, @@ -125,11 +139,10 @@ private val LightColorPalette = AppColors( info_variant = light_info_variant, onWarning = light_onWarning, onInfo = light_onInfo, - buttonBorder = light_button_border, rateStars = light_rate_stars, inactiveButtonBackground = light_inactive_button_background, - inactiveButtonText = light_button_text, + inactiveButtonText = light_primary_button_text, accessGreen = light_access_green, @@ -139,6 +152,7 @@ private val LightColorPalette = AppColors( datesSectionBarNextWeek = light_dates_section_bar_next_week, datesSectionBarUpcoming = light_dates_section_bar_upcoming, + authGoogleButtonBackground = light_auth_google_button_background, authFacebookButtonBackground = light_auth_facebook_button_background, authMicrosoftButtonBackground = light_auth_microsoft_button_background, diff --git a/core/src/openedx/org/openedx/core/ui/theme/Colors.kt b/core/src/openedx/org/openedx/core/ui/theme/Colors.kt index b8eec6324..155b66cbd 100644 --- a/core/src/openedx/org/openedx/core/ui/theme/Colors.kt +++ b/core/src/openedx/org/openedx/core/ui/theme/Colors.kt @@ -23,17 +23,24 @@ val light_text_primary_light = light_text_primary val light_text_secondary = Color(0xFFB3B3B3) val light_text_dark = Color(0xFF19212F) val light_text_accent = Color(0xFF3C68FF) -val light_text_warning= Color(0xFF19212F) +val light_text_warning = Color(0xFF19212F) val light_text_field_background = Color(0xFFF7F7F8) val light_text_field_background_variant = Color.White val light_text_field_border = Color(0xFF97A5BB) val light_text_field_text = Color(0xFF3D4964) val light_text_field_hint = Color(0xFF97A5BB) val light_text_hyper_link = Color(0xFF3C68FF) -val light_button_background = Color(0xFF3C68FF) -val light_button_border = Color(0xFF97A5BB) -val light_button_secondary_background = Color(0xFF79889F) -val light_button_text = Color.White + +val light_primary_button_background = Color(0xFF3C68FF) +val light_primary_button_border = Color(0xFF97A5BB) +val light_primary_button_text = Color.White +val light_primary_button_bordered_text = Color(0xFF3C68FF) +val light_secondary_button_background = Color(0xFF3C68FF) +val light_secondary_button_text = Color.White +val light_secondary_button_border = Color(0xFF97A5BB) +val light_secondary_button_bordered_background = Color.White +val light_secondary_button_bordered_text = Color(0xFF3C68FF) + val light_card_view_background = Color(0xFFF9FAFB) val light_card_view_border = Color(0xFFCCD4E0) val light_divider = Color(0xFFCCD4E0) @@ -50,6 +57,7 @@ val light_dates_section_bar_today = light_info val light_dates_section_bar_this_week = light_text_primary_variant val light_dates_section_bar_next_week = light_text_field_border val light_dates_section_bar_upcoming = Color(0xFFCCD4E0) +val light_auth_google_button_background = Color.White val light_auth_facebook_button_background = Color(0xFF0866FF) val light_auth_microsoft_button_background = Color(0xFA000000) val light_component_horizontal_progress_completed_and_selected = Color(0xFF30a171) @@ -72,21 +80,29 @@ val dark_onSurface = Color.White val dark_onError = Color.Black val dark_text_primary = Color.White val dark_text_primary_light = dark_text_primary -val dark_text_primary_variant = Color(0xFF79889F) +val dark_text_primary_variant = Color.White val dark_text_secondary = Color(0xFFB3B3B3) val dark_text_dark = Color.White val dark_text_accent = Color(0xFF879FF5) -val dark_text_warning= Color(0xFF19212F) +val dark_text_warning = Color(0xFF19212F) val dark_text_field_background = Color(0xFF273346) val dark_text_field_background_variant = Color(0xFF273346) val dark_text_field_border = Color(0xFF4E5A70) val dark_text_field_text = Color.White val dark_text_field_hint = Color(0xFF79889F) val dark_text_hyper_link = Color(0xFF5478F9) -val dark_button_background = Color(0xFF5478F9) -val dark_button_border = Color(0xFF4E5A70) -val dark_button_secondary_background = Color(0xFF79889F) -val dark_button_text = Color.White + +val dark_primary_button_background = Color(0xFF5478F9) +val dark_primary_button_text = Color.White +val dark_primary_button_border = Color(0xFF4E5A70) +val dark_primary_button_bordered_text = Color(0xFF5478F9) + +val dark_secondary_button_background = Color(0xFF5478F9) +val dark_secondary_button_text = Color.White +val dark_secondary_button_border = Color(0xFF4E5A70) +val dark_secondary_button_bordered_background = Color(0xFF19212F) +val dark_secondary_button_bordered_text = Color(0xFF5478F9) + val dark_card_view_background = Color(0xFF273346) val dark_card_view_border = Color(0xFF4E5A70) val dark_divider = Color(0xFF4E5A70) @@ -106,6 +122,7 @@ val dark_dates_section_bar_today = dark_info val dark_dates_section_bar_this_week = dark_text_primary_variant val dark_dates_section_bar_next_week = dark_text_field_border val dark_dates_section_bar_upcoming = Color(0xFFCCD4E0) +val dark_auth_google_button_background = Color(0xFF19212F) val dark_auth_facebook_button_background = Color(0xFF0866FF) val dark_auth_microsoft_button_background = Color(0xFA000000) val dark_component_horizontal_progress_completed_and_selected = Color(0xFF30a171) diff --git a/course/src/main/java/org/openedx/course/presentation/ChapterEndFragmentDialog.kt b/course/src/main/java/org/openedx/course/presentation/ChapterEndFragmentDialog.kt index 6fb8c305d..c416aa497 100644 --- a/course/src/main/java/org/openedx/course/presentation/ChapterEndFragmentDialog.kt +++ b/course/src/main/java/org/openedx/course/presentation/ChapterEndFragmentDialog.kt @@ -197,7 +197,7 @@ private fun ChapterEndDialogScreen( Text( modifier = Modifier.fillMaxWidth(), text = stringResource(id = R.string.course_section_finished, sectionName), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textFieldText, style = MaterialTheme.appTypography.titleSmall, textAlign = TextAlign.Center ) @@ -209,7 +209,7 @@ private fun ChapterEndDialogScreen( TextIcon( text = stringResource(id = R.string.course_next_section), painter = painterResource(org.openedx.core.R.drawable.core_ic_forward), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, textStyle = MaterialTheme.appTypography.labelLarge, iconModifier = Modifier.rotate(if (isVerticalNavigation) 90f else 0f) ) @@ -219,15 +219,15 @@ private fun ChapterEndDialogScreen( Spacer(Modifier.height(16.dp)) } OpenEdXOutlinedButton( - borderColor = MaterialTheme.appColors.buttonBackground, - textColor = MaterialTheme.appColors.onBackground, + borderColor = MaterialTheme.appColors.primaryButtonBackground, + textColor = MaterialTheme.appColors.primaryButtonBackground, text = stringResource(id = R.string.course_back_to_outline), onClick = onBackButtonClick, content = { AutoSizeText( text = stringResource(id = R.string.course_back_to_outline), style = MaterialTheme.appTypography.bodyMedium, - color = MaterialTheme.appColors.onBackground + color = MaterialTheme.appColors.primaryButtonBorderedText ) } ) @@ -309,7 +309,7 @@ private fun ChapterEndDialogScreenLandscape( Text( modifier = Modifier.fillMaxWidth(), text = stringResource(id = R.string.course_section_finished, sectionName), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textFieldText, style = MaterialTheme.appTypography.titleSmall, textAlign = TextAlign.Center ) @@ -326,7 +326,7 @@ private fun ChapterEndDialogScreenLandscape( TextIcon( text = stringResource(id = R.string.course_next_section), painter = painterResource(org.openedx.core.R.drawable.core_ic_forward), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, textStyle = MaterialTheme.appTypography.labelLarge ) }, @@ -335,15 +335,15 @@ private fun ChapterEndDialogScreenLandscape( Spacer(Modifier.height(16.dp)) } OpenEdXOutlinedButton( - borderColor = MaterialTheme.appColors.buttonBackground, - textColor = MaterialTheme.appColors.buttonBackground, + borderColor = MaterialTheme.appColors.primaryButtonBackground, + textColor = MaterialTheme.appColors.primaryButtonBackground, text = stringResource(id = R.string.course_back_to_outline), onClick = onBackButtonClick, content = { AutoSizeText( text = stringResource(id = R.string.course_back_to_outline), style = MaterialTheme.appTypography.bodyMedium, - color = MaterialTheme.appColors.onBackground + color = MaterialTheme.appColors.primaryButtonBorderedText ) } ) diff --git a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt index 6cecead9a..6b378d354 100644 --- a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt @@ -570,7 +570,7 @@ private fun ResumeCourse( TextIcon( text = stringResource(id = org.openedx.course.R.string.course_resume), painter = painterResource(id = R.drawable.core_ic_forward), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, textStyle = MaterialTheme.appTypography.labelLarge ) } @@ -629,7 +629,7 @@ private fun ResumeCourseTablet( TextIcon( text = stringResource(id = org.openedx.course.R.string.course_resume), painter = painterResource(id = R.drawable.core_ic_forward), - color = MaterialTheme.appColors.buttonText, + color = MaterialTheme.appColors.primaryButtonText, textStyle = MaterialTheme.appTypography.labelLarge ) } diff --git a/course/src/main/java/org/openedx/course/presentation/ui/CourseUI.kt b/course/src/main/java/org/openedx/course/presentation/ui/CourseUI.kt index ecfc48fb3..3fd228d4f 100644 --- a/course/src/main/java/org/openedx/course/presentation/ui/CourseUI.kt +++ b/course/src/main/java/org/openedx/course/presentation/ui/CourseUI.kt @@ -181,7 +181,7 @@ fun CourseImageHeader( OpenEdXOutlinedButton( modifier = Modifier, borderColor = Color.White, - textColor = MaterialTheme.appColors.buttonText, + textColor = MaterialTheme.appColors.primaryButtonText, text = stringResource(id = R.string.course_view_certificate), onClick = { courseCertificate.certificateURL?.let { @@ -325,7 +325,7 @@ fun OfflineQueueCard( Text( text = downloadModel.size.toLong().toFileSize(), style = MaterialTheme.appTypography.titleSmall, - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textSecondary, overflow = TextOverflow.Ellipsis, maxLines = 1 ) @@ -358,7 +358,7 @@ fun OfflineQueueCard( Icon( imageVector = Icons.Filled.Close, contentDescription = stringResource(id = R.string.course_accessibility_stop_downloading_course_section), - tint = MaterialTheme.appColors.onBackground + tint = MaterialTheme.appColors.error ) } } @@ -476,7 +476,7 @@ fun NavigationUnitsButtons( colors = ButtonDefaults.outlinedButtonColors( backgroundColor = MaterialTheme.appColors.background ), - border = BorderStroke(1.dp, MaterialTheme.appColors.secondary), + border = BorderStroke(1.dp, MaterialTheme.appColors.primaryButtonBorder), elevation = null, shape = MaterialTheme.appShapes.navigationButtonShape, onClick = onPrevClick, @@ -505,7 +505,7 @@ fun NavigationUnitsButtons( modifier = Modifier .height(42.dp), colors = ButtonDefaults.buttonColors( - backgroundColor = MaterialTheme.appColors.buttonBackground + backgroundColor = MaterialTheme.appColors.primaryButtonBackground ), elevation = null, shape = MaterialTheme.appShapes.navigationButtonShape, @@ -517,7 +517,7 @@ fun NavigationUnitsButtons( ) { Text( text = nextButtonText, - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, style = MaterialTheme.appTypography.labelLarge ) Spacer(Modifier.width(8.dp)) @@ -525,7 +525,7 @@ fun NavigationUnitsButtons( modifier = Modifier.rotate(if (isVerticalNavigation || !hasNextBlock) 0f else -90f), painter = nextButtonIcon, contentDescription = null, - tint = MaterialTheme.appColors.onSecondary + tint = MaterialTheme.appColors.primaryButtonText ) } } diff --git a/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt b/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt index d52db4275..53136e1b0 100644 --- a/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt +++ b/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt @@ -562,7 +562,7 @@ private fun AllVideosDownloadItem( Spacer(modifier = Modifier.height(2.dp)) Text( text = downloadVideoSubTitle, - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelMedium ) } @@ -636,7 +636,7 @@ private fun AllVideosDownloadItem( Spacer(modifier = Modifier.height(2.dp)) Text( text = stringResource(id = videoSettings.videoDownloadQuality.titleResId), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelMedium ) } diff --git a/course/src/main/java/org/openedx/course/presentation/unit/NotSupportedUnitFragment.kt b/course/src/main/java/org/openedx/course/presentation/unit/NotSupportedUnitFragment.kt index f16d5906a..0aaae4a3c 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/NotSupportedUnitFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/NotSupportedUnitFragment.kt @@ -139,14 +139,14 @@ private fun NotSupportedUnitScreen( .height(42.dp), shape = MaterialTheme.appShapes.buttonShape, colors = ButtonDefaults.buttonColors( - backgroundColor = MaterialTheme.appColors.buttonBackground + backgroundColor = MaterialTheme.appColors.primaryButtonBackground ), onClick = { uriHandler.openUri(uri) }) { Text( text = stringResource(id = courseR.string.course_open_in_browser), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, style = MaterialTheme.appTypography.labelLarge ) } diff --git a/dashboard/src/main/java/org/openedx/dashboard/presentation/DashboardFragment.kt b/dashboard/src/main/java/org/openedx/dashboard/presentation/DashboardFragment.kt index 5caed8984..1c314c445 100644 --- a/dashboard/src/main/java/org/openedx/dashboard/presentation/DashboardFragment.kt +++ b/dashboard/src/main/java/org/openedx/dashboard/presentation/DashboardFragment.kt @@ -418,7 +418,7 @@ private fun CourseItem( Text( modifier = Modifier.testTag("txt_course_org"), text = enrolledCourse.course.org, - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textFieldHint, style = MaterialTheme.appTypography.labelMedium ) Spacer(modifier = Modifier.height(4.dp)) @@ -454,7 +454,7 @@ private fun CourseItem( enrolledCourse.course.startType, enrolledCourse.course.startDisplay ), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textFieldHint, style = MaterialTheme.appTypography.labelMedium ) Box( diff --git a/discussion/src/main/java/org/openedx/discussion/presentation/threads/DiscussionThreadsFragment.kt b/discussion/src/main/java/org/openedx/discussion/presentation/threads/DiscussionThreadsFragment.kt index fd7dc21af..34a08ebb2 100644 --- a/discussion/src/main/java/org/openedx/discussion/presentation/threads/DiscussionThreadsFragment.kt +++ b/discussion/src/main/java/org/openedx/discussion/presentation/threads/DiscussionThreadsFragment.kt @@ -475,7 +475,7 @@ private fun DiscussionThreadsScreen( Modifier .size(40.dp) .clip(CircleShape) - .background(MaterialTheme.appColors.secondary) + .background(MaterialTheme.appColors.secondaryButtonBackground) .clickable { onCreatePostClick() }, @@ -485,7 +485,7 @@ private fun DiscussionThreadsScreen( modifier = Modifier.size(16.dp), painter = painterResource(id = discussionR.drawable.discussion_ic_add_comment), contentDescription = stringResource(id = discussionR.string.discussion_add_comment), - tint = MaterialTheme.appColors.buttonText + tint = MaterialTheme.appColors.primaryButtonText ) } } diff --git a/profile/src/main/java/org/openedx/profile/presentation/delete/DeleteProfileFragment.kt b/profile/src/main/java/org/openedx/profile/presentation/delete/DeleteProfileFragment.kt index bf5615b2a..50771187a 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/delete/DeleteProfileFragment.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/delete/DeleteProfileFragment.kt @@ -250,7 +250,7 @@ fun DeleteProfileScreen( .fillMaxWidth(), text = stringResource(id = profileR.string.profile_confirm_action), style = MaterialTheme.appTypography.labelLarge, - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textSecondary, textAlign = TextAlign.Center ) Spacer(Modifier.height(40.dp)) diff --git a/profile/src/main/java/org/openedx/profile/presentation/edit/EditProfileFragment.kt b/profile/src/main/java/org/openedx/profile/presentation/edit/EditProfileFragment.kt index b10e67a26..1107c2753 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/edit/EditProfileFragment.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/edit/EditProfileFragment.kt @@ -611,7 +611,7 @@ private fun EditProfileScreen( Text( modifier = Modifier.testTag("txt_edit_profile_type_label"), text = stringResource(if (uiState.isLimited) R.string.profile_limited_profile else R.string.profile_full_profile), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.titleSmall ) Spacer(modifier = Modifier.height(32.dp)) @@ -985,7 +985,7 @@ private fun SelectableField( .fillMaxWidth(), text = name, style = MaterialTheme.appTypography.labelLarge, - color = MaterialTheme.appColors.onBackground + color = MaterialTheme.appColors.textPrimary ) Spacer(modifier = Modifier.height(8.dp)) OutlinedTextField( @@ -1000,7 +1000,7 @@ private fun SelectableField( Icon( imageVector = Icons.Filled.ExpandMore, contentDescription = null, - tint = MaterialTheme.appColors.textFieldText + tint = MaterialTheme.appColors.textPrimaryVariant ) }, modifier = Modifier @@ -1147,7 +1147,7 @@ private fun LeaveProfile( .testTag("txt_leave") .fillMaxWidth(), text = stringResource(id = R.string.profile_leave), - color = MaterialTheme.appColors.buttonText, + color = MaterialTheme.appColors.primaryButtonText, style = MaterialTheme.appTypography.labelLarge, textAlign = TextAlign.Center ) @@ -1238,7 +1238,7 @@ private fun LeaveProfileLandscape( modifier = Modifier.testTag("txt_leave_profile_dialog_leave"), text = stringResource(id = R.string.profile_leave), style = MaterialTheme.appTypography.bodyMedium, - color = MaterialTheme.appColors.buttonText + color = MaterialTheme.appColors.primaryButtonText ) }, onClick = onLeaveClick diff --git a/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt b/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt index 33a33bb7e..ad9208980 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt @@ -600,7 +600,7 @@ private fun AppVersionItemAppToDate(versionName: String) { Text( modifier = Modifier.testTag("txt_up_to_date"), text = stringResource(id = R.string.core_up_to_date), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelLarge ) } diff --git a/profile/src/main/java/org/openedx/profile/presentation/settings/video/VideoSettingsFragment.kt b/profile/src/main/java/org/openedx/profile/presentation/settings/video/VideoSettingsFragment.kt index 2a090d78b..19a19245f 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/settings/video/VideoSettingsFragment.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/settings/video/VideoSettingsFragment.kt @@ -198,7 +198,7 @@ private fun VideoSettingsScreen( Text( modifier = Modifier.testTag("txt_wifi_only_description"), text = stringResource(id = R.string.profile_only_download_when_wifi_turned_on), - color = MaterialTheme.appColors.textFieldText, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelMedium ) } @@ -235,7 +235,7 @@ private fun VideoSettingsScreen( Spacer(Modifier.height(4.dp)) Text( text = stringResource(id = videoSettings.videoStreamingQuality.titleResId), - color = MaterialTheme.appColors.textFieldText, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelMedium ) } @@ -266,7 +266,7 @@ private fun VideoSettingsScreen( Spacer(Modifier.height(4.dp)) Text( text = stringResource(id = videoSettings.videoDownloadQuality.titleResId), - color = MaterialTheme.appColors.textFieldText, + color = MaterialTheme.appColors.textSecondary, style = MaterialTheme.appTypography.labelMedium ) } diff --git a/profile/src/main/java/org/openedx/profile/presentation/ui/ProfileUI.kt b/profile/src/main/java/org/openedx/profile/presentation/ui/ProfileUI.kt index 9095d9c22..c47820f23 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/ui/ProfileUI.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/ui/ProfileUI.kt @@ -94,7 +94,7 @@ fun ProfileInfoSection(account: Account) { modifier = Modifier.testTag("txt_profile_info_label"), text = stringResource(id = org.openedx.profile.R.string.profile_prof_info), style = MaterialTheme.appTypography.labelLarge, - color = MaterialTheme.appColors.onBackground + color = MaterialTheme.appColors.textSecondary ) Spacer(modifier = Modifier.height(14.dp)) Card( diff --git a/whatsnew/src/main/java/org/openedx/whatsnew/presentation/ui/WhatsNewUI.kt b/whatsnew/src/main/java/org/openedx/whatsnew/presentation/ui/WhatsNewUI.kt index 5aabed2e2..7d97eee40 100644 --- a/whatsnew/src/main/java/org/openedx/whatsnew/presentation/ui/WhatsNewUI.kt +++ b/whatsnew/src/main/java/org/openedx/whatsnew/presentation/ui/WhatsNewUI.kt @@ -49,7 +49,7 @@ fun PageIndicator( numberOfPages: Int, modifier: Modifier = Modifier, selectedPage: Int = 0, - selectedColor: Color = MaterialTheme.appColors.primaryVariant, + selectedColor: Color = MaterialTheme.appColors.info, previousUnselectedColor: Color = MaterialTheme.appColors.cardViewBorder, nextUnselectedColor: Color = MaterialTheme.appColors.textFieldBorder, defaultRadius: Dp = 20.dp, @@ -176,7 +176,7 @@ fun PrevButton( colors = ButtonDefaults.outlinedButtonColors( backgroundColor = MaterialTheme.appColors.background ), - border = BorderStroke(1.dp, MaterialTheme.appColors.secondary), + border = BorderStroke(1.dp, MaterialTheme.appColors.primary), elevation = null, shape = MaterialTheme.appShapes.navigationButtonShape, onClick = onPrevClick, @@ -193,7 +193,7 @@ fun PrevButton( Spacer(Modifier.width(8.dp)) Text( text = stringResource(R.string.whats_new_navigation_previous), - color = MaterialTheme.appColors.onBackground, + color = MaterialTheme.appColors.primary, style = MaterialTheme.appTypography.labelLarge ) } @@ -210,7 +210,7 @@ fun NextFinishButton( .testTag("btn_next") .height(42.dp), colors = ButtonDefaults.buttonColors( - backgroundColor = MaterialTheme.appColors.buttonBackground + backgroundColor = MaterialTheme.appColors.primaryButtonBackground ), elevation = null, shape = MaterialTheme.appShapes.navigationButtonShape, @@ -231,14 +231,14 @@ fun NextFinishButton( Text( modifier = Modifier.testTag("txt_next"), text = stringResource(id = R.string.whats_new_navigation_next), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, style = MaterialTheme.appTypography.labelLarge ) Spacer(Modifier.width(8.dp)) Icon( painter = painterResource(id = org.openedx.core.R.drawable.core_ic_forward), contentDescription = null, - tint = MaterialTheme.appColors.onSecondary + tint = MaterialTheme.appColors.primaryButtonText ) } } else { @@ -249,14 +249,14 @@ fun NextFinishButton( Text( modifier = Modifier.testTag("txt_done"), text = stringResource(id = R.string.whats_new_navigation_done), - color = MaterialTheme.appColors.onSecondary, + color = MaterialTheme.appColors.primaryButtonText, style = MaterialTheme.appTypography.labelLarge ) Spacer(Modifier.width(8.dp)) Icon( painter = painterResource(id = org.openedx.core.R.drawable.core_ic_check), contentDescription = null, - tint = MaterialTheme.appColors.onSecondary + tint = MaterialTheme.appColors.primaryButtonText ) } }