Example usage for com.facebook.react.views.text TextInlineImageSpan possiblyUpdateInlineImageSpans

List of usage examples for com.facebook.react.views.text TextInlineImageSpan possiblyUpdateInlineImageSpans

Introduction

In this page you can find the example usage for com.facebook.react.views.text TextInlineImageSpan possiblyUpdateInlineImageSpans.

Prototype

public static void possiblyUpdateInlineImageSpans(Spannable spannable, TextView view) 

Source Link

Document

For TextInlineImageSpan we need to update the Span to know that the window is attached and the TextView that we will set as the callback on the Drawable.

Usage

From source file:fr.bamlab.textinput.ReactTextInputManager.java

License:Open Source License

@Override
public void updateExtraData(ReactEditText view, Object extraData) {
    if (extraData instanceof float[]) {
        float[] padding = (float[]) extraData;

        view.setPadding((int) Math.ceil(padding[0]), (int) Math.ceil(padding[1]), (int) Math.ceil(padding[2]),
                (int) Math.ceil(padding[3]));
    } else if (extraData instanceof ReactTextUpdate) {
        ReactTextUpdate update = (ReactTextUpdate) extraData;
        if (update.containsImages()) {
            Spannable spannable = update.getText();
            TextInlineImageSpan.possiblyUpdateInlineImageSpans(spannable, view);
        }//from ww w . j  a v  a2s . co  m
        view.maybeSetText(update);
    }
}