Giter Site home page Giter Site logo

wasabeef / richeditor-android Goto Github PK

View Code? Open in Web Editor NEW
6.2K 188.0 1.2K 2.83 MB

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.

License: Apache License 2.0

Java 60.65% HTML 1.40% JavaScript 34.58% CSS 3.37%
android android-library wysiwyg-editor

richeditor-android's Introduction

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.

Supported Functions

Toolbar

  • Bold
  • Italic
  • Subscript
  • Superscript
  • Strikethrough
  • Underline
  • Justify Left
  • Justify Center
  • Justify Right
  • Blockquote
  • Heading 1
  • Heading 2
  • Heading 3
  • Heading 4
  • Heading 5
  • Heading 6
  • Undo
  • Redo
  • Indent
  • Outdent
  • Insert Image
  • Insert Youtube
  • Insert Video
  • Insert Audio
  • Insert Link
  • Checkbox
  • Text Color
  • Text Background Color
  • Text Font Size
  • Unordered List (Bullets)
  • Ordered List (Numbers)

Attribute change of editor

  • Font Size
  • Background Color
  • Width
  • Height
  • Placeholder
  • Load CSS
  • State Callback

Milestone

  • Font Family

Demo

Demo

How do I use it?

Setup

Gradle
repositories {
  mavenCentral()
}

dependencies {
  implementation 'jp.wasabeef:richeditor-android:2.0.0'
}

Default Setting for Editor


Height

editor.setEditorHeight(200);

Font

editor.setEditorFontSize(22);
editor.setEditorFontColor(Color.RED);

Background

editor.setEditorBackgroundColor(Color.BLUE);
editor.setBackgroundColor(Color.BLUE);
editor.setBackgroundResource(R.drawable.bg);
editor.setBackground("https://raw.githubusercontent.com/wasabeef/art/master/chip.jpg");

Padding

editor.setPadding(10, 10, 10, 10);

Placeholder

editor.setPlaceholder("Insert text here...");

Others
Please refer the samples for usage.

Functions for ContentEditable


Bold

editor.setBold();

Italic

editor.setItalic();

Insert Image

editor.insertImage("https://raw.githubusercontent.com/wasabeef/art/master/twitter.png","twitter");

Text Change Listener

RichEditor editor = (RichEditor) findViewById(R.id.editor);
editor. setOnTextChangeListener(new RichEditor.OnTextChangeListener() {
  @Override
  public void onTextChange(String text) {
    // Do Something
     Log.d("RichEditor", "Preview " + text);
  }
});

Others
Please refer the samples for usage.

Requirements

Android 4+

Applications using RichEditor for Android

Please ping me or send a pull request if you would like to be added here.

Icon Application
Ameba Ownd
ScorePal

Developed By

Daichi Furiya (Wasabeef) - [email protected]

Follow me on Twitter

Thanks

  • Inspired by ZSSRichTextEditor in nnhubbard.

License

Copyright (C) 2020 Wasabeef

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.

richeditor-android's People

Contributors

alexcrist avatar bitdeli-chef avatar bmadaras avatar chrissd23 avatar cjwirth avatar jbcorreia avatar kashish-sharma avatar leandrolerena avatar michar avatar monkeydone avatar richfuns avatar victory-over avatar vmarch avatar wasabeef avatar yulocus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

richeditor-android's Issues

insert the audio tag

I think the insertion of audio tag should be similar to the insertion of image tag in html5, but when i insert audio tag, the position of cursor is wrong:(

Rich Editor typing data issue.

If i type the content then the content gets hidden and gets visible after i stop typing the content in it. I also kept watching it for a moment after i typed the content in it, and the cursor gets visible and hidden itself, with some text getting visible and hidden. Please fix this.

两个问题

1.怎么使富文本编辑器不可编辑(我只要查看,不要编辑)
2.如何退出subscript(点了一直在变小变小,我需要退出这个状态)

Clickable links

Hi!
First of all: Thanks for this great text editor! I am using it in my app kolabnotes android. An user of my app created an issue for a new feature, but I think the right place to handle the issue is here: konradrenner/kolabnotes-android#112

The feature request is to make links clickable in the editor view, it would be perfect if that is configureable like in the defaul android EditText, as described here: http://stackoverflow.com/questions/18219568/how-can-i-make-links-in-an-edittext-clickable

Keep the good work going ;-)

