belongs to Maven artifact com.android.support:support-core-ui:28.0.0-alpha1
Deprecated since version 22.1.0
ActionBarDrawerToggle
public
class
ActionBarDrawerToggle
extends Object
implements
DrawerLayout.DrawerListener
java.lang.Object | |
↳ | android.support.v4.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.
Summary
Nested classes | |
---|---|
interface |
ActionBarDrawerToggle.Delegate
This interface was deprecated in API level 25.4.0. Use ActionBarDrawerToggle.DelegateProvider in support-v7-appcompat. |
interface |
ActionBarDrawerToggle.DelegateProvider
This interface was deprecated in API level 25.4.0. Use ActionBarDrawerToggle.DelegateProvider in support-v7-appcompat. |
Public constructors | |
---|---|
ActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int drawerImageRes, int openDrawerContentDescRes, int closeDrawerContentDescRes)
Construct a new ActionBarDrawerToggle. |
|
ActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, boolean animate, int drawerImageRes, int openDrawerContentDescRes, int closeDrawerContentDescRes)
Construct a new ActionBarDrawerToggle. |
Public methods | |
---|---|
boolean
|
isDrawerIndicatorEnabled()
|
void
|
onConfigurationChanged(Configuration newConfig)
This method should always be called by your |
void
|
onDrawerClosed(View drawerView)
|
void
|
onDrawerOpened(View drawerView)
|
void
|
onDrawerSlide(View drawerView, float slideOffset)
|
void
|
onDrawerStateChanged(int newState)
|
boolean
|
onOptionsItemSelected(MenuItem item)
This method should be called by your |
void
|
setDrawerIndicatorEnabled(boolean enable)
Enable or disable the drawer indicator. |
void
|
|