当前位置: 首页>>代码示例>>Java>>正文


Java RichEditor类代码示例

本文整理汇总了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();
}
 
开发者ID:djuelg,项目名称:Neuronizer,代码行数:16,代码来源:BaseDialogs.java

示例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");
    }
}
 
开发者ID:hamzux,项目名称:cosi,代码行数:34,代码来源:NoteDetailsActivity.java

示例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());
    }
}
 
开发者ID:konradrenner,项目名称:kolabnotes-android,代码行数:29,代码来源:DetailFragment.java

示例4: RichEditorNavigation

import jp.wasabeef.richeditor.RichEditor; //导入依赖的package包/类
public RichEditorNavigation(View view, RichEditor mEditor) {
    this.mView = view;
    this.mEditor = mEditor;
}
 
开发者ID:djuelg,项目名称:Neuronizer,代码行数:5,代码来源:RichEditorNavigation.java

示例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);
}
 
开发者ID:djuelg,项目名称:Neuronizer,代码行数:7,代码来源:RichEditorNavigation.java


注:本文中的jp.wasabeef.richeditor.RichEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。