Package icyllis.modernui.markflow
Interface TextSetter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface to set text on a TextView. Primary goal is to give a way to use PrecomputedText
functionality.
-
Method Summary
-
Method Details
-
setText
void setText(@NonNull TextView textView, @NonNull Spanned markdown, @NonNull TextView.BufferType bufferType, @NonNull Consumer<TextView> afterSetText) Called byMarkflow
to install rendered Markdown to TextView.The implementation must invoke the given afterSetText with the given TextView on UI thread when set-text is finished. However, the implementation can create a WeakReference for the TextView. If it is no longer reachable, the set-text operation should be canceled and there is no need to invoke afterSetText.
- Parameters:
textView
- the TextViewmarkdown
- the rendered MarkdownbufferType
- the desired BufferTypeafterSetText
- action to run when set-text is finished (required to call in order to executeMarkflowPlugin.afterSetText(TextView)
)
-