Step 1: demo中引入richeditor
implementation 'jp.wasabeef:richeditor-android:1.2.2'
Step 2: demo中设置简单布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.example.demo.weimuyundemo.plugins.x5webview.X5WebView
android:id="@+id/x5_view"
android:layout_width="match_parent"
android:layout_height="100dp"
android:padding="5dp"
android:background="@android:color/darker_gray">
</com.example.demo.weimuyundemo.plugins.x5webview.X5WebView>
<TextView
android:id="@+id/text_view"
android:layout_below="@id/x5_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<jp.wasabeef.richeditor.RichEditor
android:id="@+id/rich_editor"
android:layout_below="@id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="5dp"
android:background="@android:color/darker_gray">
</jp.wasabeef.richeditor.RichEditor>
<LinearLayout
android:layout_below="@id/rich_editor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginHorizontal="5dp">
<Button
android:id="@+id/undo_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="撤销"/>
<Button
android:id