Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/AvinashSKaranth/android-summernote

Offline WYSIWYG HTML Editor for Android App
https://github.com/AvinashSKaranth/android-summernote

Last synced: about 1 month ago
JSON representation

Offline WYSIWYG HTML Editor for Android App

Awesome Lists containing this project

README

        

# android-summernote
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-android--summernote-green.svg?style=true)](https://android-arsenal.com/details/1/3392)

To Add Offline WYSIWYG HTML Editor to your Android App

android-summernote

Add this to your dependencies

```groovy
compile 'in.nashapp.androidsummernote:androidsummernote:1.0.5'
```

Add to Manifest (For adding images from Device)
```xml

```

Add to your XML
```xml

```

Link the view in your Java Code
```java
Summernote summernote = (Summernote) findViewById(R.id.summernote);
summernote.setRequestCodeforFilepicker(5);//Any Number which is not being used by other OnResultActivity
```

Pass the on onActivityResult to Summernote. (Enables attaching images to the Document)
```java
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
summernote.onActivityResult(requestCode, resultCode, intent);
}
```

Retrive HTML Data
```java
String html_data = summernote.getText()
```

Set HTML Data
```java
summernote.setText("

Hello World.



I'am Summernote

");
```

Known Issues

* Calling from Fragment

Current Resolution

Using summernote as a static variable in the Fragment and calling onActivityResult from the Main Activity
```java
// In Fragment
static Summernote summernote;

// In Activity
Fragment.summernote.onActivityResult(requestCode, resultCode, intent);
```
**License**
Apache License 2.0