custom keyboard keys looks blurry

android, blurry, keyboard, soft-keyboard

Solution

Though it is very late answer, it will help others.

use either android:shadowRadius or android:shadowColor attribute in your KeyboardView tag.

ex:

<android.inputmethodservice.KeyboardView
    android:id="@+id/keyboardview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:shadowColor="@android:color/transparent"
    android:focusableInTouchMode="true" 
    android:visibility="gone" />

or

<android.inputmethodservice.KeyboardView
        android:id="@+id/keyboardview"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:shadowRadius="0.0"
        android:focusableInTouchMode="true" 
        android:visibility="gone" />

Problem

I customized the soft keyboard. But keyboard keys(1,2,3,4,5,6,7,8,9,0,. and OK) is looking blurry.Delete key is fine but other key is looking blurry. Here is my keyboard. Here is my custom keyboard xml file ``` <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:horizontalGap="0px" android:keyHeight="10%p" android:keyWidth="24%p" android:verticalGap="0px" > <Row> <Key android:codes="49" android:keyEdgeFlags="left" android:keyLabel="1" /> <Key android:codes="50" android:keyLabel="2" /> <Key android:codes="51" android:keyLabel="3" /> <Key android:codes="-3" android:keyEdgeFlags="right" android:keyLabel="OK" android:keyWidth="28%p" /> </Row> <Row> <Key android:codes="52" android:keyEdgeFlags="left" android:keyLabel="4" /> <Key android:codes="53" android:keyLabel="5" /> <Key android:codes="54" android:keyLabel="6" /> <Key android:codes="-5" android:isRepeatable="true" android:keyEdgeFlags="right" android:keyIcon="@drawable/sym_keyboard_delete" android:keyWidth="28%p" /> </Row> <Row> <Key android:codes="55" android:keyEdgeFlags="left" android:keyLabel="7" /> <Key android:codes="56" android:keyLabel="8" /> <Key android:codes="57" android:keyLabel="9" /> <Key android:codes="48" android:keyLabel="0" android:keyWidth="14%p" /> <Key android:codes="46" android:keyEdgeFlags="right" android:keyLabel="." android:keyWidth="14%p" /> </Row> ```

Original source