public class RecipientEditTextView extends MultiAutoCompleteTextView implements AdapterView.OnItemClickListener, ActionMode.Callback, GestureDetector.OnGestureListener, TextView.OnEditorActionListener, DropdownChipLayouter.ChipDeleteListener, DropdownChipLayouter.PermissionRequestDismissedListener
Modifier and Type | Class and Description |
---|---|
static interface |
RecipientEditTextView.PermissionsRequestItemClickedListener
Listener for handling clicks on the
RecipientEntry that have
RecipientEntry.ENTRY_TYPE_PERMISSION_REQUEST type. |
static interface |
RecipientEditTextView.RecipientChipAddedListener
Listener for handling addition of chips in the recipient edit text.
|
static interface |
RecipientEditTextView.RecipientChipDeletedListener
Listener for handling deletion of chips in the recipient edit text.
|
static interface |
RecipientEditTextView.RecipientEntryItemClickedListener |
MultiAutoCompleteTextView.CommaTokenizer, MultiAutoCompleteTextView.Tokenizer
AutoCompleteTextView.OnDismissListener, AutoCompleteTextView.Validator
TextView.BufferType, TextView.OnEditorActionListener, TextView.SavedState
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.DrawingCacheQuality, View.FindViewFlags, View.FocusableMode, View.FocusDirection, View.FocusRealDirection, View.LayoutDir, View.MeasureSpec, View.OnApplyWindowInsetsListener, View.OnAttachStateChangeListener, View.OnClickListener, View.OnContextClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnScrollChangeListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener, View.ResolvedLayoutDir, View.ScrollBarStyle, View.ScrollIndicators, View.TextAlignment, View.Visibility
Modifier and Type | Field and Description |
---|---|
protected DropdownChipLayouter |
mDropdownChipLayouter |
ACCESSIBILITY_CURSOR_POSITION_UNDEFINED, ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DEBUG_LAYOUT_PROPERTY, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, 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_ACCESSIBILITY_NODE_PROVIDERS, 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, LAYOUT_DIRECTION_UNDEFINED, mAttributes, mBottom, mCachingFailed, mContext, mCurrentAnimation, mDebugViewAttributes, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, mInputEventConsistencyVerifier, mLayoutParams, mLeft, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, mUserPaddingBottom, mUserPaddingLeft, mUserPaddingRight, NAVIGATION_BAR_TRANSIENT, NAVIGATION_BAR_TRANSLUCENT, NAVIGATION_BAR_TRANSPARENT, NAVIGATION_BAR_UNHIDE, 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, PUBLIC_STATUS_BAR_VISIBILITY_MASK, 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, sPreserveMarginParamsInLayoutParamConversion, STATUS_BAR_DISABLE_BACK, STATUS_BAR_DISABLE_CLOCK, STATUS_BAR_DISABLE_EXPAND, STATUS_BAR_DISABLE_HOME, STATUS_BAR_DISABLE_NOTIFICATION_ALERTS, STATUS_BAR_DISABLE_NOTIFICATION_ICONS, STATUS_BAR_DISABLE_NOTIFICATION_TICKER, STATUS_BAR_DISABLE_RECENT, STATUS_BAR_DISABLE_SEARCH, STATUS_BAR_DISABLE_SYSTEM_INFO, STATUS_BAR_HIDDEN, STATUS_BAR_TRANSIENT, STATUS_BAR_TRANSLUCENT, STATUS_BAR_TRANSPARENT, STATUS_BAR_UNHIDE, STATUS_BAR_VISIBLE, SYSTEM_UI_CLEARABLE_FLAGS, 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, SYSTEM_UI_TRANSPARENT, 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 |
---|
RecipientEditTextView(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
void |
append(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.
|
void |
appendRecipientEntry(RecipientEntry entry)
Append a new
RecipientEntry to the end of the recipient chips, leaving any
unfinished text at the end. |
void |
clearSelectedChip()
Clears the selected chip if there is one (and dismissing any popups related to the selected
chip in the process).
|
protected ListAdapter |
createAlternatesAdapter(DrawableRecipientChip chip) |
protected void |
drawIconOnCanvas(Bitmap icon,
Canvas canvas,
RectF src,
RectF dst)
Draws the icon onto the canvas given the source rectangle of the bitmap and the destination
rectangle of the canvas.
|
void |
enableDrag()
Enables drag-and-drop for chips.
|
BaseRecipientAdapter |
getAdapter()
Returns a filterable list adapter used for auto completion.
|
List<RecipientEntry> |
getAllRecipients() |
float |
getChipHeight() |
protected ScrollView |
getScrollView() |
List<RecipientEntry> |
getSelectedRecipients() |
String |
getSuggestionDropdownOpenedVerbalization(int suggestionCount)
Return the accessibility verbalization when the suggestion dropdown is opened.
|
protected float |
getTextYOffset(int height)
Given a height, returns a Y offset that will draw the text in the middle of the height.
|
boolean |
isGeneratedContact(DrawableRecipientChip chip) |
boolean |
isNoChipMode()
Returns whether view is in no-chip or chip mode.
|
protected boolean |
isPhoneQuery() |
boolean |
lastCharacterIsCommitCharacter(CharSequence s) |
boolean |
onActionItemClicked(ActionMode mode,
MenuItem item)
Called to report a user click on an action button.
|
protected void |
onAttachedToWindow()
This is called when the view is attached to a window.
|
void |
onCheckedItemChanged(int position) |
protected void |
onChipCreated(RecipientEntry entry)
A callback for subclasses to use to know when a chip was created with the
given RecipientEntry.
|
void |
onChipDelete() |
void |
onClick(DrawableRecipientChip chip)
Handle click events for a chip.
|
boolean |
onCreateActionMode(ActionMode mode,
Menu menu)
No chips are selectable.
|
InputConnection |
onCreateInputConnection(EditorInfo outAttrs)
Create a new InputConnection for an InputMethod to interact
with the view.
|
void |
onDestroyActionMode(ActionMode mode)
Called when an action mode is about to be exited and destroyed.
|
protected void |
onDetachedFromWindow()
This is called when the view is detached from a window.
|
boolean |
onDown(MotionEvent e)
Notified when a tap occurs with the down
MotionEvent
that triggered it. |
boolean |
onDragEvent(DragEvent event)
Handles drag event.
|
boolean |
onEditorAction(TextView view,
int action,
KeyEvent keyEvent)
Called when an action is being performed.
|
boolean |
onFling(MotionEvent e1,
MotionEvent e2,
float velocityX,
float velocityY)
Notified of a fling event when it occurs with the initial on down
MotionEvent
and the matching up MotionEvent . |
void |
onFocusChanged(boolean hasFocus,
int direction,
Rect previous)
Called by the view system when the focus state of this view changes.
|
void |
onItemClick(AdapterView<?> parent,
View view,
int position,
long id)
When an item in the suggestions list has been clicked, create a chip from the
contact information of the selected item.
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
If there is a selected chip, delegate the key events
to the selected chip.
|
boolean |
onKeyPreIme(int keyCode,
KeyEvent event)
Dismiss any selected chips when the back key is pressed.
|
boolean |
onKeyUp(int keyCode,
KeyEvent event)
Monitor key presses in this view to see if the user types
any commit keys, which consist of ENTER, TAB, or DPAD_CENTER.
|
void |
onLongPress(MotionEvent event)
Notified when a long press occurs with the initial on down
MotionEvent
that trigged it. |
void |
onPermissionRequestDismissed()
Callback that occurs when user dismisses the item that asks user to grant permissions to
the app.
|
boolean |
onPrepareActionMode(ActionMode mode,
Menu menu)
Called to refresh an action mode's action menu whenever it is invalidated.
|
void |
onRestoreInstanceState(Parcelable state)
Hook allowing a view to re-apply a representation of its internal state that had previously
been generated by
View.onSaveInstanceState() . |
Parcelable |
onSaveInstanceState()
Hook allowing a view to generate a representation of its internal state
that can later be used to create a new instance with that same state.
|
boolean |
onScroll(MotionEvent e1,
MotionEvent e2,
float distanceX,
float distanceY)
Notified when a scroll occurs with the initial on down
MotionEvent and the
current move MotionEvent . |
void |
onSelectionChanged(int start,
int end)
This method is called when the selection has changed, in case any
subclasses would like to know.
|
void |
onShowPress(MotionEvent e)
The user has performed a down
MotionEvent and not performed
a move or up yet. |
boolean |
onSingleTapUp(MotionEvent e)
Notified when a tap occurs with the up
MotionEvent
that triggered it. |
void |
onSizeChanged(int width,
int height,
int oldw,
int oldh)
This is called during layout when the size of this view has changed.
|
boolean |
onTextContextMenuItem(int id)
Called when a context menu option for the text view is selected.
|
boolean |
onTouchEvent(MotionEvent event)
Monitor touch events in the RecipientEditTextView.
|
void |
performFiltering(CharSequence text,
int keyCode)
Instead of filtering on the entire contents of the edit box,
this subclass method filters on the range from
Tokenizer#findTokenStart to TextView.getSelectionEnd()
if the length of that range meets or exceeds AutoCompleteTextView.getThreshold()
and makes sure that the range is not already a Chip. |
void |
performValidation()
Instead of validating the entire text, this subclass method validates
each token of the text individually.
|
void |
removeRecipientEntry(RecipientEntry entry)
Remove all chips matching the given RecipientEntry.
|
void |
removeTextChangedListener(TextWatcher watcher)
Removes the specified TextWatcher from the list of those whose
methods are called
whenever this TextView's text changes.
|
protected void |
replaceText(CharSequence text)
We cannot use the default mechanism for replaceText.
|
protected void |
scrollBottomIntoView() |
<T extends ListAdapter & Filterable> |
setAdapter(T adapter)
Changes the list of data used for auto completion.
|
void |
setAlternatePopupAnchor(View v) |
void |
setDropDownAnchor(int anchorId)
Sets the view to which the auto-complete drop down list should anchor.
|
void |
setDropdownChipLayouter(DropdownChipLayouter dropdownChipLayouter) |
void |
setOnFocusListShrinkRecipients(boolean shrink)
Set whether to shrink the recipients field such that at most
one line of recipients chips are shown when the field loses
focus.
|
void |
setPermissionsRequestItemClickedListener(RecipientEditTextView.PermissionsRequestItemClickedListener listener) |
void |
setRecipientChipAddedListener(RecipientEditTextView.RecipientChipAddedListener listener) |
void |
setRecipientChipDeletedListener(RecipientEditTextView.RecipientChipDeletedListener listener) |
void |
setRecipientEntryItemClickedListener(RecipientEditTextView.RecipientEntryItemClickedListener listener) |
void |
setTokenizer(MultiAutoCompleteTextView.Tokenizer tokenizer)
Sets the Tokenizer that will be used to determine the relevant
range of the text where the user is typing.
|
void |
setValidator(AutoCompleteTextView.Validator validator)
Sets the validator used to perform text validation.
|
void |
setVisibility(int visibility)
Set the visibility state of this view.
|
enoughToFilter, getAccessibilityClassName, performFiltering
clearListSelection, convertSelectionToString, dismissDropDown, ensureImeVisible, getCompletionHint, getDropDownAnchor, getDropDownAnimationStyle, getDropDownBackground, getDropDownHeight, getDropDownHorizontalOffset, getDropDownVerticalOffset, getDropDownWidth, getFilter, getItemClickListener, getItemSelectedListener, getListSelection, getOnItemClickListener, getOnItemSelectedListener, getThreshold, getValidator, isDropDownAlwaysVisible, isDropDownDismissedOnCompletion, isInputMethodNotNeeded, isPerformingCompletion, isPopupShowing, onCommitCompletion, onDisplayHint, onFilterComplete, onWindowFocusChanged, performCompletion, setCompletionHint, setDropDownAlwaysVisible, setDropDownAnimationStyle, setDropDownBackgroundDrawable, setDropDownBackgroundResource, setDropDownDismissedOnCompletion, setDropDownHeight, setDropDownHorizontalOffset, setDropDownVerticalOffset, setDropDownWidth, setForceIgnoreOutsideTouch, setFrame, setListSelection, setOnClickListener, setOnDismissListener, setOnItemClickListener, setOnItemSelectedListener, setText, setThreshold, showDropDown, showDropDownAfterLayout
extendSelection, getDefaultEditable, getDefaultMovementMethod, getFreezesText, getText, onInitializeAccessibilityNodeInfoInternal, selectAll, setEllipsize, setSelection, setSelection, setText
addTextChangedListener, append, beginBatchEdit, bringPointIntoView, cancelLongPress, clearComposingText, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollRange, debug, deleteText_internal, didTouchFocusSelect, drawableHotspotChanged, drawableStateChanged, encodeProperties, endBatchEdit, extractText, findViewsWithText, getAccessibilitySelectionEnd, getAccessibilitySelectionStart, getAutoLinkMask, getBaseline, getBottomPaddingOffset, getBreakStrategy, getCompoundDrawablePadding, getCompoundDrawables, getCompoundDrawablesRelative, getCompoundDrawableTintList, getCompoundDrawableTintMode, getCompoundPaddingBottom, getCompoundPaddingEnd, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingStart, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getCustomInsertionActionModeCallback, getCustomSelectionActionModeCallback, getEditableText, getEditorForTesting, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFadeHeight, getFadeTop, getFilters, getFocusedRect, getFontFeatureSettings, getGravity, getHighlightColor, getHint, getHintTextColors, getHorizontallyScrolling, getHorizontalOffsetForDrawables, getHyphenationFrequency, getImeActionId, getImeActionLabel, getImeHintLocales, getImeOptions, getIncludeFontPadding, getInputExtras, getInputType, getIterableTextForAccessibility, getIteratorForGranularity, getKeyListener, getLayout, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLetterSpacing, getLineBounds, getLineCount, getLineHeight, getLineSpacingExtra, getLineSpacingMultiplier, getLinksClickable, getLinkTextColors, getMarqueeRepeatLimit, getMaxEms, getMaxHeight, getMaxLines, getMaxWidth, getMinEms, getMinHeight, getMinLines, getMinWidth, getMovementMethod, getOffsetForPosition, getPaint, getPaintFlags, getPrivateImeOptions, getRightFadingEdgeStrength, getRightPaddingOffset, getScaledTextSize, getSelectionEnd, getSelectionStart, getShadowColor, getShadowDx, getShadowDy, getShadowRadius, getShowSoftInputOnFocus, getSpellCheckerLocale, getTextColor, getTextColors, getTextColors, getTextDirectionHeuristic, getTextLocale, getTextLocales, getTextScaleX, getTextServicesLocale, getTextSize, getTopPaddingOffset, getTotalPaddingBottom, getTotalPaddingEnd, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingStart, getTotalPaddingTop, getTransformationMethod, getTypeface, getTypefaceStyle, getUndoManager, getUrls, getWordIterator, handleBackInTextActionModeIfNeeded, hasOverlappingRendering, hasSelection, hideErrorIfUnchanged, invalidateDrawable, isAccessibilitySelectionExtendable, isCursorVisible, isInExtractedMode, isInputMethodTarget, isPaddingOffsetRequired, isSuggestionsEnabled, isTextSelectable, jumpDrawablesToCurrentState, length, makeNewLayout, makeSingleLayout, moveCursorToVisibleOffset, onActivityResult, onBeginBatchEdit, onCheckIsTextEditor, onCommitCorrection, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onDetachedFromWindowInternal, onDraw, onEditorAction, onEndBatchEdit, onGenericMotionEvent, onInitializeAccessibilityEventInternal, onKeyMultiple, onKeyShortcut, onLayout, onMeasure, onPopulateAccessibilityEventInternal, onPreDraw, onPrivateIMECommand, onProvideStructure, onResolveDrawables, onResolvePointerIcon, onRtlPropertiesChanged, onScreenStateChanged, onScrollChanged, onTextChanged, onTrackballEvent, onVisibilityChanged, performAccessibilityActionInternal, performLongClick, preloadFontCache, replaceText_internal, resetErrorChangedFlag, resetResolvedDrawables, sendAccessibilityEventInternal, setAccessibilitySelection, setAllCaps, setAutoLinkMask, setBreakStrategy, setCompoundDrawablePadding, setCompoundDrawables, setCompoundDrawablesRelative, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCompoundDrawableTintList, setCompoundDrawableTintMode, setCursorPosition_internal, setCursorVisible, setCustomInsertionActionModeCallback, setCustomSelectionActionModeCallback, setEditableFactory, setElegantTextHeight, setEms, setEnabled, setError, setError, setExtractedText, setExtracting, setFilters, setFontFeatureSettings, setFreezesText, setGravity, setHeight, setHighlightColor, setHint, setHint, setHintTextColor, setHintTextColor, setHorizontallyScrolling, setHyphenationFrequency, setImeActionLabel, setImeHintLocales, setImeOptions, setIncludeFontPadding, setInputExtras, setInputType, setKeyListener, setLetterSpacing, setLines, setLineSpacing, setLinksClickable, setLinkTextColor, setLinkTextColor, setMarqueeRepeatLimit, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setOnEditorActionListener, setPadding, setPaddingRelative, setPaintFlags, setPrivateImeOptions, setRawInputType, setScroller, setSelectAllOnFocus, setSelected, setShadowLayer, setShowSoftInputOnFocus, setSingleLine, setSingleLine, setSpan_internal, setSpannableFactory, setText, setText, setText, setText, setTextAppearance, setTextAppearance, setTextColor, setTextColor, setTextIsSelectable, setTextKeepState, setTextKeepState, setTextLocale, setTextLocales, setTextScaleX, setTextSize, setTextSize, setTransformationMethod, setTypeface, setTypeface, setUndoManager, setWidth, showContextMenu, showContextMenu, stopTextActionMode, verifyDrawable, viewClicked
addChildrenForAccessibility, addFocusables, addFocusables, addFrameMetricsListener, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, applyDrawableToTransparentRegion, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelPendingInputEvents, canHaveDisplayList, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, captureTransitioningViews, checkInputConnectionProxy, clearAccessibilityFocus, clearAnimation, clearFocus, combineMeasuredStates, computeFitSystemWindows, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeOpaqueFlags, computeSystemWindowInsets, computeVerticalScrollOffset, createAccessibilityNodeInfo, createAccessibilityNodeInfoInternal, createContextMenu, createSnapshot, damageInParent, debug, debugIndent, destroyDrawingCache, destroyHardwareResources, dispatchActivityResult, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchGetDisplayList, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerEvent, dispatchPopulateAccessibilityEvent, dispatchPopulateAccessibilityEventInternal, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, encode, findFocus, findNamedViews, findViewByAccessibilityIdTraversal, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewByPredicateTraversal, findViewTraversal, findViewWithTag, findViewWithTagTraversal, fitsSystemWindows, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, gatherTransparentRegion, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAccessibilityViewId, getAccessibilityWindowId, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBoundsOnScreen, getBoundsOnScreen, 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, getHardwareRenderer, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollFactor, getHotspotBounds, getId, getImportantForAccessibility, getInverseMatrix, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOpticalInsets, getOutlineProvider, getOutsets, getOverlay, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getRawLayoutDirection, getRawTextAlignment, getRawTextDirection, getResources, getRevealOnFocusHint, getRight, 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, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getVerticalScrollFactor, getViewRootImpl, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowDisplayFrame, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, handleScrollBarDragging, hasFocus, hasFocusable, hasHoveredChild, hasNestedScrollingParent, hasOnClickListeners, hasOpaqueScrollbars, hasShadow, hasTransientState, hasWindowFocus, includeForAccessibility, inflate, initializeFadingEdge, initializeFadingEdgeInternal, initializeScrollbars, initializeScrollbarsInternal, internalSetPadding, invalidate, invalidate, invalidate, invalidateOutline, invalidateParentCaches, invalidateParentIfNeeded, invalidateParentIfNeededAndWasQuickRejected, isAccessibilityFocused, isActionableForAccessibility, isActivated, isAssistBlocked, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isForegroundInsidePadding, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInScrollingContainer, isInTouchMode, isLaidOut, isLayoutDirectionInherited, isLayoutDirectionResolved, isLayoutModeOptical, isLayoutRequested, isLayoutRtl, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPressed, isRootNamespace, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentInherited, isTextAlignmentResolved, isTextDirectionInherited, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVerticalScrollBarHidden, isVisibleToUser, isVisibleToUser, layout, makeOptionalFitsSystemWindows, measure, mergeDrawableStates, notifySubtreeAccessibilityStateChangedIfNeeded, notifyViewAccessibilityStateChangedIfNeeded, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCloseSystemDialogs, onDrawForeground, onDrawHorizontalScrollBar, onDrawScrollBars, onDrawVerticalScrollBar, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusLost, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyLongPress, onOverScrolled, onPopulateAccessibilityEvent, onProvideVirtualStructure, onRenderNodeDetached, onSetAlpha, onStartTemporaryDetach, onVisibilityAggregated, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, outputDirtyFlags, overScrollBy, performAccessibilityAction, performButtonActionOnTouchDown, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, pointInView, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, recomputePadding, refreshDrawableState, removeCallbacks, removeFrameMetricsListener, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestAccessibilityFocus, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestKeyboardShortcuts, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resetPaddingToInitialValues, resetResolvedLayoutDirection, resetResolvedPadding, resetResolvedTextAlignment, resetResolvedTextDirection, resetRtlProperties, resolveDrawables, resolveLayoutDirection, resolveLayoutParams, resolvePadding, resolveRtlPropertiesIfNeeded, resolveSize, resolveSizeAndState, resolveTextAlignment, resolveTextDirection, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, sendAccessibilityEventUncheckedInternal, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAssistBlocked, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDisabledSystemUiVisibility, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setIsRootNamespace, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOpticalInsets, setOutlineProvider, setOverScrollMode, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealClip, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTagInternal, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, startActionMode, startActionMode, startActivityForResult, startAnimation, startDrag, startDragAndDrop, startMovingTask, startNestedScroll, stopNestedScroll, toGlobalMotionEvent, toLocalMotionEvent, toString, transformFromViewToWindowSpace, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDisplayListIfDirty, updateDragShadow, willNotCacheDrawing, willNotDraw
protected DropdownChipLayouter mDropdownChipLayouter
public RecipientEditTextView(Context context, AttributeSet attrs)
public void setDropdownChipLayouter(DropdownChipLayouter dropdownChipLayouter)
public void setRecipientEntryItemClickedListener(RecipientEditTextView.RecipientEntryItemClickedListener listener)
public void setPermissionsRequestItemClickedListener(RecipientEditTextView.PermissionsRequestItemClickedListener listener)
public void setRecipientChipAddedListener(RecipientEditTextView.RecipientChipAddedListener listener)
public void setRecipientChipDeletedListener(RecipientEditTextView.RecipientChipDeletedListener listener)
protected void onDetachedFromWindow()
View
onDetachedFromWindow
in class AutoCompleteTextView
View.onAttachedToWindow()
protected void onAttachedToWindow()
View
View.onDraw(android.graphics.Canvas)
,
however it may be called any time before the first onDraw -- including
before or after View.onMeasure(int, int)
.onAttachedToWindow
in class AutoCompleteTextView
View.onDetachedFromWindow()
public void setDropDownAnchor(int anchorId)
AutoCompleteTextView
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.
setDropDownAnchor
in class AutoCompleteTextView
anchorId
- the id to anchor the drop down list view topublic boolean onEditorAction(TextView view, int action, KeyEvent keyEvent)
TextView.OnEditorActionListener
onEditorAction
in interface TextView.OnEditorActionListener
view
- The view that was clicked.action
- Identifier of the action. This will be either the
identifier you supplied, or EditorInfo.IME_NULL
if being called due to the enter key
being pressed.keyEvent
- If triggered by an enter key, this is the event;
otherwise, this is null.public InputConnection onCreateInputConnection(@NonNull EditorInfo outAttrs)
View
When implementing this, you probably also want to implement
View.onCheckIsTextEditor()
to indicate you will return a
non-null InputConnection.
Also, take good care to fill in the EditorInfo
object correctly and in its entirety, so that the connected IME can rely
on its values. For example, EditorInfo.initialSelStart
and EditorInfo.initialSelEnd
members
must be filled in with the correct cursor position for IMEs to work correctly
with your application.
onCreateInputConnection
in class TextView
outAttrs
- Fill in with attribute information about the connection.public List<RecipientEntry> getSelectedRecipients()
RecipientEntry
s that have been selected by the user.public List<RecipientEntry> getAllRecipients()
RecipientEntry
s that have been selected by the user and also
hidden due to mMoreChip
span.public void onSelectionChanged(int start, int end)
TextView
onSelectionChanged
in class TextView
start
- The new selection start location.end
- The new selection end location.public void onRestoreInstanceState(Parcelable state)
View
View.onSaveInstanceState()
. This function will never be called with a
null state.onRestoreInstanceState
in class TextView
state
- The frozen state that had previously been returned by
View.onSaveInstanceState()
.View.onSaveInstanceState()
,
View.restoreHierarchyState(android.util.SparseArray)
,
View.dispatchRestoreInstanceState(android.util.SparseArray)
public Parcelable onSaveInstanceState()
View
Some examples of things you may store here: the current cursor position in a text view (but usually not the text itself since that is stored in a content provider or other persistent storage), the currently selected item in a list view.
onSaveInstanceState
in class TextView
View.onRestoreInstanceState(android.os.Parcelable)
,
View.saveHierarchyState(android.util.SparseArray)
,
View.dispatchSaveInstanceState(android.util.SparseArray)
,
View.setSaveEnabled(boolean)
public void append(CharSequence text, int start, int end)
public void onFocusChanged(boolean hasFocus, int direction, Rect previous)
View
onFocusChanged
in class AutoCompleteTextView
hasFocus
- True if the View has focus; false otherwise.direction
- The direction focus has moved when requestFocus()
is called to give this view focus. Values are
View.FOCUS_UP
, View.FOCUS_DOWN
, View.FOCUS_LEFT
,
View.FOCUS_RIGHT
, View.FOCUS_FORWARD
, or View.FOCUS_BACKWARD
.
It may not always apply, in which case use the default.previous
- The rectangle, in this view's coordinate
system, of the previously focused view. If applicable, this will be
passed in as finer grained information about where the focus is coming
from (in addition to direction). Will be null
otherwise.public <T extends ListAdapter & Filterable> void setAdapter(@NonNull T adapter)
AutoCompleteTextView
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.
setAdapter
in class AutoCompleteTextView
adapter
- the adapter holding the auto completion dataAutoCompleteTextView.getAdapter()
,
Filterable
,
ListAdapter
public String getSuggestionDropdownOpenedVerbalization(int suggestionCount)
protected void scrollBottomIntoView()
protected ScrollView getScrollView()
public void performValidation()
MultiAutoCompleteTextView
protected float getTextYOffset(int height)
protected void drawIconOnCanvas(Bitmap icon, Canvas canvas, RectF src, RectF dst)
public float getChipHeight()
public boolean isNoChipMode()
public void setOnFocusListShrinkRecipients(boolean shrink)
shrink
- public void onSizeChanged(int width, int height, int oldw, int oldh)
View
onSizeChanged
in class View
width
- Current width of this view.height
- Current height of this view.oldw
- Old width of this view.oldh
- Old height of this view.public void setTokenizer(MultiAutoCompleteTextView.Tokenizer tokenizer)
MultiAutoCompleteTextView
setTokenizer
in class MultiAutoCompleteTextView
public void setValidator(AutoCompleteTextView.Validator validator)
AutoCompleteTextView
setValidator
in class AutoCompleteTextView
validator
- The validator used to validate the text entered in this widget.AutoCompleteTextView.getValidator()
,
AutoCompleteTextView.performValidation()
protected void replaceText(CharSequence text)
replaceText
in class MultiAutoCompleteTextView
text
- the selected suggestion in the drop down listpublic boolean onKeyPreIme(int keyCode, @NonNull KeyEvent event)
onKeyPreIme
in class AutoCompleteTextView
keyCode
- The value in event.getKeyCode().event
- Description of the key event.public boolean onKeyUp(int keyCode, @NonNull KeyEvent event)
onKeyUp
in interface KeyEvent.Callback
onKeyUp
in class AutoCompleteTextView
keyCode
- A key code that represents the button pressed, from
KeyEvent
.event
- The KeyEvent object that defines the button action.public boolean onKeyDown(int keyCode, @NonNull KeyEvent event)
onKeyDown
in interface KeyEvent.Callback
onKeyDown
in class AutoCompleteTextView
keyCode
- a key code that represents the button pressed, from
KeyEvent
event
- the KeyEvent object that defines the button actionpublic void performFiltering(@NonNull CharSequence text, int keyCode)
Tokenizer#findTokenStart
to TextView.getSelectionEnd()
if the length of that range meets or exceeds AutoCompleteTextView.getThreshold()
and makes sure that the range is not already a Chip.performFiltering
in class MultiAutoCompleteTextView
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.public void clearSelectedChip()
public boolean onTouchEvent(@NonNull MotionEvent event)
onTouchEvent
in class TextView
event
- The motion event.protected ListAdapter createAlternatesAdapter(DrawableRecipientChip chip)
public void onCheckedItemChanged(int position)
protected void onChipCreated(RecipientEntry entry)
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
onItemClick
in interface AdapterView.OnItemClickListener
parent
- The AdapterView where the click happened.view
- The view within the AdapterView that was clicked (this
will be a view provided by the adapter)position
- The position of the view in the adapter.id
- The row id of the item that was clicked.public boolean onActionItemClicked(ActionMode mode, MenuItem item)
ActionMode.Callback
onActionItemClicked
in interface ActionMode.Callback
mode
- The current ActionModeitem
- The item that was clickedpublic void onDestroyActionMode(ActionMode mode)
ActionMode.Callback
onDestroyActionMode
in interface ActionMode.Callback
mode
- The current ActionMode being destroyedpublic boolean onPrepareActionMode(ActionMode mode, Menu menu)
ActionMode.Callback
onPrepareActionMode
in interface ActionMode.Callback
mode
- ActionMode being preparedmenu
- Menu used to populate action buttonspublic boolean onCreateActionMode(ActionMode mode, Menu menu)
onCreateActionMode
in interface ActionMode.Callback
mode
- ActionMode being createdmenu
- Menu used to populate action buttonspublic void onChipDelete()
onChipDelete
in interface DropdownChipLayouter.ChipDeleteListener
public void onPermissionRequestDismissed()
DropdownChipLayouter.PermissionRequestDismissedListener
onPermissionRequestDismissed
in interface DropdownChipLayouter.PermissionRequestDismissedListener
public void onClick(DrawableRecipientChip chip)
public void removeTextChangedListener(TextWatcher watcher)
TextView
removeTextChangedListener
in class TextView
public boolean lastCharacterIsCommitCharacter(CharSequence s)
public boolean isGeneratedContact(DrawableRecipientChip chip)
public boolean onTextContextMenuItem(int id)
TextView
android.R.id#selectAll
, android.R.id#cut
,
android.R.id#copy
, android.R.id#paste
or android.R.id#shareText
.onTextContextMenuItem
in class TextView
public boolean onDown(MotionEvent e)
GestureDetector.OnGestureListener
MotionEvent
that triggered it. This will be triggered immediately for
every down event. All other events should be preceded by this.onDown
in interface GestureDetector.OnGestureListener
e
- The down motion event.public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
GestureDetector.OnGestureListener
MotionEvent
and the matching up MotionEvent
. The calculated velocity is supplied along
the x and y axis in pixels per second.onFling
in interface GestureDetector.OnGestureListener
e1
- The first down motion event that started the fling.e2
- The move motion event that triggered the current onFling.velocityX
- The velocity of this fling measured in pixels per second
along the x axis.velocityY
- The velocity of this fling measured in pixels per second
along the y axis.public void onLongPress(MotionEvent event)
GestureDetector.OnGestureListener
MotionEvent
that trigged it.onLongPress
in interface GestureDetector.OnGestureListener
event
- The initial on down motion event that started the longpress.public void enableDrag()
public boolean onDragEvent(@NonNull DragEvent event)
onDragEvent
in class TextView
event
- The DragEvent
sent by the system.
The DragEvent.getAction()
method returns an action type constant defined
in DragEvent, indicating the type of drag event represented by this object.true
if the method was successful, otherwise false
.
The method should return true
in response to an action type of
DragEvent.ACTION_DRAG_STARTED
to receive drag events for the current
operation.
The method should also return true
in response to an action type of
DragEvent.ACTION_DROP
if it consumed the drop, or
false
if it didn't.
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
GestureDetector.OnGestureListener
MotionEvent
and the
current move MotionEvent
. The distance in x and y is also supplied for
convenience.onScroll
in interface GestureDetector.OnGestureListener
e1
- The first down motion event that started the scrolling.e2
- The move motion event that triggered the current onScroll.distanceX
- The distance along the X axis that has been scrolled since the last
call to onScroll. This is NOT the distance between e1
and e2
.distanceY
- The distance along the Y axis that has been scrolled since the last
call to onScroll. This is NOT the distance between e1
and e2
.public void onShowPress(MotionEvent e)
GestureDetector.OnGestureListener
MotionEvent
and not performed
a move or up yet. This event is commonly used to provide visual
feedback to the user to let them know that their action has been
recognized i.e. highlight an element.onShowPress
in interface GestureDetector.OnGestureListener
e
- The down motion eventpublic boolean onSingleTapUp(MotionEvent e)
GestureDetector.OnGestureListener
MotionEvent
that triggered it.onSingleTapUp
in interface GestureDetector.OnGestureListener
e
- The up motion event that completed the first tapprotected boolean isPhoneQuery()
public BaseRecipientAdapter getAdapter()
AutoCompleteTextView
Returns a filterable list adapter used for auto completion.
getAdapter
in class AutoCompleteTextView
public void appendRecipientEntry(RecipientEntry entry)
RecipientEntry
to the end of the recipient chips, leaving any
unfinished text at the end.public void removeRecipientEntry(RecipientEntry entry)
public void setAlternatePopupAnchor(View v)
public void setVisibility(int visibility)
View
setVisibility
in class View
visibility
- One of View.VISIBLE
, View.INVISIBLE
, or View.GONE
.