How to implement navigation drawer selector similar to Google Play Music

Posted by Shivam Bhalla on Stack Overflow See other posts from Stack Overflow or by Shivam Bhalla
Published on 2013-10-12T05:51:02Z Indexed on 2013/10/25 9:55 UTC
Read the original article Hit count: 230

I am looking to implement a navigation drawer selector which shows the currently selected item at all times when the drawer is opened and that is retained even when the drawer is closed. Something like this:

enter image description here

I have used something like this but it only shows the selector when I click on the list item. This is in my res folder:

<?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/list_activated_holo" />

</selector>

How do i attain the above shown implementation?Which state do i need to implement? Thanks

© Stack Overflow or respective owner

Related posts about android

Related posts about android-selector