Build 1.0_r1(from source)

android.text.method
Class NumberKeyListener

java.lang.Object
  extended by android.text.method.MetaKeyKeyListener
      extended by android.text.method.BaseKeyListener
          extended by android.text.method.NumberKeyListener
All Implemented Interfaces:
InputFilter, KeyListener
Direct Known Subclasses:
DateKeyListener, DateTimeKeyListener, DialerKeyListener, DigitsKeyListener, TimeKeyListener

public abstract class NumberKeyListener
extends BaseKeyListener
implements InputFilter

For numeric text entry


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.text.InputFilter
InputFilter.AllCaps, InputFilter.LengthFilter
 
Field Summary
 
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
NumberKeyListener()
           
 
Method Summary
 CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend)
          This method is called when the buffer is going to replace the range dstart … dend of dest with the new text from the range start … end of source.
protected abstract  char[] getAcceptedChars()
          You can say which characters you can accept.
protected  int lookup(KeyEvent event, Spannable content)
           
protected static boolean ok(char[] accept, char c)
           
 boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event)
          Handles presses of the meta keys.
 
Methods inherited from class android.text.method.BaseKeyListener
backspace
 
Methods inherited from class android.text.method.MetaKeyKeyListener
adjustMetaAfterKeypress, getMetaState, getMetaState, isMetaTracker, onKeyUp, resetLockedMeta, resetMetaState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.text.method.KeyListener
onKeyUp
 

Constructor Detail

NumberKeyListener

public NumberKeyListener()
Method Detail

getAcceptedChars

protected abstract char[] getAcceptedChars()
You can say which characters you can accept.


lookup

protected int lookup(KeyEvent event,
                     Spannable content)

filter

public CharSequence filter(CharSequence source,
                           int start,
                           int end,
                           Spanned dest,
                           int dstart,
                           int dend)
Description copied from interface: InputFilter
This method is called when the buffer is going to replace the range dstart … dend of dest with the new text from the range start … end of source. Return the CharSequence that you would like to have placed there instead, including an empty string if appropriate, or null to accept the original replacement. Be careful to not to reject 0-length replacements, as this is what happens when you delete text. Also beware that you should not attempt to make any changes to dest from this method; you may only examine it for context.

Specified by:
filter in interface InputFilter

ok

protected static boolean ok(char[] accept,
                            char c)

onKeyDown

public boolean onKeyDown(View view,
                         Editable content,
                         int keyCode,
                         KeyEvent event)
Description copied from class: MetaKeyKeyListener
Handles presses of the meta keys.

Specified by:
onKeyDown in interface KeyListener
Overrides:
onKeyDown in class BaseKeyListener

Build 1.0_r1(from source)

Please submit a feedback, bug or feature