private void formatNavDrawerItem ( DrawerItem item , boolean selected ) { if ( item instanceof SeperatorDrawerItem || item instanceof SwitchDrawerItem ) { // not applicable return ; } // Get the associated view View view = mNavDrawerItemViews . get ( item . getId ( ) ) ; ImageView iconView = ( ImageView ) view . findViewById ( R . id . icon ) ; TextView titleView = ( TextView ) view . findViewById ( R . id . title ) ; // configure its appearance according to whether or not it's selected titleView . setTextColor ( selected ? mConfig . getItemHighlightColor ( mActivity ) : UIUtils . getColorAttr ( mActivity , android . R . attr . textColorPrimary ) ) ; iconView . setColorFilter ( selected ? mConfig . getItemHighlightColor ( mActivity ) : getResources ( ) . getColor ( R . color . navdrawer_icon_tint ) , PorterDuff . Mode . SRC_ATOP ) ; }
Format a nav drawer item based on current selected states