public class EditText extends FrameLayout implements ThemeManager.OnThemeChangedListener
android.widget.FrameLayout.LayoutParamsandroid.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener| Modifier and Type | Field and Description |
|---|---|
static int |
AUTOCOMPLETE_MODE_MULTI |
static int |
AUTOCOMPLETE_MODE_NONE |
static int |
AUTOCOMPLETE_MODE_SINGLE |
protected int |
mAutoCompleteMode |
protected android.widget.EditText |
mInputView |
protected com.rey.material.widget.EditText.LabelView |
mLabelView |
protected int |
mSupportMode |
protected com.rey.material.widget.EditText.LabelView |
mSupportView |
static int |
SUPPORT_MODE_CHAR_COUNTER
Indicate this EditText should show a char counter text.
|
static int |
SUPPORT_MODE_HELPER
Indicate this EditText should show a helper text, or error text if it's set.
|
static int |
SUPPORT_MODE_HELPER_WITH_ERROR
Indicate this EditText should show a helper text, along with error text if it's set.
|
static int |
SUPPORT_MODE_NONE
Indicate this EditText should not show a support text.
|
mCurrentStyle, mStyleIdCLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHEACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z| Constructor and Description |
|---|
EditText(android.content.Context context) |
EditText(android.content.Context context,
android.util.AttributeSet attrs) |
EditText(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTextChangedListener(android.text.TextWatcher textWatcher)
Adds a TextWatcher to the list of those whose methods are called
whenever this TextView's text changes.
|
void |
append(java.lang.CharSequence text)
Convenience method: Append the specified text to the TextView's
display buffer, upgrading it to BufferType.EDITABLE if it was
not already editable.
|
void |
append(java.lang.CharSequence text,
int start,
int end)
Convenience method: Append the specified text slice to the TextView's
display buffer, upgrading it to BufferType.EDITABLE if it was
not already editable.
|
protected void |
applyStyle(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
void |
beginBatchEdit() |
boolean |
bringPointIntoView(int offset)
Move the point, specified by the offset, into the view if it is needed.
|
void |
cancelLongPress() |
boolean |
canCopy() |
boolean |
canCut() |
boolean |
canPaste() |
void |
clearComposingText()
Use
BaseInputConnection.removeComposingSpans() to remove any IME composing
state from this text view. |
void |
clearError()
Clear the error text.
|
void |
clearListSelection()
Clear the list selection.
|
void |
computeScroll() |
protected java.lang.CharSequence |
convertSelectionToString(java.lang.Object selectedItem)
Converts the selected item from the drop down list into a sequence
of character that can be used in the edit box.
|
protected float |
convertToLocalHorizontalCoordinate(float x) |
void |
debug(int depth) |
boolean |
didTouchFocusSelect()
Returns true, only while processing a touch gesture, if the initial
touch down event caused focus to move to the text view and as a result
its selection changed.
|
void |
dismissDropDown()
Closes the drop down if present on screen.
|
void |
endBatchEdit() |
boolean |
enoughToFilter()
Returns
true if the amount of text in the field meets
or exceeds the getThreshold() requirement. |
void |
extendSelection(int index)
Convenience for
Selection.extendSelection(android.text.Spannable, int). |
boolean |
extractText(android.view.inputmethod.ExtractedTextRequest request,
android.view.inputmethod.ExtractedText outText)
If this TextView contains editable content, extract a portion of it
based on the information in request in to outText.
|
void |
findViewsWithText(java.util.ArrayList<android.view.View> outViews,
java.lang.CharSequence searched,
int flags) |
android.widget.ListAdapter |
getAdapter()
Returns a filterable list adapter used for auto completion.
|
int |
getAutoLinkMask()
Gets the autolink mask of the text.
|
int |
getBaseline() |
java.lang.CharSequence |
getCompletionHint()
Gets the optional hint text displayed at the bottom of the the matching list.
|
int |
getCompoundDrawablePadding()
Returns the padding between the compound drawables and the text.
|
android.graphics.drawable.Drawable[] |
getCompoundDrawables()
Returns drawables for the left, top, right, and bottom borders.
|
android.graphics.drawable.Drawable[] |
getCompoundDrawablesRelative() |
int |
getCompoundPaddingBottom()
Returns the bottom padding of the view, plus space for the bottom
Drawable if any.
|
int |
getCompoundPaddingEnd()
Returns the end padding of the view, plus space for the end
Drawable if any.
|
int |
getCompoundPaddingLeft()
Returns the left padding of the view, plus space for the left
Drawable if any.
|
int |
getCompoundPaddingRight()
Returns the right padding of the view, plus space for the right
Drawable if any.
|
int |
getCompoundPaddingStart()
Returns the start padding of the view, plus space for the start
Drawable if any.
|
int |
getCompoundPaddingTop()
Returns the top padding of the view, plus space for the top
Drawable if any.
|
int |
getCurrentHintTextColor()
Return the current color selected to paint the hint text.
|
int |
getCurrentTextColor()
Return the current color selected for normal text.
|
android.view.ActionMode.Callback |
getCustomSelectionActionModeCallback()
Retrieves the value set in
setCustomSelectionActionModeCallback(android.view.ActionMode.Callback). |
int |
getDropDownAnchor()
Returns the id for the view that the auto-complete drop down list is anchored to.
|
android.graphics.drawable.Drawable |
getDropDownBackground()
Gets the background of the auto-complete drop-down list.
|
int |
getDropDownHeight()
Returns the current height for the auto-complete drop down list.
|
int |
getDropDownHorizontalOffset()
Gets the horizontal offset used for the auto-complete drop-down list.
|
int |
getDropDownVerticalOffset()
Gets the vertical offset used for the auto-complete drop-down list.
|
int |
getDropDownWidth()
Returns the current width for the auto-complete drop down list.
|
android.text.Editable |
getEditableText()
Return the text the TextView is displaying as an Editable object.
|
android.text.TextUtils.TruncateAt |
getEllipsize()
Returns where, if anywhere, words that are longer than the view
is wide should be ellipsized.
|
java.lang.CharSequence |
getError() |
int |
getExtendedPaddingBottom()
Returns the extended bottom padding of the view, including both the
bottom Drawable if any and any extra space to keep more than maxLines
of text from showing.
|
int |
getExtendedPaddingTop()
Returns the extended top padding of the view, including both the
top Drawable if any and any extra space to keep more than maxLines
of text from showing.
|
protected android.widget.Filter |
getFilter()
Returns the Filter obtained from
Filterable.getFilter(),
or null if setAdapter(T) was not called with
a Filterable. |
android.text.InputFilter[] |
getFilters()
Returns the current list of input filters.
|
void |
getFocusedRect(android.graphics.Rect r) |
java.lang.String |
getFontFeatureSettings() |
boolean |
getFreezesText()
Return whether this text view is including its entire text contents
in frozen icicles.
|
int |
getGravity()
Returns the horizontal and vertical alignment of this TextView.
|
java.lang.CharSequence |
getHelper() |
int |
getHighlightColor() |
java.lang.CharSequence |
getHint()
Returns the hint that is displayed when the text of the TextView
is empty.
|
android.content.res.ColorStateList |
getHintTextColors() |
int |
getImeActionId()
Get the IME action ID previous set with
setImeActionLabel(java.lang.CharSequence, int). |
java.lang.CharSequence |
getImeActionLabel()
Get the IME action label previous set with
setImeActionLabel(java.lang.CharSequence, int). |
int |
getImeOptions()
Get the type of the IME editor.
|
boolean |
getIncludeFontPadding()
Gets whether the TextView includes extra top and bottom padding to make
room for accents that go above the normal ascent and descent.
|
android.os.Bundle |
getInputExtras(boolean create)
Retrieve the input extras currently associated with the text view, which
can be viewed as well as modified.
|
int |
getInputType()
Get the type of the editable content.
|
android.text.method.KeyListener |
getKeyListener() |
android.text.Layout |
getLayout() |
float |
getLetterSpacing() |
protected int |
getLineAtCoordinate(float y) |
int |
getLineBounds(int line,
android.graphics.Rect bounds)
Return the baseline for the specified line (0...getLineCount() - 1)
If bounds is not null, return the top, left, right, bottom extents
of the specified line in it.
|
int |
getLineCount()
Return the number of lines of text, or 0 if the internal Layout has not
been built.
|
int |
getLineHeight() |
float |
getLineSpacingExtra()
Gets the line spacing extra space
|
float |
getLineSpacingMultiplier()
Gets the line spacing multiplier
|
boolean |
getLinksClickable()
Returns whether the movement method will automatically be set to
LinkMovementMethod if setAutoLinkMask(int) has been
set to nonzero and links are detected in setText(java.lang.CharSequence, com.rey.material.widget.TextView.BufferType). |
android.content.res.ColorStateList |
getLinkTextColors() |
int |
getListSelection()
Get the position of the dropdown view selection, if there is one.
|
int |
getMarqueeRepeatLimit()
Gets the number of times the marquee animation is repeated.
|
int |
getMaxEms() |
int |
getMaxHeight() |
int |
getMaxLines() |
int |
getMaxWidth() |
int |
getMinEms() |
int |
getMinHeight() |
int |
getMinLines() |
int |
getMinWidth() |
android.text.method.MovementMethod |
getMovementMethod() |
protected int |
getOffsetAtCoordinate(int line,
float x) |
int |
getOffsetForPosition(float x,
float y)
Get the character offset closest to the specified absolute position.
|
android.widget.AdapterView.OnItemClickListener |
getOnItemClickListener()
Returns the listener that is notified whenever the user clicks an item
in the drop down list.
|
android.widget.AdapterView.OnItemSelectedListener |
getOnItemSelectedListener()
Returns the listener that is notified whenever the user selects an
item in the drop down list.
|
android.text.TextPaint |
getPaint() |
int |
getPaintFlags() |
java.lang.String |
getPrivateImeOptions()
Get the private type of the content.
|
int |
getSelectionEnd()
Convenience for
Selection.getSelectionEnd(java.lang.CharSequence). |
int |
getSelectionStart()
Convenience for
Selection.getSelectionStart(java.lang.CharSequence). |
int |
getShadowColor() |
float |
getShadowDx() |
float |
getShadowDy() |
float |
getShadowRadius()
Gets the radius of the shadow layer.
|
boolean |
getShowSoftInputOnFocus()
Returns whether the soft input method will be made visible when this
TextView gets focused.
|
android.text.Editable |
getText() |
android.content.res.ColorStateList |
getTextColors()
Gets the text colors for the different states (normal, selected, focused) of the TextView.
|
java.util.Locale |
getTextLocale()
Get the default
Locale of the text in this TextView. |
float |
getTextScaleX() |
float |
getTextSize() |
int |
getThreshold()
Returns the number of characters the user must type before the drop
down list is shown.
|
int |
getTotalPaddingBottom()
Returns the total bottom padding of the view, including the bottom
Drawable if any, the extra space to keep more than maxLines
from showing, and the vertical offset for gravity, if any.
|
int |
getTotalPaddingEnd()
Returns the total end padding of the view, including the end
Drawable if any.
|
int |
getTotalPaddingLeft()
Returns the total left padding of the view, including the left
Drawable if any.
|
int |
getTotalPaddingRight()
Returns the total right padding of the view, including the right
Drawable if any.
|
int |
getTotalPaddingStart()
Returns the total start padding of the view, including the start
Drawable if any.
|
int |
getTotalPaddingTop()
Returns the total top padding of the view, including the top
Drawable if any, the extra space to keep more than maxLines
from showing, and the vertical offset for gravity, if any.
|
android.text.method.TransformationMethod |
getTransformationMethod() |
android.graphics.Typeface |
getTypeface() |
android.text.style.URLSpan[] |
getUrls()
Returns the list of URLSpans attached to the text
(by
android.text.util.Linkify or otherwise) if any. |
android.widget.AutoCompleteTextView.Validator |
getValidator()
Returns the Validator set with
setValidator(android.widget.AutoCompleteTextView.Validator),
or null if it was not set. |
boolean |
hasOverlappingRendering() |
boolean |
hasSelection()
Return true iff there is a selection inside this text view.
|
protected void |
init(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
boolean |
isCursorVisible() |
boolean |
isInputMethodTarget()
Returns whether this text view is a current input method target.
|
boolean |
isPerformingCompletion()
Identifies whether the view is currently performing a text completion, so subclasses
can decide whether to respond to text changed events.
|
boolean |
isPopupShowing()
Indicates whether the popup menu is showing.
|
boolean |
isSuggestionsEnabled()
Return whether or not suggestions are enabled on this TextView.
|
boolean |
isTextSelectable()
Returns the state of the
textIsSelectable flag (See
setTextIsSelectable()). |
int |
length()
Returns the length, in characters, of the text managed by this TextView
|
boolean |
moveCursorToVisibleOffset()
Move the cursor, if needed, so that it is at an offset that is visible
to the user.
|
void |
onCommitCompletion(android.view.inputmethod.CompletionInfo text)
Called by the framework in response to a text completion from
the current input method, provided by it calling
InputConnection.commitCompletion(). |
void |
onCommitCorrection(android.view.inputmethod.CorrectionInfo info)
Called by the framework in response to a text auto-correction (such as fixing a typo using a
a dictionnary) from the current input method, provided by it calling
InputConnection.commitCorrection(android.view.inputmethod.CorrectionInfo) InputConnection.commitCorrection()}. |
android.view.inputmethod.InputConnection |
onCreateInputConnection(android.view.inputmethod.EditorInfo outAttrs) |
void |
onEditorAction(int actionCode)
Called when an attached input method calls
InputConnection.performEditorAction()
for this text view. |
void |
onFilterComplete(int count)
Only work when autoComplete mode is
AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI |
boolean |
onKeyDown(int keyCode,
android.view.KeyEvent event) |
boolean |
onKeyMultiple(int keyCode,
int repeatCount,
android.view.KeyEvent event) |
boolean |
onKeyPreIme(int keyCode,
android.view.KeyEvent event) |
boolean |
onKeyShortcut(int keyCode,
android.view.KeyEvent event) |
boolean |
onKeyUp(int keyCode,
android.view.KeyEvent event) |
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onRtlPropertiesChanged(int layoutDirection) |
protected void |
onSelectionChanged(int selStart,
int selEnd)
This method is called when the selection has changed, in case any
subclasses would like to know.
|
void |
performCompletion()
Performs the text completion by converting the selected item from
the drop down list into a string, replacing the text box's content with
this string and finally dismissing the drop down menu.
|
protected void |
performFiltering(java.lang.CharSequence text,
int keyCode)
Starts filtering the content of the drop down list.
|
protected void |
performFiltering(java.lang.CharSequence text,
int start,
int end,
int keyCode)
Starts filtering the content of the drop down list.
|
void |
performValidation()
If a validator was set on this view and the current string is not valid,
ask the validator to fix it.
|
void |
removeTextChangedListener(android.text.TextWatcher watcher)
Removes the specified TextWatcher from the list of those whose
methods are called
whenever this TextView's text changes.
|
protected void |
replaceText(java.lang.CharSequence text)
Performs the text completion by replacing the current text by the
selected item.
|
void |
selectAll()
Convenience for
Selection.selectAll(android.text.Spannable). |
<T extends android.widget.ListAdapter & android.widget.Filterable> |
setAdapter(T adapter)
Changes the list of data used for auto completion.
|
void |
setAllCaps(boolean allCaps)
Sets the properties of this field to transform input to ALL CAPS
display.
|
void |
setAutoLinkMask(int mask)
Sets the autolink mask of the text.
|
void |
setCompletionHint(java.lang.CharSequence hint)
Sets the optional hint text that is displayed at the bottom of the
the matching list.
|
void |
setCompoundDrawablePadding(int pad)
Sets the size of the padding between the compound drawables and
the text.
|
void |
setCompoundDrawables(android.graphics.drawable.Drawable left,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable right,
android.graphics.drawable.Drawable bottom)
Sets the Drawables (if any) to appear to the left of, above, to the
right of, and below the text.
|
void |
setCompoundDrawablesRelative(android.graphics.drawable.Drawable start,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable end,
android.graphics.drawable.Drawable bottom)
Sets the Drawables (if any) to appear to the start of, above, to the end
of, and below the text.
|
void |
setCompoundDrawablesRelativeWithIntrinsicBounds(android.graphics.drawable.Drawable start,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable end,
android.graphics.drawable.Drawable bottom)
Sets the Drawables (if any) to appear to the start of, above, to the end
of, and below the text.
|
void |
setCompoundDrawablesRelativeWithIntrinsicBounds(int start,
int top,
int end,
int bottom)
Sets the Drawables (if any) to appear to the start of, above, to the end
of, and below the text.
|
void |
setCompoundDrawablesWithIntrinsicBounds(android.graphics.drawable.Drawable left,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable right,
android.graphics.drawable.Drawable bottom)
Sets the Drawables (if any) to appear to the left of, above, to the
right of, and below the text.
|
void |
setCompoundDrawablesWithIntrinsicBounds(int left,
int top,
int right,
int bottom)
Sets the Drawables (if any) to appear to the left of, above, to the
right of, and below the text.
|
void |
setCursorVisible(boolean visible)
Set whether the cursor is visible.
|
void |
setCustomSelectionActionModeCallback(android.view.ActionMode.Callback actionModeCallback)
If provided, this ActionMode.Callback will be used to create the ActionMode when text
selection is initiated in this View.
|
void |
setDropDownAnchor(int id)
Sets the view to which the auto-complete drop down list should anchor.
|
void |
setDropDownBackgroundDrawable(android.graphics.drawable.Drawable d)
Sets the background of the auto-complete drop-down list.
|
void |
setDropDownBackgroundResource(int id)
Sets the background of the auto-complete drop-down list.
|
void |
setDropDownHeight(int height)
Sets the current height for the auto-complete drop down list.
|
void |
setDropDownHorizontalOffset(int offset)
Sets the horizontal offset used for the auto-complete drop-down list.
|
void |
setDropDownVerticalOffset(int offset)
Sets the vertical offset used for the auto-complete drop-down list.
|
void |
setDropDownWidth(int width)
Sets the current width for the auto-complete drop down list.
|
void |
setEditableFactory(android.text.Editable.Factory factory)
Sets the Factory used to create new Editables.
|
void |
setElegantTextHeight(boolean elegant)
Set the TextView's elegant height metrics flag.
|
void |
setEllipsize(android.text.TextUtils.TruncateAt ellipsis)
Causes words in the text that are longer than the view is wide
to be ellipsized instead of broken in the middle.
|
void |
setEms(int ems)
Makes the TextView exactly this many ems wide
|
void |
setEnabled(boolean enabled) |
void |
setError(java.lang.CharSequence error)
Set the error text of this EditText.
|
void |
setExtractedText(android.view.inputmethod.ExtractedText text)
Apply to this text view the given extracted text, as previously
returned by
extractText(ExtractedTextRequest, ExtractedText). |
void |
setFilters(android.text.InputFilter[] filters)
Sets the list of input filters that will be used if the buffer is
Editable.
|
void |
setFontFeatureSettings(java.lang.String fontFeatureSettings)
Sets font feature settings.
|
void |
setFreezesText(boolean freezesText)
Control whether this text view saves its entire text contents when
freezing to an icicle, in addition to dynamic state such as cursor
position.
|
void |
setGravity(int gravity)
Sets the horizontal alignment of the text and the
vertical gravity that will be used when there is extra space
in the TextView beyond what is required for the text itself.
|
void |
setHelper(java.lang.CharSequence helper)
Set the helper text of this EditText.
|
void |
setHighlightColor(int color)
Sets the color used to display the selection highlight.
|
void |
setHint(java.lang.CharSequence hint)
Sets the text to be displayed when the text of the TextView is empty.
|
void |
setHint(int resid)
Sets the text to be displayed when the text of the TextView is empty,
from a resource.
|
void |
setHintTextColor(android.content.res.ColorStateList colors)
Sets the color of the hint text.
|
void |
setHintTextColor(int color)
Sets the color of the hint text for all the states (disabled, focussed, selected...) of this
TextView.
|
void |
setHorizontallyScrolling(boolean whether)
Sets whether the text should be allowed to be wider than the
View is.
|
void |
setImeActionLabel(java.lang.CharSequence label,
int actionId)
Change the custom IME action associated with the text view, which
will be reported to an IME with
EditorInfo.actionLabel
and EditorInfo.actionId when it has focus. |
void |
setImeOptions(int imeOptions)
Change the editor type integer associated with the text view, which
will be reported to an IME with
EditorInfo.imeOptions when it
has focus. |
void |
setIncludeFontPadding(boolean includepad)
Set whether the TextView includes extra top and bottom padding to make
room for accents that go above the normal ascent and descent.
|
void |
setInputExtras(int xmlResId)
Set the extra input data of the text, which is the
TextBoxAttribute.extras
Bundle that will be filled in when creating an input connection. |
void |
setInputType(int type)
Set the type of the content with a constant as defined for
EditorInfo.inputType. |
void |
setKeyListener(android.text.method.KeyListener input)
Sets the key listener to be used with this TextView.
|
void |
setLetterSpacing(float letterSpacing)
Sets text letter-spacing.
|
void |
setLines(int lines)
Makes the TextView exactly this many lines tall.
|
void |
setLineSpacing(float add,
float mult)
Sets line spacing for this TextView.
|
void |
setLinksClickable(boolean whether)
Sets whether the movement method will automatically be set to
LinkMovementMethod if setAutoLinkMask(int) has been
set to nonzero and links are detected in setText(java.lang.CharSequence, com.rey.material.widget.TextView.BufferType). |
void |
setLinkTextColor(android.content.res.ColorStateList colors)
Sets the color of links in the text.
|
void |
setLinkTextColor(int color)
Sets the color of links in the text.
|
void |
setListSelection(int position)
Set the position of the dropdown view selection.
|
void |
setMarqueeRepeatLimit(int marqueeLimit)
Sets how many times to repeat the marquee animation.
|
void |
setMaxEms(int maxems)
Makes the TextView at most this many ems wide
|
void |
setMaxHeight(int maxHeight)
Makes the TextView at most this many pixels tall.
|
void |
setMaxLines(int maxlines)
Makes the TextView at most this many lines tall.
|
void |
setMaxWidth(int maxpixels)
Makes the TextView at most this many pixels wide
|
void |
setMinEms(int minems)
Makes the TextView at least this many ems wide
|
void |
setMinHeight(int minHeight)
Makes the TextView at least this many pixels tall.
|
void |
setMinLines(int minlines)
Makes the TextView at least this many lines tall.
|
void |
setMinWidth(int minpixels)
Makes the TextView at least this many pixels wide
|
void |
setMovementMethod(android.text.method.MovementMethod movement)
Sets the movement method (arrow key handler) to be used for
this TextView.
|
void |
setOnEditorActionListener(com.rey.material.widget.TextView.OnEditorActionListener l)
Set a special listener to be called when an action is performed
on the text view.
|
void |
setOnFocusChangeListener(android.view.View.OnFocusChangeListener l)
Register a callback to be invoked when focus of this view changed.
|
void |
setOnItemClickListener(android.widget.AdapterView.OnItemClickListener l)
Sets the listener that will be notified when the user clicks an item
in the drop down list.
|
void |
setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener l)
Sets the listener that will be notified when the user selects an item
in the drop down list.
|
void |
setOnKeyListener(android.view.View.OnKeyListener l)
Register a callback to be invoked when a hardware key is pressed in this view.
|
void |
setOnSelectionChangedListener(TextView.OnSelectionChangedListener listener) |
void |
setRawInputType(int type)
Directly change the content type integer of the text view, without
modifying any other state.
|
void |
setScroller(android.widget.Scroller s) |
void |
setSelectAllOnFocus(boolean selectAllOnFocus)
Set the TextView so that when it takes focus, all the text is
selected.
|
void |
setSelected(boolean selected) |
void |
setSelection(int index)
Convenience for
Selection.setSelection(Spannable, int). |
void |
setSelection(int start,
int stop)
Convenience for
Selection.setSelection(Spannable, int, int). |
void |
setShadowLayer(float radius,
float dx,
float dy,
int color)
Gives the text a shadow of the specified blur radius and color, the specified
distance from its drawn position.
|
void |
setShowSoftInputOnFocus(boolean show)
Sets whether the soft input method will be made visible when this
TextView gets focused.
|
void |
setSingleLine()
Sets the properties of this field (lines, horizontally scrolling,
transformation method) to be for a single-line input.
|
void |
setSpannableFactory(android.text.Spannable.Factory factory)
Sets the Factory used to create new Spannables.
|
void |
setText(char[] text,
int start,
int len) |
void |
setText(java.lang.CharSequence text) |
void |
setText(java.lang.CharSequence text,
com.rey.material.widget.TextView.BufferType type) |
void |
setText(int resid) |
void |
setText(int resid,
com.rey.material.widget.TextView.BufferType type) |
void |
setTextAppearance(android.content.Context context,
int resid)
Sets the text color, size, style, hint color, and highlight color
from the specified TextAppearance resource.
|
void |
setTextColor(android.content.res.ColorStateList colors)
Sets the text color.
|
void |
setTextColor(int color)
Sets the text color for all the states (normal, selected,
focused) to be this color.
|
void |
setTextIsSelectable(boolean selectable)
Sets whether the content of this view is selectable by the user.
|
void |
setTextKeepState(java.lang.CharSequence text)
Like
setText(CharSequence),
except that the cursor position (if any) is retained in the new text. |
void |
setTextKeepState(java.lang.CharSequence text,
com.rey.material.widget.TextView.BufferType type)
Like
#setText(CharSequence, TextView.BufferType),
except that the cursor position (if any) is retained in the new text. |
void |
setTextLocale(java.util.Locale locale)
Set the default
Locale of the text in this TextView to the given value. |
void |
setTextScaleX(float size)
Sets the extent by which text should be stretched horizontally.
|
void |
setTextSize(float size)
Set the default text size to the given value, interpreted as "scaled
pixel" units.
|
void |
setTextSize(int unit,
float size)
Set the default text size to a given unit and value.
|
void |
setThreshold(int threshold)
Specifies the minimum number of characters the user has to type in the
edit box before the drop down list is shown.
|
void |
setTokenizer(android.widget.MultiAutoCompleteTextView.Tokenizer t)
Sets the Tokenizer that will be used to determine the relevant
range of the text where the user is typing.
|
void |
setTransformationMethod(android.text.method.TransformationMethod method)
Sets the transformation that is applied to the text that this
TextView is displaying.
|
void |
setTypeface(android.graphics.Typeface tf)
Sets the typeface and style in which the text should be displayed.
|
void |
setTypeface(android.graphics.Typeface tf,
int style)
Sets the typeface and style in which the text should be displayed,
and turns on the fake bold and italic bits in the Paint if the
Typeface that you provided does not have all the bits in the
style that you specified.
|
void |
setValidator(android.widget.AutoCompleteTextView.Validator validator)
Sets the validator used to perform text validation.
|
void |
showDropDown()
Displays the drop down on screen.
|
applyStyle, getRippleManager, onAttachedToWindow, onDetachedFromWindow, onThemeChanged, onTouchEvent, setBackgroundDrawable, setOnClickListenercheckLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedStateaddChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasNestedScrollingParent, hasOnClickListeners, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyLongPress, onOverScrolled, onPopulateAccessibilityEvent, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setForeground, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnGenericMotionListener, setOnHoverListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonThemeChangedcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows, requestLayoutprotected int mSupportMode
protected int mAutoCompleteMode
public static final int SUPPORT_MODE_NONE
public static final int SUPPORT_MODE_HELPER
public static final int SUPPORT_MODE_HELPER_WITH_ERROR
public static final int SUPPORT_MODE_CHAR_COUNTER
public static final int AUTOCOMPLETE_MODE_NONE
public static final int AUTOCOMPLETE_MODE_SINGLE
public static final int AUTOCOMPLETE_MODE_MULTI
protected com.rey.material.widget.EditText.LabelView mLabelView
protected android.widget.EditText mInputView
protected com.rey.material.widget.EditText.LabelView mSupportView
public EditText(android.content.Context context)
public EditText(android.content.Context context,
android.util.AttributeSet attrs)
public EditText(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
protected void init(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
init in class FrameLayoutprotected void applyStyle(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
applyStyle in class FrameLayoutpublic void onRtlPropertiesChanged(int layoutDirection)
onRtlPropertiesChanged in class android.view.Viewprotected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onMeasure in class android.widget.FrameLayoutprotected void onLayout(boolean changed,
int l,
int t,
int r,
int b)
onLayout in class android.widget.FrameLayoutpublic void setHelper(java.lang.CharSequence helper)
SUPPORT_MODE_HELPER and SUPPORT_MODE_HELPER_WITH_ERROR.helper - The helper text.public java.lang.CharSequence getHelper()
public void setError(java.lang.CharSequence error)
SUPPORT_MODE_HELPER and SUPPORT_MODE_HELPER_WITH_ERROR.error - The error text. Set null will clear the error.public java.lang.CharSequence getError()
public void clearError()
SUPPORT_MODE_HELPER and SUPPORT_MODE_HELPER_WITH_ERROR.protected java.lang.CharSequence convertSelectionToString(java.lang.Object selectedItem)
Converts the selected item from the drop down list into a sequence of character that can be used in the edit box.
selectedItem - the item selected by the user for completionprotected void performFiltering(java.lang.CharSequence text,
int keyCode)
Starts filtering the content of the drop down list. The filtering
pattern is the content of the edit box. Subclasses should override this
method to filter with a different pattern, for instance a substring of
text.
text - the filtering patternkeyCode - the last character inserted in the edit box; beware that
this will be null when text is being added through a soft input method.protected void replaceText(java.lang.CharSequence text)
Performs the text completion by replacing the current text by the selected item. Subclasses should override this method to avoid replacing the whole content of the edit box.
text - the selected suggestion in the drop down listprotected android.widget.Filter getFilter()
Filterable.getFilter(),
or null if setAdapter(T) was not called with
a Filterable.protected void performFiltering(java.lang.CharSequence text,
int start,
int end,
int keyCode)
Starts filtering the content of the drop down list. The filtering
pattern is the specified range of text from the edit box. Subclasses may
override this method to filter with a different pattern, for
instance a smaller substring of text.
public void setCompletionHint(java.lang.CharSequence hint)
Sets the optional hint text that is displayed at the bottom of the the matching list. This can be used as a cue to the user on how to best use the list, or to provide extra information.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
hint - the text to be displayed to the usergetCompletionHint()public java.lang.CharSequence getCompletionHint()
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
setCompletionHint(CharSequence)public int getDropDownWidth()
Returns the current width for the auto-complete drop down list. This can
be a fixed width, or ViewGroup.LayoutParams#MATCH_PARENT to fill the screen, or
ViewGroup.LayoutParams#WRAP_CONTENT to fit the width of its anchor view.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setDropDownWidth(int width)
Sets the current width for the auto-complete drop down list. This can
be a fixed width, or ViewGroup.LayoutParams#MATCH_PARENT to fill the screen, or
ViewGroup.LayoutParams#WRAP_CONTENT to fit the width of its anchor view.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
width - the width to usepublic int getDropDownHeight()
Returns the current height for the auto-complete drop down list. This can
be a fixed height, or ViewGroup.LayoutParams#MATCH_PARENT to fill
the screen, or ViewGroup.LayoutParams#WRAP_CONTENT to fit the height
of the drop down's content.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setDropDownHeight(int height)
Sets the current height for the auto-complete drop down list. This can
be a fixed height, or ViewGroup.LayoutParams#MATCH_PARENT to fill
the screen, or ViewGroup.LayoutParams#WRAP_CONTENT to fit the height
of the drop down's content.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
height - the height to usepublic int getDropDownAnchor()
Returns the id for the view that the auto-complete drop down list is anchored to.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
View.NO_ID if none specifiedpublic void setDropDownAnchor(int id)
Sets the view to which the auto-complete drop down list should anchor. The view corresponding to this id will not be loaded until the next time it is needed to avoid loading a view which is not yet instantiated.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
id - the id to anchor the drop down list view topublic android.graphics.drawable.Drawable getDropDownBackground()
Gets the background of the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setDropDownBackgroundDrawable(android.graphics.drawable.Drawable d)
Sets the background of the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
d - the drawable to set as the backgroundpublic void setDropDownBackgroundResource(int id)
Sets the background of the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
id - the id of the drawable to set as the backgroundpublic void setDropDownVerticalOffset(int offset)
Sets the vertical offset used for the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
offset - the vertical offsetpublic int getDropDownVerticalOffset()
Gets the vertical offset used for the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setDropDownHorizontalOffset(int offset)
Sets the horizontal offset used for the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
offset - the horizontal offsetpublic int getDropDownHorizontalOffset()
Gets the horizontal offset used for the auto-complete drop-down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public int getThreshold()
Returns the number of characters the user must type before the drop down list is shown.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
setThreshold(int)public void setThreshold(int threshold)
Specifies the minimum number of characters the user has to type in the edit box before the drop down list is shown.
When threshold is less than or equals 0, a threshold of
1 is applied.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
threshold - the number of characters to type before the drop down
is showngetThreshold()public void setOnItemClickListener(android.widget.AdapterView.OnItemClickListener l)
Sets the listener that will be notified when the user clicks an item in the drop down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
l - the item click listenerpublic void setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener l)
Sets the listener that will be notified when the user selects an item in the drop down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
l - the item selected listenerpublic android.widget.AdapterView.OnItemClickListener getOnItemClickListener()
Returns the listener that is notified whenever the user clicks an item in the drop down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public android.widget.AdapterView.OnItemSelectedListener getOnItemSelectedListener()
Returns the listener that is notified whenever the user selects an item in the drop down list.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public android.widget.ListAdapter getAdapter()
Returns a filterable list adapter used for auto completion.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public <T extends android.widget.ListAdapter & android.widget.Filterable> void setAdapter(T adapter)
Changes the list of data used for auto completion. The provided list must be a filterable list adapter.
The caller is still responsible for managing any resources used by the adapter.
Notably, when the AutoCompleteTextView is closed or released, the adapter is not notified.
A common case is the use of CursorAdapter, which
contains a Cursor that must be closed. This can be done
automatically (see
startManagingCursor()),
or by manually closing the cursor when the AutoCompleteTextView is dismissed.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
adapter - the adapter holding the auto completion datagetAdapter(),
Filterable,
ListAdapterpublic boolean enoughToFilter()
true if the amount of text in the field meets
or exceeds the getThreshold() requirement. You can override
this to impose a different standard for when filtering will be
triggered.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public boolean isPopupShowing()
Indicates whether the popup menu is showing.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void clearListSelection()
Clear the list selection. This may only be temporary, as user input will often bring it back.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setListSelection(int position)
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
position - The position to move the selector to.public int getListSelection()
ListView.INVALID_POSITION if there is no dropdown or if
there is no selection.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
ListView.INVALID_POSITION if not.ListView#getSelectedItemPosition()public void performCompletion()
Performs the text completion by converting the selected item from the drop down list into a string, replacing the text box's content with this string and finally dismissing the drop down menu.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public boolean isPerformingCompletion()
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void onFilterComplete(int count)
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void dismissDropDown()
Closes the drop down if present on screen.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void showDropDown()
Displays the drop down on screen.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setValidator(android.widget.AutoCompleteTextView.Validator validator)
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
validator - The validator used to validate the text entered in this widget.getValidator(),
performValidation()public android.widget.AutoCompleteTextView.Validator getValidator()
setValidator(android.widget.AutoCompleteTextView.Validator),
or null if it was not set.
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void performValidation()
Only work when autoComplete mode is AUTOCOMPLETE_MODE_SINGLE or AUTOCOMPLETE_MODE_MULTI
public void setTokenizer(android.widget.MultiAutoCompleteTextView.Tokenizer t)
Only work when autoCompleMode is AUTOCOMPLETE_MODE_MULTI
public void setEnabled(boolean enabled)
setEnabled in class android.view.Viewpublic void extendSelection(int index)
Selection.extendSelection(android.text.Spannable, int).public android.text.Editable getText()
public void selectAll()
Selection.selectAll(android.text.Spannable).public void setEllipsize(android.text.TextUtils.TruncateAt ellipsis)
setSingleLine() or setHorizontallyScrolling(boolean)
to constrain the text to a single line. Use null
to turn off ellipsizing.
If setMaxLines(int) has been used to set two or more lines,
only TextUtils.TruncateAt.END and
TextUtils.TruncateAt.MARQUEE are supported
(other ellipsizing types will not do anything).public void setSelection(int index)
Selection.setSelection(Spannable, int).public void setSelection(int start,
int stop)
Selection.setSelection(Spannable, int, int).public void setText(java.lang.CharSequence text,
com.rey.material.widget.TextView.BufferType type)
public void addTextChangedListener(android.text.TextWatcher textWatcher)
In 1.0, the TextWatcher.afterTextChanged(android.text.Editable) method was erroneously
not called after setText(java.lang.CharSequence, com.rey.material.widget.TextView.BufferType) calls. Now, doing setText(java.lang.CharSequence, com.rey.material.widget.TextView.BufferType)
if there are any text changed listeners forces the buffer type to
Editable if it would not otherwise be and does call this method.
public final void append(java.lang.CharSequence text)
public void append(java.lang.CharSequence text,
int start,
int end)
public void beginBatchEdit()
public boolean bringPointIntoView(int offset)
public void cancelLongPress()
cancelLongPress in class android.view.Viewpublic void clearComposingText()
BaseInputConnection.removeComposingSpans() to remove any IME composing
state from this text view.public void computeScroll()
computeScroll in class android.view.Viewpublic void debug(int depth)
debug in class android.view.ViewGrouppublic boolean didTouchFocusSelect()
public void endBatchEdit()
public boolean extractText(android.view.inputmethod.ExtractedTextRequest request,
android.view.inputmethod.ExtractedText outText)
public void findViewsWithText(java.util.ArrayList<android.view.View> outViews,
java.lang.CharSequence searched,
int flags)
findViewsWithText in class android.view.ViewGrouppublic final int getAutoLinkMask()
Linkify.ALL and peers for
possible values.public int getBaseline()
getBaseline in class android.view.Viewpublic int getCompoundDrawablePadding()
public android.graphics.drawable.Drawable[] getCompoundDrawables()
public android.graphics.drawable.Drawable[] getCompoundDrawablesRelative()
public int getCompoundPaddingBottom()
public int getCompoundPaddingEnd()
public int getCompoundPaddingLeft()
public int getCompoundPaddingRight()
public int getCompoundPaddingStart()
public int getCompoundPaddingTop()
public final int getCurrentHintTextColor()
Return the current color selected to paint the hint text.
public final int getCurrentTextColor()
Return the current color selected for normal text.
public android.view.ActionMode.Callback getCustomSelectionActionModeCallback()
setCustomSelectionActionModeCallback(android.view.ActionMode.Callback). Default is null.public android.text.Editable getEditableText()
getText()public android.text.TextUtils.TruncateAt getEllipsize()
public int getExtendedPaddingBottom()
public int getExtendedPaddingTop()
public android.text.InputFilter[] getFilters()
public void getFocusedRect(android.graphics.Rect r)
getFocusedRect in class android.view.Viewpublic java.lang.String getFontFeatureSettings()
setFontFeatureSettings(String),
Paint.setFontFeatureSettings(java.lang.String)public boolean getFreezesText()
setFreezesText(boolean)public int getGravity()
Gravitypublic int getHighlightColor()
setHighlightColor(int)public java.lang.CharSequence getHint()
public final android.content.res.ColorStateList getHintTextColors()
setHintTextColor(ColorStateList),
setHintTextColor(int),
setTextColor(ColorStateList),
setLinkTextColor(ColorStateList)public int getImeActionId()
setImeActionLabel(java.lang.CharSequence, int).setImeActionLabel(java.lang.CharSequence, int),
EditorInfopublic java.lang.CharSequence getImeActionLabel()
setImeActionLabel(java.lang.CharSequence, int).setImeActionLabel(java.lang.CharSequence, int),
EditorInfopublic int getImeOptions()
setImeOptions(int),
EditorInfopublic boolean getIncludeFontPadding()
setIncludeFontPadding(boolean)public android.os.Bundle getInputExtras(boolean create)
create - If true, the extras will be created if they don't already
exist. Otherwise, null will be returned if none have been created.setInputExtras(int),
EditorInfo.extraspublic int getInputType()
setInputType(int),
InputTypepublic final android.text.method.KeyListener getKeyListener()
public final android.text.Layout getLayout()
public float getLetterSpacing()
setLetterSpacing(float),
Paint.setLetterSpacing(float)public int getLineBounds(int line,
android.graphics.Rect bounds)
line - which line to examine (0..getLineCount() - 1)bounds - Optional. If not null, it returns the extent of the linepublic int getLineCount()
public int getLineHeight()
public float getLineSpacingExtra()
setLineSpacing(float, float),
getLineSpacingMultiplier()public float getLineSpacingMultiplier()
setLineSpacing(float, float),
getLineSpacingExtra()public final android.content.res.ColorStateList getLinkTextColors()
setLinkTextColor(ColorStateList),
setLinkTextColor(int)public final boolean getLinksClickable()
LinkMovementMethod if setAutoLinkMask(int) has been
set to nonzero and links are detected in setText(java.lang.CharSequence, com.rey.material.widget.TextView.BufferType).
The default is true.public int getMarqueeRepeatLimit()
setMarqueeRepeatLimit(int)public int getMaxEms()
setMaxWidth(int) or #setWidth(int)).setMaxEms(int),
setEms(int)public int getMaxHeight()
or #setLines(int).setMaxHeight(int)public int getMaxLines()
or #setDividerHeight(int).setMaxLines(int)public int getMaxWidth()
setMaxEms(int) or setEms(int)).setMaxWidth(int),
#setWidth(int)public int getMinEms()
setMinWidth(int) or #setWidth(int)).setMinEms(int),
setEms(int)public int getMinHeight()
or #setLines(int).setMinHeight(int)public int getMinLines()
or #setDividerHeight(int).setMinLines(int)public int getMinWidth()
setMinEms(int) or setEms(int)).setMinWidth(int),
#setWidth(int)public final android.text.method.MovementMethod getMovementMethod()
public int getOffsetForPosition(float x,
float y)
MotionEvent.getX() and MotionEvent.getY() to this method.x - The horizontal absolute position of a point on screeny - The vertical absolute position of a point on screenprotected float convertToLocalHorizontalCoordinate(float x)
protected int getLineAtCoordinate(float y)
protected int getOffsetAtCoordinate(int line,
float x)
public android.text.TextPaint getPaint()
public int getPaintFlags()
Paint.getFlags()public java.lang.String getPrivateImeOptions()
#setPrivateImeOptions(String),
EditorInfo.privateImeOptionspublic int getSelectionEnd()
Selection.getSelectionEnd(java.lang.CharSequence).public int getSelectionStart()
Selection.getSelectionStart(java.lang.CharSequence).public int getShadowColor()
setShadowLayer(float, float, float, int)public float getShadowDx()
setShadowLayer(float, float, float, int)public float getShadowDy()
setShadowLayer(float, float, float, int)public float getShadowRadius()
setShadowLayer(float, float, float, int)public final boolean getShowSoftInputOnFocus()
public final android.content.res.ColorStateList getTextColors()
public java.util.Locale getTextLocale()
Locale of the text in this TextView.Locale of the text in this TextView.public float getTextScaleX()
public float getTextSize()
public int getTotalPaddingBottom()
public int getTotalPaddingEnd()
public int getTotalPaddingLeft()
public int getTotalPaddingRight()
public int getTotalPaddingStart()
public int getTotalPaddingTop()
public final android.text.method.TransformationMethod getTransformationMethod()
public android.graphics.Typeface getTypeface()
setTypeface(Typeface)public android.text.style.URLSpan[] getUrls()
android.text.util.Linkify or otherwise) if any. You can call
URLSpan.getURL() on them to find where they link to
or use Spanned.getSpanStart(java.lang.Object) and Spanned.getSpanEnd(java.lang.Object)
to find the region of the text they are attached to.public boolean hasOverlappingRendering()
hasOverlappingRendering in class android.view.Viewpublic boolean hasSelection()
public boolean isCursorVisible()
setCursorVisible(boolean)public boolean isInputMethodTarget()
InputMethodManager.public boolean isSuggestionsEnabled()
SuggestionSpans to the text.
When suggestions are enabled (default), this list of suggestions will be displayed when the
user asks for them on these parts of the text. This value depends on the inputType of this
TextView.
The class of the input type must be InputType.TYPE_CLASS_TEXT.
In addition, the type variation must be one of
InputType.TYPE_TEXT_VARIATION_NORMAL,
InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT,
InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE,
InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE or
InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT.
And finally, the InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS flag must not be set.public boolean isTextSelectable()
textIsSelectable flag (See
setTextIsSelectable()). Although you have to set this flag
to allow users to select and copy text in a non-editable TextView, the content of an
EditText can always be selected, independently of the value of this flag.
public int length()
public boolean moveCursorToVisibleOffset()
public void onCommitCompletion(android.view.inputmethod.CompletionInfo text)
InputConnection.commitCompletion(). The default implementation does
nothing; text views that are supporting auto-completion should override
this to do their desired behavior.text - The auto complete text the user has selected.public void onCommitCorrection(android.view.inputmethod.CorrectionInfo info)
InputConnection.commitCorrection(android.view.inputmethod.CorrectionInfo) InputConnection.commitCorrection()}. The default
implementation flashes the background of the corrected word to provide feedback to the user.info - The auto correct info about the text that was corrected.public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo outAttrs)
onCreateInputConnection in class android.view.Viewpublic void onEditorAction(int actionCode)
InputConnection.performEditorAction()
for this text view. The default implementation will call your action
listener supplied to setOnEditorActionListener(com.rey.material.widget.TextView.OnEditorActionListener), or perform
a standard operation for EditorInfo.IME_ACTION_NEXT, EditorInfo.IME_ACTION_PREVIOUS, or EditorInfo.IME_ACTION_DONE.
For backwards compatibility, if no IME options have been set and the text view would not normally advance focus on enter, then the NEXT and DONE actions received here will be turned into an enter key down/up pair to go through the normal key handling.
actionCode - The code of the action being performed.setOnEditorActionListener(com.rey.material.widget.TextView.OnEditorActionListener)public boolean onKeyDown(int keyCode,
android.view.KeyEvent event)
onKeyDown in interface android.view.KeyEvent.CallbackonKeyDown in class android.view.Viewpublic boolean onKeyMultiple(int keyCode,
int repeatCount,
android.view.KeyEvent event)
onKeyMultiple in interface android.view.KeyEvent.CallbackonKeyMultiple in class android.view.Viewpublic boolean onKeyPreIme(int keyCode,
android.view.KeyEvent event)
onKeyPreIme in class android.view.Viewpublic boolean onKeyShortcut(int keyCode,
android.view.KeyEvent event)
onKeyShortcut in class android.view.Viewpublic boolean onKeyUp(int keyCode,
android.view.KeyEvent event)
onKeyUp in interface android.view.KeyEvent.CallbackonKeyUp in class android.view.Viewpublic void setOnSelectionChangedListener(TextView.OnSelectionChangedListener listener)
protected void onSelectionChanged(int selStart,
int selEnd)
selStart - The new selection start location.selEnd - The new selection end location.public void removeTextChangedListener(android.text.TextWatcher watcher)
public void setAllCaps(boolean allCaps)
public final void setAutoLinkMask(int mask)
Linkify.ALL and peers for
possible values.public void setCompoundDrawablePadding(int pad)
public void setCompoundDrawables(android.graphics.drawable.Drawable left,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable right,
android.graphics.drawable.Drawable bottom)
null if you do not want a
Drawable there. The Drawables must already have had
Drawable.setBounds(int, int, int, int) called.
Calling this method will overwrite any Drawables previously set using
setCompoundDrawablesRelative(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable) or related methods.
public void setCompoundDrawablesRelative(android.graphics.drawable.Drawable start,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable end,
android.graphics.drawable.Drawable bottom)
null if you do not want a Drawable
there. The Drawables must already have had Drawable.setBounds(int, int, int, int)
called.
Calling this method will overwrite any Drawables previously set using
setCompoundDrawables(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable) or related methods.
public void setCompoundDrawablesRelativeWithIntrinsicBounds(android.graphics.drawable.Drawable start,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable end,
android.graphics.drawable.Drawable bottom)
null if you do not want a Drawable
there. The Drawables' bounds will be set to their intrinsic bounds.
Calling this method will overwrite any Drawables previously set using
setCompoundDrawables(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable) or related methods.
public void setCompoundDrawablesRelativeWithIntrinsicBounds(int start,
int top,
int end,
int bottom)
Calling this method will overwrite any Drawables previously set using
setCompoundDrawables(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable) or related methods.
start - Resource identifier of the start Drawable.top - Resource identifier of the top Drawable.end - Resource identifier of the end Drawable.bottom - Resource identifier of the bottom Drawable.public void setCompoundDrawablesWithIntrinsicBounds(android.graphics.drawable.Drawable left,
android.graphics.drawable.Drawable top,
android.graphics.drawable.Drawable right,
android.graphics.drawable.Drawable bottom)
null if you do not want a
Drawable there. The Drawables' bounds will be set to their intrinsic
bounds.
Calling this method will overwrite any Drawables previously set using
setCompoundDrawablesRelative(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable) or related methods.
public void setCompoundDrawablesWithIntrinsicBounds(int left,
int top,
int right,
int bottom)
Calling this method will overwrite any Drawables previously set using
setCompoundDrawablesRelative(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, android.graphics.drawable.Drawable) or related methods.
left - Resource identifier of the left Drawable.top - Resource identifier of the top Drawable.right - Resource identifier of the right Drawable.bottom - Resource identifier of the bottom Drawable.public void setCursorVisible(boolean visible)
isCursorVisible()public void setCustomSelectionActionModeCallback(android.view.ActionMode.Callback actionModeCallback)
ActionMode.Callback#onPrepareActionMode(ActionMode, android.view.Menu) method. The
default actions can also be removed from the menu using Menu.removeItem(int) and
passing R.id.selectAll, R.id.cut, R.id.copy
or R.id.paste ids as parameters.
Returning false from
ActionMode.Callback#onCreateActionMode(ActionMode, android.view.Menu) will prevent
the action mode from being started.
Action click events should be handled by the custom implementation of
ActionMode.Callback#onActionItemClicked(ActionMode, android.view.MenuItem).
Note that text selection mode is not started when a TextView receives focus and the
R.attr.selectAllOnFocus flag has been set. The content is highlighted in
that case, to allow for quick replacement.public final void setEditableFactory(android.text.Editable.Factory factory)
public void setElegantTextHeight(boolean elegant)
elegant - set the paint's elegant metrics flag.public void setEms(int ems)
setMaxEms(int),
setMinEms(int),
getMinEms(),
getMaxEms()public void setExtractedText(android.view.inputmethod.ExtractedText text)
extractText(ExtractedTextRequest, ExtractedText).public void setFilters(android.text.InputFilter[] filters)
public void setFontFeatureSettings(java.lang.String fontFeatureSettings)
fontFeatureSettings - font feature settings represented as CSS compatible stringgetFontFeatureSettings(),
Paint.getFontFeatureSettings()public void setFreezesText(boolean freezesText)
freezesText - Controls whether a frozen icicle should include the
entire text data: true to include it, false to not.public void setGravity(int gravity)
Gravitypublic void setHighlightColor(int color)
public final void setHint(java.lang.CharSequence hint)
public final void setHint(int resid)
public final void setHintTextColor(android.content.res.ColorStateList colors)
public final void setHintTextColor(int color)
public void setHorizontallyScrolling(boolean whether)
public void setImeActionLabel(java.lang.CharSequence label,
int actionId)
EditorInfo.actionLabel
and EditorInfo.actionId when it has focus.getImeActionLabel(),
getImeActionId(),
EditorInfopublic void setImeOptions(int imeOptions)
EditorInfo.imeOptions when it
has focus.getImeOptions(),
EditorInfopublic void setIncludeFontPadding(boolean includepad)
getIncludeFontPadding()public void setInputExtras(int xmlResId)
throws org.xmlpull.v1.XmlPullParserException,
java.io.IOException
TextBoxAttribute.extras
Bundle that will be filled in when creating an input connection. The
given integer is the resource ID of an XML resource holding an
<input-extras> XML tree.org.xmlpull.v1.XmlPullParserExceptionjava.io.IOExceptiongetInputExtras(boolean),
EditorInfo.extraspublic void setInputType(int type)
EditorInfo.inputType. This
will take care of changing the key listener, by calling setKeyListener(KeyListener),
to match the given content type. If the given content type is InputType.TYPE_NULL
then a soft keyboard will not be displayed for this text view.
Note that the maximum number of displayed lines (see setMaxLines(int)) will be
modified if you change the InputType.TYPE_TEXT_FLAG_MULTI_LINE flag of the input
type.getInputType(),
setRawInputType(int),
InputTypepublic void setKeyListener(android.text.method.KeyListener input)
KeyListener.getContentType()
for important details. Calling this method will replace the current
content type of the text view with the content type returned by the
key listener.
Be warned that if you want a TextView with a key listener or movement
method not to be focusable, or if you want a TextView without a
key listener or movement method to be focusable, you must call
View.setFocusable(boolean) again after calling this to get the focusability
back the way you want it.
public void setLetterSpacing(float letterSpacing)
getLetterSpacing(),
Paint.getLetterSpacing()public void setLineSpacing(float add,
float mult)
mult and have add added to it.public void setLines(int lines)
public final void setLinkTextColor(android.content.res.ColorStateList colors)
public final void setLinkTextColor(int color)
public final void setLinksClickable(boolean whether)
LinkMovementMethod if setAutoLinkMask(int) has been
set to nonzero and links are detected in setText(java.lang.CharSequence, com.rey.material.widget.TextView.BufferType).
The default is true.public void setMarqueeRepeatLimit(int marqueeLimit)
getMarqueeRepeatLimit()public void setMaxEms(int maxems)
public void setMaxHeight(int maxHeight)
setMaxLines(int) method.
Setting this value overrides any other (maximum) number of lines setting.public void setMaxLines(int maxlines)
public void setMaxWidth(int maxpixels)
public void setMinEms(int minems)
public void setMinHeight(int minHeight)
public void setMinLines(int minlines)
getMinLines()public void setMinWidth(int minpixels)
public final void setMovementMethod(android.text.method.MovementMethod movement)
Be warned that if you want a TextView with a key listener or movement
method not to be focusable, or if you want a TextView without a
key listener or movement method to be focusable, you must call
View.setFocusable(boolean) again after calling this to get the focusability
back the way you want it.
public void setOnEditorActionListener(com.rey.material.widget.TextView.OnEditorActionListener l)
public void setOnKeyListener(android.view.View.OnKeyListener l)
setOnKeyListener in class android.view.Viewl - the key listener to attach to this viewpublic void setOnFocusChangeListener(android.view.View.OnFocusChangeListener l)
setOnFocusChangeListener in class android.view.Viewl - The callback that will run.public void setRawInputType(int type)
setInputType(int),
InputTypepublic void setScroller(android.widget.Scroller s)
public void setSelectAllOnFocus(boolean selectAllOnFocus)
public void setSelected(boolean selected)
setSelected in class android.view.Viewpublic void setShadowLayer(float radius,
float dx,
float dy,
int color)
The text shadow produced does not interact with the properties on view
that are responsible for real time shadows,
elevation and
translationZ.
Paint.setShadowLayer(float, float, float, int)public final void setShowSoftInputOnFocus(boolean show)
public void setSingleLine()
public final void setSpannableFactory(android.text.Spannable.Factory factory)
public final void setText(int resid)
public final void setText(char[] text,
int start,
int len)
public final void setText(int resid,
com.rey.material.widget.TextView.BufferType type)
public final void setText(java.lang.CharSequence text)
public void setTextAppearance(android.content.Context context,
int resid)
public void setTextColor(android.content.res.ColorStateList colors)
public void setTextColor(int color)
setTextColor(ColorStateList),
getTextColors()public void setTextIsSelectable(boolean selectable)
false, meaning that the content is not selectable.
When you use a TextView to display a useful piece of information to the user (such as a
contact's address), make it selectable, so that the user can select and copy its
content. You can also use set the XML attribute
android.R.styleable#TextView_textIsSelectable to "true".
When you call this method to set the value of textIsSelectable, it sets
the flags focusable, focusableInTouchMode, clickable,
and longClickable to the same value. These flags correspond to the attributes
android:focusable,
android:focusableInTouchMode,
android:clickable, and
android:longClickable. To restore any of these
flags to a state you had set previously, call one or more of the following methods:
setFocusable(),
setFocusableInTouchMode(),
setClickable() or
setLongClickable().
selectable - Whether the content of this TextView should be selectable.public final void setTextKeepState(java.lang.CharSequence text)
setText(CharSequence),
except that the cursor position (if any) is retained in the new text.text - The new text to place in the text view.setText(CharSequence)public final void setTextKeepState(java.lang.CharSequence text,
com.rey.material.widget.TextView.BufferType type)
#setText(CharSequence, TextView.BufferType),
except that the cursor position (if any) is retained in the new text.#setText(CharSequence, TextView.BufferType)public void setTextLocale(java.util.Locale locale)
Locale of the text in this TextView to the given value. This value
is used to choose appropriate typefaces for ambiguous characters. Typically used for CJK
locales to disambiguate Hanzi/Kanji/Hanja characters.locale - the Locale for drawing text, must not be null.Paint.setTextLocale(java.util.Locale)public void setTextScaleX(float size)
public void setTextSize(float size)
size - The scaled pixel size.public void setTextSize(int unit,
float size)
TypedValue for the possible dimension units.unit - The desired dimension unit.size - The desired size in the given units.public final void setTransformationMethod(android.text.method.TransformationMethod method)
public void setTypeface(android.graphics.Typeface tf,
int style)
public void setTypeface(android.graphics.Typeface tf)
setTypeface(Typeface, int) to get the appearance
that you actually want.getTypeface()public boolean canCut()
public boolean canCopy()
public boolean canPaste()