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
This commit is contained in:
ErikWaegerle 2020-06-07 10:21:19 +02:00
parent 7441559a11
commit b98c930517
6 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorPrimaryDark" android:state_checked="true" />
<item android:color="@android:color/transparent" />
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/white" android:state_checked="true" />
<item android:color="@color/white" />
</selector>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/white" android:state_checked="true" />
<item android:color="@color/white" />
</selector>

View file

@ -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" />

View file

@ -18,6 +18,11 @@
<item name="activeButtonColor">@color/lightblue</item>
<item name="inactiveButtonColor">@color/middlegrey</item>
<item name="highlightedButtonBorder">@color/yellow</item>
<item name="android:itemBackground">@color/cardview_dark_background</item>
<item name="android:textColor">@color/white</item>
<item name="menu_background_color">@color/menu_background_color</item>
<item name="menu_icon_color">@color/menu_icon_color</item>
<item name="menu_text_color">@color/menu_text_color</item>
</style>
<style name="ToolbarStyle" parent="Widget.AppCompat.ActionBar">

View file

@ -11,5 +11,8 @@
<attr name="inactiveButtonColor" format="color"/>
<attr name="activeButtonColor" format="color"/>
<attr name="highlightedButtonBorder" format="color"/>
<attr name="menu_text_color" format="color"/>
<attr name="menu_background_color" format="color"/>
<attr name="menu_icon_color" format="color"/>
</declare-styleable>
</resources>