Most visited

Recently visited

GuidedActionEditText

public class GuidedActionEditText
extends EditText implements ImeKeyMonitor

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ android.widget.EditText
         ↳ android.support.v17.leanback.widget.GuidedActionEditText


A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment.

Summary

Inherited XML attributes

From class android.widget.TextView
From class android.view.View

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

GuidedActionEditText(Context ctx)
GuidedActionEditText(Context ctx, AttributeSet attrs)
GuidedActionEditText(Context ctx, AttributeSet attrs, int defStyleAttr)

Public methods

void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)

Initializes an AccessibilityNodeInfo with information about this view.

boolean onKeyPreIme(int keyCode, KeyEvent event)

Handle a key event before it is processed by any input method associated with the view hierarchy.

void setImeKeyListener(ImeKeyMonitor.ImeKeyListener listener)

Set the listener for this edit text object.

Protected methods

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

Called by the view system when the focus state of this view changes.

Inherited methods

From class android.widget.EditText
From class android.widget.TextView
From class android.view.View
From class java.lang.Object
From interface android.view.ViewTreeObserver.OnPreDrawListener
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.support.v17.leanback.widget.ImeKeyMonitor

Public constructors

GuidedActionEditText

GuidedActionEditText (Context ctx)

Parameters
ctx Context

GuidedActionEditText

GuidedActionEditText (Context ctx, 
                AttributeSet attrs)

Parameters
ctx Context
attrs AttributeSet

GuidedActionEditText

GuidedActionEditText (Context ctx, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
ctx Context
attrs AttributeSet
defStyleAttr int

Public methods

onInitializeAccessibilityNodeInfo

void onInitializeAccessibilityNodeInfo (AccessibilityNodeInfo info)

Initializes an AccessibilityNodeInfo with information about this view. The base implementation sets:

Subclasses should override this method, call the super implementation, and set additional attributes.

If an View.AccessibilityDelegate has been specified via calling setAccessibilityDelegate(AccessibilityDelegate) its onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo) is responsible for handling this call.

Parameters
info AccessibilityNodeInfo: The instance to initialize.

onKeyPreIme

boolean onKeyPreIme (int keyCode, 
                KeyEvent event)

Handle a key event before it is processed by any input method associated with the view hierarchy. This can be used to intercept key events in special situations before the IME consumes them; a typical example would be handling the BACK key to update the application's UI instead of allowing the IME to see it and close itself.

Parameters
keyCode int: The value in event.getKeyCode().
event KeyEvent: Description of the key event.
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.

setImeKeyListener

void setImeKeyListener (ImeKeyMonitor.ImeKeyListener listener)

Set the listener for this edit text object. The listener's onKeyPreIme method will be invoked from the host edit text's onKeyPreIme method.

Parameters
listener ImeKeyMonitor.ImeKeyListener

Protected methods

onFocusChanged

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

Called by the view system when the focus state of this view changes. When the focus change event is caused by directional navigation, direction and previouslyFocusedRect provide insight into where the focus is coming from. When overriding, be sure to call up through to the super class so that the standard focus handling will occur.

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.

Hooray!