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:
parent
7441559a11
commit
b98c930517
6 changed files with 27 additions and 0 deletions
5
app/src/main/res/color/menu_background_color.xml
Normal file
5
app/src/main/res/color/menu_background_color.xml
Normal 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>
|
5
app/src/main/res/color/menu_icon_color.xml
Normal file
5
app/src/main/res/color/menu_icon_color.xml
Normal 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>
|
6
app/src/main/res/color/menu_text_color.xml
Normal file
6
app/src/main/res/color/menu_text_color.xml
Normal 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>
|
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
Loading…
Reference in a new issue