android.text.method.TextKeyListener
This is the key listener for typing normal text. It delegates to
other key listeners appropriate to the current keyboard and language.
Nested Classes
Summary
Public Constructors
Public Methods
|
|
|
static |
|
void |
clear(Editable e) |
|
|
|
static |
|
TextKeyListener |
getInstance(boolean autotext, TextKeyListener.Capitalize cap) |
|
|
|
static |
|
TextKeyListener |
getInstance() |
|
|
|
|
|
boolean |
onKeyDown(View view, Editable content, int keyCode, KeyEvent event) |
|
|
|
|
|
boolean |
onKeyUp(View view, Editable content, int keyCode, KeyEvent event) |
|
|
|
|
|
void |
onSpanAdded(Spannable s, Object what, int start, int end) |
|
|
|
|
|
void |
onSpanChanged(Spannable s, Object what, int start, int end, int st, int en) |
|
|
|
|
|
void |
onSpanRemoved(Spannable s, Object what, int start, int end) |
|
|
|
static |
|
boolean |
shouldCap(TextKeyListener.Capitalize cap, CharSequence cs, int off) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
|
|
|
|
void |
onSpanAdded(Spannable text, Object what, int start, int end) |
|
|
|
|
|
void |
onSpanChanged(Spannable text, Object what, int ostart, int oend, int nstart, int nend) |
|
|
|
|
|
void |
onSpanRemoved(Spannable text, Object what, int start, int end) |
Details
Public Constructors
Creates a new TextKeyListener with the specified capitalization
and correction properties.
Parameters
cap
| when, if ever, to automatically capitalize. |
autotext
| whether to automatically do spelling corrections.
|
Public Methods
public
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.
Parameters
e
| the buffer whose text and state are to be cleared.
|
Returns a new or existing instance with the specified capitalization
and correction properties.
Parameters
autotext
| whether to automatically do spelling corrections.
|
cap
| when, if ever, to automatically capitalize. |
Returns a new or existing instance with no automatic capitalization
or correction.
public
boolean
onKeyDown(View view, Editable content, int keyCode, KeyEvent event)
Handles presses of the meta keys.
public
boolean
onKeyUp(View view, Editable content, int keyCode, KeyEvent event)
Handles release of the meta keys.
public
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.
public
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.
public
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.
Returns whether it makes sense to automatically capitalize at the
specified position in the specified text, with the specified rules.
Parameters
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. |
Returns
- whether the character being inserted should be capitalized.