How to detect if Software Keyboard is Visible on Android tv (fire tv)?

252 Views Asked by At

I know how to detect in android mobile devices when keyboard is shown, but how can I do that on android tv, or fire tv?

1

There are 1 best solutions below

0
On

Try this

fun isKeyBoardVisible() = ViewCompat.getRootWindowInsets(requireView())?.isVisible(WindowInsetsCompat.Type.ime()) ?: true