java.lang.Object | |
↳ | com.droidux.pack.action.widget.ActionDrawer |
A slide-out view, usually used to provide a menu of actions that allows users to switch between views of your app.
Use the ActionDrawer.Builder
class to build and customize the action drawer. You need to provide an implementation of
the ActionDrawer.Callback
interface that create the drawer's view and prepare the drawer's view before it is shown.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ActionDrawer.Builder | Use this class to build and customize the action drawer. | ||||||||||
ActionDrawer.Callback | Callback interface for action drawer. | ||||||||||
ActionDrawer.DrawerMode | Determines whether the drawer will be overlaid by the activity's content (exclusive action bar) or the whole window (inclusive action bar) | ||||||||||
ActionDrawer.DrawerPosition | Determines the position of the drawer. | ||||||||||
ActionDrawer.OnDrawerStateChangeListener | Listener for receiving events when the action drawer state has changed. | ||||||||||
ActionDrawer.OnDrawingListener | A listener to be notified when the drawer, content and arrow are being drawn. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | STATE_DRAWER_CLOSED | ||||||||||
int | STATE_DRAWER_CLOSING | ||||||||||
int | STATE_DRAWER_DRAGGING | ||||||||||
int | STATE_DRAWER_OPEN | ||||||||||
int | STATE_DRAWER_OPENING |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Close the action drawer.
| |||||||||||
Close the action drawer.
| |||||||||||
Returns the container view.
| |||||||||||
Returns the parent ViewGroup that contains the content view.
| |||||||||||
Returns the parent ViewGroup that contains the drawer view.
| |||||||||||
Gets whether the drawer is enabled.
| |||||||||||
Gets whether the drawer's fading/dimming effect is enabled.
| |||||||||||
Returns the mode of the drawer.
| |||||||||||
Returns the position of the drawer view.
| |||||||||||
Gets the current state of the drawer.
| |||||||||||
Returns the listener to be notified when the drawer state has changed.
| |||||||||||
Gets the listener to be notified when various components of the drawer is being drawn.
| |||||||||||
Whether the drawer's parallax-scrolling effect is enabled.
| |||||||||||
Whether the drawer is visible or not.
| |||||||||||
Restore/re-apply a representation of its internal state that had previously been generated by
onSaveInstanceState() . | |||||||||||
Save the representation of its internal state that can later be used to create a new instance with that same state.
| |||||||||||
Opens the action drawer.
| |||||||||||
Opens the action drawer.
| |||||||||||
Call this method within the
onPrepareDrawerView(View) to have an arrow pointed to
the specified anchor view. | |||||||||||
Sets the content's background.
| |||||||||||
Sets the content's background.
| |||||||||||
Enable/disable whether to slide the content along with the drawer.
| |||||||||||
Disable/enable the content view when the drawer is visible.
| |||||||||||
Sets the drawer's background.
| |||||||||||
Sets the drawer's background.
| |||||||||||
Enable/disable the drawer.
| |||||||||||
Enable/disable the fade/dim effect when the drawer is opening/closing.
| |||||||||||
Sets the listener to be notified when the drawer state has changed.
| |||||||||||
Sets the listener to be notified when various components of the drawer is being drawn.
| |||||||||||
Enables/disables parallax-scrolling effect.
| |||||||||||
Set the factor to determine the initial offset of the position of the drawer when it's start opening.
| |||||||||||
If the drawer is closed, it will be opened.
| |||||||||||
If the drawer is closed, it will be opened.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Close the action drawer.
animate | If true , the drawer will be animated.
|
---|
Returns the container view. This container view is a parent ViewGroup that contains
both the drawer's container and the content's container. If you need to work with the container that
contains only the drawer, use the getContainerForDrawer()
method instead. If you need to work with
the container that contains only the content view, use the getContainerForContent()
method instead.
Returns the parent ViewGroup that contains the content view.
Returns the parent ViewGroup that contains the drawer view.
Gets whether the drawer is enabled.
true
if enabled.
Gets whether the drawer's fading/dimming effect is enabled.
true
when the effect is enabled, false
otherwise.
Returns the mode of the drawer. Can be one of WINDOW_OVERLAY
or CONTENT_OVERLAY
.
Gets the current state of the drawer. Possible states are: STATE_DRAWER_CLOSED
, STATE_DRAWER_CLOSING
,
STATE_DRAWER_OPEN
, STATE_DRAWER_OPENING
, STATE_DRAWER_DRAGGING
.
Returns the listener to be notified when the drawer state has changed.
null
if no listener has been set, or the listener.
Gets the listener to be notified when various components of the drawer is being drawn.
Whether the drawer's parallax-scrolling effect is enabled.
true
if the parallax-scrolling effect is enabled.
Whether the drawer is visible or not.
true
if the drawer is visible.
Restore/re-apply a representation of its internal state that had previously been generated by onSaveInstanceState()
.
CONTENT_OVERLAY
the state will be restored automatically.
However, if the drawer's mode is WINDOW_OVERLAY
, you need
to call this method manually to restore the state (e.g. in onRestoreInstanceState(android.os.Bundle))state | The state to restored. |
---|
Save the representation of its internal state that can later be used to create a new instance with that same state.
Note: If the drawer's mode isCONTENT_OVERLAY
, and isSaveEnabled() is true
,
the state will be saved automatically. However, if the drawer's mode is WINDOW_OVERLAY
, you need
to call this method manually to save the state (e.g. in onSaveInstanceState(android.os.Bundle))Opens the action drawer.
animate | If true , the drawer will be animated.
|
---|
Call this method within the onPrepareDrawerView(View)
to have an arrow pointed to
the specified anchor
view. Normally you do this if you want to highlight the selected item within
the action drawer.
anchor | The view onto which the arrow should point. |
---|
Sets the content's background.
background | The Drawable to use as the background, or null
to remove the background.
|
---|
Sets the content's background. The resource should refer to a Drawable, or 0 to remove the background.
backgroundResId | The identifier of the resource |
---|
Enable/disable whether to slide the content along with the drawer.
enabled | If true the content will slide while the drawer is opening/closing.
Default is true .
|
---|
Disable/enable the content view when the drawer is visible.
disable | If true , the content view will be disabled (no interaction) when
the drawer is visible/opened. Otherwise, you can still interact with the content
when the drawer is visible/opened. |
---|---|
fadeContentWhenDisabled | If true , the content view will be dimmed/faded when
the content is disabled. Otherwise, no dim/fade effect will be applied.
|
Sets the drawer's background.
background | The Drawable to use as the background, or null
to remove the background.
|
---|
Sets the drawer's background. The resource should refer to a Drawable, or 0 to remove the background.
backgroundResId | The identifier of the resource |
---|
Enable/disable the drawer. If disabled, the drawer can't be opened.
enabled | If true , the drawer behave normally. Otherwise, the drawer can't be opened.
|
---|
Enable/disable the fade/dim effect when the drawer is opening/closing.
enabled | If true , the drawer will have a fade/dimmed effect when it's opening/closing.
|
---|
Sets the listener to be notified when the drawer state has changed.
listener | The listener to be notified. |
---|
Sets the listener to be notified when various components of the drawer is being drawn.
listener | The listener to be notified. |
---|
Enables/disables parallax-scrolling effect.
enabled | If true , the parallax-scrolling effect will be enabled. Otherwise, disabled.
|
---|
Set the factor to determine the initial offset of the position of the drawer when it's start opening.
When the factor is set to 0.0f
, the initial position of the drawer will be the same as the
final position (no offset). When the factor is set to 1.0f
(full offset), the drawer will
be initially positioned at the edge of the screen. With factor between 0.0f - 1.0f
, the drawer
will initially be positioned in between the edge of the screen and its final position.
factor | Value must be between 0.0f - 1.0f . Default is 0.25f
|
---|
If the drawer is closed, it will be opened. And vice versa, if it's currently opened, it will be closed.
If the drawer is closed, it will be opened. And vice versa, if it's currently opened, it will be closed.
animated | If true , the drawer will be animated.
|
---|