1
<Keyboard 
  android:keyWidth="%10p"
  android:keyHeight="50px"
  android:horizontalGap="2px" 
  android:verticalGap="2px">

What does %10p mean? I couldn't quite find it in the documentation or on Google. I'm assuming it's 10% of keyboard width?

Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110
aelgoa
  • 1,193
  • 1
  • 8
  • 24

2 Answers2

0

10p is percent:

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).

May be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container.

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

This corresponds to the global attribute resource symbol keyWidth.

Source.

Dmitry Sadakov
  • 2,128
  • 3
  • 19
  • 34
  • and % as prefix? exmamples: http://stackoverflow.com/questions/17232871/android-custom-keyboard http://stackoverflow.com/questions/9987788/no-xml-content-please-add-a-root-view-or-layout-to-your-document http://developer.android.com/reference/android/inputmethodservice/Keyboard.html or did they all just copy the wrong example from the documentation? – aelgoa Sep 16 '14 at 12:58
0

May be a fractional value, which is a floating point number appended with either % or %p, such as "14.5%". The % suffix always means a percentage of the base size; the optional %p suffix provides a size relative to some parent container.

The Android keyboard layout is based on rows and each row has keys. The {number}%p is the width of the keys in the keyboard unless it is explicitly defined on individual key. The {number}%p means the width of key in percentage relative to parent container.

Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110