Android’s Magnifier UI component

A look at a lesser known feature of Android P

Thomas Künneth
Tommis Programming Blog
2 min readJan 4, 2020

--

A reading lens on an article in a journal
Magnifying portions of the Android screen

When Android P was released, its key features quickly got widespread attention. One of them is the magnifier, which helps entering and editing text similar to iOS. What may not be too obvious is that as a developer you can use it in your apps, too. Take a look at the following activity.

The Magnifier is created by passing its constructor the view to be magnified. It is not visible by default. To show it, just call the show() method and pass the location where to do so. Use dismiss() to hide the magnifier. update() refreshes itself.

How to use the Android Magnifier ui component
Screenshot of the Android Emulator running the Magnifier demo
The Magnifier component in action

A previous version of this article was published 2018/03/10 on my Blogger.com blog Tommis Blog. I deleted the weblog in the wake of the GDPR (General Data Protection Regulation), so the original post is no longer available (or only through the Wayback machine of the Internet Archive).

If not stated otherwise images are © Thomas Künneth

--

--

Thomas Künneth
Tommis Programming Blog

Google Developer Expert for Android. Author. Speaker. Listener. Loves writing.