Create XML like this for keyboard :
<?xml version="1.0" encoding="utf-8"?>
<com.YourKeyboardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
style="@style/keyboard_1_style"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</com.YourKeyboardView>
And style is as below:
<style name="keyboard_1_style">
<item name="android:keyBackground">@drawable/k1_selector</item>
<item name="android:keyTextColor">#24B2E7</item>
<item name="android:background">@android:color/white</item>
<item name="android:keyPreviewLayout">@layout/k1_preview</item>
</style>
In which
<item name="android:keyBackground">@drawable/k1_selector</item>
is used to set background for key.
<item name="android:keyTextColor">#24B2E7</item>
is used for text color of key.
<item name="android:background">@android:color/white</item>
is used to set background of entire keyboard and
<item name="android:keyPreviewLayout">@layout/k1_preview</item>
is uesd to set preview of key.
Preview layout xml :
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40sp"
android:textColor="@android:color/white"
android:gravity="center"
android:background="@drawable/neon_candidate_middle_pressed"/>
For spaces between keys use this.
And for android:background="@drawable/neon_candidate_middle_pressed"
it is background image which you want to show in preview of key.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…