Implement fake-subclassing for the android.graphics.View class: Add CustomView class, which delegates onDraw() to IView interface, which can be implemented in Python.
Action
Russell, if you're willing to review this and give me naming advice, and/or merge it into dev & 3.7 & 3.8 & 3.9, that would help as I build the toga_android Canvas widget.
PR Checklist:
[x] All new features have been tested
[ ] All new features have been documented
[x] I have read the CONTRIBUTING.md file
[x] I will abide by the code of conduct
Screenshot
Here is a picture of Python drawing a black circle on the canvas using this approach.
Summary
Implement fake-subclassing for the
android.graphics.View
class: AddCustomView
class, which delegatesonDraw()
toIView
interface, which can be implemented in Python.Action
Russell, if you're willing to review this and give me naming advice, and/or merge it into dev & 3.7 & 3.8 & 3.9, that would help as I build the toga_android
Canvas
widget.PR Checklist:
Screenshot
Here is a picture of Python drawing a black circle on the canvas using this approach.
Here is a full example app that uses it.
Here is a snippet to give you the idea.