Android’s Magnifier UI component
A look at a lesser known feature of Android P
--
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.
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