当前位置: 首页>>代码示例>>Java>>正文


Java Spanned.SPAN_EXCLUSIVE_EXCLUSIVE属性代码示例

本文整理汇总了Java中android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE属性的典型用法代码示例。如果您正苦于以下问题:Java Spanned.SPAN_EXCLUSIVE_EXCLUSIVE属性的具体用法?Java Spanned.SPAN_EXCLUSIVE_EXCLUSIVE怎么用?Java Spanned.SPAN_EXCLUSIVE_EXCLUSIVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.text.Spanned的用法示例。


在下文中一共展示了Spanned.SPAN_EXCLUSIVE_EXCLUSIVE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attachFontFace

private static void attachFontFace(SpannableStringBuilder cueText, int fontFace,
    int defaultFontFace, int start, int end, int spanPriority) {
  if (fontFace != defaultFontFace) {
    final int flags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | spanPriority;
    boolean isBold = (fontFace & FONT_FACE_BOLD) != 0;
    boolean isItalic = (fontFace & FONT_FACE_ITALIC) != 0;
    if (isBold) {
      if (isItalic) {
        cueText.setSpan(new StyleSpan(Typeface.BOLD_ITALIC), start, end, flags);
      } else {
        cueText.setSpan(new StyleSpan(Typeface.BOLD), start, end, flags);
      }
    } else if (isItalic) {
      cueText.setSpan(new StyleSpan(Typeface.ITALIC), start, end, flags);
    }
    boolean isUnderlined = (fontFace & FONT_FACE_UNDERLINE) != 0;
    if (isUnderlined) {
      cueText.setSpan(new UnderlineSpan(), start, end, flags);
    }
    if (!isUnderlined && !isBold && !isItalic) {
      cueText.setSpan(new StyleSpan(Typeface.NORMAL), start, end, flags);
    }
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:24,代码来源:Tx3gDecoder.java

示例2: Builder

private Builder(@NonNull CharSequence text) {
    this.text = text;
    flag = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    foregroundColor = defaultValue;
    backgroundColor = defaultValue;
    quoteColor = defaultValue;
    proportion = -1;
    xProportion = -1;
    mBuilder = new SpannableStringBuilder();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:SpannableStringUtils.java

示例3: setDefault

private void setDefault() {
    flag = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    foregroundColor = COLOR_DEFAULT;
    backgroundColor = COLOR_DEFAULT;
    lineHeight = -1;
    quoteColor = COLOR_DEFAULT;
    first = -1;
    bulletColor = COLOR_DEFAULT;
    iconMarginBitmap = null;
    iconMarginDrawable = null;
    iconMarginUri = null;
    iconMarginResourceId = -1;
    iconMarginGapWidth = -1;
    fontSize = -1;
    proportion = -1;
    xProportion = -1;
    isStrikethrough = false;
    isUnderline = false;
    isSuperscript = false;
    isSubscript = false;
    isBold = false;
    isItalic = false;
    isBoldItalic = false;
    fontFamily = null;
    typeface = null;
    alignment = null;
    clickSpan = null;
    url = null;
    blurRadius = -1;
    shader = null;
    shadowRadius = -1;
    spans = null;

    imageBitmap = null;
    imageDrawable = null;
    imageUri = null;
    imageResourceId = -1;

    spaceSize = -1;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:SpanUtils.java

示例4: Builder

public Builder() {
    flag = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    foregroundColor = defaultValue;
    backgroundColor = defaultValue;
    quoteColor = defaultValue;
    margin = -1;
    fontSize = -1;
    proportion = -1;
    xProportion = -1;
    align = ALIGN_BOTTOM;
    mBuilder = new SpannableStringBuilder();
}
 
开发者ID:hoangkien0705,项目名称:Android-UtilCode,代码行数:12,代码来源:SpannableStringUtils.java

示例5: Builder

private Builder(Context context, @NonNull CharSequence text) {
    this.mContext = context;
    this.text = text;
    flag = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    foregroundColor = defaultValue;
    backgroundColor = defaultValue;
    quoteColor = defaultValue;
    proportion = -1;
    xProportion = -1;
    mBuilder = new SpannableStringBuilder();
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:11,代码来源:SpannableStringUtils.java

示例6: setDefault

private void setDefault() {
    flag = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    foregroundColor = DEFAULT_COLOR;
    backgroundColor = DEFAULT_COLOR;
    lineHeight = -1;
    quoteColor = DEFAULT_COLOR;
    first = -1;
    bulletColor = DEFAULT_COLOR;
    iconMarginBitmap = null;
    iconMarginDrawable = null;
    iconMarginUri = null;
    iconMarginResourceId = -1;
    iconMarginGapWidth = -1;
    fontSize = -1;
    proportion = -1;
    xProportion = -1;
    isStrikethrough = false;
    isUnderline = false;
    isSuperscript = false;
    isSubscript = false;
    isBold = false;
    isItalic = false;
    isBoldItalic = false;
    fontFamily = null;
    typeface = null;
    alignment = null;
    clickSpan = null;
    url = null;
    blurRadius = -1;
    shader = null;
    shadowRadius = -1;
    spans = null;

    imageBitmap = null;
    imageDrawable = null;
    imageUri = null;
    imageResourceId = -1;

    spaceSize = -1;
}
 
开发者ID:pan2yong22,项目名称:AndroidUtilCode-master,代码行数:40,代码来源:SpanUtils.java

示例7: manageSpans

/**
 * Remove and/or add {@link Spanned.SPAN_EXCLUSIVE_EXCLUSIVE} spans, since they should only exist
 * as long as the text they cover is the same. All other spans will remain the same, since they
 * will adapt to the new text, hence why {@link SpannableStringBuilder#replace} never removes
 * them.
 */
private void manageSpans(SpannableStringBuilder spannableStringBuilder) {
  Object[] spans = getText().getSpans(0, length(), Object.class);
  for (int spanIdx = 0; spanIdx < spans.length; spanIdx++) {
    // Remove all styling spans we might have previously set
    if (ForegroundColorSpan.class.isInstance(spans[spanIdx]) ||
        BackgroundColorSpan.class.isInstance(spans[spanIdx]) ||
        AbsoluteSizeSpan.class.isInstance(spans[spanIdx]) ||
        CustomStyleSpan.class.isInstance(spans[spanIdx]) ||
        ReactTagSpan.class.isInstance(spans[spanIdx])) {
      getText().removeSpan(spans[spanIdx]);
    }

    if ((getText().getSpanFlags(spans[spanIdx]) & Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) !=
        Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) {
      continue;
    }
    Object span = spans[spanIdx];
    final int spanStart = getText().getSpanStart(spans[spanIdx]);
    final int spanEnd = getText().getSpanEnd(spans[spanIdx]);
    final int spanFlags = getText().getSpanFlags(spans[spanIdx]);

    // Make sure the span is removed from existing text, otherwise the spans we set will be
    // ignored or it will cover text that has changed.
    getText().removeSpan(spans[spanIdx]);
    if (sameTextForSpan(getText(), spannableStringBuilder, spanStart, spanEnd)) {
      spannableStringBuilder.setSpan(span, spanStart, spanEnd, spanFlags);
    }
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:35,代码来源:ReactEditText.java

示例8: getSpanPointMarkFlag

private static int getSpanPointMarkFlag(final boolean isStartExclusive,
        final boolean isEndExclusive) {
    if (isStartExclusive) {
        return isEndExclusive ? Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
                : Spanned.SPAN_EXCLUSIVE_INCLUSIVE;
    }
    return isEndExclusive ? Spanned.SPAN_INCLUSIVE_EXCLUSIVE
            : Spanned.SPAN_INCLUSIVE_INCLUSIVE;
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:9,代码来源:LocaleSpanCompatUtils.java

示例9: Builder

private Builder(@NonNull CharSequence text) {
    this.text = text;
    flag = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    foregroundColor = defaultValue;
    backgroundColor = defaultValue;
    quoteColor = defaultValue;
    textSize = -1;
    proportion = -1;
    xProportion = -1;
    mBuilder = new SpannableStringBuilder();
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:11,代码来源:SpannableStringUtils.java

示例10: exclusive

@Override
public StyleEZ exclusive() {
    spanFlags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
    return this;
}
 
开发者ID:yombunker,项目名称:SpanEZ,代码行数:5,代码来源:SpanEZ.java


注:本文中的android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。