I wanted to create custom keyboard with some keys wider than normal, and some keys higher. Is it possible? Here's picture: 1
Asked
Active
Viewed 816 times
-2
-
You can make a custom keyboard look like anything you want. Do you have an actual question? – Gabe Sechan May 19 '15 at 20:29
-
No, it looked confusing at first, but I managed to design keyboard I wanted. :) – Dabler May 19 '15 at 21:04
1 Answers
1
Ok, thanks for your answers. Maybe i wrote my question a little unclear but I wanted to know how to design keyboard looking like on picture, not how to create keyboard from the start. It was a little confusing because at first I was using only android: keyHeight atribute which caused hiding other keys. Later I tried to use android:horizontalGap atribute with height attribute and that helped me to achive result i wanted. Here's my code: (got to adjust keys sizes some more)
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:keyWidth="8%p"
android:keyHeight="14%p">
<Row>
<Key android:codes="-3" android:keyLabel="abc" android:horizontalGap="0.1%p" android:keyHeight="30%"/>
<Key android:codes="49" android:keyLabel="1" android:horizontalGap="0.1%p"/>
<Key android:codes="50" android:keyLabel="2" android:horizontalGap="0.1%p" />
<Key android:codes="51" android:keyLabel="3" android:horizontalGap="0.1%p" />
<Key android:codes="52" android:keyLabel="4" android:horizontalGap="0.1%p" />
<Key android:codes="53" android:keyLabel="5" android:horizontalGap="0.1%p" />
<Key android:codes="47" android:keyLabel="/" android:horizontalGap="0.1%p" android:keyHeight="30%"/>
</Row>
<Row>
<Key android:codes="54" android:keyLabel="6" android:horizontalGap="8%p"/>
<Key android:codes="55" android:keyLabel="7" android:horizontalGap="0.1%p" />
<Key android:codes="56" android:keyLabel="8" android:horizontalGap="0.1%p" />
<Key android:codes="57" android:keyLabel="9" android:horizontalGap="0.1%p" />
<Key android:codes="48" android:keyLabel="0" android:horizontalGap="0.1%p" />
</Row>
<Row>
<Key android:codes="-1" android:keyLabel="Back" android:keyWidth="50%p" android:horizontalGap="0.1%p"/>
<Key android:codes="-2" android:keyLabel="Next" android:keyWidth="50%p" android:horizontalGap="0.1%p"/>
</Row>
</Keyboard>

Dabler
- 877
- 1
- 7
- 11