I would like to create a “Flash” class to display a white flash screen (200ms) as easily as a toast, like this:
Flash.create(context).show();
- This layer should appear instantly then gradually disappear (alpha transition)
- It must not catch events
- It must adapt to the screen rotation
- It can be created from any activity
I looked for a solution via WindowManager but I am having some difficulties.
What solution do you recommend?
After searching for many hours, it seems impossible to delegate events from one window to another. So the final functional solution I’ve found is to extend an activity so that it achieves this flash effect. For those who are interested in it, here’s my subclass:
Code to call flash effect in an extended activity:
With this implementation, the events pass through the layer