Unable to change default text color in RichEditor

The color change button works to change a span, but I want the default color to be something other than black - my app has a dark background. There is not an obvious way to do this. Is there something I'm missing, or does this feature need to be added? I'm a newcomer to Java.

How to set different text size

I have modified the source code, add a set the font size of function, but is not successful, there are two problems: 1, change the size of the font size but is not what I want; 2, conflicting with the font color. Excuse me, how to solve this problem?

I want to set the font.

I want to set the custom Font to richeditor Please help me.
On Activity launch the cursor should be in the richeditor by default. How should I implement.

Can't set Padding and background drawable

I am trying to set padding and background drawable to RichTextditor but its not working.

mEditor.setPadding(5,5,5,5);

mEditorTitle.setBackgroundResource(R.drawable.customgrey);

StackOverflowError on RichEditor.setPaddingRelative

I'm using this great library, but I have a problem in some devices:

Using library version 0.3 on Android 4.0.4 ,this is the exception:

android.view.View.setPadding (View.java:11973)
android.view.ViewGroup.setPadding (ViewGroup.java:2377)
jp.wasabeef.richeditor.RichEditor.setPadding (RichEditor.java:227)
jp.wasabeef.richeditor.RichEditor.setPaddingRelative (RichEditor.java:234)
android.view.View.setPadding (View.java:11973)
android.view.ViewGroup.setPadding (ViewGroup.java:2377)
jp.wasabeef.richeditor.RichEditor.setPadding (RichEditor.java:227)
jp.wasabeef.richeditor.RichEditor.setPaddingRelative (RichEditor.java:234)
android.view.View.setPadding (View.java:11973)
android.view.ViewGroup.setPadding (ViewGroup.java:2377)
jp.wasabeef.richeditor.RichEditor.setPadding (RichEditor.java:227)
jp.wasabeef.richeditor.RichEditor.setPaddingRelative (RichEditor.java:234)

loop goes on until StackOverflowError exception

Thanks,

Clicking on icons sometimes text disappears

When i am clicking on icons i see sometimes the text disappears.However on ur playstore sample app no such issue is there.What could be the reason of such issue?I am using the same code in my project as in sample project

charset can't too much

你好,我发现这个控件输入的字符不能太多。不然就会整个空白一片
Hello, I found this control to enter characters not too much. Otherwise it will empty a whole

Placeholder with format

Any ways of formatting the placeholder string, similarly to how the setHtml function works?

Problem with arabic language

If you write in Arabic, the cursor always stay to the right (if the text is aligned to the right) and should always stay to the left as you type.

有内存泄露问题

LongArticalEditorActivity has leaked:

  • GC ROOT org.chromium.content.browser.input.PopupTouchHandleDrawable.mContext

Insert link is not inserting a new text with the referenced link

I haven't tried on other SDKs as I am short on devices. But I tried implementing on my own app, and tried the sample app and confirmed that it is not inserting the link into the editor.

EDIT:
I found out why it is not working. It requires that there is text selected on the editor. I am trying to insert a link with a new text using the insertLink method, but since there is no selected text it is not inserting the link. Is there a workaround for this? Or maybe you can expose the insertHTML method?

Picture is enlarged

loading picture after the picture is enlarged, size beyond the screen width

String resource app_name

You have richeditor in your resources. It's overriding the default app_name used in most android projects. It is probably not used in your code anyway, so should be removed, or renamed to have a prefix like jpre__app_name otherwise.

Please update to new version

Hi,

Is it possible to upload the latest version to jcenter ?

It would be nice , because i would like to use list elements :)

Clipboard cannot set or getData

RE.editor.addEventListener("paste", function(evt) {
evt.preventDefault();
var pasteData = evt.clipboardData;
// pasteData getData.length = 0
}
How to fix it..I want to remove css style from pasted contents.

Images deletion does not work on Android 4.4

I have tested on Samsung Galaxy 4 and 5 on Android 4.4. And seems like images deletion does not work when you use software backspace button. When you connect hardware keyboard and use it everything works fine.

how to control the shown size of image

hello,i want to upload a 1080 * 1920 picture to the service,but the local picture shown is too large.how to control the shown size of picture in local.Thanks!

how to delete a pic?

I insert a pic ,but i find it's hard to delete it.When i want to delete a picture , the word before picture is deleted.The problem botherd me for days,anyone can help me ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.