DEV Community

Cover image for Matt's Tidbits #76 - A long-overdue feature
Matthew Groves
Matthew Groves

Posted on • Originally published at Medium

Matt's Tidbits #76 - A long-overdue feature

Last week I shared some moving tidbits. This time, I wanted to tell you about an exciting upcoming feature of Android 11!

Last week I attended an interesting online meetup sponsored by multiple Android Google Developer Groups (GDGs), where two of Google's best-known developer advocates presented on upcoming features of Android 11:
https://www.meetup.com/Google-Developer-Group-of-the-Capital-Region/events/271595586/

One of the upcoming features that is the most exciting to me (you'll know I must be an Android developer after you learn what it is) -
...is the ability to tell if the keyboard is currently visible or not.

Believe it or not, this is something that has been missing since the beginning of Android, and only possible to find out through fairly janky/inconvenient means.

However, Android friends, the wait is over!
This tweet demonstrates how you can use this (IME is short for "input method editor" - a slightly more generic way of referring to a keyboard):

Here's the API documentation for this new capability of the WindowInsets class: https://developer.android.com/reference/kotlin/android/view/WindowInsets#isvisible

The best news of all though is that they are working on adding this to AndroidX - which means that this functionality will be backported (TBD how far) to older versions of Android!

If you've been an Android developer for a while, you've likely endured this, so this is a real cause to celebrate! 🎉

I'm curious - how have you worked around this missing API in your app? Let me know in the comments! And, please follow me on Medium if you're interested in being notified of future tidbits.

This tidbit was discovered on July 30, 2020.

Top comments (0)