Android’s Magnifier UI component

A look at a lesser known feature of Android P

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 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




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
Thomas Künneth

Thomas Künneth

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

More from Medium

Boolean fields that start with “is” in Firebase Firestore

Shimmer effect in android

Manage back navigation from notification in android

Retrofit Overview (Kotlin)