Summary
This chapter stepped through the details of how layouts work, the details of all the built-in layouts in the toolkit, and when to use them. We also saw how simple it is to combine multiple layouts and created our own custom layout to add a bit of flair to our image browsing application.
We also explored how to adapt file handling code to work across all platforms using the URI
and ListableURI
types. Using this knowledge, our image browsing application is now compatible with all desktop and mobile platforms. With this knowledge of how to lay out applications and avoid assumptions about a traditional filesystem, you can now ensure that your apps will function correctly on any supported platforms, mobile, desktop, and beyond.
While we have created a complete application using just canvas primitives and layouts, it is possible to build much more complex applications using the widget
package, which we will look at in the next chapter.