當前位置: 首頁>>代碼示例>>Java>>正文


Java CodeProcessor類代碼示例

本文整理匯總了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);
}
 
開發者ID:daquexian,項目名稱:FlexibleRichTextView,代碼行數:38,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:daquexian,項目名稱:chaoli-forum-for-android-2,代碼行數:14,代碼來源:ChaoliApplication.java

示例3: onCreate

import io.github.kbiakov.codeview.classifier.CodeProcessor; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    CodeProcessor.init(this);
}
 
開發者ID:OlgaKuklina,項目名稱:GitJourney,代碼行數:6,代碼來源:GJApplication.java


注:本文中的io.github.kbiakov.codeview.classifier.CodeProcessor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。