【SoftKeyboard研究系列】Keyboard.Row研究
来源:互联网 发布:react.js starter kit 编辑:程序博客网 时间:2024/05/17 08:48
一、Keyboard.Row doc位置
本地:%ANDROID_HOME%/sdk/docs/reference/android/inputmethodservice/Keyboard.Row.html
Web:
二、Keyboard.Row doc内容
Keyboard.Row
extends ObjectClass Overview
Container for keys in the keyboard. All keys in a row are at the same Y-coordinate. Some of the key size defaults can be overridden per row from what the Keyboard
defines.
Summary
XML Attributes
android:horizontalGap
Default horizontal gap between keys.
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 horizontalGap
.
Related Methods
android:keyHeight
Default height of a key, in pixels or percentage of display width.
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 keyHeight
.
Related Methods
android:keyWidth
Default width of a key, in pixels or percentage of display width.
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
.
Related Methods
android:keyboardMode
Mode of the keyboard. If the mode doesn't match the requested keyboard mode, the row will be skipped.
Must be a reference to another resource, in the form "@[+][package:]type:name
" or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute resource symbol keyboardMode
.
Related Methods
android:rowEdgeFlags
Row edge flags.
Must be one or more (separated by '|') of the following constant values.
top
4Row is anchored to the top of the keyboard.bottom
8Row is anchored to the bottom of the keyboard.This corresponds to the global attribute resource symbol rowEdgeFlags
.
Related Methods
android:verticalGap
Default vertical gap between rows of keys.
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 verticalGap
.
Related Methods
Fields
public int defaultHeight
Default height of a key in this row.
public int defaultHorizontalGap
Default horizontal gap between keys in this row.
public int defaultWidth
Default width of a key in this row.
public int mode
The keyboard mode for this row
public int rowEdgeFlags
Edge flags for this row of keys. Possible values that can be assigned are EDGE_TOP
and EDGE_BOTTOM
public int verticalGap
Vertical gap following this row.
Public Constructors
public Keyboard.Row (Keyboard parent)
public Keyboard.Row (Resources res, Keyboard parent, XmlResourceParser parser)
三、Keyboard.Row源码
/** * Container for keys in the keyboard. All keys in a row are at the same Y-coordinate. * Some of the key size defaults can be overridden per row from what the {@link Keyboard} * defines. * @attr ref android.R.styleable#Keyboard_keyWidth * @attr ref android.R.styleable#Keyboard_keyHeight * @attr ref android.R.styleable#Keyboard_horizontalGap * @attr ref android.R.styleable#Keyboard_verticalGap * @attr ref android.R.styleable#Keyboard_Row_rowEdgeFlags * @attr ref android.R.styleable#Keyboard_Row_keyboardMode */ public static class Row { /** Default width of a key in this row. */ public int defaultWidth; /** Default height of a key in this row. */ public int defaultHeight; /** Default horizontal gap between keys in this row. */ public int defaultHorizontalGap; /** Vertical gap following this row. */ public int verticalGap; ArrayList<Key> mKeys = new ArrayList<Key>(); /** * Edge flags for this row of keys. Possible values that can be assigned are * {@link Keyboard#EDGE_TOP EDGE_TOP} and {@link Keyboard#EDGE_BOTTOM EDGE_BOTTOM} */ public int rowEdgeFlags; /** The keyboard mode for this row */ public int mode; private Keyboard parent; public Row(Keyboard parent) { this.parent = parent; } public Row(Resources res, Keyboard parent, XmlResourceParser parser) { this.parent = parent; TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser), com.android.internal.R.styleable.Keyboard); defaultWidth = getDimensionOrFraction(a, com.android.internal.R.styleable.Keyboard_keyWidth, parent.mDisplayWidth, parent.mDefaultWidth); defaultHeight = getDimensionOrFraction(a, com.android.internal.R.styleable.Keyboard_keyHeight, parent.mDisplayHeight, parent.mDefaultHeight); defaultHorizontalGap = getDimensionOrFraction(a, com.android.internal.R.styleable.Keyboard_horizontalGap, parent.mDisplayWidth, parent.mDefaultHorizontalGap); verticalGap = getDimensionOrFraction(a, com.android.internal.R.styleable.Keyboard_verticalGap, parent.mDisplayHeight, parent.mDefaultVerticalGap); a.recycle(); a = res.obtainAttributes(Xml.asAttributeSet(parser), com.android.internal.R.styleable.Keyboard_Row); rowEdgeFlags = a.getInt(com.android.internal.R.styleable.Keyboard_Row_rowEdgeFlags, 0); mode = a.getResourceId(com.android.internal.R.styleable.Keyboard_Row_keyboardMode, 0); } }
四、Keyboard.Row研究
- 【SoftKeyboard研究系列】Keyboard.Row研究
- 【SoftKeyboard研究系列】Keyboard研究
- 【SoftKeyboard研究系列】Keyboard.Key研究
- 【SoftKeyboard研究系列】SoftKeyboard研究
- 【SoftKeyboard研究系列】自己动手做最简单的SoftKeyboard
- Android-L版本SDK下的Sample:SoftKeyboard研究
- row cache objects latch研究
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Keyboard Row
- Yii框架开发安全考虑
- 处理成svm的
- 黑马程序员----Collection和Collections有什么关系?List和Set有什么异同点?Map有哪些常用类,各有什么特点?
- 我做淘宝7年的工作经验总结
- 简洁的ios小界面
- 【SoftKeyboard研究系列】Keyboard.Row研究
- IOS 怎样实现APP版本更新
- WLAN 和WIFI 有什么区别
- 互联网协议入门(二)
- 百度地图api 获取当前位置经纬度。自驾俩点间的路线。
- java 上传图片并裁剪(spring MVC,)
- 企业服务治理概述
- Android对apk源码的修改--反编译+源码修改+重新打包+签名【附HelloWorld的修改实例】
- js ajax简单实例