java.lang.Object | |
↳ | com.droidux.ui.widgets.actiondrawer.LegacyActionDrawerToggle |
This class is deprecated.
Please use ActionDrawerToggle
for compatibility with the "material" design
(Android 5.0 Lollipop, or AppCompat v7 r21+).
This class provides a handy way to tie together the functionality of
ActionDrawer
and the framework ActionBar
to implement the recommended
design for navigation drawers.
To use ActionDrawerToggle
, 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 ActionDrawer.
If the drawer's mode is set to WINDOW_OVERLAY
,
you must also call the onSaveInstanceState()
and
onRestoreInstanceState(android.os.Parcelable)
in the Activity's onSaveInstanceState(android.os.Bundle)
and onRestoreInstanceState(android.os.Parcelable)
. If the drawer's mode is set to
CONTENT_OVERLAY
, the drawer state will be
automatically saved and restored.
ActionDrawerToggle
can be used directly as a
ActionDrawer.OnDrawingListener
, or if you are already providing your own listener,
call through to each of the listener methods from your own.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
float | TOGGLE_DRAWABLE_OFFSET |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Whether the drawer indicator is enabled.
| |||||||||||
This method should always be called by your
Activity 's
onConfigurationChanged
method. | |||||||||||
This method should be called by your
Activity 's
onOptionsItemSelected method. | |||||||||||
Enable or disable the drawer indicator.
| |||||||||||
Synchronize the state of the drawer indicator/affordance with the linked
ActionDrawer . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.droidux.ui.widgets.actiondrawer.ActionDrawer.OnDrawerStateChangeListener
| |||||||||||
From interface
com.droidux.ui.widgets.actiondrawer.ActionDrawer.OnDrawingListener
|
Whether the drawer indicator is enabled.
This method should always be called by your Activity
's
onConfigurationChanged
method.
newConfig | The new configuration |
---|
This method should be called by your Activity
's
onOptionsItemSelected method.
If it returns true, your onOptionsItemSelected
method should return true and
skip further processing.
item | the MenuItem instance representing the selected menu item |
---|
Enable or disable the drawer indicator. The indicator defaults to enabled.
When the indicator is disabled, the ActionBar
will revert to displaying
the home-as-up indicator provided by the Activity
's theme in the
android.R.attr.homeAsUpIndicator
attribute instead of the animated
drawer glyph.
enable | true to enable, false to disable |
---|
Synchronize the state of the drawer indicator/affordance with the linked ActionDrawer
.
This should be called from your Activity
's
onPostCreate method to synchronize after
the ActionDrawer
's instance state has been restored, and any other time when the state
may have diverged in such a way that the ActionBarDrawerToggle was not notified.
(For example, if you stop forwarding appropriate drawer events for a period of time.)