Exploring Android UI design

We will see with Android UI design that so much of what we learn is context sensitive. The way that a given widget's x attribute will influence its appearance might depend on a widget's y attribute or even on an attribute on another widget. It isn't easy to learn this verbatim. It is best to expect to gradually achieve better and faster results with practice.

For example, if you play with the designer by dragging and dropping widgets onto the design, the XML code that is generated will vary quite considerably depending upon which layout type you are using. We will see this as we proceed through this chapter.

This is because different layout types use different means to decide on the position of their children. For example, the LinearLayout we will explore next works very differently to the ConstraintLayout that was added by default to our project in Chapter 1, Beginning Android and Java.

This information might initially seem like a problem, or even a bad idea, and it certainly is a little awkward at first. What we will begin to learn, however, is that this clear abundance of layout options and their individual quirks are a good thing because they give us almost unlimited design potential. There are very few layouts you can imagine that are not possible to achieve.

This almost unlimited potential comes with a bit of complexity, however. The best way to start to get to grips with this is to build some working examples of several types. In this chapter, we will see three—a LinearLayout, a ConstraintLayout, and a TableLayout. We will see how to make things easier using the distinctive features of the visual designer, and we will also pay some attention to the XML that is auto-generated to make our understanding more rounded.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.53.143