本文整理汇总了Java中jp.wasabeef.richeditor.RichEditor.setHtml方法的典型用法代码示例。如果您正苦于以下问题:Java RichEditor.setHtml方法的具体用法?Java RichEditor.setHtml怎么用?Java RichEditor.setHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jp.wasabeef.richeditor.RichEditor
的用法示例。
在下文中一共展示了RichEditor.setHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showHtmlDialog
import jp.wasabeef.richeditor.RichEditor; //导入方法依赖的package包/类
public static void showHtmlDialog(Context context, String title, String htmlMessage) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
final View dialogView = inflater.inflate(R.layout.dialog_rich_text, null);
dialogBuilder.setView(dialogView);
RichEditor richEditor = dialogView.findViewById(R.id.richEditor_dialog);
richEditor.setHtml(htmlMessage);
richEditor.setInputEnabled(false);
richEditor.setFocusable(false);
setupRichEditor(richEditor);
dialogBuilder.setTitle(context.getResources().getString(R.string.details_title, title));
dialogBuilder.setPositiveButton(R.string.done, null);
dialogBuilder.create().show();
}
示例2: onCreate
import jp.wasabeef.richeditor.RichEditor; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_note_details);
body = (RichEditor) findViewById(R.id.body);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
body.setPlaceholder("Insert text here...");
body.setEnabled(true);
setupEditor();
long noteId = getIntent().getLongExtra("noteId", -1);
if (noteId != -1) {
note = Note.load(Note.class, noteId);
if (note != null) {
body.setHtml(note.getContent());
getSupportActionBar().setSubtitle("Note details");
} else {
Toast.makeText(this, "Something went terribly wrong... Can't load note information", Toast.LENGTH_LONG).show();
}
} else {
getSupportActionBar().setSubtitle("New note");
}
}