From b98c930517beaa79d55e270678f75d4106bb6adf Mon Sep 17 00:00:00 2001 From: ErikWaegerle Date: Sun, 7 Jun 2020 10:21:19 +0200 Subject: [PATCH] Color adjustment in the Navigation Drawer (blue background) Introduction of the resources color files to define the color matching of the selected item Creating the appropriate attributes and customizing the styles/night.xml --- app/src/main/res/color/menu_background_color.xml | 5 +++++ app/src/main/res/color/menu_icon_color.xml | 5 +++++ app/src/main/res/color/menu_text_color.xml | 6 ++++++ app/src/main/res/layout/activity_main_menu.xml | 3 +++ app/src/main/res/values-night/styles.xml | 5 +++++ app/src/main/res/values/attrs.xml | 3 +++ 6 files changed, 27 insertions(+) create mode 100644 app/src/main/res/color/menu_background_color.xml create mode 100644 app/src/main/res/color/menu_icon_color.xml create mode 100644 app/src/main/res/color/menu_text_color.xml diff --git a/app/src/main/res/color/menu_background_color.xml b/app/src/main/res/color/menu_background_color.xml new file mode 100644 index 0000000..6dc3a45 --- /dev/null +++ b/app/src/main/res/color/menu_background_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/color/menu_icon_color.xml b/app/src/main/res/color/menu_icon_color.xml new file mode 100644 index 0000000..36a18c3 --- /dev/null +++ b/app/src/main/res/color/menu_icon_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/color/menu_text_color.xml b/app/src/main/res/color/menu_text_color.xml new file mode 100644 index 0000000..a217851 --- /dev/null +++ b/app/src/main/res/color/menu_text_color.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main_menu.xml b/app/src/main/res/layout/activity_main_menu.xml index cdf9e59..26b0ff4 100644 --- a/app/src/main/res/layout/activity_main_menu.xml +++ b/app/src/main/res/layout/activity_main_menu.xml @@ -233,6 +233,9 @@ android:layout_gravity="start" android:fitsSystemWindows="true" android:background="?attr/lightestBackGround" + app:itemBackground="?attr/menu_background_color" + app:itemTextColor="?attr/menu_text_color" + app:itemIconTint="?attr/menu_icon_color" app:menu="@menu/menu_drawer_main" app:headerLayout="@layout/nav_header" /> diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index 23df2f6..ad5bb0a 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -18,6 +18,11 @@ @color/lightblue @color/middlegrey @color/yellow + @color/cardview_dark_background + @color/white + @color/menu_background_color + @color/menu_icon_color + @color/menu_text_color