本文整理汇总了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();
}
}
});
}
}