From c7349c3c24f99b16c9f5115fd410fbe9c827e1d0 Mon Sep 17 00:00:00 2001 From: MOHIT GUPTA <76530270+MohitGupta121@users.noreply.github.com> Date: Mon, 20 Feb 2023 19:40:41 +0530 Subject: [PATCH] Fixed #4147 : Remove colors_migrating.xml post dark mode implementation. (#4876) ## Explanation Fixed #4147 : Remove colors_migrating.xml post dark mode implementation. ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-(A11y)-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing --- .github/CODEOWNERS | 1 - .../NavigationDrawerFragmentPresenter.kt | 8 +- .../onboarding/OnboardingFragmentPresenter.kt | 10 +- .../profile/AddProfileActivityPresenter.kt | 6 +- .../ProfileChooserFragmentPresenter.kt | 52 ++++---- .../ProfilePictureActivityPresenter.kt | 4 +- .../app/spotlight/SpotlightFragment.kt | 2 +- .../WalkthroughActivityPresenter.kt | 6 +- ...ft_rounded_rect_coming_soon_background.xml | 4 +- ...ft_rounded_rect_coming_soon_background.xml | 4 +- ...m_left_rounded_rect_primary_background.xml | 8 -- .../res/drawable/edit_text_red_border.xml | 13 -- .../res/drawable/lesson_thumbnail_default.xml | 4 - .../res/drawable/profile_chooser_divider.xml | 2 +- .../reading_text_size_seekbar_thumb.xml | 10 -- .../drawable/rounded_corners_progress_bar.xml | 4 +- .../main/res/drawable/seekbar_progress.xml | 2 +- .../start_button_primary_background.xml | 19 --- .../walkthrough_final_fragment.xml | 16 +-- .../walkthrough_welcome_fragment.xml | 8 +- .../res/layout/coming_soon_topic_list.xml | 20 +-- .../res/layout/coming_soon_topic_view.xml | 2 +- .../res/layout/font_scale_test_activity.xml | 2 +- .../main/res/layout/my_downloads_fragment.xml | 7 +- .../layout/profile_and_device_id_activity.xml | 10 +- .../res/layout/profile_picture_activity.xml | 2 +- .../test_margin_bindable_adapter_activity.xml | 2 +- ...test_text_view_for_int_no_data_binding.xml | 2 +- ...st_text_view_for_int_with_data_binding.xml | 2 +- ...t_view_for_live_data_with_data_binding.xml | 2 +- ...t_text_view_for_string_no_data_binding.xml | 2 +- ...text_view_for_string_with_data_binding.xml | 2 +- .../main/res/layout/walkthrough_activity.xml | 8 +- .../res/layout/walkthrough_final_fragment.xml | 18 +-- .../layout/walkthrough_topic_header_view.xml | 2 +- .../layout/walkthrough_topic_summary_view.xml | 2 +- .../layout/walkthrough_welcome_fragment.xml | 4 +- .../main/res/values-night/color_palette.xml | 10 ++ app/src/main/res/values-v21/styles.xml | 5 - app/src/main/res/values/color_defs.xml | 30 +++++ app/src/main/res/values/color_palette.xml | 10 ++ app/src/main/res/values/colors_migrating.xml | 115 ------------------ app/src/main/res/values/component_colors.xml | 14 +++ .../NavigationDrawerActivityDebugTest.kt | 16 ++- .../NavigationDrawerActivityProdTest.kt | 4 +- 45 files changed, 193 insertions(+), 283 deletions(-) delete mode 100644 app/src/main/res/drawable/bottom_left_rounded_rect_primary_background.xml delete mode 100644 app/src/main/res/drawable/edit_text_red_border.xml delete mode 100644 app/src/main/res/drawable/lesson_thumbnail_default.xml delete mode 100644 app/src/main/res/drawable/reading_text_size_seekbar_thumb.xml delete mode 100644 app/src/main/res/drawable/start_button_primary_background.xml delete mode 100644 app/src/main/res/values/colors_migrating.xml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 45a6ce701da..adcef3bf43a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -53,7 +53,6 @@ gradlew.bat @BenHenning # All resource files. /app/src/main/res/**/*.xml @rt4914 /utility/src/main/res/**/*.xml @rt4914 -/app/src/main/res/values/colors_migrating.xml @rt4914 # App UI strings. /app/src/main/res/values*/strings.xml @BenHenning diff --git a/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt index 1caee17fa2d..2f45b29a533 100644 --- a/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/drawer/NavigationDrawerFragmentPresenter.kt @@ -419,7 +419,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( super.onDrawerOpened(drawerView) fragment.activity!!.invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( - R.color.slide_drawer_open_status_bar, + R.color.component_color_shared_slide_drawer_open_status_bar_color, activity, false ) @@ -429,7 +429,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( super.onDrawerClosed(drawerView) fragment.activity!!.invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( - R.color.oppia_primary_dark, + R.color.component_color_shared_activity_status_bar_color, activity, false ) @@ -456,7 +456,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( super.onDrawerOpened(drawerView) fragment.activity!!.invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( - R.color.slide_drawer_open_status_bar, + R.color.component_color_shared_slide_drawer_open_status_bar_color, activity, false ) @@ -466,7 +466,7 @@ class NavigationDrawerFragmentPresenter @Inject constructor( super.onDrawerClosed(drawerView) fragment.activity!!.invalidateOptionsMenu() StatusBarColor.statusBarColorUpdate( - R.color.oppia_primary_dark, + R.color.component_color_shared_activity_status_bar_color, activity, false ) diff --git a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt index 4fc99927934..1551e6c4199 100644 --- a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt @@ -169,27 +169,27 @@ class OnboardingFragmentPresenter @Inject constructor( private fun onboardingStatusBarColorUpdate(position: Int) { when (position) { 0 -> StatusBarColor.statusBarColorUpdate( - R.color.onboarding_1_status_bar, + R.color.component_color_onboarding_1_status_bar_color, activity, false ) 1 -> StatusBarColor.statusBarColorUpdate( - R.color.onboarding_2_status_bar, + R.color.component_color_onboarding_2_status_bar_color, activity, false ) 2 -> StatusBarColor.statusBarColorUpdate( - R.color.onboarding_3_status_bar, + R.color.component_color_onboarding_3_status_bar_color, activity, false ) 3 -> StatusBarColor.statusBarColorUpdate( - R.color.onboarding_4_status_bar, + R.color.component_color_onboarding_4_status_bar_color, activity, false ) else -> StatusBarColor.statusBarColorUpdate( - R.color.oppia_primary_dark, + R.color.component_color_shared_activity_status_bar_color, activity, false ) diff --git a/app/src/main/java/org/oppia/android/app/profile/AddProfileActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/profile/AddProfileActivityPresenter.kt index 3937481cbdc..12e079fd465 100644 --- a/app/src/main/java/org/oppia/android/app/profile/AddProfileActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/profile/AddProfileActivityPresenter.kt @@ -105,7 +105,11 @@ class AddProfileActivityPresenter @Inject constructor( isFirstResource: Boolean ): Boolean { uploadImageView.setColorFilter( - ResourcesCompat.getColor(activity.resources, R.color.avatar_background_11, null), + ResourcesCompat.getColor( + activity.resources, + R.color.color_def_avatar_background_11, + null + ), PorterDuff.Mode.DST_OVER ) return false diff --git a/app/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenter.kt index 1dfcbff875a..eefe86c8c99 100644 --- a/app/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenter.kt @@ -31,30 +31,30 @@ import org.oppia.android.util.statusbar.StatusBarColor import javax.inject.Inject private val COLORS_LIST = listOf( - R.color.avatar_background_1, - R.color.avatar_background_2, - R.color.avatar_background_3, - R.color.avatar_background_4, - R.color.avatar_background_5, - R.color.avatar_background_6, - R.color.avatar_background_7, - R.color.avatar_background_8, - R.color.avatar_background_9, - R.color.avatar_background_10, - R.color.avatar_background_11, - R.color.avatar_background_12, - R.color.avatar_background_13, - R.color.avatar_background_14, - R.color.avatar_background_15, - R.color.avatar_background_16, - R.color.avatar_background_17, - R.color.avatar_background_18, - R.color.avatar_background_19, - R.color.avatar_background_20, - R.color.avatar_background_21, - R.color.avatar_background_22, - R.color.avatar_background_23, - R.color.avatar_background_24 + R.color.color_def_avatar_background_1, + R.color.color_def_avatar_background_2, + R.color.color_def_avatar_background_3, + R.color.color_def_avatar_background_4, + R.color.color_def_avatar_background_5, + R.color.color_def_avatar_background_6, + R.color.color_def_avatar_background_7, + R.color.color_def_avatar_background_8, + R.color.color_def_avatar_background_9, + R.color.color_def_avatar_background_10, + R.color.color_def_avatar_background_11, + R.color.color_def_avatar_background_12, + R.color.color_def_avatar_background_13, + R.color.color_def_avatar_background_14, + R.color.color_def_avatar_background_15, + R.color.color_def_avatar_background_16, + R.color.color_def_avatar_background_17, + R.color.color_def_avatar_background_18, + R.color.color_def_avatar_background_19, + R.color.color_def_avatar_background_20, + R.color.color_def_avatar_background_21, + R.color.color_def_avatar_background_22, + R.color.color_def_avatar_background_23, + R.color.color_def_avatar_background_24 ) /** The presenter for [ProfileChooserFragment]. */ @@ -77,7 +77,9 @@ class ProfileChooserFragmentPresenter @Inject constructor( /** Binds ViewModel and sets up RecyclerView Adapter. */ fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? { - StatusBarColor.statusBarColorUpdate(R.color.profile_status_bar, activity, false) + StatusBarColor.statusBarColorUpdate( + R.color.component_color_shared_profile_status_bar_color, activity, false + ) binding = ProfileChooserFragmentBinding.inflate( inflater, container, diff --git a/app/src/main/java/org/oppia/android/app/profileprogress/ProfilePictureActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/profileprogress/ProfilePictureActivityPresenter.kt index 9a487c48a1a..cd9398374aa 100644 --- a/app/src/main/java/org/oppia/android/app/profileprogress/ProfilePictureActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/profileprogress/ProfilePictureActivityPresenter.kt @@ -31,7 +31,9 @@ class ProfilePictureActivityPresenter @Inject constructor( private lateinit var profileId: ProfileId fun handleOnCreate(internalProfileId: Int) { - StatusBarColor.statusBarColorUpdate(R.color.profile_status_bar, activity, false) + StatusBarColor.statusBarColorUpdate( + R.color.component_color_shared_profile_status_bar_color, activity, false + ) val binding = DataBindingUtil .setContentView( activity, diff --git a/app/src/main/java/org/oppia/android/app/spotlight/SpotlightFragment.kt b/app/src/main/java/org/oppia/android/app/spotlight/SpotlightFragment.kt index 689c8320f3e..5e6be96804e 100644 --- a/app/src/main/java/org/oppia/android/app/spotlight/SpotlightFragment.kt +++ b/app/src/main/java/org/oppia/android/app/spotlight/SpotlightFragment.kt @@ -154,7 +154,7 @@ class SpotlightFragment : InjectableFragment(), SpotlightNavigationListener, Spo if (targetList.isNullOrEmpty()) return spotlight = Spotlight.Builder(activity) .setTargets(targetList) - .setBackgroundColorRes(R.color.spotlight_overlay_background) + .setBackgroundColorRes(R.color.component_color_shared_close_spotlight_button_color) .setDuration(500L) .setAnimation(AccelerateInterpolator(0.5f)) .setOnSpotlightListener(object : OnSpotlightListener { diff --git a/app/src/main/java/org/oppia/android/app/walkthrough/WalkthroughActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/walkthrough/WalkthroughActivityPresenter.kt index c940c3db94d..9f7733df2fc 100644 --- a/app/src/main/java/org/oppia/android/app/walkthrough/WalkthroughActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/walkthrough/WalkthroughActivityPresenter.kt @@ -29,7 +29,11 @@ class WalkthroughActivityPresenter @Inject constructor( presenter = this@WalkthroughActivityPresenter lifecycleOwner = activity } - StatusBarColor.statusBarColorUpdate(R.color.walkthrough_status_bar, activity, true) + StatusBarColor.statusBarColorUpdate( + R.color.component_color_walkthrough_activity_status_bar_color, + activity, + true + ) val currentFragmentIndex = getWalkthroughViewModel().currentProgress.get()?.minus(1) if (currentFragmentIndex == -1 && getWalkthroughWelcomeFragment() == null) { diff --git a/app/src/main/res/drawable-ldrtl/bottom_left_rounded_rect_coming_soon_background.xml b/app/src/main/res/drawable-ldrtl/bottom_left_rounded_rect_coming_soon_background.xml index 801d7144094..d6b114b0902 100644 --- a/app/src/main/res/drawable-ldrtl/bottom_left_rounded_rect_coming_soon_background.xml +++ b/app/src/main/res/drawable-ldrtl/bottom_left_rounded_rect_coming_soon_background.xml @@ -7,7 +7,7 @@ android:topRightRadius="0dp" /> diff --git a/app/src/main/res/drawable/bottom_left_rounded_rect_coming_soon_background.xml b/app/src/main/res/drawable/bottom_left_rounded_rect_coming_soon_background.xml index 1e583977b52..03560a4e2b1 100644 --- a/app/src/main/res/drawable/bottom_left_rounded_rect_coming_soon_background.xml +++ b/app/src/main/res/drawable/bottom_left_rounded_rect_coming_soon_background.xml @@ -7,7 +7,7 @@ android:topRightRadius="4dp" /> diff --git a/app/src/main/res/drawable/bottom_left_rounded_rect_primary_background.xml b/app/src/main/res/drawable/bottom_left_rounded_rect_primary_background.xml deleted file mode 100644 index d924e608c60..00000000000 --- a/app/src/main/res/drawable/bottom_left_rounded_rect_primary_background.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/edit_text_red_border.xml b/app/src/main/res/drawable/edit_text_red_border.xml deleted file mode 100644 index 17c79f6a5c8..00000000000 --- a/app/src/main/res/drawable/edit_text_red_border.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/drawable/lesson_thumbnail_default.xml b/app/src/main/res/drawable/lesson_thumbnail_default.xml deleted file mode 100644 index 375130555db..00000000000 --- a/app/src/main/res/drawable/lesson_thumbnail_default.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/profile_chooser_divider.xml b/app/src/main/res/drawable/profile_chooser_divider.xml index a13bd2fa5a1..84a6b07c394 100644 --- a/app/src/main/res/drawable/profile_chooser_divider.xml +++ b/app/src/main/res/drawable/profile_chooser_divider.xml @@ -2,5 +2,5 @@ - + diff --git a/app/src/main/res/drawable/reading_text_size_seekbar_thumb.xml b/app/src/main/res/drawable/reading_text_size_seekbar_thumb.xml deleted file mode 100644 index 5e4117bd915..00000000000 --- a/app/src/main/res/drawable/reading_text_size_seekbar_thumb.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/drawable/rounded_corners_progress_bar.xml b/app/src/main/res/drawable/rounded_corners_progress_bar.xml index 5465e2350e3..f388452e424 100644 --- a/app/src/main/res/drawable/rounded_corners_progress_bar.xml +++ b/app/src/main/res/drawable/rounded_corners_progress_bar.xml @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/app/src/main/res/drawable/seekbar_progress.xml b/app/src/main/res/drawable/seekbar_progress.xml index be1a035b148..8815c02f884 100644 --- a/app/src/main/res/drawable/seekbar_progress.xml +++ b/app/src/main/res/drawable/seekbar_progress.xml @@ -3,5 +3,5 @@ android:shape="line"> + android:color="@color/component_color_shared_secondary_6_text_color" /> diff --git a/app/src/main/res/drawable/start_button_primary_background.xml b/app/src/main/res/drawable/start_button_primary_background.xml deleted file mode 100644 index dd6d1885805..00000000000 --- a/app/src/main/res/drawable/start_button_primary_background.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-land/walkthrough_final_fragment.xml b/app/src/main/res/layout-land/walkthrough_final_fragment.xml index 15a19eb25c1..1ae0bbbaed0 100644 --- a/app/src/main/res/layout-land/walkthrough_final_fragment.xml +++ b/app/src/main/res/layout-land/walkthrough_final_fragment.xml @@ -23,10 +23,10 @@ android:layout_width="180dp" android:layout_height="180dp" android:layout_marginStart="28dp" - app:srcCompat="@drawable/ic_portrait_onboarding_0" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_portrait_onboarding_0" /> @@ -89,7 +89,7 @@ android:layout_gravity="center_horizontal" android:fontFamily="sans-serif" android:text="@string/yes" - android:textColor="@color/oppia_primary" + android:textColor="@color/component_color_shared_secondary_6_text_color" android:textSize="20sp" /> @@ -113,7 +113,7 @@ android:layout_marginTop="4dp" android:fontFamily="sans-serif" android:text="@{viewModel.topicTitle}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_shared_primary_text_color" android:textSize="20sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/walkthrough_final_image_view" @@ -126,7 +126,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/great" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_shared_primary_text_color" android:textSize="24sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/walkthrough_final_image_view" diff --git a/app/src/main/res/layout-land/walkthrough_welcome_fragment.xml b/app/src/main/res/layout-land/walkthrough_welcome_fragment.xml index 49161635f88..7ac43a97c01 100644 --- a/app/src/main/res/layout-land/walkthrough_welcome_fragment.xml +++ b/app/src/main/res/layout-land/walkthrough_welcome_fragment.xml @@ -30,7 +30,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@{viewModel.profileName}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_shared_primary_text_color" android:textSize="24sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/walkthrough_welcome_image_view" @@ -47,7 +47,7 @@ android:layout_marginEnd="56dp" android:fontFamily="sans-serif" android:text="@string/walkthrough_welcome_description" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_shared_primary_text_color" android:textSize="20sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/walkthrough_welcome_image_view" @@ -58,10 +58,10 @@ android:layout_width="180dp" android:layout_height="180dp" android:layout_marginStart="56dp" - app:srcCompat="@drawable/ic_portrait_onboarding_0" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_portrait_onboarding_0" />