Chapter 13. Working with the Canvas and Advanced Drawing

Now that you understand how to create completely custom views, it is helpful to understand some advanced drawing techniques. This chapter will show different methods of image compositing using a custom view as well as a method for using a custom Shader to change the shape of an image by using a custom Drawable. Both the image compositing techniques and the Shader techniques can be used in your own views, Drawables, and even custom utility classes to achieve effects that aren’t readily supported by Android’s default classes.

PorterDuff Image Compositing

Behind the scenes, Android is using Skia, an excellent 2D C++ graphics library. Most of the drawing-related code you use in Android directly ...

Get Android™ User Interface Design: Turning Ideas and Sketches into Beautifully Designed Apps now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.