Keyboard

open fun Keyboard(context: Context, xmlLayoutResId: Int)

Creates a keyboard from the given xml key layout file.

Parameters

context

the application or service context

xmlLayoutResId

the resource file that contains the keyboard layout and keys.

open fun Keyboard(context: Context, @XmlRes() xmlLayoutResId: Int, modeId: Int, width: Int, height: Int)

Creates a keyboard from the given xml key layout file. Weeds out rows that have a keyboard mode defined but don't match the specified mode.

Parameters

context

the application or service context

xmlLayoutResId

the resource file that contains the keyboard layout and keys.

modeId

keyboard mode identifier

width

sets width of keyboard

height

sets height of keyboard

open fun Keyboard(context: Context, @XmlRes() xmlLayoutResId: Int, modeId: Int)

Creates a keyboard from the given xml key layout file. Weeds out rows that have a keyboard mode defined but don't match the specified mode.

Parameters

context

the application or service context

xmlLayoutResId

the resource file that contains the keyboard layout and keys.

modeId

keyboard mode identifier

open fun Keyboard(context: Context, layoutTemplateResId: Int, characters: CharSequence, columns: Int, horizontalPadding: Int)

Creates a blank keyboard from the given resource file and populates it with the specified characters in left-to-right, top-to-bottom fashion, using the specified number of columns.

If the specified number of columns is -1, then the keyboard will fit as many keys as possible in each row.

Parameters

context

the application or service context

layoutTemplateResId

the layout template file, containing no keys.

characters

the list of characters to display on the keyboard. One key will be created for each character.

columns

the number of columns of keys to display. If this number is greater than the number of keys that can fit in a row, it will be ignored. If this number is -1, the keyboard will fit as many keys as possible in each row.