Did you know that Android has a ViewGroup called
blink? Surprised right? Same was my expression when I first found out about it.
I was reading the source code of LayoutInflater for a post. I was particularly interested in how the xml to view object conversion was done, so I started reading the
inflate(layoutRes, parent) method than reading from the beginning of the class.
Some time into the reading, I ended up in a method with signature
View createViewFromTag(View parent, String name, Context context, AttributeSet attrs, boolean ignoreThemeAttr). Nothing special in that method signature, but the following condition was rather strange, and the comment too.
Let's party like it's 1995!
Sounds interesting, but the next line spoilt the fun, we know what exactly it is going to be. A ViewGroup that makes its children blink like festival light. But hey what is the name of that ViewGroup? Is it
No, name of it is
blink , no layout suffix like
RelativeLayout or any other ViewGroup android has. Is it really useful for any android application developer? Mostly no, but good to know such easter eggs 🙂
Want to see it in action? Here it is
It is an attempt to uncover easter eggs in the Android framework source code. Not sure how many I will be able to uncover, it might end up without having much follow up posts. Fingers crossed for finding out more easter eggs like this 🤞
Here is the commit by Romain Guy that added blink layout to the android framework.