本文整理匯總了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);
}
}
}