I've got an issue with dealing with ActionBarDrawerToggle(v7) and icons.
Basically, i've got a classical Activity with a DrawerFragment and Fragments to be displayed and it works.
My issue occurs when i try to replace a Fragment with another for detail view (List/Detail Fragments).
I push my new DetailFragment with:
private void putDetailFragment(Fragment fragment, String fragmentName) {
getSupportFragmentManager()
.beginTransaction()
.addToBackStack(fragmentName)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.replace(R.id.container, fragment)
.commit();
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(getString(mTitleId).toUpperCase());
mNavigationDrawerFragment.setHomeAsUp(getSupportActionBar(), true);
}
}
public void setHomeAsUp(ActionBar actionBar, boolean show) {
actionBar.setDisplayHomeAsUpEnabled(show);
setDrawerIndicatorEnabled(!show);
}
public void setDrawerIndicatorEnabled(Boolean enabled) {
if (mDrawerToggle != null) {
mDrawerToggle.setDrawerIndicatorEnabled(enabled);
mDrawerToggle.syncState();
}
if(mDrawerLayout != null) {
mDrawerLayout.setDrawerLockMode(enabled ? DrawerLayout.LOCK_MODE_UNLOCKED : DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
}
}
Unfortunately, the arrow is not animated as it is with opening the drawer. And when i go back from my DetailFragment, the hamburger icon's gone.
Does anyone has a clue what's wrong here? It was working nice with ActionBarDrawerToggle(v4), but not with the new animated one.
Thanks !