Created
July 14, 2015 07:24
-
-
Save jimbray/472046c5c74dfb2b6c4c to your computer and use it in GitHub Desktop.
DrawerLayout与toolbar 的联动动画(左上角的icon动画)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer); | |
drawerToggle = setupDrawerToggle(); | |
mDrawerLayout.setDrawerListener(drawerToggle); | |
private ActionBarDrawerToggle setupDrawerToggle() { | |
return new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, | |
R.string.app_name, R.string.app_name); | |
} | |
@Override | |
public void onConfigurationChanged(Configuration newConfig) { | |
super.onConfigurationChanged(newConfig); | |
drawerToggle.onConfigurationChanged(newConfig); | |
} | |
@Override | |
protected void onPostCreate(Bundle savedInstanceState) { | |
super.onPostCreate(savedInstanceState); | |
drawerToggle.syncState(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment