本文整理汇总了Java中jp.wasabeef.richeditor.RichEditor类的典型用法代码示例。如果您正苦于以下问题:Java RichEditor类的具体用法?Java RichEditor怎么用?Java RichEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RichEditor类属于jp.wasabeef.richeditor包,在下文中一共展示了RichEditor类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
}
示例3: initTextEditor
import jp.wasabeef.richeditor.RichEditor; //导入依赖的package包/类
private void initTextEditor() {
boolean useRicheditor = Utils.getUseRicheditor(activity);
if(useRicheditor) {
editor = (RichEditor) activity.findViewById(R.id.detail_description);
editor.setVisibility(View.VISIBLE);
editor.setBackgroundColor(Color.TRANSPARENT);
editor.setEditorHeight(300);
editor.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
final View bar = activity.findViewById(R.id.editor_bar);
final int visibility = bar.getVisibility();
if (visibility == View.GONE) {
bar.setVisibility(View.VISIBLE);
} else {
bar.setVisibility(View.GONE
);
}
}
});
initEditor();
}else{
editText = (EditText) activity.findViewById(R.id.detail_description_plain);
editText.setVisibility(View.VISIBLE);
editText.setMovementMethod(LinkMovementMethod.getInstance());
}
}
示例4: RichEditorNavigation
import jp.wasabeef.richeditor.RichEditor; //导入依赖的package包/类
public RichEditorNavigation(View view, RichEditor mEditor) {
this.mView = view;
this.mEditor = mEditor;
}
示例5: setupRichEditor
import jp.wasabeef.richeditor.RichEditor; //导入依赖的package包/类
public static void setupRichEditor(RichEditor richEditor) {
richEditor.setEditorHeight(EDITOR_HEIGHT);
richEditor.setPadding(EDITOR_PADDING, EDITOR_PADDING, EDITOR_PADDING, EDITOR_PADDING);
richEditor.setEditorFontSize(EDITOR_FONT_SIZE);
richEditor.loadCSS(EDITOR_DETAILS_CSS);
}