IT. Expert System.

Android Reference

Keyboard


android.inputmethodservice

Class Keyboard



  • public class Keyboard
    extends Object
    Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard consists of rows of keys.

    The layout file for a keyboard contains XML that looks like the following snippet:

     <Keyboard
             android:keyWidth="%10p"
             android:keyHeight="50px"
             android:horizontalGap="2px"
             android:verticalGap="2px" >
         <Row android:keyWidth="32px" >
             <Key android:keyLabel="A" />
             ...
         </Row>
         ...
     </Keyboard>
     
    • Constructor Detail

      • Keyboard

        public Keyboard(Context context,
                int xmlLayoutResId)
        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.
      • Keyboard

        public Keyboard(Context context,
                int xmlLayoutResId,
                int modeId,
                int width,
                int height)
        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
      • Keyboard

        public Keyboard(Context context,
                int xmlLayoutResId,
                int modeId)
        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
      • Keyboard

        public Keyboard(Context context,
                int layoutTemplateResId,
                CharSequence characters,
                int columns,
                int horizontalPadding)

        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.
    • Method Detail

      • getHorizontalGap

        protected int getHorizontalGap()
      • setHorizontalGap

        protected void setHorizontalGap(int gap)
      • getVerticalGap

        protected int getVerticalGap()
      • setVerticalGap

        protected void setVerticalGap(int gap)
      • getKeyHeight

        protected int getKeyHeight()
      • setKeyHeight

        protected void setKeyHeight(int height)
      • getKeyWidth

        protected int getKeyWidth()
      • setKeyWidth

        protected void setKeyWidth(int width)
      • getHeight

        public int getHeight()
        Returns the total height of the keyboard
        Returns:
        the total height of the keyboard
      • getMinWidth

        public int getMinWidth()
      • setShifted

        public boolean setShifted(boolean shiftState)
      • isShifted

        public boolean isShifted()
      • getShiftKeyIndices

        public int[] getShiftKeyIndices()
      • getShiftKeyIndex

        public int getShiftKeyIndex()
      • getNearestKeys

        public int[] getNearestKeys(int x,
                           int y)
        Returns the indices of the keys that are closest to the given point.
        Parameters:
        x - the x-coordinate of the point
        y - the y-coordinate of the point
        Returns:
        the array of integer indices for the nearest keys to the given point. If the given point is out of range, then an array of size zero is returned.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1583 / 96487382. Delta: 0.03937 с