I refactored some of your code to make it easier to undertand.
I also extracted the buttons in .xml instead of creating them programmatically because it is much easier. I also extracted the DrawingView to a separate class. I also tested it so it works for sure.