本文整理汇总了Java中com.zzhoujay.markdown.style.CodeSpan类的典型用法代码示例。如果您正苦于以下问题:Java CodeSpan类的具体用法?Java CodeSpan怎么用?Java CodeSpan使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CodeSpan类属于com.zzhoujay.markdown.style包,在下文中一共展示了CodeSpan类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkInCode
import com.zzhoujay.markdown.style.CodeSpan; //导入依赖的package包/类
private boolean checkInCode(SpannableStringBuilder builder, int start, int end) {
CodeSpan[] css = builder.getSpans(0, builder.length(), CodeSpan.class);
for (CodeSpan cs : css) {
int c_start = builder.getSpanStart(cs);
int c_end = builder.getSpanEnd(cs);
if (!(c_start >= end || c_end <= start)) {
return true;
}
}
return false;
}
示例2: code
import com.zzhoujay.markdown.style.CodeSpan; //导入依赖的package包/类
@Override
public SpannableStringBuilder code(CharSequence charSequence) {
SpannableStringBuilder builder = SpannableStringBuilder.valueOf(charSequence);
CodeSpan span = new CodeSpan(code_background_color, code_text_color);
builder.setSpan(span, 0, charSequence.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return builder;
}
示例3: reallyHandler
import com.zzhoujay.markdown.style.CodeSpan; //导入依赖的package包/类
@SuppressWarnings("unused")
private void reallyHandler(int start, int end, String tag, Editable out, XMLReader reader) {
switch (tag.toLowerCase()) {
case "code":
CodeSpan cs = new CodeSpan(code_color);
out.setSpan(cs, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
break;
case "ol":
case "ul":
out.append('\n');
if (!list.isEmpty())
list.pop();
break;
case "li":
boolean isUl = list.peek();
int i;
if (isUl) {
index = 0;
i = -1;
} else {
i = ++index;
}
out.append('\n');
TextView textView = textViewSoftReference.get();
if (textView == null) {
return;
}
MarkDownBulletSpan bulletSpan = new MarkDownBulletSpan(list.size() - 1, h1_color, i, textView);
out.setSpan(bulletSpan, start, out.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
break;
}
}