Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Android Studio 3

You're reading from  Mastering Android Studio 3

Product type Book
Published in Aug 2017
Publisher
ISBN-13 9781786467447
Pages 220 pages
Edition 1st Edition
Languages
Author (1):
Kyle Mew Kyle Mew
Profile icon Kyle Mew

Assets and Resources

So far, in this book, we have covered layouts, design, and the libraries and tools that support them. We then went on to explore developing for different screen sizes, shapes, and densities, as well as other form factors. This is the last chapter in the UI development module where we will look at how Android Studio manages various assets and resources, such as icons and other drawables.

Android Studio is very accommodating when it comes to including drawables in our projects and, particularly, when it comes to vector graphics, which are invaluable to an Android developer, as they scale nicely across different screen sizes and densities, and this is catered for with a very valuable tool, the vector asset studio. Along with this, there is an asset studio to generate and configure bitmap images.

Vector drawables are widely used for in-app icons and in components...

Asset Studio

There are very few, if any, apps that do not employ some forms of icons and even if these are only launcher and, action icons, the correct choices and design make the difference between a successful UI and a confusing one.

Although it is not essential, Google is very keen that we use material design icons. This is an attempt to create a uniform user experience across the platform to counter the perception that iOS offers a more consistent feel. This is unsurprising, as iOS is a closed system that places a lot of restrictions on the developer. Google, on the other hand, prefers to offer a far more creative freedom to developers. In the past, this has led Apple devices to gain a reputation for being generally slicker than Android and, to counter this, Google introduced material design guidelines, which have gone on to far exceed original expectations and can now be...

Animated icons

Everyone with an Android device will be familiar with the animated icon. Perhaps the best known example is the way the hamburger icon transforms into an arrow and vice versa when a navigation drawer is opened and closed. The use of vector graphics makes this process remarkably simple. Provided that both the icons have the same number of points, any icon can be transformed into any other.

Using space efficiently is essential on a mobile device, and animating action icons not only looks good, but also saves space and, if applied intelligently, will convey meaning to the user as well.

Vector images are easily transformed from one to another by mapping points on the original image onto the target image. This is done with the AnimatedVectorDrawable class.

There are several methods of animating these drawables. Firstly, we can apply a number of predefined animations,...

General drawables

We saw earlier how to convert a black icon into a color to match our app or current activity using tinting. With other images, there are times when they take up a considerable amount of the screen, and we want to apply the reverse and have our icons colored so that they match our graphics. Fortunately, Android provides a support library to extract prominent and dominant colors from any bitmap.

The palette library

Applying our own themes to our apps can produce very stylish-looking interfaces, especially when we are dealing with text, icons, and images we created ourselves to suit the app. Many apps incorporate the user's own images and, in these cases, there is no way of knowing in advance how to select...

Summary

Not only in this chapter, but also in the previous three chapters, we saw how Android Studio makes the designing and testing of our graphical layouts over a wide range of devices and factors both simple and intuitive. Having been specifically designed for Android's eccentricities, Studio is also the first to integrate new design features, such as the constraint layout, which has revolutionized designing of visual activities.

The chapters done till now have covered all the fundamental design considerations catered for by the IDE and hopefully introduced the reader to the wealth of features that simplify and clarify this often complex process.

In the next chapter, we will begin the process of bringing these designs to life as we see how Android Studio facilitates the often complex processes of coding, testing, and debugging our applications. These essential processes...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Mastering Android Studio 3
Published in: Aug 2017 Publisher: ISBN-13: 9781786467447
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime}