From dd32a17885727dd08390300ea606820a387a2c36 Mon Sep 17 00:00:00 2001 From: MohitGupta121 Date: Tue, 25 Jul 2023 00:23:22 -0600 Subject: [PATCH 1/7] Implement dark mode for nps survey --- .../SurveyOnboardingBackgroundView.kt | 2 +- .../rounded_button_white_background_color.xml | 4 ++-- .../rounded_button_white_outline_color.xml | 4 ++-- .../survey_confirmation_dialog_background.xml | 2 +- .../survey_next_button_background.xml | 7 ------- .../survey_nps_radio_selected_color.xml | 2 +- .../drawable/survey_nps_radio_text_color.xml | 4 ++-- .../survey_nps_radio_unselected_color.xml | 2 +- .../survey_submit_button_background.xml | 7 ------- .../survey_exit_confirmation_dialog.xml | 3 ++- app/src/main/res/layout/survey_fragment.xml | 6 +++--- .../res/layout/survey_free_form_layout.xml | 1 + .../main/res/values-night/color_palette.xml | 19 +++++++++++++++++++ app/src/main/res/values/color_defs.xml | 4 ++-- app/src/main/res/values/color_palette.xml | 14 ++++++++++++-- app/src/main/res/values/component_colors.xml | 12 +++++++++++- app/src/main/res/values/styles.xml | 11 ++++++----- 17 files changed, 66 insertions(+), 38 deletions(-) delete mode 100644 app/src/main/res/drawable/survey_next_button_background.xml delete mode 100644 app/src/main/res/drawable/survey_submit_button_background.xml diff --git a/app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt b/app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt index ba17796be34..4ef674dc6ab 100644 --- a/app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt +++ b/app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt @@ -94,7 +94,7 @@ class SurveyOnboardingBackgroundView : View { strokeWidth = this@SurveyOnboardingBackgroundView.strokeWidth color = ContextCompat.getColor( context, - R.color.component_color_survey_onboarding_background_color + R.color.component_color_survey_popup_background_color ) } setBackgroundColor(Color.TRANSPARENT) diff --git a/app/src/main/res/drawable/rounded_button_white_background_color.xml b/app/src/main/res/drawable/rounded_button_white_background_color.xml index a11197bd37a..196f7707443 100644 --- a/app/src/main/res/drawable/rounded_button_white_background_color.xml +++ b/app/src/main/res/drawable/rounded_button_white_background_color.xml @@ -2,8 +2,8 @@ - + + android:color="@color/component_color_shared_button_active_stroke_color" /> diff --git a/app/src/main/res/drawable/rounded_button_white_outline_color.xml b/app/src/main/res/drawable/rounded_button_white_outline_color.xml index 9745cd92363..e0062e45189 100644 --- a/app/src/main/res/drawable/rounded_button_white_outline_color.xml +++ b/app/src/main/res/drawable/rounded_button_white_outline_color.xml @@ -2,8 +2,8 @@ - + + android:color="@color/component_color_survey_white_button_color" /> diff --git a/app/src/main/res/drawable/survey_confirmation_dialog_background.xml b/app/src/main/res/drawable/survey_confirmation_dialog_background.xml index a8e76a82fd6..4ccc77e6490 100644 --- a/app/src/main/res/drawable/survey_confirmation_dialog_background.xml +++ b/app/src/main/res/drawable/survey_confirmation_dialog_background.xml @@ -2,7 +2,7 @@ - + diff --git a/app/src/main/res/drawable/survey_next_button_background.xml b/app/src/main/res/drawable/survey_next_button_background.xml deleted file mode 100644 index de55a5e10e0..00000000000 --- a/app/src/main/res/drawable/survey_next_button_background.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/drawable/survey_nps_radio_selected_color.xml b/app/src/main/res/drawable/survey_nps_radio_selected_color.xml index c62b0773a38..0019620da24 100644 --- a/app/src/main/res/drawable/survey_nps_radio_selected_color.xml +++ b/app/src/main/res/drawable/survey_nps_radio_selected_color.xml @@ -1,7 +1,7 @@ - - + + diff --git a/app/src/main/res/drawable/survey_nps_radio_unselected_color.xml b/app/src/main/res/drawable/survey_nps_radio_unselected_color.xml index b2665b4d899..ac3f393f2fe 100644 --- a/app/src/main/res/drawable/survey_nps_radio_unselected_color.xml +++ b/app/src/main/res/drawable/survey_nps_radio_unselected_color.xml @@ -1,7 +1,7 @@ - - - - - - diff --git a/app/src/main/res/layout/survey_exit_confirmation_dialog.xml b/app/src/main/res/layout/survey_exit_confirmation_dialog.xml index 78128ced3dd..fbbfe690df1 100644 --- a/app/src/main/res/layout/survey_exit_confirmation_dialog.xml +++ b/app/src/main/res/layout/survey_exit_confirmation_dialog.xml @@ -11,7 +11,8 @@ style="@style/SurveyQuestionTextStyle" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="@dimen/survey_question_text_margin" + android:layout_marginStart="@dimen/survey_question_text_margin" + android:layout_marginEnd="@dimen/survey_question_text_margin" android:text="@string/survey_exit_confirmation_text" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/survey_fragment.xml b/app/src/main/res/layout/survey_fragment.xml index 07f6770a3d5..b12beec427d 100644 --- a/app/src/main/res/layout/survey_fragment.xml +++ b/app/src/main/res/layout/survey_fragment.xml @@ -28,10 +28,10 @@ android:id="@+id/survey_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/component_color_shared_secondary_toolbar_color" + android:background="@color/component_color_shared_activity_toolbar_color" + android:contentDescription="@string/survey_exit_button_description" android:minHeight="?attr/actionBarSize" android:theme="@style/Widget.AppCompat.ActionBar" - android:contentDescription="@string/survey_exit_button_description" app:navigationIcon="@drawable/ic_close_white_24dp"> @color/color_def_onboarding_4_status_bar @color/color_def_grape_violet @color/color_def_bright_violet + + @color/color_def_oppia_light_black + @color/color_def_white_f6 + @color/color_def_dark_turquoise + @color/color_def_white_f5 + @color/color_def_dark_green + @color/color_def_white + @color/color_def_white_f6 + @color/color_def_dark_green + @color/color_def_light_blue + @color/color_def_white + @color/color_def_oppia_grayish_black + @color/color_def_chooser_grey + @color/color_def_oppia_green + @color/color_def_grey + @color/color_def_dark_green + @color/color_def_white + @color/color_def_dark_green + @color/color_def_pale_green diff --git a/app/src/main/res/values/color_defs.xml b/app/src/main/res/values/color_defs.xml index 27498356b7e..446a12a3a70 100644 --- a/app/src/main/res/values/color_defs.xml +++ b/app/src/main/res/values/color_defs.xml @@ -137,8 +137,8 @@ #AB29CC #CC29B1 #CC2970 - #F5F5F5 - #F6F6F6 + #F5F5F5 + #F6F6F6 #BDCCCC #E8E8E8 diff --git a/app/src/main/res/values/color_palette.xml b/app/src/main/res/values/color_palette.xml index 0c34c6b9f99..56601a32426 100644 --- a/app/src/main/res/values/color_palette.xml +++ b/app/src/main/res/values/color_palette.xml @@ -245,8 +245,18 @@ @color/color_def_avatar_background_23 @color/color_def_avatar_background_24 - @color/color_def_survey_background - @color/color_def_survey_buttons_white + @color/color_def_white_f5 + @color/color_def_white_f6 + @color/color_def_oppia_green + @color/color_def_oppia_green + @color/color_def_oppia_green + @color/color_def_white + @color/color_def_white_f6 + @color/color_def_oppia_green + @color/color_def_oppia_green + @color/color_def_white + @color/color_def_oppia_green + @color/color_def_pale_green @color/color_def_light_blue @color/color_def_accessible_grey @color/color_def_survey_disabled_button_grey diff --git a/app/src/main/res/values/component_colors.xml b/app/src/main/res/values/component_colors.xml index 59b36435596..08c6285a6e8 100644 --- a/app/src/main/res/values/component_colors.xml +++ b/app/src/main/res/values/component_colors.xml @@ -280,7 +280,17 @@ @color/color_palette_survey_background_color @color/color_palette_survey_shared_button_color - @color/color_palette_primary_color + @color/color_palette_survey_previous_button_text_color + @color/color_palette_survey_popup_header_color + @color/color_palette_survey_popup_message_color + @color/color_palette_survey_popup_background_color + @color/color_palette_survey_shared_button_color + @color/color_palette_survey_green_button_color + @color/color_palette_toolbar_color + @color/color_palette_nps_unselected_text_color + @color/color_palette_nps_selected_text_color + @color/color_palette_nps_unselected_background_color + @color/color_palette_nps_selected_background_color @color/color_palette_primary_color @color/color_palette_survey_dialog_stroke_color @color/color_palette_survey_radio_button_color diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c86d564fef6..3738d2d993b 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -558,7 +558,7 @@ sans-serif-medium @dimen/clickable_item_min_height true - @color/component_color_shared_secondary_button_background_trim_color + @color/component_color_survey_previous_button_text_color 14sp @@ -568,6 +568,7 @@ center 144dp @dimen/survey_navigation_buttons_margin + @drawable/state_button_primary_background sans-serif-medium @dimen/clickable_item_min_height true @@ -580,7 +581,7 @@ 12dp 12dp 144dp - @drawable/survey_submit_button_background + @drawable/state_button_primary_background sans-serif-medium @dimen/clickable_item_min_height true @@ -612,7 +613,7 @@ @@ -544,7 +544,7 @@ @drawable/rounded_button_white_outline_color sans-serif-medium @dimen/clickable_item_min_height - true + false @color/component_color_shared_secondary_4_text_color 14sp @@ -557,7 +557,7 @@ @dimen/survey_navigation_buttons_margin sans-serif-medium @dimen/clickable_item_min_height - true + false @color/component_color_survey_previous_button_text_color 14sp @@ -571,7 +571,7 @@ @drawable/state_button_primary_background sans-serif-medium @dimen/clickable_item_min_height - true + false @color/component_color_shared_secondary_4_text_color 14sp @@ -584,7 +584,7 @@ @drawable/state_button_primary_background sans-serif-medium @dimen/clickable_item_min_height - true + false @color/component_color_shared_secondary_4_text_color 14sp @@ -626,7 +626,7 @@ @dimen/survey_popup_message_margin @dimen/survey_popup_message_text_size sans-serif - + false