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:
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!
Chris BanesAnd to preempt the obvious question, yes we're currently investigating and working on a version for AndroidX.21:08 PM - 20 Feb 2020
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.