public class FrescoBasedReactTextInlineImageSpan extends TextInlineImageSpan
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.
| Constructor and Description |
|---|
FrescoBasedReactTextInlineImageSpan(android.content.res.Resources resources,
int height,
int width,
int tintColor,
android.net.Uri uri,
ReadableMap headers,
AbstractDraweeControllerBuilder draweeControllerBuilder,
java.lang.Object callerContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(android.graphics.Canvas canvas,
java.lang.CharSequence text,
int start,
int end,
float x,
int top,
int y,
int bottom,
android.graphics.Paint paint) |
android.graphics.drawable.Drawable |
getDrawable()
Get the drawable that is span represents.
|
int |
getHeight()
Get the height of the span.
|
int |
getSize(android.graphics.Paint paint,
java.lang.CharSequence text,
int start,
int end,
android.graphics.Paint.FontMetricsInt fm) |
int |
getWidth()
Get the width of the span.
|
void |
onAttachedToWindow()
Called by the text view from
View.onAttachedToWindow(). |
void |
onDetachedFromWindow()
The ReactTextView that holds this ImageSpan is responsible for passing these methods on so that
we can do proper lifetime management for Fresco
|
void |
onFinishTemporaryDetach()
Called by the text view from
View.onFinishTemporaryDetach(). |
void |
onStartTemporaryDetach()
Called by the text view from
View.onStartTemporaryDetach(). |
void |
setTextView(android.widget.TextView textView)
Set the textview that will contain this span.
|
possiblyUpdateInlineImageSpanspublic FrescoBasedReactTextInlineImageSpan(android.content.res.Resources resources,
int height,
int width,
int tintColor,
android.net.Uri uri,
ReadableMap headers,
AbstractDraweeControllerBuilder draweeControllerBuilder,
java.lang.Object callerContext)
public void onDetachedFromWindow()
onDetachedFromWindow in class TextInlineImageSpanpublic void onStartTemporaryDetach()
TextInlineImageSpanView.onStartTemporaryDetach().onStartTemporaryDetach in class TextInlineImageSpanpublic void onAttachedToWindow()
TextInlineImageSpanView.onAttachedToWindow().onAttachedToWindow in class TextInlineImageSpanpublic void onFinishTemporaryDetach()
TextInlineImageSpanView.onFinishTemporaryDetach().onFinishTemporaryDetach in class TextInlineImageSpanpublic android.graphics.drawable.Drawable getDrawable()
TextInlineImageSpangetDrawable in class TextInlineImageSpanpublic int getSize(android.graphics.Paint paint,
java.lang.CharSequence text,
int start,
int end,
android.graphics.Paint.FontMetricsInt fm)
getSize in class android.text.style.ReplacementSpanpublic void setTextView(android.widget.TextView textView)
TextInlineImageSpansetTextView in class TextInlineImageSpanpublic void draw(android.graphics.Canvas canvas,
java.lang.CharSequence text,
int start,
int end,
float x,
int top,
int y,
int bottom,
android.graphics.Paint paint)
draw in class android.text.style.ReplacementSpanpublic int getWidth()
TextInlineImageSpangetWidth in class TextInlineImageSpanpublic int getHeight()
TextInlineImageSpangetHeight in class TextInlineImageSpan