9. Creating Custom Screens
IF the plain old LCDUI screens are not sufficiently jazzy or flexible for your application, you can create your own screen using a canvas. It’s more work, but it’s more fun. You can control almost all of the drawing on the display and you get fine-grained event information as well.
The Canvas class is a lot like the other screens, a descendent of the Displayable class. This means that it can have commands, a title, and a ticker.
You can’t just create a canvas directly, as you can with other screens. Canvas is an abstract class, with a single abstract method, paint(). You must write a subclass of Canvas and define a paint() method that draws whatever you want. Then you can create an instance of your canvas and show it ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access