You can use selector
In the selectable folder there is selector.xml as shown below
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/press" /> <item android:state_focused="false" android:drawable="@drawable/normal" /> </selector>
In the drop-down folder, click .xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#FF9D21"/> </shape>
In drawable foldernormal.xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#8BC7EB"/> </shape>
In drawer_list_item.xml
android:background="@drawable/selector"
To style a panel
<resources> <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> <item name="android:background">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar"> <item name="android:background">@drawable/press</item> </style> </resources>
In your manifest
<activity android:name=".MainActivity" android:theme="@style/MyActionBar" android:label="@string/app_name">
You can specify a theme for a specific action, and not for the entire application.
Additional Information
http://android-developers.blogspot.in/2011/04/customizing-action-bar.html
https://developer.android.com/training/basics/actionbar/styling.html
Snapshot
![enter image description here](https://fooobar.com/undefined)
source share