A layout that blurs some areas of underlying views.
This was my first early attempt with many mistakes and misunderstandings.
Currently I use the following strategy:
- make a custom ViewGroup which I gonna blur partially
- add a view which will draw blur and be as small as possible
- override ViewGroup's
invalidate
,onDescendantInvalidated
andinvalidateChildInParent
, and propagate invalidation to blur, if applicable - when it's time to draw blur, create or reuse a Bitmap of required size divided by 4..8, draw required views into it through a scaled Canvas, apply blur (I use modified allocation-free in-place version of Stack Blur), apply clipping, if any, and draw blur