|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.text.method.MetaKeyKeyListener
android.text.method.BaseKeyListener
android.text.method.TextKeyListener
public class TextKeyListener
This is the key listener for typing normal text. It delegates to other key listeners appropriate to the current keyboard and language.
| Nested Class Summary | |
|---|---|
static class |
TextKeyListener.Capitalize
|
| Field Summary | |
|---|---|
(package private) static Object |
ACTIVE
|
(package private) static int |
AUTO_CAP
|
(package private) static int |
AUTO_PERIOD
|
(package private) static int |
AUTO_TEXT
|
(package private) static Object |
CAPPED
|
(package private) static Object |
INHIBIT_REPLACEMENT
|
(package private) static Object |
LAST_TYPED
|
(package private) static int |
SHOW_PASSWORD
|
| Fields inherited from class android.text.method.BaseKeyListener |
|---|
OLD_SEL_START |
| Fields inherited from class android.text.method.MetaKeyKeyListener |
|---|
META_ALT_LOCKED, META_ALT_ON, META_CAP_LOCKED, META_SHIFT_ON, META_SYM_LOCKED, META_SYM_ON |
| Constructor Summary | |
|---|---|
TextKeyListener(TextKeyListener.Capitalize cap,
boolean autotext)
Creates a new TextKeyListener with the specified capitalization and correction properties. |
|
| Method Summary | |
|---|---|
static void |
clear(Editable e)
Clear all the input state (autotext, autocap, multitap, undo) from the specified Editable, going beyond Editable.clear(), which just clears the text but not the input state. |
static TextKeyListener |
getInstance()
Returns a new or existing instance with no automatic capitalization or correction. |
static TextKeyListener |
getInstance(boolean autotext,
TextKeyListener.Capitalize cap)
Returns a new or existing instance with the specified capitalization and correction properties. |
(package private) int |
getPrefs(Context context)
|
boolean |
onKeyDown(View view,
Editable content,
int keyCode,
KeyEvent event)
Handles presses of the meta keys. |
boolean |
onKeyUp(View view,
Editable content,
int keyCode,
KeyEvent event)
Handles release of the meta keys. |
void |
onSpanAdded(Spannable s,
Object what,
int start,
int end)
This method is called to notify you that the specified object has been attached to the specified range of the text. |
void |
onSpanChanged(Spannable s,
Object what,
int start,
int end,
int st,
int en)
This method is called to notify you that the specified object has been relocated from the range ostart…oend
to the new range nstart…nend of the text. |
void |
onSpanRemoved(Spannable s,
Object what,
int start,
int end)
This method is called to notify you that the specified object has been detached from the specified range of the text. |
void |
release()
|
static boolean |
shouldCap(TextKeyListener.Capitalize cap,
CharSequence cs,
int off)
Returns whether it makes sense to automatically capitalize at the specified position in the specified text, with the specified rules. |
| Methods inherited from class android.text.method.BaseKeyListener |
|---|
backspace |
| Methods inherited from class android.text.method.MetaKeyKeyListener |
|---|
adjustMetaAfterKeypress, getMetaState, getMetaState, isMetaTracker, resetLockedMeta, resetMetaState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final Object ACTIVE
static final Object CAPPED
static final Object INHIBIT_REPLACEMENT
static final Object LAST_TYPED
static final int AUTO_CAP
static final int AUTO_TEXT
static final int AUTO_PERIOD
static final int SHOW_PASSWORD
| Constructor Detail |
|---|
public TextKeyListener(TextKeyListener.Capitalize cap,
boolean autotext)
cap - when, if ever, to automatically capitalize.autotext - whether to automatically do spelling corrections.| Method Detail |
|---|
public static TextKeyListener getInstance(boolean autotext,
TextKeyListener.Capitalize cap)
cap - when, if ever, to automatically capitalize.autotext - whether to automatically do spelling corrections.public static TextKeyListener getInstance()
public static boolean shouldCap(TextKeyListener.Capitalize cap,
CharSequence cs,
int off)
cap - the capitalization rules to consider.cs - the text in which an insertion is being made.off - the offset into that text where the insertion is being made.
public boolean onKeyDown(View view,
Editable content,
int keyCode,
KeyEvent event)
MetaKeyKeyListener
onKeyDown in interface KeyListeneronKeyDown in class BaseKeyListener
public boolean onKeyUp(View view,
Editable content,
int keyCode,
KeyEvent event)
MetaKeyKeyListener
onKeyUp in interface KeyListeneronKeyUp in class MetaKeyKeyListenerpublic static void clear(Editable e)
e - the buffer whose text and state are to be cleared.
public void onSpanAdded(Spannable s,
Object what,
int start,
int end)
SpanWatcher
onSpanAdded in interface SpanWatcher
public void onSpanRemoved(Spannable s,
Object what,
int start,
int end)
SpanWatcher
onSpanRemoved in interface SpanWatcher
public void onSpanChanged(Spannable s,
Object what,
int start,
int end,
int st,
int en)
SpanWatcherostart…oend
to the new range nstart…nend of the text.
onSpanChanged in interface SpanWatcherpublic void release()
int getPrefs(Context context)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||