From 49babed0a62b39ac4ff73d9a7404534976a175cd Mon Sep 17 00:00:00 2001 From: bhaktideshmukh <78796264+bhaktideshmukh@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:54:03 +0900 Subject: [PATCH] Fixes #4193: Added dark mode support to ProfileProgressActivity, RecentlyPlayedActivity, CompletedStoryListActivity and OngoingTopicListActivity (#4612) * dark mode to profile_progress, recently_played, topics_in_progress and completed_stories * nit changes * removed duplicate colors * removed duplicate colors --- .../layout-land/profile_progress_header.xml | 16 +++++++------- .../profile_progress_header.xml | 16 +++++++------- .../main/res/layout/completed_story_item.xml | 6 +++--- .../layout/completed_story_list_fragment.xml | 4 ++-- .../main/res/layout/ongoing_story_card.xml | 4 +++- .../layout/ongoing_topic_list_fragment.xml | 4 ++-- .../res/layout/profile_progress_fragment.xml | 3 ++- .../res/layout/profile_progress_header.xml | 16 +++++++------- ...le_progress_recently_played_story_card.xml | 6 +++--- .../main/res/layout/promoted_story_list.xml | 0 .../res/layout/recently_played_fragment.xml | 2 +- app/src/main/res/layout/section_title.xml | 2 +- .../main/res/values-night/color_palette.xml | 7 +++++++ app/src/main/res/values/color_palette.xml | 10 +++++++-- app/src/main/res/values/component_colors.xml | 21 +++++++++++++++++++ 15 files changed, 80 insertions(+), 37 deletions(-) mode change 100755 => 100644 app/src/main/res/layout/promoted_story_list.xml diff --git a/app/src/main/res/layout-land/profile_progress_header.xml b/app/src/main/res/layout-land/profile_progress_header.xml index b32b60509f8..c4746910d69 100644 --- a/app/src/main/res/layout-land/profile_progress_header.xml +++ b/app/src/main/res/layout-land/profile_progress_header.xml @@ -56,7 +56,7 @@ android:layout_marginTop="12dp" android:fontFamily="sans-serif-medium" android:text="@{viewModel.profile.name}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_profile_name_text_color" android:textSize="28sp" app:layout_constraintEnd_toEndOf="@id/completed_stories_container" app:layout_constraintStart_toStartOf="@+id/ongoing_topics_container" @@ -74,6 +74,7 @@ android:clickable="@{viewModel.ongoingTopicCount > 0}" android:importantForAccessibility="yes" android:onClick="@{() -> viewModel.clickOnOngoingTopicCount()}" + app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color" app:cardElevation="4dp" app:contentPadding="8dp" app:layout_constraintEnd_toStartOf="@+id/completed_stories_container" @@ -96,7 +97,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@{Integer.toString(viewModel.ongoingTopicCount)}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color" android:textSize="24sp" /> @@ -122,6 +123,7 @@ android:clickable="@{viewModel.completedStoryCount > 0}" android:importantForAccessibility="yes" android:onClick="@{() -> viewModel.clickOnCompletedStoryCount()}" + app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color" app:cardElevation="4dp" app:contentPadding="8dp" app:layout_constraintEnd_toEndOf="parent" @@ -144,7 +146,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@{Integer.toString(viewModel.completedStoryCount)}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color" android:textSize="24sp" /> @@ -168,7 +170,7 @@ android:fontFamily="sans-serif-medium" android:minHeight="48dp" android:text="@string/recently_played_stories" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_recently_played_stories_text_color" android:textSize="18sp" android:visibility="@{viewModel.headerTextVisibility}" app:layout_constraintStart_toStartOf="parent" @@ -185,7 +187,7 @@ android:onClick="@{() -> viewModel.clickOnViewAll()}" android:text="@string/view_all" android:textAllCaps="true" - android:textColor="@color/oppia_primary" + android:textColor="@color/component_color_profile_progress_activity_view_all_text_color" android:textSize="14sp" android:visibility="@{viewModel.viewAllButtonVisibility}" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout-sw600dp/profile_progress_header.xml b/app/src/main/res/layout-sw600dp/profile_progress_header.xml index 43563612d84..42a6ef0ac7e 100644 --- a/app/src/main/res/layout-sw600dp/profile_progress_header.xml +++ b/app/src/main/res/layout-sw600dp/profile_progress_header.xml @@ -58,7 +58,7 @@ android:layout_marginEnd="@dimen/profile_name_text_view_layout_margin_end" android:fontFamily="sans-serif-medium" android:text="@{viewModel.profile.name}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_profile_name_text_color" android:textSize="28sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/profile_edit_image" @@ -75,6 +75,7 @@ android:clickable="@{viewModel.ongoingTopicCount > 0}" android:importantForAccessibility="yes" android:onClick="@{() -> viewModel.clickOnOngoingTopicCount()}" + app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color" app:cardElevation="4dp" app:contentPadding="8dp" app:layout_constraintEnd_toStartOf="@+id/completed_stories_container" @@ -97,7 +98,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@{Integer.toString(viewModel.ongoingTopicCount)}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color" android:textSize="24sp" /> @@ -122,6 +123,7 @@ android:clickable="@{viewModel.completedStoryCount > 0}" android:importantForAccessibility="yes" android:onClick="@{() -> viewModel.clickOnCompletedStoryCount()}" + app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color" app:cardElevation="4dp" app:contentPadding="8dp" app:layout_constraintEnd_toEndOf="@+id/profile_name_text_view" @@ -144,7 +146,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@{Integer.toString(viewModel.completedStoryCount)}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color" android:textSize="24sp" /> @@ -169,7 +171,7 @@ android:fontFamily="sans-serif-medium" android:minHeight="48dp" android:text="@string/recently_played_stories" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color" android:textSize="18sp" android:visibility="@{viewModel.headerTextVisibility}" app:layout_constraintEnd_toStartOf="@+id/view_all_text_view" @@ -188,7 +190,7 @@ android:onClick="@{() -> viewModel.clickOnViewAll()}" android:text="@string/view_all" android:textAllCaps="true" - android:textColor="@color/oppia_primary" + android:textColor="@color/component_color_profile_progress_activity_view_all_text_color" android:textSize="14sp" android:visibility="@{viewModel.viewAllButtonVisibility}" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/completed_story_item.xml b/app/src/main/res/layout/completed_story_item.xml index b5341b699a8..5ddf4c84f47 100755 --- a/app/src/main/res/layout/completed_story_item.xml +++ b/app/src/main/res/layout/completed_story_item.xml @@ -49,7 +49,7 @@ android:id="@+id/constraintLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/color_def_white" + android:background="@color/component_color_completed_progress_activity_completed_story_card_color" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -69,7 +69,7 @@ android:maxLines="2" android:minLines="2" android:text="@{viewModel.completedStoryName}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_completed_progress_activity_completed_story_card_text_color" android:textSize="14sp" android:textStyle="bold" app:layout_constraintStart_toStartOf="parent" @@ -90,7 +90,7 @@ android:paddingBottom="12dp" android:text="@{viewModel.topicName}" android:textAllCaps="true" - android:textColor="@color/color_def_oppia_stroke_black" + android:textColor="@color/component_color_completed_progress_activity_completed_story_card_text_color" android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/completed_story_name_text_view" /> diff --git a/app/src/main/res/layout/completed_story_list_fragment.xml b/app/src/main/res/layout/completed_story_list_fragment.xml index eee17246f45..141cfbb9a54 100644 --- a/app/src/main/res/layout/completed_story_list_fragment.xml +++ b/app/src/main/res/layout/completed_story_list_fragment.xml @@ -12,7 +12,7 @@ + android:background="@color/component_color_completed_progress_activity_background_color"> + android:background="@color/component_color_ongoing_progress_activity_background_color"> + android:layout_height="match_parent" + android:background="@color/component_color_profile_progress_activity_background_color"> @@ -124,6 +125,7 @@ android:clickable="@{viewModel.completedStoryCount > 0}" android:importantForAccessibility="yes" android:onClick="@{() -> viewModel.clickOnCompletedStoryCount()}" + app:cardBackgroundColor="@color/component_color_profile_progress_activity_stories_progress_background_color" app:cardElevation="2dp" app:contentPadding="8dp" app:layout_constraintEnd_toEndOf="parent" @@ -146,7 +148,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@{Integer.toString(viewModel.completedStoryCount)}" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_stories_progress_text_color" android:textSize="24sp" /> @@ -172,7 +174,7 @@ android:fontFamily="sans-serif-medium" android:minHeight="48dp" android:text="@string/recently_played_stories" - android:textColor="@color/oppia_primary_text" + android:textColor="@color/component_color_profile_progress_activity_recently_played_stories_text_color" android:textSize="18sp" android:visibility="@{viewModel.headerTextVisibility}" app:layout_constraintEnd_toStartOf="@+id/view_all_text_view" @@ -192,7 +194,7 @@ android:onClick="@{() -> viewModel.clickOnViewAll()}" android:text="@string/view_all" android:textAllCaps="true" - android:textColor="@color/oppia_primary" + android:textColor="@color/component_color_profile_progress_activity_view_all_text_color" android:textSize="14sp" android:visibility="@{viewModel.viewAllButtonVisibility}" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/profile_progress_recently_played_story_card.xml b/app/src/main/res/layout/profile_progress_recently_played_story_card.xml index c54b1175726..4b00558b9be 100755 --- a/app/src/main/res/layout/profile_progress_recently_played_story_card.xml +++ b/app/src/main/res/layout/profile_progress_recently_played_story_card.xml @@ -47,7 +47,7 @@ diff --git a/app/src/main/res/values-night/color_palette.xml b/app/src/main/res/values-night/color_palette.xml index f88f89f3737..fb33ff56f18 100644 --- a/app/src/main/res/values-night/color_palette.xml +++ b/app/src/main/res/values-night/color_palette.xml @@ -112,6 +112,13 @@ @color/color_def_white @color/color_def_oppia_metallic_blue @color/color_def_dark_purple + @color/color_def_oppia_light_black + @color/color_def_oppia_light_black + @color/color_def_white + @color/color_def_oppia_light_black + @color/color_def_oppia_light_black + @color/color_def_oppia_light_black + @color/color_def_white @color/color_def_oppia_light_black @color/color_def_oppia_silver @color/color_def_white diff --git a/app/src/main/res/values/color_palette.xml b/app/src/main/res/values/color_palette.xml index a41db0cb20e..aeff388e4fe 100644 --- a/app/src/main/res/values/color_palette.xml +++ b/app/src/main/res/values/color_palette.xml @@ -94,7 +94,6 @@ @color/color_def_oppia_dark_blue @color/color_def_oppia_white @color/color_def_white - @color/color_def_oppia_green @color/color_def_accessible_grey @color/color_def_accessible_grey @color/color_def_accessible_grey @@ -113,8 +112,15 @@ @color/color_def_black @color/color_def_teal_blue @color/color_def_dark_red - @color/color_def_oppia_white_2 @color/color_def_oppia_white_2 + @color/color_def_transparent + @color/color_def_accessible_grey + @color/color_def_oppia_green + @color/color_def_white + @color/color_def_white + @color/color_def_white + @color/color_def_oppia_stroke_black + @color/color_def_oppia_white_2 @color/color_def_accessible_light_grey_2 @color/color_def_accessible_grey diff --git a/app/src/main/res/values/component_colors.xml b/app/src/main/res/values/component_colors.xml index e5f8b9b2d3a..86b3e7d11f9 100644 --- a/app/src/main/res/values/component_colors.xml +++ b/app/src/main/res/values/component_colors.xml @@ -288,6 +288,27 @@ @color/color_palette_seekbar_progress_background_color @color/color_palette_topic_revision_background_color + + @color/color_palette_profile_progress_activity_background_color + @color/color_palette_profile_progress_activity_profile_name_text_color + @color/color_palette_rounded_rect_background_color + @color/color_palette_highlighted_text_color + @color/color_palette_highlighted_text_color + @color/color_palette_view_all_text_color + + @color/color_palette_toolbar_color + @color/color_palette_recently_played_activity_background_color + @color/color_palette_rounded_rect_background_color + @color/color_palette_highlighted_text_color + @color/color_palette_highlighted_text_color + + @color/color_palette_toolbar_color + @color/color_palette_ongoing_progress_activity_background_color + + @color/color_palette_toolbar_color + @color/color_palette_completed_progress_activity_background_color + @color/color_palette_rounded_rect_background_color + @color/color_palette_completed_progress_activity_completed_story_card_text_color @color/color_palette_topic_fragments_background_color @color/color_palette_topic_practice_header_description_color