-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewTreeObserver.OnPreDrawListener,android.view.accessibility.AccessibilityEventSource,androidx.appcompat.widget.EmojiCompatConfigurationView,androidx.core.view.OnReceiveContentViewBehavior,androidx.core.view.TintableBackgroundView,androidx.core.widget.TintableCompoundDrawablesView
public final class EditorEditText extends AppCompatEditText
An EditText that handles rich text editing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceEditorEditText.OnSelectionChangeListenerpublic interfaceEditorEditText.OnActionStatesChangedListenerpublic interfaceEditorEditText.OnMenuActionChangedListenerpublic interfaceEditorEditText.OnLinkActionChangedListenerpublic interfaceEditorEditText.OnMentionsStateChangedListener
-
Field Summary
Fields Modifier and Type Field Description private StyleConfigstyleConfigprivate EditorEditText.OnSelectionChangeListenerselectionChangeListenerprivate EditorEditText.OnActionStatesChangedListeneractionStatesChangedListenerprivate EditorEditText.OnMenuActionChangedListenermenuActionListenerprivate EditorEditText.OnLinkActionChangedListenerlinkActionChangedListenerprivate EditorEditText.OnMentionsStateChangedListenermentionsStateChangedListenerprivate RustErrorCollectorrustErrorCollector
-
Constructor Summary
Constructors Constructor Description EditorEditText(Context context)EditorEditText(Context context, AttributeSet attrs)EditorEditText(Context context, AttributeSet attrs, Integer defStyleAttr)
-
Method Summary
Modifier and Type Method Description final StyleConfiggetStyleConfig()The StyleConfig used to style the spans generated from the HTML in this EditText. final UnitsetStyleConfig(StyleConfig styleConfig)final EditorEditText.OnSelectionChangeListenergetSelectionChangeListener()final UnitsetSelectionChangeListener(EditorEditText.OnSelectionChangeListener selectionChangeListener)final EditorEditText.OnActionStatesChangedListenergetActionStatesChangedListener()final UnitsetActionStatesChangedListener(EditorEditText.OnActionStatesChangedListener actionStatesChangedListener)final EditorEditText.OnMenuActionChangedListenergetMenuActionListener()final UnitsetMenuActionListener(EditorEditText.OnMenuActionChangedListener menuActionListener)final EditorEditText.OnLinkActionChangedListenergetLinkActionChangedListener()Set the link action listener to be notified when the available link action changes. final UnitsetLinkActionChangedListener(EditorEditText.OnLinkActionChangedListener linkActionChangedListener)final EditorEditText.OnMentionsStateChangedListenergetMentionsStateChangedListener()Set the MentionsState change listener to be notified when the state of mentions in the composer changes. final UnitsetMentionsStateChangedListener(EditorEditText.OnMentionsStateChangedListener mentionsStateChangedListener)final RustErrorCollectorgetRustErrorCollector()final UnitsetRustErrorCollector(RustErrorCollector rustErrorCollector)BooleangetFreezesText()We'll do our own text restoration. UnitonRestoreInstanceState(Parcelable state)InputConnectiononCreateInputConnection(EditorInfo outAttrs)We wrap the internal com.android.internal.widget.EditableInputConnectionas it's not public, but its internal behavior is needed to work properly with the EditText.BooleanonTextContextMenuItem(Integer id)Override context menu actions, such as cut & paste so its input is redirected to the viewModel. final UnitupdateStyle(StyleConfig styleConfig, MentionDisplayHandler mentionDisplayHandler)Sets up the styling used to translate HTML to Spanned text. final UnitsetOnRichContentSelected(Function1<Uri, Unit> onRichContentSelected)UnitsetText(CharSequence text, TextView.BufferType type)Unitappend(CharSequence text, Integer start, Integer end)final BooleantoggleInlineFormat(InlineFormat inlineFormat)final BooleantoggleCodeBlock()final BooleantoggleQuote()final Unitundo()final Unitredo()final LinkActiongetLinkAction()Get the action that can be performed based on the current link and selection state. final UnitsetLink(String url)Set a link for the current selection. final UnitremoveLink()Remove a link for the current selection. final UnitinsertLink(String url, String text)Insert new text with a link. final UnittoggleList(Boolean ordered)final Unitindent()final Unitunindent()final UnitsetHtml(String html)final StringgetContentAsMessageHtml()Get the editor content as clean HTML suitable for sending as a message. final StringgetInternalHtml()final StringgetMarkdown()Get the text as markdown. final StringgetContentAsMessageMarkdown()Get the editor content as clean markdown suitable for sending as a message. final UnitsetMarkdown(String markdown)Set the text as markdown, it will be turned into to HTML internally. final UnitinsertMentionAtSuggestion(String url, String text)Set a mention link that applies to the current suggestion range final UnitinsertAtRoomMentionAtSuggestion()Set a mention link that applies to the current suggestion range final UnitreplaceTextSuggestion(String text)Replace text in the current suggestion range final MentionsStategetMentionsState()Get the current MentionsState of the editor. UnitsetSelection(Integer start, Integer stop)UnitaddTextChangedListener(TextWatcher watcher)UnitremoveTextChangedListener(TextWatcher watcher)ViewfocusSearch(Integer direction)-
Methods inherited from class android.widget.EditText
addExtraDataToAccessibilityNodeInfo, append, autofill, beginBatchEdit, bringPointIntoView, bringPointIntoView, cancelLongPress, clearComposingText, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollRange, debug, didTouchFocusSelect, drawableHotspotChanged, endBatchEdit, extractText, findViewsWithText, getAutoLinkMask, getAutoSizeMaxTextSize, getAutoSizeMinTextSize, getAutoSizeStepGranularity, getAutoSizeTextAvailableSizes, getAutoSizeTextType, getAutofillHints, getAutofillType, getAutofillValue, getBaseline, getBottomPaddingOffset, getBreakStrategy, getCompoundDrawablePadding, getCompoundDrawableTintBlendMode, getCompoundDrawableTintList, getCompoundDrawableTintMode, getCompoundDrawables, getCompoundDrawablesRelative, getCompoundPaddingBottom, getCompoundPaddingEnd, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingStart, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getCustomInsertionActionModeCallback, getEditableText, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFilters, getFirstBaselineToTopHeight, getFocusedRect, getFocusedSearchResultHighlightColor, getFocusedSearchResultIndex, getFontFeatureSettings, getFontVariationSettings, getGravity, getHighlightColor, getHighlights, getHint, getHintTextColors, getHyphenationFrequency, getImeActionId, getImeActionLabel, getImeHintLocales, getImeOptions, getIncludeFontPadding, getInputExtras, getInputType, getJustificationMode, getKeyListener, getLastBaselineToBottomHeight, getLayout, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLetterSpacing, getLineBounds, getLineBreakStyle, getLineBreakWordStyle, getLineCount, getLineHeight, getLineSpacingExtra, getLineSpacingMultiplier, getLinkTextColors, getLinksClickable, getMarqueeRepeatLimit, getMaxEms, getMaxHeight, getMaxLines, getMaxWidth, getMinEms, getMinHeight, getMinLines, getMinWidth, getMovementMethod, getOffsetForPosition, getPaint, getPaintFlags, getPrivateImeOptions, getRightFadingEdgeStrength, getRightPaddingOffset, getSearchResultHighlightColor, getSearchResultHighlights, getSelectionEnd, getSelectionStart, getShadowColor, getShadowDx, getShadowDy, getShadowRadius, getShowSoftInputOnFocus, getTextColors, getTextCursorDrawable, getTextDirectionHeuristic, getTextLocale, getTextLocales, getTextMetricsParams, getTextScaleX, getTextSelectHandle, getTextSelectHandleLeft, getTextSelectHandleRight, getTextSize, getTextSizeUnit, getTopPaddingOffset, getTotalPaddingBottom, getTotalPaddingEnd, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingStart, getTotalPaddingTop, getTransformationMethod, getTypeface, getUrls, hasOverlappingRendering, hasSelection, invalidateDrawable, isAllCaps, isAutoHandwritingEnabled, isCursorVisible, isElegantTextHeight, isFallbackLineSpacing, isHorizontallyScrollable, isInputMethodTarget, isPaddingOffsetRequired, isSingleLine, isSuggestionsEnabled, isTextSelectable, jumpDrawablesToCurrentState, length, moveCursorToVisibleOffset, onAttachedToWindow, onBeginBatchEdit, onCheckIsTextEditor, onCommitCompletion, onCommitCorrection, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onCreateViewTranslationRequest, onEditorAction, onEndBatchEdit, onFocusChanged, onGenericMotionEvent, onKeyDown, onKeyMultiple, onKeyPreIme, onKeyUp, onLayout, onMeasure, onPreDraw, onPrivateIMECommand, onReceiveContent, onResolvePointerIcon, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onTextChanged, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, performLongClick, sendAccessibilityEventUnchecked, setAllCaps, setAutoLinkMask, setAutoSizeTextTypeUniformWithConfiguration, setAutoSizeTextTypeUniformWithPresetSizes, setAutoSizeTextTypeWithDefaults, setBreakStrategy, setCompoundDrawablePadding, setCompoundDrawableTintBlendMode, setCompoundDrawableTintList, setCompoundDrawableTintMode, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCursorVisible, setCustomInsertionActionModeCallback, setEditableFactory, setElegantTextHeight, setEms, setEnabled, setError, setError, setExtractedText, setFallbackLineSpacing, setFilters, setFirstBaselineToTopHeight, setFocusedSearchResultHighlightColor, setFocusedSearchResultIndex, setFontFeatureSettings, setFontVariationSettings, setFrame, setFreezesText, setGravity, setHeight, setHighlightColor, setHighlights, setHint, setHint, setHintTextColor, setHintTextColor, setHorizontallyScrolling, setHyphenationFrequency, setImeActionLabel, setImeHintLocales, setImeOptions, setIncludeFontPadding, setInputExtras, setInputType, setJustificationMode, setLastBaselineToBottomHeight, setLetterSpacing, setLineBreakStyle, setLineBreakWordStyle, setLineHeight, setLineHeight, setLineSpacing, setLines, setLinkTextColor, setLinkTextColor, setLinksClickable, setMarqueeRepeatLimit, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setOnEditorActionListener, setPadding, setPaddingRelative, setPaintFlags, setPrivateImeOptions, setRawInputType, setScroller, setSearchResultHighlightColor, setSearchResultHighlights, setSelectAllOnFocus, setSelected, setShadowLayer, setShowSoftInputOnFocus, setSingleLine, setSingleLine, setSpannableFactory, setText, setText, setText, setText, setTextAppearance, setTextColor, setTextColor, setTextCursorDrawable, setTextCursorDrawable, setTextIsSelectable, setTextKeepState, setTextKeepState, setTextLocale, setTextLocales, setTextMetricsParams, setTextScaleX, setTextSelectHandle, setTextSelectHandle, setTextSelectHandleLeft, setTextSelectHandleLeft, setTextSelectHandleRight, setTextSelectHandleRight, setTextSize, setTextSize, setTransformationMethod, setTypeface, setTypeface, setWidth, showContextMenu, showContextMenu, verifyDrawable -
Methods inherited from class androidx.appcompat.widget.AppCompatEditText
extendSelection, getAccessibilityClassName, getDefaultEditable, getDefaultMovementMethod, isStyleShortcutEnabled, onKeyShortcut, selectAll, setEllipsize, setSelection, setStyleShortcutsEnabled -
Methods inherited from class android.widget.TextView
addChildrenForAccessibility, addFocusables, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearFocus, clearViewTranslationCallback, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeSystemWindowInsets, computeVerticalScrollOffset, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findOnBackInvokedDispatcher, findViewById, findViewWithTag, fitSystemWindows, forceHasOverlappingRendering, forceLayout, gatherTransparentRegion, generateDisplayHash, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAllowedHandwritingDelegatePackageName, getAllowedHandwritingDelegatorPackageName, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillId, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHandwritingBoundsOffsetBottom, getHandwritingBoundsOffsetLeft, getHandwritingBoundsOffsetRight, getHandwritingBoundsOffsetTop, getHandwritingDelegatorCallback, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasPointerCapture, hasTransientState, hasWindowFocus, invalidate, invalidate, invalidate, invalidateOutline, isAccessibilityDataSensitive, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isCredential, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHandwritingDelegate, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCreateVirtualViewTranslationRequests, onDisplayHint, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyLongPress, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onScrollCaptureSearch, onSetAlpha, onStartTemporaryDetach, onViewTranslationResponse, onVirtualViewTranslationResponses, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPivot, restoreDefaultFocus, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, setAccessibilityDataSensitive, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAllowedHandwritingDelegatePackage, setAllowedHandwritingDelegatorPackage, setAlpha, setAnimation, setAnimationMatrix, setAutoHandwritingEnabled, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHandwritingBoundsOffsets, setHandwritingDelegatorCallback, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setIsCredential, setIsHandwritingDelegate, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setWindowInsetsAnimationCallback, setX, setY, setZ, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw -
Methods inherited from class io.element.android.wysiwyg.EditorEditText
drawableStateChanged, getCustomSelectionActionModeCallback, getSupportBackgroundTintList, getSupportBackgroundTintMode, getSupportCompoundDrawablesTintList, getSupportCompoundDrawablesTintMode, getText, getTextClassifier, initEmojiKeyListener, isEmojiCompatEnabled, onDetachedFromWindow, onDragEvent, onReceiveContent, setBackgroundDrawable, setBackgroundResource, setCompoundDrawables, setCompoundDrawablesRelative, setCustomSelectionActionModeCallback, setEmojiCompatEnabled, setKeyListener, setSupportBackgroundTintList, setSupportBackgroundTintMode, setSupportCompoundDrawablesTintList, setSupportCompoundDrawablesTintMode, setTextAppearance, setTextClassifier -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
EditorEditText
EditorEditText(Context context)
-
EditorEditText
EditorEditText(Context context, AttributeSet attrs)
-
EditorEditText
EditorEditText(Context context, AttributeSet attrs, Integer defStyleAttr)
-
-
Method Detail
-
getStyleConfig
final StyleConfig getStyleConfig()
The StyleConfig used to style the spans generated from the HTML in this EditText.
-
setStyleConfig
final Unit setStyleConfig(StyleConfig styleConfig)
-
getSelectionChangeListener
final EditorEditText.OnSelectionChangeListener getSelectionChangeListener()
-
setSelectionChangeListener
final Unit setSelectionChangeListener(EditorEditText.OnSelectionChangeListener selectionChangeListener)
-
getActionStatesChangedListener
final EditorEditText.OnActionStatesChangedListener getActionStatesChangedListener()
-
setActionStatesChangedListener
final Unit setActionStatesChangedListener(EditorEditText.OnActionStatesChangedListener actionStatesChangedListener)
-
getMenuActionListener
final EditorEditText.OnMenuActionChangedListener getMenuActionListener()
-
setMenuActionListener
final Unit setMenuActionListener(EditorEditText.OnMenuActionChangedListener menuActionListener)
-
getLinkActionChangedListener
final EditorEditText.OnLinkActionChangedListener getLinkActionChangedListener()
Set the link action listener to be notified when the available link action changes.
-
setLinkActionChangedListener
final Unit setLinkActionChangedListener(EditorEditText.OnLinkActionChangedListener linkActionChangedListener)
-
getMentionsStateChangedListener
final EditorEditText.OnMentionsStateChangedListener getMentionsStateChangedListener()
Set the MentionsState change listener to be notified when the state of mentions in the composer changes.
-
setMentionsStateChangedListener
final Unit setMentionsStateChangedListener(EditorEditText.OnMentionsStateChangedListener mentionsStateChangedListener)
-
getRustErrorCollector
final RustErrorCollector getRustErrorCollector()
-
setRustErrorCollector
final Unit setRustErrorCollector(RustErrorCollector rustErrorCollector)
-
getFreezesText
Boolean getFreezesText()
We'll do our own text restoration.
-
onRestoreInstanceState
Unit onRestoreInstanceState(Parcelable state)
-
onCreateInputConnection
InputConnection onCreateInputConnection(EditorInfo outAttrs)
We wrap the internal
com.android.internal.widget.EditableInputConnectionas it's not public, but its internal behavior is needed to work properly with the EditText.
-
onTextContextMenuItem
Boolean onTextContextMenuItem(Integer id)
Override context menu actions, such as cut & paste so its input is redirected to the viewModel.
-
updateStyle
final Unit updateStyle(StyleConfig styleConfig, MentionDisplayHandler mentionDisplayHandler)
Sets up the styling used to translate HTML to Spanned text.
- Parameters:
styleConfig- The styles to use for the generated spans.mentionDisplayHandler- Used to decide how to display any mentions found in the HTML text.
-
setOnRichContentSelected
final Unit setOnRichContentSelected(Function1<Uri, Unit> onRichContentSelected)
-
setText
Unit setText(CharSequence text, TextView.BufferType type)
-
append
Unit append(CharSequence text, Integer start, Integer end)
-
toggleInlineFormat
final Boolean toggleInlineFormat(InlineFormat inlineFormat)
-
toggleCodeBlock
final Boolean toggleCodeBlock()
-
toggleQuote
final Boolean toggleQuote()
-
getLinkAction
final LinkAction getLinkAction()
Get the action that can be performed based on the current link and selection state.
Based on this the caller can decide whether to call setLink, removeLink, or insertLink.
-
setLink
final Unit setLink(String url)
Set a link for the current selection. This method does nothing if there is no text selected.
- Parameters:
url- The link URL to set or null to remove
-
removeLink
final Unit removeLink()
Remove a link for the current selection. Convenience for setLink(null).
-
insertLink
final Unit insertLink(String url, String text)
Insert new text with a link.
- Parameters:
url- The link URL to settext- The new text to insert
-
toggleList
final Unit toggleList(Boolean ordered)
-
getContentAsMessageHtml
final String getContentAsMessageHtml()
Get the editor content as clean HTML suitable for sending as a message.
-
getInternalHtml
final String getInternalHtml()
-
getMarkdown
final String getMarkdown()
Get the text as markdown.
-
getContentAsMessageMarkdown
final String getContentAsMessageMarkdown()
Get the editor content as clean markdown suitable for sending as a message.
-
setMarkdown
final Unit setMarkdown(String markdown)
Set the text as markdown, it will be turned into to HTML internally.
-
insertMentionAtSuggestion
final Unit insertMentionAtSuggestion(String url, String text)
Set a mention link that applies to the current suggestion range
- Parameters:
url- The url of the new linktext- The text to insert into the current suggestion range
-
insertAtRoomMentionAtSuggestion
final Unit insertAtRoomMentionAtSuggestion()
Set a mention link that applies to the current suggestion range
-
replaceTextSuggestion
final Unit replaceTextSuggestion(String text)
Replace text in the current suggestion range
- Parameters:
text- The text to insert into the current suggestion range
-
getMentionsState
final MentionsState getMentionsState()
Get the current MentionsState of the editor.
-
setSelection
Unit setSelection(Integer start, Integer stop)
-
addTextChangedListener
Unit addTextChangedListener(TextWatcher watcher)
-
removeTextChangedListener
Unit removeTextChangedListener(TextWatcher watcher)
-
focusSearch
View focusSearch(Integer direction)
-
-
-
-