Most visited

Recently visited

Added in API level 3

ExtractEditText

public class ExtractEditText
extends EditText

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.TextView
       ↳ android.widget.EditText
         ↳ android.inputmethodservice.ExtractEditText


Specialization of EditText for showing and interacting with the extracted text in a full-screen input method.

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

ExtractEditText(Context context)
ExtractEditText(Context context, AttributeSet attrs)
ExtractEditText(Context context, AttributeSet attrs, int defStyleAttr)
ExtractEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

void finishInternalChanges()

Finish making changes that will not be reported to the client.

boolean hasFocus()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

boolean hasVerticalScrollBar()

Return true if the edit text is currently showing a scroll bar.

boolean hasWindowFocus()

Pretend like the window this view is in always has focus, so its highlight and cursor will be displayed.

boolean isFocused()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

boolean isInputMethodTarget()

We are always considered to be an input method target.

boolean onTextContextMenuItem(int id)

Called when a context menu option for the text view is selected.

boolean performClick()

Redirect clicks to the IME for handling there.

void setExtractedText(ExtractedText text)

Implement just to keep track of when we are setting text from the client (vs.

void startInternalChanges()

Start making changes that will not be reported to the client.

Protected methods

void onSelectionChanged(int selStart, int selEnd)

Report to the underlying text editor about selection 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

Public constructors

ExtractEditText

Added in API level 3
ExtractEditText (Context context)

Parameters
context Context

ExtractEditText

Added in API level 3
ExtractEditText (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

ExtractEditText

Added in API level 3
ExtractEditText (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context
attrs AttributeSet
defStyleAttr int

ExtractEditText

Added in API level 21
ExtractEditText (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context
attrs AttributeSet
defStyleAttr int
defStyleRes int

Public methods

finishInternalChanges

Added in API level 3
void finishInternalChanges ()

Finish making changes that will not be reported to the client. That is, onSelectionChanged(int, int) will not result in sending the new selection to the client

hasFocus

Added in API level 3
boolean hasFocus ()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

Returns
boolean True if this view has or contains focus, false otherwise.

hasVerticalScrollBar

Added in API level 3
boolean hasVerticalScrollBar ()

Return true if the edit text is currently showing a scroll bar.

Returns
boolean

hasWindowFocus

Added in API level 3
boolean hasWindowFocus ()

Pretend like the window this view is in always has focus, so its highlight and cursor will be displayed.

Returns
boolean True if this view is in a window that currently has window focus.

isFocused

Added in API level 3
boolean isFocused ()

Pretend like this view always has focus, so its highlight and cursor will be displayed.

Returns
boolean True if this view has focus, false otherwise.

isInputMethodTarget

Added in API level 3
boolean isInputMethodTarget ()

We are always considered to be an input method target.

Returns
boolean

onTextContextMenuItem

Added in API level 3
boolean onTextContextMenuItem (int id)

Called when a context menu option for the text view is selected. Currently this will be one of selectAll, cut, copy, paste or shareText.

Parameters
id int
Returns
boolean true if the context menu item action was performed.

performClick

Added in API level 3
boolean performClick ()

Redirect clicks to the IME for handling there. First allows any on click handler to run, though.

Returns
boolean True there was an assigned OnClickListener that was called, false otherwise is returned.

setExtractedText

Added in API level 3
void setExtractedText (ExtractedText text)

Implement just to keep track of when we are setting text from the client (vs. seeing changes in ourself from the user).

Parameters
text ExtractedText

startInternalChanges

Added in API level 3
void startInternalChanges ()

Start making changes that will not be reported to the client. That is, onSelectionChanged(int, int) will not result in sending the new selection to the client

Protected methods

onSelectionChanged

Added in API level 3
void onSelectionChanged (int selStart, 
                int selEnd)

Report to the underlying text editor about selection changes.

Parameters
selStart int: The new selection start location.
selEnd int: The new selection end location.

Hooray!