This is the proposed architecture for implementing drawing on text, photos and videos on Leo.
- This is the custom view that will display the drawing created by the user.
- Will be the View on "top" (relative to z-axis) of all the other views in
AddTextActivity
except the top bar Views. - Notes:
- overrides
onTouchEvent(...)
- has a method called
setEnabled(boolean enabled)
- enabled value will be returned by
onTouchEvent(...)
. this means that it will intercept all touch events when enabled. - Note: this will be toggled by the compose views (enabled when in drawing mode, disabled when not in drawing mode).
- enabled value will be returned by
- has a
setColor(...)
method - contains a transcript (LinkedList) of "drawing events" (I think these "drawing events" will be Path objects)
- has an undo function that removes the last drawn event from the canvas (head of the LinkedList)
- Look at the FingerPaint sample app in the API demos to see how to draw to canvas given a sequence of touch points.
- overrides
- Create a screenshot (Bitmap) of the composition by calling View.getDrawingCache(). The screenshot should not include the EditText, top & bottom bar views. This means
getDrawingCache()
should only be called on the ViewGroup that contains the ImageView + DrawingView.