Chapter 4. Getting Started with Layouts and Material Design

We have already seen the Android Studio UI designer, as well as a little bit of Java in action. In this hands-on chapter, we will build three more layouts—still quite simple, yet a step up from what we have done so far.

Before we get to the hands-on part, we will have a quick introduction to the concept of Material Design.

We will see another type of layout called LinearLayout and step through, using it to create a usable UI. We will take things a step further by using ConstraintLayout, both with understanding constraints and with designing more complex and precise UI designs. Finally, we will meet the TableLayout for laying out data in an easily readable table.

We will also write some Java code to switch between our different layouts within one app/project. This is the first major app that links together multiple topics into one neat parcel. The app is called Exploring Layouts.

In this chapter, we will do the following:

  • Find out about material design
  • Build a LinearLayout and learn when it is best to use this type
  • Build another, slightly more advanced ConstraintLayout and find out a bit more about using constraints
  • Build a TableLayout and fill it with data to display
  • Link everything together in a single app called Exploring Layouts.

First on the list is material design.

Material design

You might have heard of material design, but what exactly is it? The objective of material design is quite simply to achieve beautiful user interfaces. It is also, however, about making these user interfaces consistent across Android devices. Material design is not a new idea. It is taken straight from the design principles used in pen and paper design, like having visually pleasing embellishments such as shadows and depth.

Material design uses the concept of layers of materials that you can think of in the same way you would think of layers in a photo editing app. Consistency is achieved with a set of principles, rules, and guidelines. It must be stressed that material design is entirely optional, but it also must be stressed that material design works, and if you are not following it, there is a good chance your design will be disliked by the user. The user, after all, has become used to a certain type of UI and that UI was most likely created using material design principles.

So, material design is a sensible standard to strive for, but while we are learning the details of material design, we mustn't let it hold us back from learning how to get started with Android.

This book will focus on getting things done, while occasionally pointing out when material design is influencing how we do it, as well as pointing you to further resources for those who want to look at material design in more depth right away.

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

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