This application has custom drawing widget. I have made the drawing widget with canvas.
The user can draw color, change brush size, change color, erase your drawing, clear screen, undo last action, redo last action, add background from the gallery and save your drawing in the gallery!!!
to access media from the gallery, we need read access for devices upto API 28 i.e., Android 9 to save image in gallery, we need write access for devices upto API 28 i.e., Android 9
for devices running Android 10 and plus, API 29 and plus, to deal with scoped-storage in android, a new concept, we use content resolver to save image in gallery!
if you have any question feel free to ask.
We just save all paths drawn by the user in an array and to undo, just pop the last saved path from originalPaths list to undoPathlist and call the method invalidate()