Skip to content

Most visited

Recently visited

navigation

DialerFilter

public class DialerFilter
extends RelativeLayout

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


Summary

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

Inherited constants

From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View

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, KEYCODE_ENTER or KEYCODE_SPACE 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.

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.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Constants

DIGITS_AND_LETTERS

Added in API level 1
int DIGITS_AND_LETTERS

This mode has both lines

Constant Value: 1 (0x00000001)

DIGITS_AND_LETTERS_NO_DIGITS

Added in API level 1
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

Constant Value: 2 (0x00000002)

DIGITS_AND_LETTERS_NO_LETTERS

Added in API level 1
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

Constant Value: 3 (0x00000003)

DIGITS_ONLY

Added in API level 1
int DIGITS_ONLY

This mode has only the digits line

Constant Value: 4 (0x00000004)

LETTERS_ONLY

Added in API level 1
int LETTERS_ONLY

This mode has only the letters line

Constant Value: 5 (0x00000005)

Public constructors

DialerFilter

Added in API level 1
DialerFilter (Context context)

Parameters
context Context

DialerFilter

Added in API level 1
DialerFilter (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

Public methods

append

Added in API level 1
void append (String text)

Parameters
text String

clearText

Added in API level 1
void clearText ()

Clears both the digits and the filter text.

getDigits

Added in API level 1
CharSequence getDigits ()

Returns
CharSequence

getFilterText

Added in API level 1
CharSequence getFilterText ()

Returns
CharSequence

getLetters

Added in API level 1
CharSequence getLetters ()

Returns
CharSequence

getMode

Added in API level 1
int getMode ()

Returns
int

isQwertyKeyboard

Added in API level 1
boolean isQwertyKeyboard ()

Returns
boolean

onKeyDown

Added in API level 1
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.

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 int: a key code that represents the button pressed, from KeyEvent
event KeyEvent: the KeyEvent object that defines the button action
Returns
boolean If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

onKeyUp

Added in API level 1
boolean onKeyUp (int keyCode, 
                KeyEvent event)

Default implementation of KeyEvent.Callback.onKeyUp(): perform clicking of the view when KEYCODE_DPAD_CENTER, KEYCODE_ENTER or KEYCODE_SPACE 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 int: A key code that represents the button pressed, from KeyEvent.
event KeyEvent: The KeyEvent object that defines the button action.
Returns
boolean If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

removeFilterWatcher

Added in API level 1
void removeFilterWatcher (TextWatcher watcher)

Parameters
watcher TextWatcher

setDigitsWatcher

Added in API level 1
void setDigitsWatcher (TextWatcher watcher)

Parameters
watcher TextWatcher

setFilterWatcher

Added in API level 1
void setFilterWatcher (TextWatcher watcher)

Parameters
watcher TextWatcher

setLettersWatcher

Added in API level 1
void setLettersWatcher (TextWatcher watcher)

Parameters
watcher TextWatcher

setMode

Added in API level 1
void setMode (int newMode)

Change the mode of the widget.

Parameters
newMode int: The mode to switch to.

Protected methods

onFinishInflate

Added in API level 1
void onFinishInflate ()

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.

onFocusChanged

Added in API level 1
void onFocusChanged (boolean focused, 
                int direction, 
                Rect previouslyFocusedRect)

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

Parameters
focused boolean: True if the View has focus; false otherwise.
direction int: 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 Rect: 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.

onModeChange

Added in API level 1
void onModeChange (int oldMode, 
                int newMode)

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

Parameters
oldMode int
newMode int
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.