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

Inherited constants

Inherited fields

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

Public constructors

ExtractEditText

Added in API level 3
public ExtractEditText (Context context)

Parameters
context Context

ExtractEditText

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

Parameters
context Context

attrs AttributeSet

ExtractEditText

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

Parameters
context Context

attrs AttributeSet

defStyleAttr int

ExtractEditText

Added in API level 21
public 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
public 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
public 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
public boolean hasVerticalScrollBar ()

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

Returns
boolean

hasWindowFocus

Added in API level 3
public 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
public 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
public boolean isInputMethodTarget ()

We are always considered to be an input method target.

Returns
boolean True if the TextView is a current input method target; false otherwise.

onTextContextMenuItem

Added in API level 3
public boolean onTextContextMenuItem (int id)

Called when a context menu option for the text view is selected. Currently this will be one of R.id.selectAll, R.id.cut, R.id.copy, R.id.paste, R.id.pasteAsPlainText (starting at API level\u202f23) or R.id.shareText.

Parameters
id int

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

performClick

Added in API level 3
public 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
public 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
public 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
protected 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.