Knife

介绍:

一个原生的富文本编辑器,支持html的导入与导出。

运行效果:

使用说明:

apk

 demo apk

Api

  • bold(boolean valid) bold the selected text.

  • italic(boolean valid) italic the selected text.

  • underline(boolean valid) underline the selected text.

  • strikethrough(boolean valid) strikethrough the selected text.

  • bullet(boolean valid) bullet the selected text.

  • quote(boolean valid) quote the selected text.

  • link(String link) and link(String link, int start, int end) to link the text.

  • contains(int FORMAT) return true if the selected text contains the FORMAT.

  • clearFormats() clear all formats.

  • redo() when text changed, you can redo it!

  • undo() when text change, you can also undo it!

  • fromHtml() import from HTML file.

  • toHtml() export as HTML file.

Custom

  • app:bulletColor

  • app:bulletRadius

  • app:bulletGapWidth

  • app:historyEnable true to enable record history, so you can redo() and undo().

  • app:historySize the record max limit.

  • app:linkColor

  • app:linkUnderline true to enable link underline.

  • app:quoteColor

  • app:quoteStripeWidth the quote line width.

  • app:quoteCapWidth

Gradle

At your top-level build.gradle file:

repositories {
    // ...
    maven { url 'https://jitpack.io' }
}

And then at your project build.gradle file:

dependencies {
    compile 'com.github.mthli:Knife:v1.1'
}

Reference

已下载
0