Java 类com.facebook.react.views.text.TextInlineImageSpan 实例源码

项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@Override
public void updateExtraData(ReactEditText view, Object extraData) {
  if (extraData instanceof ReactTextUpdate) {
    ReactTextUpdate update = (ReactTextUpdate) extraData;

    view.setPadding(
        (int) update.getPaddingLeft(),
        (int) update.getPaddingTop(),
        (int) update.getPaddingRight(),
        (int) update.getPaddingBottom());

    if (update.containsImages()) {
      Spannable spannable = update.getText();
      TextInlineImageSpan.possiblyUpdateInlineImageSpans(spannable, view);
    }
    view.maybeSetText(update);
  }
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@Override
public void updateExtraData(ReactEditText view, Object extraData) {
  if (extraData instanceof ReactTextUpdate) {
    ReactTextUpdate update = (ReactTextUpdate) extraData;

    view.setPadding(
        (int) update.getPaddingLeft(),
        (int) update.getPaddingTop(),
        (int) update.getPaddingRight(),
        (int) update.getPaddingBottom());

    if (update.containsImages()) {
      Spannable spannable = update.getText();
      TextInlineImageSpan.possiblyUpdateInlineImageSpans(spannable, view);
    }
    view.maybeSetText(update);
  }
}
项目:ReactNativeSignatureExample    文件:ReactTextInputManager.java   
@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);
    }
    view.maybeSetText(update);
  }
}
项目:react-native-ibeacon-android    文件:ReactTextInputManager.java   
@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);
    }
    view.maybeSetText(update);
  }
}
项目:react-native-text-input    文件:ReactTextInputManager.java   
@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);
    }
    view.maybeSetText(update);
  }
}
项目:react-native-box-loaders    文件:ReactTextInputManager.java   
@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);
    }
    view.maybeSetText(update);
  }
}
项目:Ironman    文件:ReactTextInputManager.java   
@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);
    }
    view.maybeSetText(update);
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
protected boolean verifyDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        return true;
      }
    }
  }
  return super.verifyDrawable(drawable);
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void invalidateDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        invalidate();
      }
    }
  }
  super.invalidateDrawable(drawable);
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onDetachedFromWindow() {
  super.onDetachedFromWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onDetachedFromWindow();
    }
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onStartTemporaryDetach() {
  super.onStartTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onStartTemporaryDetach();
    }
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onAttachedToWindow() {
  super.onAttachedToWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onAttachedToWindow();
    }
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onFinishTemporaryDetach() {
  super.onFinishTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onFinishTemporaryDetach();
    }
  }
}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageShadowNode.java   
@Override
public TextInlineImageSpan buildInlineImageSpan() {
  Resources resources = getThemedContext().getResources();
  int width = (int) Math.ceil(mWidth);
  int height = (int) Math.ceil(mHeight);
  return new FrescoBasedReactTextInlineImageSpan(
    resources,
    height,
    width,
    getUri(),
    getHeaders(),
    getDraweeControllerBuilder(),
    getCallerContext());
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
protected boolean verifyDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        return true;
      }
    }
  }
  return super.verifyDrawable(drawable);
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void invalidateDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        invalidate();
      }
    }
  }
  super.invalidateDrawable(drawable);
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onDetachedFromWindow() {
  super.onDetachedFromWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onDetachedFromWindow();
    }
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onStartTemporaryDetach() {
  super.onStartTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onStartTemporaryDetach();
    }
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onAttachedToWindow() {
  super.onAttachedToWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onAttachedToWindow();
    }
  }
}
项目:RNLearn_Project1    文件:ReactEditText.java   
@Override
public void onFinishTemporaryDetach() {
  super.onFinishTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onFinishTemporaryDetach();
    }
  }
}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageShadowNode.java   
@Override
public TextInlineImageSpan buildInlineImageSpan() {
  Resources resources = getThemedContext().getResources();
  int width = (int) Math.ceil(mWidth);
  int height = (int) Math.ceil(mHeight);
  return new FrescoBasedReactTextInlineImageSpan(
    resources,
    height,
    width,
    getUri(),
    getHeaders(),
    getDraweeControllerBuilder(),
    getCallerContext());
}
项目:ReactNativeSignatureExample    文件:ReactEditText.java   
@Override
protected boolean verifyDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        return true;
      }
    }
  }
  return super.verifyDrawable(drawable);
}
项目:ReactNativeSignatureExample    文件:ReactEditText.java   
@Override
public void invalidateDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        invalidate();
      }
    }
  }
  super.invalidateDrawable(drawable);
}
项目:ReactNativeSignatureExample    文件:ReactEditText.java   
@Override
public void onDetachedFromWindow() {
  super.onDetachedFromWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onDetachedFromWindow();
    }
  }
}
项目:ReactNativeSignatureExample    文件:ReactEditText.java   
@Override
public void onStartTemporaryDetach() {
  super.onStartTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onStartTemporaryDetach();
    }
  }
}
项目:ReactNativeSignatureExample    文件:ReactEditText.java   
@Override
public void onAttachedToWindow() {
  super.onAttachedToWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onAttachedToWindow();
    }
  }
}
项目:ReactNativeSignatureExample    文件:ReactEditText.java   
@Override
public void onFinishTemporaryDetach() {
  super.onFinishTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onFinishTemporaryDetach();
    }
  }
}
项目:ReactNativeSignatureExample    文件:FrescoBasedReactTextInlineImageShadowNode.java   
@Override
public TextInlineImageSpan buildInlineImageSpan() {
  Resources resources = getThemedContext().getResources();
  int height = (int) Math.ceil(getStyleHeight());
  int width = (int) Math.ceil(getStyleWidth());
  return new FrescoBasedReactTextInlineImageSpan(
    resources,
    height,
    width,
    getUri(),
    getDraweeControllerBuilder(),
    getCallerContext());
}
项目:react-native-ibeacon-android    文件:ReactEditText.java   
@Override
protected boolean verifyDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        return true;
      }
    }
  }
  return super.verifyDrawable(drawable);
}
项目:react-native-ibeacon-android    文件:ReactEditText.java   
@Override
public void invalidateDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        invalidate();
      }
    }
  }
  super.invalidateDrawable(drawable);
}
项目:react-native-ibeacon-android    文件:ReactEditText.java   
@Override
public void onDetachedFromWindow() {
  super.onDetachedFromWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onDetachedFromWindow();
    }
  }
}
项目:react-native-ibeacon-android    文件:ReactEditText.java   
@Override
public void onStartTemporaryDetach() {
  super.onStartTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onStartTemporaryDetach();
    }
  }
}
项目:react-native-ibeacon-android    文件:ReactEditText.java   
@Override
public void onAttachedToWindow() {
  super.onAttachedToWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onAttachedToWindow();
    }
  }
}
项目:react-native-ibeacon-android    文件:ReactEditText.java   
@Override
public void onFinishTemporaryDetach() {
  super.onFinishTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onFinishTemporaryDetach();
    }
  }
}
项目:react-native-ibeacon-android    文件:FrescoBasedReactTextInlineImageShadowNode.java   
@Override
public TextInlineImageSpan buildInlineImageSpan() {
  Resources resources = getThemedContext().getResources();
  int height = (int) Math.ceil(getStyleHeight());
  int width = (int) Math.ceil(getStyleWidth());
  return new FrescoBasedReactTextInlineImageSpan(
    resources,
    height,
    width,
    getUri(),
    getDraweeControllerBuilder(),
    getCallerContext());
}
项目:react-native-text-input    文件:ReactEditText.java   
@Override
protected boolean verifyDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        return true;
      }
    }
  }
  return super.verifyDrawable(drawable);
}
项目:react-native-text-input    文件:ReactEditText.java   
@Override
public void invalidateDrawable(Drawable drawable) {
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      if (span.getDrawable() == drawable) {
        invalidate();
      }
    }
  }
  super.invalidateDrawable(drawable);
}
项目:react-native-text-input    文件:ReactEditText.java   
@Override
public void onDetachedFromWindow() {
  super.onDetachedFromWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onDetachedFromWindow();
    }
  }
}
项目:react-native-text-input    文件:ReactEditText.java   
@Override
public void onStartTemporaryDetach() {
  super.onStartTemporaryDetach();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onStartTemporaryDetach();
    }
  }
}
项目:react-native-text-input    文件:ReactEditText.java   
@Override
public void onAttachedToWindow() {
  super.onAttachedToWindow();
  if (mContainsImages && getText() instanceof Spanned) {
    Spanned text = (Spanned) getText();
    TextInlineImageSpan[] spans = text.getSpans(0, text.length(), TextInlineImageSpan.class);
    for (TextInlineImageSpan span : spans) {
      span.onAttachedToWindow();
    }
  }
}