From 7def64a0c997aa7e9418bb22c9ed5ba04e617f3a Mon Sep 17 00:00:00 2001
From: MOHIT GUPTA <76530270+MohitGupta121@users.noreply.github.com>
Date: Mon, 6 Feb 2023 23:04:21 +0530
Subject: [PATCH] Dark mode implementation - Non Visible Layouts (Topic and
Practice Fragments) (#4870)
## Explanation
Dark mode implementation - Non Visible Layouts (Topic and Practice
Fragments)
## 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: ...".)
- [ ] 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
### Info Fragment
### Practice Fragment
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
---
.../res/layout-land/topic_info_fragment.xml | 17 +++++++++--------
.../resume_lesson_fragment.xml | 2 +-
.../layout-sw600dp-land/topic_info_fragment.xml | 17 +++++++++--------
.../layout-sw600dp-port/topic_info_fragment.xml | 17 +++++++++--------
.../layout-sw600dp/topic_practice_fragment.xml | 2 +-
app/src/main/res/layout/topic_info_fragment.xml | 14 +++++++-------
.../res/layout/topic_practice_footer_view.xml | 2 +-
.../main/res/layout/topic_practice_fragment.xml | 2 +-
.../main/res/layout/topic_practice_subtopic.xml | 2 +-
app/src/main/res/values-night/color_palette.xml | 2 +-
app/src/main/res/values/color_palette.xml | 2 +-
app/src/main/res/values/component_colors.xml | 14 +++-----------
12 files changed, 44 insertions(+), 49 deletions(-)
diff --git a/app/src/main/res/layout-land/topic_info_fragment.xml b/app/src/main/res/layout-land/topic_info_fragment.xml
index cf5c1595bc1..18502150884 100644
--- a/app/src/main/res/layout-land/topic_info_fragment.xml
+++ b/app/src/main/res/layout-land/topic_info_fragment.xml
@@ -14,7 +14,7 @@
@@ -34,7 +34,7 @@
android:layout_marginEnd="72dp"
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="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -51,7 +51,7 @@
android:layout_marginEnd="72dp"
android:fontFamily="sans-serif"
android:text="@{viewModel.storyCountText}"
- android:textColor="@color/oppia_primary_text"
+ android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -84,7 +84,7 @@
android:onClick="@{(v) -> viewModel.clickSeeMore()}"
android:paddingTop="8dp"
android:text="@{viewModel.isDescriptionExpanded() ? @string/see_less : @string/see_more}"
- android:textColor="@color/oppia_primary"
+ android:textColor="@color/component_color_shared_active_text_color"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="@{viewModel.isSeeMoreVisible() ? View.VISIBLE : View.GONE}"
@@ -101,10 +101,11 @@
android:layout_marginTop="24dp"
android:layout_marginEnd="72dp"
android:layout_marginBottom="32dp"
- app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/see_more_text_view" />
+ app:layout_constraintTop_toBottomOf="@+id/see_more_text_view"
+ app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
+ app:tint="@color/component_color_topic_info_fragment_download_status_image_color" />
+ app:layout_constraintTop_toBottomOf="@+id/see_more_text_view"
+ app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
+ app:tint="@color/component_color_topic_info_fragment_download_status_image_color" />
@@ -52,7 +52,7 @@
android:layout_marginEnd="120dp"
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="24sp"
app:layout_constraintBottom_toBottomOf="@+id/topic_thumbnail_image_view"
app:layout_constraintEnd_toEndOf="parent"
@@ -69,7 +69,7 @@
android:layout_marginEnd="120dp"
android:fontFamily="sans-serif"
android:text="@{viewModel.storyCountText}"
- android:textColor="@color/oppia_primary_text"
+ android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -101,7 +101,7 @@
android:onClick="@{(v) -> viewModel.clickSeeMore()}"
android:paddingTop="8dp"
android:text="@{viewModel.isDescriptionExpanded() ? @string/see_less : @string/see_more}"
- android:textColor="@color/oppia_primary"
+ android:textColor="@color/component_color_shared_active_text_color"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="@{viewModel.isSeeMoreVisible() ? View.VISIBLE : View.GONE}"
@@ -116,9 +116,10 @@
android:layout_height="20dp"
android:layout_marginStart="120dp"
android:layout_marginTop="24dp"
- app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/see_more_text_view" />
+ app:layout_constraintTop_toBottomOf="@+id/see_more_text_view"
+ app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
+ app:tint="@color/component_color_topic_info_fragment_download_status_image_color" />
@@ -56,7 +56,7 @@
android:layout_marginBottom="8dp"
android:fontFamily="sans-serif"
android:text="@{viewModel.topicTitle}"
- android:textColor="@color/component_color_topic_info_fragment_topic_name_text_color"
+ android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="@+id/topic_thumbnail_image_view"
app:layout_constraintEnd_toEndOf="parent"
@@ -73,7 +73,7 @@
android:layout_marginEnd="32dp"
android:fontFamily="sans-serif"
android:text="@{viewModel.storyCountText}"
- android:textColor="@color/component_color_topic_info_fragment_story_count_text_color"
+ android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -106,7 +106,7 @@
android:onClick="@{(v) -> viewModel.clickSeeMore()}"
android:paddingTop="8dp"
android:text="@{viewModel.isDescriptionExpanded() ? @string/see_less : @string/see_more}"
- android:textColor="@color/component_color_topic_info_fragment_see_more_text_color"
+ android:textColor="@color/component_color_shared_active_text_color"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="@{viewModel.isSeeMoreVisible() ? View.VISIBLE : View.GONE}"
@@ -122,10 +122,10 @@
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="32dp"
- app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/see_more_text_view"
+ app:srcCompat="@{viewModel.downloadStatusIndicatorDrawableResourceId, default=@drawable/ic_available_offline_primary_24dp}"
app:tint="@color/component_color_topic_info_fragment_download_status_image_color" />
@color/color_def_white
@color/color_def_oppia_turquoise
@color/color_def_oppia_turquoise
- @color/color_def_oppia_turquoise
+ @color/color_def_oppia_turquoise
@color/color_def_oppia_pink
@color/color_def_oppia_turquoise
@color/color_def_oppia_silver
diff --git a/app/src/main/res/values/color_palette.xml b/app/src/main/res/values/color_palette.xml
index f07c4439850..31e1cbc5d38 100644
--- a/app/src/main/res/values/color_palette.xml
+++ b/app/src/main/res/values/color_palette.xml
@@ -57,7 +57,7 @@
@color/color_def_oppia_dark_blue
@color/color_def_oppia_dark_blue
@color/color_def_oppia_green
- @color/color_def_accessible_grey
+ @color/color_def_accessible_grey
@color/color_def_error_text
@color/color_def_oppia_green
@color/color_def_chooser_grey
diff --git a/app/src/main/res/values/component_colors.xml b/app/src/main/res/values/component_colors.xml
index 7add898a2bf..ca5ab5a48a6 100644
--- a/app/src/main/res/values/component_colors.xml
+++ b/app/src/main/res/values/component_colors.xml
@@ -81,6 +81,8 @@
@color/color_palette_shared_spotlight_hint_background_color
@color/color_palette_shared_close_spotlight_button_color
@color/color_palette_shared_spotlight_overlay_arrow_color
+ @color/color_palette_shared_download_story_text_color
+ @color/color_palette_topic_thumbnail_background_color
@color/color_palette_status_bar_color
@color/color_palette_fragment_status_bar_color
@@ -137,8 +139,6 @@
@color/color_palette_shared_white_background_color
@color/color_palette_story_chapter_default_progress_stroke_color
@color/color_palette_story_chapter_not_start_stroke_color
-
- @color/color_palette_topic_thumbnail_background_color
@color/color_palette_content_background_stroke_color
@color/color_palette_content_background_solid_color
@@ -175,20 +175,14 @@
@color/color_palette_view_all_text_color
@color/color_palette_layout_below_greeting_text_color
-
+
@color/color_palette_confetti_red_color
@color/color_palette_confetti_yellow_color
@color/color_palette_confetti_blue_color
- @color/color_palette_primary_background_color
- @color/color_palette_highlighted_text_color
- @color/color_palette_highlighted_text_color
@color/color_palette_thumbnail_gradient_end_color
@color/color_palette_thumbnail_gradient_start_color
- @color/color_palette_primary_color
@color/color_palette_primary_color
- @color/color_palette_show_text_color
- @color/color_palette_show_text_color
@color/color_palette_menu_selected_text_color
@color/color_palette_developer_option_menu_selected_color
@@ -206,9 +200,7 @@
@color/color_palette_view_all_text_color
@color/color_palette_profile_progress_activity_story_count_card_stroke_color
- @color/color_palette_topic_fragments_background_color
@color/color_palette_topic_practice_header_description_color
- @color/color_palette_primary_container_background_color
@color/color_palette_error_color
@color/color_palette_item_background_solid_color