本文整理汇总了Java中io.github.kbiakov.codeview.CodeView类的典型用法代码示例。如果您正苦于以下问题:Java CodeView类的具体用法?Java CodeView怎么用?Java CodeView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeView类属于io.github.kbiakov.codeview包,在下文中一共展示了CodeView类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: code
import io.github.kbiakov.codeview.CodeView; //导入依赖的package包/类
/**
* see {@link #setPost(Post)}
*/
private void code(String str) {
str = removeTags(str);
CodeView codeView = (CodeView) LayoutInflater.from(mContext).inflate(R.layout.code_view, this, false);
codeView.setCode(str);
addView(codeView);
}
示例2: setToken
import io.github.kbiakov.codeview.CodeView; //导入依赖的package包/类
public void setToken(List<TOKEN> tokens, List<Attachment> attachmentList) {
removeAllViews();
mAttachmentList = attachmentList;
mTokenList = tokens;
for (TOKEN token : tokens) {
if (token instanceof ATTACHMENT) {
mAttachmentList.remove(((ATTACHMENT) token).attachment);
}
}
resetTokenIndex();
List<Object> result = until(END.class);
if (mShowRemainingAtt) {
// remaining attachments will show at the bottom of view
for (Attachment att : mAttachmentList) {
append(result, attachment(att));
}
}
if (result == null) {
return;
}
for (final Object o : result) {
if (o instanceof TextWithFormula) {
final TextWithFormula textWithFormula = (TextWithFormula) o;
final LaTeXtView textView = new LaTeXtView(mContext);
textView.setTextWithFormula(textWithFormula);
textView.setMovementMethod(LinkMovementMethod.getInstance());
myAddView(textView);
} else if (o instanceof CodeView) {
myAddView((CodeView) o);
} else if (o instanceof ImageView) {
myAddView((ImageView) o);
} else if (o instanceof HorizontalScrollView) {
myAddView((HorizontalScrollView) o);
} else if (o instanceof QuoteView) {
myAddView((QuoteView) o);
}
}
}