com.droidux.pack.action.widget.ActionDrawer.OnDrawingListener |
A listener to be notified when the drawer, content and arrow are being drawn.
By implementing this listener you can modify the canvas and add various effects to the drawer.
The callback methods are called in the dispatchDraw(android.graphics.Canvas) of the
containers, between a call to save() and restore().
If you return true
from the callback, the container will be drawn before the canvas is restored.
Otherwise, if you return false
, the canvas will be restored first (thus cancelling any transform to the
canvas during the callback) before the container is drawn.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This callback is called before the arrow (if shown) is drawn.
| |||||||||||
This callback is called when the content container is being drawn.
| |||||||||||
This callback is called when the drawer container is being drawn.
|
This callback is called before the arrow (if shown) is drawn. Here you can implement some effect, for example to hide the arrow when it passed certain area.
canvas | The canvas used to draw the arrow. |
---|---|
openRatio | How far the drawer has been opened. Value will be between 0f - 1f. |
arrowRect | The rect of the arrow bitmap. You can use this information to know the location of the arrow. |
paint | The paint used to draw the arrow. |
true
, any transformation to the canvas and/or paint will be applied to the drawing
of the arrow. Otherwise, it will be ignored (the canvas will be restored before the drawing,
and the paint will not be used for drawing).
This callback is called when the content container is being drawn. Here you can transform your canvas to add some effect/animation to the content view during the opening/closing of the drawer.
canvas | The canvas used to draw the content container. |
---|---|
openRatio | How far the drawer has been opened. Value will be between 0f - 1f. |
true
, the content will be drawn before the canvas is restored, which means that
any transformation applied to the canvas will have effects to the drawing of the content. Otherwise,
The canvas is restored before the drawer is drawn, effectively cancelling any transform during
the callback.
This callback is called when the drawer container is being drawn. Here you can transform your canvas to add some effect/animation during the opening/closing of the drawer.
canvas | The canvas used to draw the drawer. |
---|---|
openRatio | How far the drawer has been opened. Value will be between 0f - 1f. |
true
, the drawer will be drawn before the canvas is restored, which means that
any transformation applied to the canvas will have effects to the drawing of the drawer. Otherwise,
The canvas is restored before the drawer is drawn, effectively cancelling any transform during
the callback.