inputtype接口 android,InputType

android.text.InputType

3e54f4822052f69722b015cabe630b87.pngKnown Indirect Subclasses

An EditorInfo describes several attributes of a text editing object

that an input method is communicating with (typically an EditText), most

importantly the type of text content it contains.

Class Overview

Bit definitions for an integer defining the basic content type of text

held in an

Examples

A password field with with the password visible to the user:inputType = TYPE_CLASS_TEXT |

TYPE_TEXT_VARIATION_VISIBLE_PASSWORDA multi-line postal address with automatic capitalization:inputType = TYPE_CLASS_TEXT |

TYPE_TEXT_VARIATION_POSTAL_ADDRESS |

TYPE_TEXT_FLAG_MULTI_LINEA time field:inputType = TYPE_CLASS_DATETIME |

TYPE_DATETIME_VARIATION_TIME

Summary

Constants

int

Class for dates and times.

int

Class for numeric text.

int

Class for a phone number.

int

Class for normal text.

int

Default variation of

int

Default variation of

int

Default variation of

int

Mask of bits that determine the overall class

of text being given.

int

Mask of bits that provide addition bit flags

of options.

int

Mask of bits that determine the variation of

the base content class.

int

Special content type for when no explicit type has been specified.

int

Flag of

int

Flag of

int

Default variation of

int

Flag for

int

Flag for

int

Flag for

int

Flag for

int

Flag for

int

Flag for

int

Flag for

int

Variation of

int

Variation of

int

Variation of

int

Default variation of

int

Variation of

int

Variation of

int

Variation of

int

Variation of

int

Variation of

int

Variation of

int

Variation of

int

Variation of

Constants

public

static

final

int

TYPE_CLASS_DATETIME

Constant Value:

4

(0x00000004)

public

static

final

int

TYPE_CLASS_NUMBER

Class for numeric text. This class supports the following flags:

IME authors: If you do not recognize

the variation, normal should be assumed.

Constant Value:

2

(0x00000002)

public

static

final

int

TYPE_CLASS_PHONE

Class for a phone number. This class currently supports no variations

or flags.

Constant Value:

3

(0x00000003)

public

static

final

int

TYPE_CLASS_TEXT

Class for normal text. This class supports the following flags (only

one of which should be set):

Constant Value:

1

(0x00000001)

public

static

final

int

TYPE_DATETIME_VARIATION_DATE

Default variation of

Constant Value:

16

(0x00000010)

public

static

final

int

TYPE_DATETIME_VARIATION_NORMAL

Default variation of

Constant Value:

0

(0x00000000)

public

static

final

int

TYPE_DATETIME_VARIATION_TIME

Default variation of

Constant Value:

32

(0x00000020)

public

static

final

int

TYPE_MASK_CLASS

Mask of bits that determine the overall class

of text being given. Currently supported classes are:

IME authors: If the class is not one you

understand, assume

Constant Value:

15

(0x0000000f)

public

static

final

int

TYPE_MASK_FLAGS

Mask of bits that provide addition bit flags

of options.

Constant Value:

16773120

(0x00fff000)

public

static

final

int

TYPE_MASK_VARIATION

Mask of bits that determine the variation of

the base content class.

Constant Value:

4080

(0x00000ff0)

public

static

final

int

TYPE_NULL

Special content type for when no explicit type has been specified.

This should be interpreted to mean that the target input connection

is not rich, it can not process and show things like candidate text nor

retrieve the current text, so the input method will need to run in a

limited "generate key events" mode, if it supports it. Note that some

input methods may not support it, for example a voice-based input

method will likely not be able to generate key events even if this

flag is set.

Constant Value:

0

(0x00000000)

public

static

final

int

TYPE_NUMBER_FLAG_DECIMAL

Flag of

Constant Value:

8192

(0x00002000)

public

static

final

int

TYPE_NUMBER_FLAG_SIGNED

Flag of

Constant Value:

4096

(0x00001000)

public

static

final

int

TYPE_NUMBER_VARIATION_NORMAL

Default variation of

Constant Value:

0

