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.

@FunctionalInterface public interface TextSetter
Interface to set text on a TextView. Primary goal is to give a way to use PrecomputedText functionality.
  • Method Details

    • setText

      void setText(@NonNull TextView textView, @NonNull Spanned markdown, @NonNull TextView.BufferType bufferType, @NonNull Consumer<TextView> afterSetText)
      Called by Markflow 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 TextView
      markdown - the rendered Markdown
      bufferType - the desired BufferType
      afterSetText - action to run when set-text is finished (required to call in order to execute MarkflowPlugin.afterSetText(TextView))