From f514c8b6f716a3fcf6f6d28ad67952001e597f4e Mon Sep 17 00:00:00 2001 From: PavloNetrebchuk Date: Wed, 27 Mar 2024 11:43:17 +0200 Subject: [PATCH] fix: String and color changes, files auto-formatting --- auth/src/main/res/drawable/auth_ic_email.xml | 8 +- .../java/org/openedx/core/ui/ComposeCommon.kt | 6 +- .../org/openedx/core/ui/theme/AppColors.kt | 1 + .../java/org/openedx/core/ui/theme/Theme.kt | 2 + core/src/main/res/drawable/core_ic_close.xml | 24 ------ .../src/main/res/drawable/core_ic_offline.xml | 77 +++++++++---------- core/src/main/res/drawable/core_ic_reload.xml | 35 ++++----- .../drawable/core_no_internet_connection.xml | 6 +- core/src/main/res/values/strings.xml | 4 +- .../org/openedx/core/ui/theme/Colors.kt | 2 + .../presentation/handouts/HandoutsFragment.kt | 4 +- .../course_ic_not_supported_block.xml | 24 +++--- course/src/main/res/values-uk/strings.xml | 2 +- course/src/main/res/values/strings.xml | 4 +- dashboard/src/main/res/values-uk/strings.xml | 1 + .../presentation/edit/EditProfileFragment.kt | 5 +- .../profile/compose/ProfileView.kt | 3 +- .../src/main/res/drawable/profile_ic_exit.xml | 8 +- profile/src/main/res/values-uk/strings.xml | 2 - profile/src/main/res/values/strings.xml | 2 - 20 files changed, 97 insertions(+), 123 deletions(-) delete mode 100644 core/src/main/res/drawable/core_ic_close.xml diff --git a/auth/src/main/res/drawable/auth_ic_email.xml b/auth/src/main/res/drawable/auth_ic_email.xml index 160718b5f..3fdb37de2 100644 --- a/auth/src/main/res/drawable/auth_ic_email.xml +++ b/auth/src/main/res/drawable/auth_ic_email.xml @@ -3,8 +3,8 @@ android:height="66dp" android:viewportWidth="85" android:viewportHeight="66"> - + 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 7961e6d46..f27647be1 100644 --- a/core/src/main/java/org/openedx/core/ui/ComposeCommon.kt +++ b/core/src/main/java/org/openedx/core/ui/ComposeCommon.kt @@ -1073,7 +1073,7 @@ fun OfflineModeDialog( }) { Icon( modifier = Modifier.size(20.dp), - painter = painterResource(R.drawable.core_ic_close), + imageVector = Icons.Filled.Close, contentDescription = null, tint = Color.Black ) @@ -1185,7 +1185,7 @@ fun ConnectionErrorView( Spacer(Modifier.height(28.dp)) Text( modifier = Modifier.fillMaxWidth(0.8f), - text = stringResource(id = R.string.core_not_internet_connection), + text = stringResource(id = R.string.core_no_internet_connection), color = MaterialTheme.appColors.textPrimary, style = MaterialTheme.appTypography.titleLarge, textAlign = TextAlign.Center @@ -1193,7 +1193,7 @@ fun ConnectionErrorView( Spacer(Modifier.height(16.dp)) Text( modifier = Modifier.fillMaxWidth(0.8f), - text = stringResource(id = R.string.core_not_internet_connection_description), + text = stringResource(id = R.string.core_no_internet_connection_description), color = MaterialTheme.appColors.textPrimary, style = MaterialTheme.appTypography.bodyLarge, textAlign = TextAlign.Center 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 3a540d9fa..9db8faa60 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 @@ -11,6 +11,7 @@ data class AppColors( val textSecondary: Color, val textDark: Color, val textAccent: Color, + val textWarning: Color, val textFieldBackground: Color, val textFieldBackgroundVariant: 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 e5e7a00d3..01ae95110 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 @@ -30,6 +30,7 @@ private val DarkColorPalette = AppColors( textSecondary = dark_text_secondary, textDark = dark_text_dark, textAccent = dark_text_accent, + textWarning = dark_text_warning, textFieldBackground = dark_text_field_background, textFieldBackgroundVariant = dark_text_field_background_variant, @@ -92,6 +93,7 @@ private val LightColorPalette = AppColors( textSecondary = light_text_secondary, textDark = light_text_dark, textAccent = light_text_accent, + textWarning = light_text_warning, textFieldBackground = light_text_field_background, textFieldBackgroundVariant = light_text_field_background_variant, diff --git a/core/src/main/res/drawable/core_ic_close.xml b/core/src/main/res/drawable/core_ic_close.xml deleted file mode 100644 index edfd3eb3f..000000000 --- a/core/src/main/res/drawable/core_ic_close.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/core/src/main/res/drawable/core_ic_offline.xml b/core/src/main/res/drawable/core_ic_offline.xml index 226f1dfae..020f42218 100644 --- a/core/src/main/res/drawable/core_ic_offline.xml +++ b/core/src/main/res/drawable/core_ic_offline.xml @@ -3,43 +3,42 @@ android:height="20dp" android:viewportWidth="20" android:viewportHeight="20"> - - - - - - - - + + + + + + + + diff --git a/core/src/main/res/drawable/core_ic_reload.xml b/core/src/main/res/drawable/core_ic_reload.xml index 00af32593..d2f423f05 100644 --- a/core/src/main/res/drawable/core_ic_reload.xml +++ b/core/src/main/res/drawable/core_ic_reload.xml @@ -3,22 +3,21 @@ android:height="20dp" android:viewportWidth="20" android:viewportHeight="20"> - - - - - + + + + + diff --git a/core/src/main/res/drawable/core_no_internet_connection.xml b/core/src/main/res/drawable/core_no_internet_connection.xml index 89af2f689..11d9f58f0 100644 --- a/core/src/main/res/drawable/core_no_internet_connection.xml +++ b/core/src/main/res/drawable/core_no_internet_connection.xml @@ -3,7 +3,7 @@ android:height="86dp" android:viewportWidth="86" android:viewportHeight="86"> - + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 6e242f0e4..27c109b26 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -73,8 +73,8 @@ Rate Us Thank you for sharing your feedback with us. Would you like to share your review of this app with other users on the app store? We received your feedback and will use it to help improve your learning experience going forward. Thank you for sharing! - No internet connection - Please connect to the internet to view this content. + No internet connection + Please connect to the internet to view this content. OK Continue Leaving the app 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 29f09b21b..35d695cc1 100644 --- a/core/src/openedx/org/openedx/core/ui/theme/Colors.kt +++ b/core/src/openedx/org/openedx/core/ui/theme/Colors.kt @@ -19,6 +19,7 @@ val light_text_primary_variant = Color(0xFF3D4964) 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_field_background = Color(0xFFF7F7F8) val light_text_field_background_variant = Color.White val light_text_field_border = Color(0xFF97A5BB) @@ -68,6 +69,7 @@ val dark_text_primary_variant = Color(0xFF79889F) 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_field_background = Color(0xFF273346) val dark_text_field_background_variant = Color(0xFF273346) val dark_text_field_border = Color(0xFF4E5A70) diff --git a/course/src/main/java/org/openedx/course/presentation/handouts/HandoutsFragment.kt b/course/src/main/java/org/openedx/course/presentation/handouts/HandoutsFragment.kt index 19693fccd..8f49c86c0 100644 --- a/course/src/main/java/org/openedx/course/presentation/handouts/HandoutsFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/handouts/HandoutsFragment.kt @@ -53,7 +53,7 @@ class HandoutsFragment : Fragment() { router.navigateToHandoutsWebView( requireActivity().supportFragmentManager, requireArguments().getString(ARG_COURSE_ID, ""), - getString(courseR.string.course_more), + getString(courseR.string.course_handouts), HandoutsType.Handouts ) }, @@ -122,7 +122,7 @@ private fun HandoutsScreen( ) { item { HandoutsItem( - title = stringResource(id = courseR.string.course_more), + title = stringResource(id = courseR.string.course_handouts), description = stringResource(id = courseR.string.course_find_important_info), painter = painterResource(id = courseR.drawable.course_ic_handouts), onClick = onHandoutsClick diff --git a/course/src/main/res/drawable/course_ic_not_supported_block.xml b/course/src/main/res/drawable/course_ic_not_supported_block.xml index 57c98844f..470876362 100644 --- a/course/src/main/res/drawable/course_ic_not_supported_block.xml +++ b/course/src/main/res/drawable/course_ic_not_supported_block.xml @@ -3,16 +3,16 @@ android:height="100dp" android:viewportWidth="100" android:viewportHeight="100"> - - - - + + + + diff --git a/course/src/main/res/values-uk/strings.xml b/course/src/main/res/values-uk/strings.xml index 70ff5ad30..7ac53f4da 100644 --- a/course/src/main/res/values-uk/strings.xml +++ b/course/src/main/res/values-uk/strings.xml @@ -23,7 +23,7 @@ Остання одиниця: Продовжити Обговорення - Роздаткові матеріали + Роздаткові матеріали Оголошення Знайдіть важливу інформацію про курс Будьте в курсі останніх новин diff --git a/course/src/main/res/values/strings.xml b/course/src/main/res/values/strings.xml index adc75f32f..da5ebe36b 100644 --- a/course/src/main/res/values/strings.xml +++ b/course/src/main/res/values/strings.xml @@ -23,7 +23,7 @@ Last unit: Resume Discussion - More + Handouts Announcements Find important course information Keep up with the latest news @@ -40,7 +40,7 @@ Discussions More You can download content only from Wi-fi - This interactive component isn\'t available on mobile + This interactive component isn\'t available on mobile. Explore other parts of this course or view this on web. Open in browser Subtitles diff --git a/dashboard/src/main/res/values-uk/strings.xml b/dashboard/src/main/res/values-uk/strings.xml index 048b62203..a7b3ef9d3 100644 --- a/dashboard/src/main/res/values-uk/strings.xml +++ b/dashboard/src/main/res/values-uk/strings.xml @@ -4,4 +4,5 @@ Курси Ласкаво просимо назад. Продовжуймо навчатися. You are not enrolled in any courses yet. + \ No newline at end of file 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 9ca3bcc4b..c09294c5b 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 @@ -135,7 +135,6 @@ import org.openedx.core.ui.theme.OpenEdXTheme import org.openedx.core.ui.theme.appColors import org.openedx.core.ui.theme.appShapes import org.openedx.core.ui.theme.appTypography -import org.openedx.core.ui.theme.light_text_dark import org.openedx.core.ui.windowSizeValue import org.openedx.core.utils.LocaleUtils import org.openedx.profile.R @@ -764,7 +763,7 @@ private fun LimitedProfileDialog( modifier: Modifier, onCloseClick: () -> Unit ) { - val tint = light_text_dark + val tint = MaterialTheme.appColors.textWarning Column( modifier .shadow( @@ -1138,7 +1137,7 @@ private fun LeaveProfile( .testTag("txt_leave") .fillMaxWidth(), text = stringResource(id = R.string.profile_leave), - color = light_text_dark, + color = MaterialTheme.appColors.textWarning, style = MaterialTheme.appTypography.labelLarge, textAlign = TextAlign.Center ) 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 a16b2741f..d8af99f72 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 @@ -81,7 +81,6 @@ import org.openedx.core.ui.theme.OpenEdXTheme import org.openedx.core.ui.theme.appColors import org.openedx.core.ui.theme.appShapes import org.openedx.core.ui.theme.appTypography -import org.openedx.core.ui.theme.light_text_dark import org.openedx.core.ui.windowSizeValue import org.openedx.profile.domain.model.Account import org.openedx.profile.presentation.profile.ProfileUIState @@ -485,7 +484,7 @@ private fun LogoutDialog( .testTag("txt_logout") .fillMaxWidth(), text = stringResource(id = org.openedx.profile.R.string.profile_logout), - color = light_text_dark, + color = MaterialTheme.appColors.textWarning, style = MaterialTheme.appTypography.labelLarge, textAlign = TextAlign.Center ) diff --git a/profile/src/main/res/drawable/profile_ic_exit.xml b/profile/src/main/res/drawable/profile_ic_exit.xml index b972f5c97..515e3091f 100644 --- a/profile/src/main/res/drawable/profile_ic_exit.xml +++ b/profile/src/main/res/drawable/profile_ic_exit.xml @@ -3,8 +3,8 @@ android:height="70dp" android:viewportWidth="63" android:viewportHeight="70"> - + diff --git a/profile/src/main/res/values-uk/strings.xml b/profile/src/main/res/values-uk/strings.xml index 7d617f734..498440ba8 100644 --- a/profile/src/main/res/values-uk/strings.xml +++ b/profile/src/main/res/values-uk/strings.xml @@ -6,7 +6,6 @@ Вийти Біо: %1$s Рік народження: %1$s - Вийти з профілю? Ви впевнені, що хочете вийти з профілю? Повний профіль Обмежений профіль @@ -21,7 +20,6 @@ Мова Перейти до повного профілю Перейти до обмеженого профілю - Ох, вибачте Готово Змінити зображення профілю Вибрати з галереї diff --git a/profile/src/main/res/values/strings.xml b/profile/src/main/res/values/strings.xml index 2a1df6173..ecc88ac6b 100644 --- a/profile/src/main/res/values/strings.xml +++ b/profile/src/main/res/values/strings.xml @@ -6,7 +6,6 @@ Log out Bio: %1$s Year of birth: %1$s - Log out? Are you sure you want to log out? Full profile Limited profile @@ -21,7 +20,6 @@ Spoken language Switch to full profile Switch to limited profile - Oh, sorry Delete account Are you sure you want to delete your account?