Hidden APIs of Android, Part 1—<blink> tag

In this series I’m going to talk about APIs of Android, that most of developers, despite being quite experienced with Android SDK, do not know about their existence.

Image, that for some weird reason you have got a specification to implement such a feature:

Topeka app

Basically, you have to blink your view hierarchy indeterminately.

How are you going to achieve this?

Sure there are plenty of ways to implement it. But turns out there exists a specific API for this use-case. It’s the <blink> tag that will do the magic for you. All you have to do is to wrap your view hierarchy with that tag:

That’s it, this will make your view hierarchy to “party like it’s 1995!”. Wonder where is the quote taken from? Perfect time to dive into sources.

As you know, it’s the LayoutInflater that will create View out of the xml resource id that is provided as an input parameter to LayoutInflater. As soon as LayoutInflater will start to parse the tags of the xml, it will eventually end up calling createViewFromTag() :

Here you can see how the magic happens. If name is equal to blink , then a BlinkLayout would be created, which is a private static class declared in LayoutInflater . Here’s the full implementation of BlinkLayout, which is quite easy to understand.

Note: there is no way to control blink in/out timing, it’s 500ms by default.

Clap if you liked the post. Subscribe to get updated with the next episodes of these series.

Happy droiding! 🤖

Android enthusiast, Google Certified Android developer, Stackoverflower

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store