Knife
Knife is a rich text editor for Android. Just select text and use one line code to style it.
Fork
Original library was abandoned for 2 years and was distributed with manifest merging problems.
Example
Usage
Add dependency to your build.gradle
file:
compile 'com.alexvasilkov:knife-fork:1.2.1'
Styling
-
bold(boolean valid)
bold the selected text. -
italic(boolean valid)
italic the selected text. -
underline(boolean valid)
<u>underline</u> the selected text. -
strikethrough(boolean valid)
strikethroughthe selected text. -
bullet(boolean valid)
bullet the selected text. -
quote(boolean valid)
quote the selected text. -
link(String link)
andlink(String link, int start, int end)
to link the text. -
contains(int FORMAT)
returntrue
if the selected text contains the FORMAT. -
clearFormats()
clear all formats. -
fromHtml()
import from HTML file. -
toHtml()
export as HTML file.
Custom
-
app:knife_bulletColor
-
app:knife_bulletRadius
-
app:knife_bulletGap
-
app:knife_linkColor
-
app:knife_linkUnderline
true
to enable link underline. -
app:knife_quoteColor
-
app:knife_quoteStripeWidth
the quote line width. -
app:knife_quoteGap
Reference
Thanks
License
Copyright 2015 Matthew Lee
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.