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.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard

Properties

Link copied to clipboard
Direction to make the arrow point to the end.
Link copied to clipboard
Direction to make the arrow point towards the left.
Link copied to clipboard
Direction to make the arrow point towards the right.
Link copied to clipboard
Direction to make the arrow point towards the start.

Functions

Link copied to clipboard
open fun draw(@NonNull canvas: @NonNull Canvas)
Link copied to clipboard
Returns the length of the arrow head (from tip to edge, perpendicular to the shaft), in pixels.
Link copied to clipboard
Returns the arrow shaft length in pixels.
Link copied to clipboard
open fun getBarLength(): Float
The length of the bars when they are parallel to each other.
Link copied to clipboard
Returns the thickness (stroke width) of the bars.
Link copied to clipboard
open fun getColor(): Int
Returns the color of the drawable.
Link copied to clipboard
open fun getDirection(): Int
Returns the arrow direction.
Link copied to clipboard
open fun getGapSize(): Float
Returns the max gap between the bars when they are parallel to each other.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getOpacity(): Int
Link copied to clipboard
Returns the paint instance used for all drawing.
Link copied to clipboard
@FloatRange(from = 0.0, to = 1.0)
open fun getProgress(): Float
Returns the current progress of the arrow.
Link copied to clipboard
Returns whether the bars should rotate or not during the transition.
Link copied to clipboard
open fun setAlpha(alpha: Int)
Link copied to clipboard
open fun setArrowHeadLength(length: Float)
Sets the length of the arrow head (from tip to edge, perpendicular to the shaft).
Link copied to clipboard
open fun setArrowShaftLength(length: Float)
Sets the arrow shaft length.
Link copied to clipboard
open fun setBarLength(length: Float)
Sets the length of the bars when they are parallel to each other.
Link copied to clipboard
open fun setBarThickness(width: Float)
Sets the thickness (stroke size) for the bars.
Link copied to clipboard
open fun setColor(@ColorInt color: Int)
Sets the color of the drawable.
Link copied to clipboard
open fun setColorFilter(colorFilter: ColorFilter)
Link copied to clipboard
open fun setDirection(direction: Int)
Set the arrow direction.
Link copied to clipboard
open fun setGapSize(gap: Float)
Sets the max gap between the bars when they are parallel to each other.
Link copied to clipboard
open fun setProgress(@FloatRange(from = 0.0, to = 1.0) progress: Float)
Set the progress of the arrow.
Link copied to clipboard
open fun setSpinEnabled(enabled: Boolean)
Returns whether the bars should rotate or not during the transition.
Link copied to clipboard
open fun setVerticalMirror(verticalMirror: Boolean)
If set, canvas is flipped when progress reached to end and going back to start.