當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。