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


Java ExternalStyleSheet類代碼示例

本文整理匯總了Java中br.tiagohm.markdownview.css.ExternalStyleSheet的典型用法代碼示例。如果您正苦於以下問題:Java ExternalStyleSheet類的具體用法?Java ExternalStyleSheet怎麽用?Java ExternalStyleSheet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExternalStyleSheet類屬於br.tiagohm.markdownview.css包,在下文中一共展示了ExternalStyleSheet類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import br.tiagohm.markdownview.css.ExternalStyleSheet; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {

    // get document metadata
    mDocumentMetadata = getIntent().getParcelableExtra(EXTRA_DOC);
    if (mDocumentMetadata == null) {
        finish();
        return;
    }

    super.onCreate(savedInstanceState);
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    setContentView(R.layout.activity_edit_doc);
    ButterKnife.bind(this);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(false);
    getSupportActionBar().setDisplayShowTitleEnabled(false);

    mToolbarTitle.setText(mDocumentMetadata.getName());
    mToolbarTitle.setContentDescription(mDocumentMetadata.getName());

    FontChangeCrawler fontChanger = new FontChangeCrawler(getAssets(),
            getString(R.string.font_libre_baskerville_regular));
    fontChanger.replaceFonts(mEditTextContent);

    // set up selection tool bar
    SelectionToolbarUtils.setDescriptionToToast(this,
            R.id.edit_toolbar_title,
            R.id.edit_toolbar_back,
            R.id.edit_selection_bar_format_bold,
            R.id.edit_selection_bar_format_italic,
            R.id.edit_selection_bar_format_strikethrough,
            R.id.edit_selection_bar_format_quote,
            R.id.edit_selection_bar_format_list_bulleted,
            R.id.edit_selection_bar_format_list_numbered,
            R.id.edit_selection_bar_format_link,
            R.id.edit_selection_bar_format_image,
            R.id.edit_selection_bar_format_video,
            R.id.edit_selection_bar_format_header,
            R.id.edit_selection_bar_format_header_2,
            R.id.edit_selection_bar_format_header_3);

    // set up markdown
    mPreview.addStyleSheet(new ExternalStyleSheet("https://fonts.googleapis.com/css?family=Libre+Baskerville"));
    InternalStyleSheet css = new Github();
    css.addRule("*", "color: black", "font-family: 'Libre Baskerville', serif");
    mPreview.addStyleSheet(css);

    if (savedInstanceState == null || !savedInstanceState.getBoolean(TEXT_LOADED_KEY, false)) {
        loadTextAsync();
    } else {
        mAppBar.setExpanded(true, true);
        mStartTime = savedInstanceState.getLong(START_TIME_KEY, -1);
        mTextEdited = savedInstanceState.getBoolean(TEXT_EDITED_KEY, false);
        mPreviewMode = savedInstanceState.getBoolean(PREVIEW_MODE_KEY, false);
        mTextLoaded = true;
        showLoading();
        // post runnable to be executed after edit text restore its content
        mEditTextContent.post(new Runnable() {
            @Override
            public void run() {
                subscribeObserver();
                showContent();
                if (mPreviewMode) {
                    showPreviewMode();
                }
            }
        });
    }
}
 
開發者ID:nfdz,項目名稱:foco,代碼行數:71,代碼來源:EditDocActivity.java


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