-1

I have implemented hamburger -> arrow button on ActionBar, just like here: http://material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0B08MbvYZK1iNWG5ldFpTU3VDd1E/animation-DelightfulDetails-DelightfulDetails-WellCrafted_v01_large_xhdpi.webm

It works nice, however I would like to change the background of this button when it is being pressed. How can I change the background of ActionBarDrawerToggle?

connexion20000
  • 235
  • 3
  • 16

1 Answers1

0

Below is workaround that solves the problem, but there have to be some nicer way:

for(int i=0; i<( getActionBarToolbar()).getChildCount(); ++i) {
    View nextChild = getActionBarToolbar().getChildAt(i);
    if (nextChild instanceof ImageButton)
    {
        nextChild.setBackgroundResource(R.drawable.selectable_background_indigo);
    }
 }

I am just iterating and looking for this ImageButton on which hamburger icon is shown, but there have to be some nicer way.

connexion20000
  • 235
  • 3
  • 16