Androids sdk softkeyboard accuracy
android, android-softkeyboard
Solution
After hours of searching I finally found a solution for my problem.
The android sample keyboard uses the `KeyboardViewStyle` which inherit from `KeyboardView` In the android source I found the definition of `Widget.KeyboardView`
<style name="Widget.KeyboardView" parent="android:Widget">
<item name="android:background">@android:drawable/keyboard_background</item>
<item name="android:keyBackground">@android:drawable/btn_keyboard_key</item>
<item name="android:keyTextSize">22sp</item>
<item name="android:keyTextColor">#FFFFFFFF</item>
<item name="android:keyPreviewLayout">@android:layout/keyboard_key_preview</item>
<item name="android:keyPreviewOffset">-12dip</item>
<item name="android:keyPreviewHeight">80dip</item>
<item name="android:labelTextSize">14sp</item>
<item name="android:popupLayout">@android:layout/keyboard_popup_keyboard</item>
<item name="android:verticalCorrection">-10dip</item>
<item name="android:shadowColor">#BB000000</item>
<item name="android:shadowRadius">2.75</item>
</style>
There I noticed following line:
<item name="android:verticalCorrection">-10dip</item>
To solve my problem I defined my own style which inherit from `Widget.KeyboardView` and overwrote `android:verticalCorrection` the following way:
<style name="Widget.MyKeyboardView" parent="android:Widget.KeyboardView">
<item name="android:verticalCorrection">0dip</item>
</style>
In the end I applied the style to my keyboard.
et voilà :)
Problem
I just imported the sdk softkeyboard in eclipse (sample code from API version 16, but tried earlier versions too) and installed it on my devices (Galaxy Note 10.1, Galaxy S2, and Galaxy Nexus). After some testing I noticed a strange behavior: When I hit a key on the very top the keyboard will show me the suggestion of the letter which is above the letter I really pressed. For my current study I need to implement a softkeyboard and add some features. But for these features I need an accurate keyboard. Can you confirm the behavior and give me any suggestions how to fix? Thank you very much in advance.