How to detect that the DrawerLayout started opening?

DEPRECATED: See other answers for a more suitable solution There are 2 possible ways to do that: Use onDrawerSlide(View drawerView, float slideOffset) callback slideOffset changes from 0 to 1. 1 means it is completely open, 0 – closed. Once offset changes from 0 to !0 – it means it started opening process. Something like: mDrawerToggle … Read more

How to implement DrawerArrowToggle from Android appcompat v7 21 library

First, you should know now the android.support.v4.app.ActionBarDrawerToggle is deprecated. You must replace that with android.support.v7.app.ActionBarDrawerToggle. Here is my example and I use the new Toolbar to replace the ActionBar. MainActivity.java public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); … Read more