Package 

Class FrescoBasedReactTextInlineImageSpan

  • All Implemented Interfaces:
    android.text.style.UpdateAppearance , android.text.style.UpdateLayout , com.facebook.react.views.text.ReactSpan

    
    public class FrescoBasedReactTextInlineImageSpan
    extends TextInlineImageSpan
                        

    FrescoBasedTextInlineImageSpan is a span for Images that are inside . It computes its size based on the input size. When it is time to draw, it will use the Fresco framework to get the right Drawable and let that draw.

    Since Fresco needs to callback to the TextView that contains this, in the ViewManager, you must tell the Span about the TextView

    Note: It borrows code from DynamicDrawableSpan and if that code updates how it computes size or draws, we need to update this as well.

    • Method Summary

      Modifier and Type Method Description
      void onDetachedFromWindow() The ReactTextView that holds this ImageSpan is responsible for passing these methods on so thatwe can do proper lifetime management for Fresco
      void onStartTemporaryDetach() Called by the text view from onStartTemporaryDetach.
      void onAttachedToWindow() Called by the text view from onAttachedToWindow.
      void onFinishTemporaryDetach() Called by the text view from onFinishTemporaryDetach.
      Drawable getDrawable() Get the drawable that is span represents.
      int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)
      void setTextView(TextView textView) Set the textview that will contain this span.
      void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
      int getWidth() Get the width of the span.
      int getHeight() Get the height of the span.
      • Methods inherited from class com.facebook.react.views.text.TextInlineImageSpan

        possiblyUpdateInlineImageSpans
      • Methods inherited from class android.text.style.ReplacementSpan

        draw, getContentDescription, getSize, setContentDescription, updateDrawState, updateMeasureState
      • Methods inherited from class android.text.style.MetricAffectingSpan

        getUnderlying
      • Methods inherited from class android.text.style.CharacterStyle

        getUnderlying, wrap
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait