Shape - aware layouts
The BoxInsetLayout class is part of the Wear UI library and allows us to design just one layout that will optimize itself for both square and round watch faces. It does this by inflating the largest possible square within any round frame. This is a simple solution but what the BoxInsetLayout also does very nicely is ensure that any background image we choose always fills all available space. As we shall see in a moment, if you position components horizontally across the screen, the BoxInsetLayout class automatically distributes them to cause a best fit.
One of the very first things you will want to do, when developing for these unusual form factors when working in Android Studio, is take advantage of the powerful preview ...
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