Reputation: 1811
Is it possible to change the behavior of native keyboard to float-able? I want to move the android keyboard to center of the screen. Is it possible? Or else I need to create a custom keyboard? I read this answer. But here no detailed explanation for why we can not move the position. I want to know the clear reason for why we can not change the position?
Upvotes: 0
Views: 616
Reputation: 93678
First- there is no "native keyboard" in Android. There's a default keyboard, which can differ by OEM. There's no one single keyboard app that you can assume is installed on all, or even a majority, of systems.
Secondly, very few keyboards support a floating mode. Its a pain in the neck to do, Android is written with the assumption that the keyboard will be a rectangle laid out below the app. You have to jump through a lot of hoops to do floating, using APIs that aren't well documented. Most keyboards don't do it. (What you need to do is play with a semi-documented feature called insets, telling the framework that you're keyboard has 0 permanent height but full screen temporary height and restrict the touchable inset to just the area you plan to take up so that other touches fall through. And since these features are all non-documented or poorly documented, really only the people who have studied them in depth will figure out how to do it).
Third, there's no API to force even those keyboards that do support it into floating mode. Android itself has no concept of a floating keyboard, so it can't tell a keyboard to float.
Basically, the keyboard API in Android on both sides is really bad. The original company that wrote Android didn't ever really think people would come up with all the great ideas for input that they have- they just thought it would be people supporting new languages and graphical skins. So they didn't make a great API. And for whatever reason, they haven't really improved the API all that much, or brought common concepts like that into the OS. Unless they decide to spend serious engineering effort on improving it, I woldn't foresee things like that changing.
Upvotes: 2