added in version 24.1.0
belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1

ActionBarDrawerToggle

public class ActionBarDrawerToggle
extends Object implements DrawerLayout.DrawerListener

java.lang.Object
   ↳ android.support.v7.app.ActionBarDrawerToggle


This class provides a handy way to tie together the functionality of DrawerLayout and the framework ActionBar to implement the recommended design for navigation drawers.

To use ActionBarDrawerToggle, create one in your Activity and call through to the following methods corresponding to your Activity callbacks:

Call syncState() from your Activity's onPostCreate to synchronize the indicator with the state of the linked DrawerLayout after onRestoreInstanceState has occurred.

ActionBarDrawerToggle can be used directly as a DrawerLayout.DrawerListener, or if you are already providing your own listener, call through to each of the listener methods from your own.

You can customize the the animated toggle by defining the drawerArrowStyle in your ActionBar theme.

Summary

Nested classes

interface ActionBarDrawerToggle.Delegate

 

interface ActionBarDrawerToggle.DelegateProvider

Allows an implementing Activity to return an ActionBarDrawerToggle.Delegate to use with ActionBarDrawerToggle. 

Public constructors

ActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int openDrawerContentDescRes, int closeDrawerContentDescRes)

Construct a new ActionBarDrawerToggle.

ActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, Toolbar toolbar, int openDrawerContentDescRes, int closeDrawerContentDescRes)

Construct a new ActionBarDrawerToggle with a Toolbar.

Public methods

DrawerArrowDrawable getDrawerArrowDrawable()
View.OnClickListener getToolbarNavigationClickListener()

Returns the fallback listener for Navigation icon click events.

boolean isDrawerIndicatorEnabled()
boolean isDrawerSlideAnimationEnabled()
void onConfigurationChanged(Configuration newConfig)

This method should always be called by your Activity's onConfigurationChanged method.

void onDrawerClosed(View drawerView)

DrawerLayout.DrawerListener callback method.

void onDrawerOpened(View drawerView)

DrawerLayout.DrawerListener callback method.

void onDrawerSlide(View drawerView, float slideOffset)

DrawerLayout.DrawerListener callback method.

void onDrawerStateChanged(int newState)