本文整理汇总了Java中io.github.kbiakov.codeview.classifier.CodeProcessor类的典型用法代码示例。如果您正苦于以下问题:Java CodeProcessor类的具体用法?Java CodeProcessor怎么用?Java CodeProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CodeProcessor类属于io.github.kbiakov.codeview.classifier包,在下文中一共展示了CodeProcessor类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import io.github.kbiakov.codeview.classifier.CodeProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// train classifier on app start
CodeProcessor.init(this);
AjLatexMath.init(this); // init library: load fonts, create paint, etc.
List<Attachment> attachments = new ArrayList<>();
attachments.add(new ExampleAttachment("Android Image", "53ce1", true, "http://tse1.mm.bing.net/th?id=OIP.M24baa78c1fb80a71891ce775d11e038ao0&w=166&h=166&c=7&qlt=90&o=4&pid=1.7"));
attachments.add(new ExampleAttachment("Here is a link", "bc41a", false, "https://google.com"));
FlexibleRichTextView flexibleRichTextView = (FlexibleRichTextView) findViewById(R.id.frtv);
Tokenizer.setCenterStartLabels("<center>");
Tokenizer.setCenterEndLabels("</center>");
Tokenizer.setTitleStartLabels("<h>");
Tokenizer.setTitleEndLabels("</h>");
flexibleRichTextView.setText("<h><center>hi!</center></h>" +
"[quote]This is quote\n" +
"second line\n" +
"third line\n" +
"fourth line[/quote]" +
"Here is an attachment:[attachment:53ce1]" +
"[code]print(\"Hello FlexibleRichTextView!\")[/code]" +
"Hello FlexibleRichTextView!\n" +
"This is LaTeX:\n" +
"$e^{\\pi i} + 1 = 0$\n" +
"This is table:\n" +
"| First Header | Second Header |\n" +
"| --- | --- |\n" +
"| Content Cell | Content Cell |\n" +
"| Content Cell | Content Cell |\n" +
"An attachment is shown at the bottom: \n",
attachments);
}
示例2: onCreate
import io.github.kbiakov.codeview.classifier.CodeProcessor; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// train classifier on app start
CodeProcessor.init(this);
ChaoliApplication.appContext = getApplicationContext();
if (NightModeHelper.isDay()){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
}
Stetho.initializeWithDefaults(this);
}
示例3: onCreate
import io.github.kbiakov.codeview.classifier.CodeProcessor; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CodeProcessor.init(this);
}