October 2018
Intermediate to advanced
464 pages
15h 17m
English
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 ...