(0x00000000)

public

static

final

int

TYPE_NUMBER_VARIATION_PASSWORD

Variation of

Constant Value:

16

(0x00000010)

public

static

final

int

TYPE_TEXT_FLAG_AUTO_COMPLETE

Flag for TYPE_TEXT_FLAG_AUTO_COMPLETE means the editor should show an

interface for displaying suggestions, but instead of supplying its own

it will rely on the Editor to pass completions/corrections.

Constant Value:

65536

(0x00010000)

public

static

final

int

TYPE_TEXT_FLAG_AUTO_CORRECT

Flag for TYPE_TEXT_FLAG_AUTO_CORRECT means that the IME will try to

auto-correct typos as the user is typing, but does not define whether

the IME offers an interface to show suggestions.

Constant Value:

32768

(0x00008000)

public

static

final

int

TYPE_TEXT_FLAG_CAP_CHARACTERS

Flag for

Constant Value:

4096

(0x00001000)

public

static

final

int

TYPE_TEXT_FLAG_CAP_SENTENCES

Flag for

Constant Value:

16384

(0x00004000)

public

static

final

int

TYPE_TEXT_FLAG_CAP_WORDS

Flag for

Constant Value:

8192

(0x00002000)

public

static

final

int

TYPE_TEXT_FLAG_IME_MULTI_LINE

Flag for

Constant Value:

262144

(0x00040000)

public

static

final

int

TYPE_TEXT_FLAG_MULTI_LINE

Flag for

Constant Value:

131072

(0x00020000)

public

static

final

int

TYPE_TEXT_FLAG_NO_SUGGESTIONS

Flag for TYPE_TEXT_FLAG_NO_SUGGESTIONS means the IME should never

show an interface to display suggestions. Most IMEs will also take this to

mean they should not try to auto-correct what the user is typing.

Constant Value:

524288

(0x00080000)

public

static

final

int

TYPE_TEXT_VARIATION_EMAIL_ADDRESS

Variation of

Constant Value:

32

(0x00000020)

public

static

final

int

TYPE_TEXT_VARIATION_EMAIL_SUBJECT

Variation of

Constant Value:

48

(0x00000030)

public

static

final

int

TYPE_TEXT_VARIATION_FILTER

Variation of

Constant Value:

176

(0x000000b0)

public

static

final

int

TYPE_TEXT_VARIATION_LONG_MESSAGE

Variation of

Constant Value:

80

(0x00000050)

public

static

final

int

TYPE_TEXT_VARIATION_NORMAL

Default variation of

Constant Value:

0

(0x00000000)

public

static

final

int

TYPE_TEXT_VARIATION_PASSWORD

Variation of

Constant Value:

128

(0x00000080)

public

static

final

int

TYPE_TEXT_VARIATION_PERSON_NAME

Variation of

Constant Value:

96

(0x00000060)

public

static

final

int

TYPE_TEXT_VARIATION_PHONETIC

Variation of

Constant Value:

192

(0x000000c0)

public

static

final

int

TYPE_TEXT_VARIATION_POSTAL_ADDRESS

Variation of

Constant Value:

112

(0x00000070)

public

static

final

int

TYPE_TEXT_VARIATION_SHORT_MESSAGE

Variation of

Constant Value:

64

(0x00000040)

public

static

final

int

TYPE_TEXT_VARIATION_URI

Variation of

Constant Value:

16

(0x00000010)

public

static

final

int

TYPE_TEXT_VARIATION_VISIBLE_PASSWORD

Variation of

Constant Value:

144

(0x00000090)

public

static

final

int

TYPE_TEXT_VARIATION_WEB_EDIT_TEXT

Variation of

Constant Value:

160

(0x000000a0)

public

static

final

int

TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS

Variation of

Constant Value:

208

(0x000000d0)

public

static

final

int

TYPE_TEXT_VARIATION_WEB_PASSWORD

Variation of

Constant Value:

224

(0x000000e0)

Except as noted, this content is licensed under Apache 2.0.

For details and restrictions, see the Content License.

Android 4.4 r1 —

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值