java.lang.Object | ||
↳ | android.graphics.drawable.Drawable | |
↳ | android.support.v7.graphics.drawable.DrawerArrowDrawable |
A drawable that can draw a "Drawer hamburger" menu or an arrow and animate between them.
The progress between the two states is controlled via setProgress(float)
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ARROW_DIRECTION_END | Direction to make the arrow point to the end. | |||||||||
int | ARROW_DIRECTION_LEFT | Direction to make the arrow point towards the left. | |||||||||
int | ARROW_DIRECTION_RIGHT | Direction to make the arrow point towards the right. | |||||||||
int | ARROW_DIRECTION_START | Direction to make the arrow point towards the start. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Draw in its bounds (set via setBounds) respecting optional effects such
as alpha (set via setAlpha) and color filter (set via setColorFilter).
| |||||||||||
Returns the length of the arrow head (from tip to edge, perpendicular to the shaft),
in pixels.
| |||||||||||
Returns the arrow shaft length in pixels.
| |||||||||||
The length of the bars when they are parallel to each other.
| |||||||||||
Returns the thickness (stroke width) of the bars.
| |||||||||||
Returns the color of the drawable.
| |||||||||||
Returns the arrow direction.
| |||||||||||
Returns the max gap between the bars when they are parallel to each other.
| |||||||||||
Return the intrinsic height of the underlying drawable object.
| |||||||||||
Return the intrinsic width of the underlying drawable object.
| |||||||||||
Return the opacity/transparency of this Drawable.
| |||||||||||
Returns the current progress of the arrow.
| |||||||||||
Returns whether the bars should rotate or not during the transition.
| |||||||||||
Specify an alpha value for the drawable.
| |||||||||||
Sets the length of the arrow head (from tip to edge, perpendicular to the shaft).
| |||||||||||
Sets the arrow shaft length.
| |||||||||||
Sets the length of the bars when they are parallel to each other.
| |||||||||||
Sets the thickness (stroke size) for the bars.
| |||||||||||
Sets the color of the drawable.
| |||||||||||
Specify an optional color filter for the drawable.
| |||||||||||
Set the arrow direction.
| |||||||||||
Sets the max gap between the bars when they are parallel to each other.
| |||||||||||
Set the progress of the arrow.
| |||||||||||
Returns whether the bars should rotate or not during the transition.
| |||||||||||
If set, canvas is flipped when progress reached to end and going back to start.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.graphics.drawable.Drawable
| |||||||||||
From class
java.lang.Object
|
Direction to make the arrow point to the end.
When used in a view with a RTL
layout direction,
this is the same as ARROW_DIRECTION_LEFT
, otherwise it is the same as
ARROW_DIRECTION_RIGHT
.
Direction to make the arrow point towards the left.
Direction to make the arrow point towards the right.
Direction to make the arrow point towards the start.
When used in a view with a RTL
layout direction,
this is the same as ARROW_DIRECTION_RIGHT
, otherwise it is the same as
ARROW_DIRECTION_LEFT
.
context | used to get the configuration for the drawable from |
---|
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
canvas | The canvas to draw into |
---|
Returns the length of the arrow head (from tip to edge, perpendicular to the shaft), in pixels.
Returns the arrow shaft length in pixels.
The length of the bars when they are parallel to each other.
Returns the thickness (stroke width) of the bars.
Returns the color of the drawable.
Returns the arrow direction.
Returns the max gap between the bars when they are parallel to each other.
Return the intrinsic height of the underlying drawable object. Returns -1 if it has no intrinsic height, such as with a solid color.
Return the intrinsic width of the underlying drawable object. Returns -1 if it has no intrinsic width, such as with a solid color.
Return the opacity/transparency of this Drawable. The returned value is
one of the abstract format constants in
PixelFormat
:
UNKNOWN
,
TRANSLUCENT
,
TRANSPARENT
, or
OPAQUE
.
An OPAQUE drawable is one that draws all all content within its bounds, completely covering anything behind the drawable. A TRANSPARENT drawable is one that draws nothing within its bounds, allowing everything behind it to show through. A TRANSLUCENT drawable is a drawable in any other state, where the drawable will draw some, but not all, of the content within its bounds and at least some content behind the drawable will be visible. If the visibility of the drawable's contents cannot be determined, the safest/best return value is TRANSLUCENT.
Generally a Drawable should be as conservative as possible with the
value it returns. For example, if it contains multiple child drawables
and only shows one of them at a time, if only one of the children is
TRANSLUCENT and the others are OPAQUE then TRANSLUCENT should be
returned. You can use the method resolveOpacity(int, int)
to perform a
standard reduction of two opacities to the appropriate single output.
Note that the returned value does not necessarily take into account a
custom alpha or color filter that has been applied by the client through
the setAlpha(int)
or setColorFilter(ColorFilter)
methods. Some subclasses,
such as BitmapDrawable
, ColorDrawable
, and GradientDrawable
,
do account for the value of setAlpha(int)
, but the general behavior is dependent
upon the implementation of the subclass.
Returns the current progress of the arrow.
Returns whether the bars should rotate or not during the transition.
Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.
Sets the length of the arrow head (from tip to edge, perpendicular to the shaft).
length | the length in pixels |
---|
Sets the arrow shaft length.
length | the length in pixels |
---|
Sets the length of the bars when they are parallel to each other.
length | the length in pixels |
---|
Sets the thickness (stroke size) for the bars.
width | stroke width in pixels |
---|
Sets the color of the drawable.
Specify an optional color filter for the drawable.
If a Drawable has a ColorFilter, each output pixel of the Drawable's drawing contents will be modified by the color filter before it is blended onto the render target of a Canvas.
Pass null
to remove any existing color filter.
Note: Setting a non-null
color
filter disables tint
.
colorFilter | The color filter to apply, or null to remove the
existing color filter
|
---|
Set the arrow direction.
Sets the max gap between the bars when they are parallel to each other.
gap | the gap in pixels |
---|
Set the progress of the arrow.
A value of 0.0
indicates that the arrow should be drawn in it's starting
position. A value of 1.0
indicates that the arrow should be drawn in it's ending
position.
Returns whether the bars should rotate or not during the transition.
enabled | true if the bars should rotate. |
---|
If set, canvas is flipped when progress reached to end and going back to start.