Skip to content

naseemakhtar994/KRichEditor

 
 

Repository files navigation

API Download Build Status Android Arsenal

KRichEditor

A rich text editor (based on QuillJs and MRichTextEditor) ported to Kotlin

Install

Add to root Gradle:

allprojects {
  repositories {
      google()
      jcenter()
      ...
      maven { url 'http://dl.bintray.com/ebolo/ebolo-oss' }
      // maven { url 'https://jitpack.io' } // For latest SNAPSHOT
      ...
  }
}

Gradle:

implementation 'com.ebolo:krichtexteditor:0.0.2'
// implementation 'com.github.daothanhduy305:KRichEditor:-SNAPSHOT'
// For latest SNAPSHOT with Jitpack
// Just retry syncing if the first one fails

Features

  • Bold
  • Italic
  • Underline
  • Strike-through
  • Heading 1
  • Heading 2
  • Heading 3
  • Heading 4
  • Heading 5
  • Heading 6
  • Paragraph
  • Quote
  • Ordered List
  • Unordered List
  • Link
  • Image
  • Justify Center
  • Justify Full
  • Justify Left
  • Justify Right
  • Subscript
  • Superscript
  • Font Size
  • Indent
  • Outdent
  • Undo
  • Redo

Screenshot

Usage

Kotlin simple - simply initialize this from any Context:

val editorFragment = kRichEditorFragment()

Kotlin advanced - you can customize it, too:

val editorFragment = kRichEditorFragment {
    // Customization block
}

To retrieve HTML code:

editorFragment.editor.getHtml( ValueCallback {
        do_something_with(it)
} )

Customizations

  • To change activated/deactivated state colors:

      buttonActivatedColorId = R.color.customActivatedColor
      buttonDeactivatedColorId = R.color.customDeactivatedColor
    
  • To set placeholder string:

      placeHolder = "New cool text..."
    
  • To set image callback:

      imageCallback = {
          // Do your stuffs here
    
          "Returning URL"
      }
    
  • ...more to come...

License

The MIT License (MIT)

Copyright © 2017 daothanhduy305,

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Packages

 
 
 

Languages

  • Kotlin 98.4%
  • Java 1.6%