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