I've tried quite a bit messing around with the ActionBarDrawerToggle & the Styles.xml with themes but nothing that I've tried or out there on Google & Stack seems to be what I need.
I'm using the v7 ActionBarDrawerToggle.
As the title says, what exactly I need to do is to keep everything as it is as on the drawer except for the Arrow when the drawer is open & when it is closed when an item is selected.
I want that arrow gone & the hamburger icon to stay. I can achieve this easily but not without losing the animation. Which is the other thing, I want too keep the animation as well, so instead of the hamburger animating/spinning to an arrow, the hamburger will animate/spin to another hamburger.
Any ideas?
Thanks! Cheers!
Here's the code
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.activity_main);
getActionBar().setBackgroundDrawable(new
ColorDrawable(Color.parseColor("#CC0000")));
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
linearMain = (LinearLayout) findViewById(R.id.linearMain);
mDrawerLayout = (DrawerLayout) findViewById(R.id.layout_mainactivity);
mDrawerList = (ListView) findViewById(R.id.left_drawer);
mDrawerList.setDividerHeight(1);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer, R.string.drawer_open) {
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerList.setAdapter(new ArrayAdapter<String>(this,
R.layout.drawer_list_item, menuItems));
Fragment fragment = null;
Class<TabLayoutFragment> fragmentClass = TabLayoutFragment.class;
try {
fragment = (Fragment) fragmentClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragmentContainer, fragment);
fragmentTransaction.commit();
mDrawerList.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view, final int
pos,long id){
mDrawerLayout.setDrawerListener( new
DrawerLayout.SimpleDrawerListener(){
@Override
public void onDrawerClosed(View drawerView){
super.onDrawerClosed(drawerView);
if (pos == 0){
TabLayoutFragment.tabLayoutViewPager.setCurrentItem(0);
} else if (pos == 1) {
TabLayoutFragment.tabLayoutViewPager.setCurrentItem(1);
}
}
});
mDrawerLayout.closeDrawer(linearMain);
}
});
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
mDrawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
mDrawerToggle.onConfigurationChanged(newConfig);
}