to top
Android APIs
public class

DialerFilter

extends RelativeLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.RelativeLayout
         ↳ android.widget.DialerFilter

Summary

[Expand]
Inherited XML Attributes
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
Constants
int DIGITS_AND_LETTERS This mode has both lines
int DIGITS_AND_LETTERS_NO_DIGITS This mode is when after starting in DIGITS_AND_LETTERS mode the filter has removed all possibility of the digits matching, leaving only the letters line
int DIGITS_AND_LETTERS_NO_LETTERS This mode is when after starting in DIGITS_AND_LETTERS mode the filter has removed all possibility of the letters matching, leaving only the digits line
int DIGITS_ONLY This mode has only the digits line
int LETTERS_ONLY This mode has only the letters line
[Expand]
Inherited Constants
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
DialerFilter(Context context)
DialerFilter(Context context, AttributeSet attrs)
Public Methods
void append(String text)
void clearText()
Clears both the digits and the filter text.
CharSequence getDigits()
CharSequence getFilterText()
CharSequence getLetters()
int getMode()
boolean isQwertyKeyboard()
boolean onKeyDown(int keyCode, KeyEvent event)
Default implementation of KeyEvent.Callback.onKeyDown(): perform press of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released, if the view is enabled and clickable.
boolean onKeyUp(int keyCode, KeyEvent event)
Default implementation of KeyEvent.Callback.onKeyUp(): perform clicking of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released.
void removeFilterWatcher(TextWatcher watcher)
void setDigitsWatcher(TextWatcher watcher)
void setFilterWatcher(TextWatcher watcher)
void setLettersWatcher(TextWatcher watcher)
void setMode(int newMode)
Change the mode of the widget.
Protected Methods
void onFinishInflate()
Finalize inflating a view from XML.
void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect)
Only show the icon view when focused, if there is one.
void onModeChange(int oldMode, int newMode)
Called right after the mode changes to give subclasses the option to restyle, etc.
[Expand]
Inherited Methods
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Constants

public static final int DIGITS_AND_LETTERS

Added in API level 1

This mode has both lines

Constant Value: 1 (0x00000001)

public static final int DIGITS_AND_LETTERS_NO_DIGITS

Added in API level 1

This mode is when after starting in DIGITS_AND_LETTERS mode the filter has removed all possibility of the digits matching, leaving only the letters line

Constant Value: 2 (0x00000002)

public static final int DIGITS_AND_LETTERS_NO_LETTERS

Added in API level 1

This mode is when after starting in DIGITS_AND_LETTERS mode the filter has removed all possibility of the letters matching, leaving only the digits line

Constant Value: 3 (0x00000003)

public static final int DIGITS_ONLY

Added in API level 1

This mode has only the digits line

Constant Value: 4 (0x00000004)

public static final int LETTERS_ONLY

Added in API level 1

This mode has only the letters line

Constant Value: 5 (0x00000005)

Public Constructors

public DialerFilter (Context context)

Added in API level 1

public DialerFilter (Context context, AttributeSet attrs)

Added in API level 1

Public Methods

public void append (String text)

Added in API level 1

public void clearText ()

Added in API level 1

Clears both the digits and the filter text.

public CharSequence getDigits ()

Added in API level 1

public CharSequence getFilterText ()

Added in API level 1

public CharSequence getLetters ()

Added in API level 1

public int getMode ()

Added in API level 1

public boolean isQwertyKeyboard ()

Added in API level 1

public boolean onKeyDown (int keyCode, KeyEvent event)

Added in API level 1

Default implementation of KeyEvent.Callback.onKeyDown(): perform press of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released, if the view is enabled and clickable.

Key presses in software keyboards will generally NOT trigger this listener, although some may elect to do so in some situations. Do not rely on this to catch software key presses.

Parameters
keyCode A key code that represents the button pressed, from KeyEvent.
event The KeyEvent object that defines the button action.
Returns
  • If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

public boolean onKeyUp (int keyCode, KeyEvent event)

Added in API level 1

Default implementation of KeyEvent.Callback.onKeyUp(): perform clicking of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released.

Key presses in software keyboards will generally NOT trigger this listener, although some may elect to do so in some situations. Do not rely on this to catch software key presses.

Parameters
keyCode A key code that represents the button pressed, from KeyEvent.
event The KeyEvent object that defines the button action.
Returns
  • If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

public void removeFilterWatcher (TextWatcher watcher)

Added in API level 1

public void setDigitsWatcher (TextWatcher watcher)

Added in API level 1

public void setFilterWatcher (TextWatcher watcher)

Added in API level 1

public void setLettersWatcher (TextWatcher watcher)

Added in API level 1

public void setMode (int newMode)

Added in API level 1

Change the mode of the widget.

Parameters
newMode The mode to switch to.

Protected Methods

protected void onFinishInflate ()

Added in API level 1

Finalize inflating a view from XML. This is called as the last phase of inflation, after all child views have been added.

Even if the subclass overrides onFinishInflate, they should always be sure to call the super method, so that we get called.

protected void onFocusChanged (boolean focused, int direction, Rect previouslyFocusedRect)

Added in API level 1

Only show the icon view when focused, if there is one.

Parameters
focused True if the View has focus; false otherwise.
direction The direction focus has moved when requestFocus() is called to give this view focus. Values are FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_FORWARD, or FOCUS_BACKWARD. It may not always apply, in which case use the default.
previouslyFocusedRect The rectangle, in this view's coordinate system, of the previously focused view. If applicable, this will be passed in as finer grained information about where the focus is coming from (in addition to direction). Will be null otherwise.

protected void onModeChange (int oldMode, int newMode)

Added in API level 1

Called right after the mode changes to give subclasses the option to restyle, etc.