O'Reilly logo

Mastering Android Studio 3 by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required