I'm working on an android keyboard application. As you know key object can set an icon or label for itself , so now I wanna set a re-sizable rounded rectangle for space keyboard button like This one
I wanna make it able to be resized when it's running on large screens , I have this in my keyboard xml class :
<Key android:codes="46" android:keyIcon = "@drawable/space_button_drawable.xml">
what should I have in my space_button_drawable.xml ?
EDIT 1 :
buttonbgselector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="false"
android:drawable="@drawable/button" />
<item
android:state_pressed="true"
android:drawable="@drawable/button2" />
</selector>
keyboard.xml
<?xml version="1.0" encoding="UTF-8"?>
<android.inputmethodservice.KeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:keyBackground="@drawable/buttonbgselector"
android:keyPreviewLayout ="@layout/preview" />