Bitcraft Blog - Keyboard Dismisser

Keyboard Dismisser

Posted on Leave a commentPosted in bitcraft, Know-how

Everyone knows, how uncomfortable some solutions are in Android. One of the most unexpected and most weird of them is the Keyboard API. Even so simple thing, as hiding keyboard programmatically is little problematic. It’s really clumsy, pretty long and not programmer friendly. We need to know the context of our application and pass current focus of a view as a parameter of a function. And it’s just a basic thing to do with keyboard. Imagine situation where you would need to add some complex functionality to that – it could be painful. One of a really nice features (from UX point of view) is possibility to hide the keyboard when user taps anywhere outside it. Google often uses this kind of feature in their own apps. It is really nice to have that option, so I decided to implement this functionality into one of my apps. Solution of this problem is not so obvious. After reaching my goal, I release it as an open source library. You can find it here: Keyboard Dismisser But if you want to implement it on your own, or you are just curious how to make it work, keep reading. I will try to […]