Custom keyboard keys look blurry

I set up a soft keyboard. But the keyboard keys (1,2,3,4,5,6,7,8,9,0 and OK) look blurry. The delete key is fine, but the other key looks blurry.

Here is my keyboard. enter image description here

Here is my custom xml keyboard 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>

+4
source share
2 answers

Although this is a very late answer, it will help others.

use the android: shadowRadius or android: shadowColor tag in the KeyboardView tag.

Example:

<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" />
+19
source

. - , . .

0

Source: https://habr.com/ru/post/1523893/


All Articles