DrawerArrowDrawable
open class DrawerArrowDrawable : Drawable
| kotlin.Any | ||
| ↳ | android.graphics.drawable.Drawable | |
| ↳ | androidx.appcompat.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).
Summary
| Constants | |
|---|---|
| static Int |
Direction to make the arrow point to the end. |
| static Int |
Direction to make the arrow point towards the left. |
| static Int |
Direction to make the arrow point towards the right. |
| static Int |
Direction to make the arrow point towards the start. |
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open Unit | |
| open Float |
Returns the length of the arrow head (from tip to edge, perpendicular to the shaft), in pixels. |
| open Float |
Returns the arrow shaft length in pixels. |
| open Float |
The length of the bars when they are parallel to each other. |
| open Float |
Returns the thickness (stroke width) of the bars. |
| open Int |
getColor()Returns the color of the drawable. |
| open Int |
Returns the arrow direction. |
| open Float |
Returns the max gap between the bars when they are parallel to each other. |
| open Int | |
| open Int | |
| open Int | |
| Paint! |
getPaint()Returns the paint instance used for all drawing. |
| open Float |
Returns the current progress of the arrow. |
| open Boolean |
Returns whether the bars should rotate or not during the transition. |
| open Unit | |
| open Unit |
setArrowHeadLength(length: Float)Sets the length of the arrow head (from tip to edge, perpendicular to the shaft). |
| open Unit |
setArrowShaftLength(length: Float)Sets the arrow shaft length. |
| open Unit |
setBarLength(length: Float)Sets the length of the bars when they are parallel to each other. |
| open Unit |
setBarThickness(width: Float)Sets the thickness (stroke size) for the bars. |
| open Unit |
Sets the color of the drawable. |
| open Unit |
setColorFilter(colorFilter: ColorFilter?) |
| open Unit |
setDirection(direction: Int)Set the arrow direction. |
| open Unit |
setGapSize(gap: Float)Sets the max gap between the bars when they are parallel to each other. |
| open Unit |
setProgress(@FloatRange(0.0, 1.0) progress: Float)Set the progress of the arrow. |
| open Unit |
setSpinEnabled(enabled: Boolean)Returns whether the bars should rotate or not during the transition. |
| open Unit |
setVerticalMirror(verticalMirror: Boolean)If set, canvas is flipped when progress reached to end and going back to start. |
Constants
ARROW_DIRECTION_END
static val ARROW_DIRECTION_END: Int
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.
Value: 3
See Also
ARROW_DIRECTION_LEFT
static val ARROW_DIRECTION_LEFT: Int
Direction to make the arrow point towards the left.
Value: 0
See Also
ARROW_DIRECTION_RIGHT
static val ARROW_DIRECTION_RIGHT: Int
Direction to make the arrow point towards the right.
Value: 1
See Also
ARROW_DIRECTION_START
static val ARROW_DIRECTION_START: Int
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.
Value: 2
See Also
Public constructors
<init>
DrawerArrowDrawable(context: Context!)
| Parameters | |
|---|---|
context |
Context!: used to get the configuration for the drawable from |
Public methods
getArrowHeadLength
open fun getArrowHeadLength(): Float
Returns the length of the arrow head (from tip to edge, perpendicular to the shaft), in pixels.
getBarLength
open fun getBarLength(): Float
The length of the bars when they are parallel to each other.
getGapSize
open fun getGapSize(): Float
Returns the max gap between the bars when they are parallel to each other.
See Also
getIntrinsicHeight
open fun getIntrinsicHeight(): Int
getIntrinsicWidth
open fun getIntrinsicWidth(): Int
getOpacity
open fun getOpacity(): Int
getProgress
@FloatRange(0.0, 1.0) open fun getProgress(): Float
Returns the current progress of the arrow.
isSpinEnabled
open fun isSpinEnabled(): Boolean
Returns whether the bars should rotate or not during the transition.
See Also
setArrowHeadLength
open fun setArrowHeadLength(length: Float): Unit
Sets the length of the arrow head (from tip to edge, perpendicular to the shaft).
| Parameters | |
|---|---|
length |
Float: the length in pixels |
setArrowShaftLength
open fun setArrowShaftLength(length: Float): Unit
Sets the arrow shaft length.
| Parameters | |
|---|---|
length |
Float: the length in pixels |
setBarLength
open fun setBarLength(length: Float): Unit
Sets the length of the bars when they are parallel to each other.
| Parameters | |
|---|---|
length |
Float: the length in pixels |
setBarThickness
open fun setBarThickness(width: Float): Unit
Sets the thickness (stroke size) for the bars.
| Parameters | |
|---|---|
width |
Float: stroke width in pixels |
setColorFilter
open fun setColorFilter(colorFilter: ColorFilter?): Unit
setGapSize
open fun setGapSize(gap: Float): Unit
Sets the max gap between the bars when they are parallel to each other.
| Parameters | |
|---|---|
gap |
Float: the gap in pixels |
See Also
setProgress
open fun setProgress(@FloatRange(0.0, 1.0) progress: Float): Unit
Set the progress of the arrow.
A value of 0.0 indicates that the arrow should be drawn in its starting position. A value of 1.0 indicates that the arrow should be drawn in its ending position.
setSpinEnabled
open fun setSpinEnabled(enabled: Boolean): Unit
Returns whether the bars should rotate or not during the transition.
| Parameters | |
|---|---|
enabled |
Boolean: true if the bars should rotate. |
See Also

