Skip to Content
Android 9 Development Cookbook - Third Edition
book

Android 9 Development Cookbook - Third Edition

by Rick Boyer
October 2018
Intermediate to advanced
464 pages
15h 17m
English
Packt Publishing
Content preview from Android 9 Development Cookbook - Third Edition

How it works...

We start off with the same XML layout as the previous recipe. And if we omitted adding the post processor, we'd get a standard rectangle image. To see for yourself, comment the following line of code in OnHeaderDecodedListener:

decoder.setPostProcessor(mCirclePostProcessor);

The core of the work being done here is in PostProcessor created in step 3. Although there are a several lines of code, what's being done is pretty simple. It just creates a circle (using the dimensions we specified) and clears everything out (by setting the color to TRANSPARENT) not in our circle.

The key is setting the post processor, which can only be done in the onHeaderDecoded() callback. This is why we first create the OnHeaderDecodedListener so ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android Application Development Cookbook - Second Edition

Android Application Development Cookbook - Second Edition

Rick Boyer, Kyle Mew
Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Android Things Projects

Android Things Projects

Francesco Azzola

Publisher Resources

ISBN: 9781788991216Supplemental Content