Giter Club home page Giter Club logo

android-wysiwyg-editor's Issues

onclick event is not working

onclick event is not working on the editor. Is there any event which detect that editor got focus?
I tried focus change event too but it's not working too.

Not able to update/render OL and UL

Query 1 :
I am not able to edit/render order and unorder list.

Edit text :

String dummyText =
                "<p>Genertaing &nbsp;html from ckeditor blah blah blah<br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod<br>tempor " +
                        "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,<br>quis nostrud exercitation ullamco laboris nisi ut aliquip " +
                        "ex ea commodo<br>consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse<br>cillum dolore eu fugiat nulla pariatur" +
                        ". Excepteur sint occaecat cupidatat non<br>proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>&nbsp;" +
                        "</p><ol><li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod<br>tempor incididunt ut labore et dolore magna " +
                        "aliqua. Ut enim ad minim veniam,<br>quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo<br>consequat. Duis aute " +
                        "irure dolor in reprehenderit in voluptate velit esse<br>cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat " +
                        "non<br>proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br><strong>ohh bold text<br><em>Why not " +
                        "italicize</em></strong><br>&nbsp;</li><li><strong><em>no</em></strong></li><li><strong><em>no</em></strong></li><li><strong><em>no" +
                        "</em></strong></li></ol>";

When i try to render this text, it repeats the data 4 times in order list format. Expected result : 2 order list items and 2 unorder list items

String dummy2 ="<p><strong>abcasd sad</strong></p><ol><li>12345</li><li>9833232</li></ol><ul><li>bullet</li><li>ok " +
            "http</li></ul><p><em>asd1111221</em></p><p><em><a href=\\\"http://abc.com\\\">http://abc.com</a></em></p>";

When i try to render this text, it repeats the same data items in order and underorder list format. Expected result : order/unorder list items have different items. It should repeated data.

Query 2 :
Will the performace hamper if I use this editor for each row-item in recyclerview. There could n no of instance of editor in recyclerview. Do you recommend to use inside recyclerview?

IndexOutOfBoundsException

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2560)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5740)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:260)
at java.util.ArrayList.get(ArrayList.java:313)
at org.jsoup.select.Elements.get(Elements.java:544)
at org.jsoup.nodes.Element.child(Element.java:171)
at com.github.irshulx.Components.HTMLExtensions.RenderImage(HTMLExtensions.java:78)
at com.github.irshulx.Components.HTMLExtensions.buildNode(HTMLExtensions.java:63)
at com.github.irshulx.Components.HTMLExtensions.parseHtml(HTMLExtensions.java:33)
at com.github.irshulx.EditorCore.renderEditorFromHtml(EditorCore.java:538)
at com.github.irshulx.Editor.render(Editor.java:75)

java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable com.github.irshulx.Components.CustomEditText.getText()' on a null object reference

Gives me this error when I have multiple lines of text and then I put the cursor in the very beginning and presses the back button. The app finally crashes.

Also when I paste an English or a Korean text, it does not paste it correctly. With English text paste I get some text missing while in case of Korean text, I get multiple same text.

java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable com.github.irshulx.Components.CustomEditText.getText()' on a null object reference
        at com.github.irshulx.EditorCore.onKey(EditorCore.java:604)
        at com.github.irshulx.Editor.onKey(Editor.java:304)
        at com.github.irshulx.Components.InputExtensions$1.onKey(InputExtensions.java:176)

How to remove auto focus from editor

I have 1 Edittext with named "title" before this editot and I would like to have focus on that title edittext when screen open but it show the focus on this editor.

I called below api to remove focus but failed.

description.clearAllContents(); description.clearChildFocus(description); title.requestFocus(); description.clearFocus();

Is there any way to remove focus from editor in starting?

rendering problem

I am trying to use android-wysiwyg-editor in fragment.
but I've got a rendering problem with below exception.

could you help me?

java.lang.ClassCastException: com.android.layoutlib.bridge.android.BridgeContext cannot be cast to android.app.Activity
at com.github.irshulx.BaseClass.(BaseClass.java:73)
at com.github.irshulx.Editor.(Editor.java:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

Exception on InsertLink When current line is empty

java.lang.StringIndexOutOfBoundsException: length=0; index=-1 at java.lang.String.indexAndLength(String.java:500) at java.lang.String.charAt(String.java:494) at com.github.irshulx.Components.InputExtensions.trimLineEnding(InputExtensions.java:428) at com.github.irshulx.Components.InputExtensions.InsertLink(InputExtensions.java:401) at com.github.irshulx.Components.InputExtensions.access$000(InputExtensions.java:50) at com.github.irshulx.Components.InputExtensions$5.onClick(InputExtensions.java:383)

Render(HTML) throws error

I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead

Copy paste issue

pasting multiple lines when copy from clipboard.
Android 5.0.1

laser-native-editor:2.0.0 Gradle error

Downloading with gradle is impossible. I use this line in gradle module file:
compile 'com.github.irshulx:laser-native-editor:2.0.0'

Compiler gives failed to resolve error. I use the latest version of Android Studio.

java.lang.NullPointerException: Attempt to read from field 'com.github.irshulx.models.EditorType com.github.irshulx.models.EditorControl.Type' on a null object reference

I have trouble with putting pictures in the article.

If I put a picture only, it works, but if i put a picture with some tags(ex, number tag, ul, ...)
it doesn't work.

There is an error message.
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://media/external/images/media/10170 flg=0x1 (has extras) }} to activity {com.ted.android.driving/com.ted.android.driving.TextEditActivity}: java.lang.NullPointerException: Attempt to read from field 'com.github.irshulx.models.EditorType com.github.irshulx.models.EditorControl.Type' on a null object reference

I don't know why this happens.

How to add text programmatically?

I can't write or append text programmatically like when I am using keyboard.
I used render() and getInputExtensions().insertEditText(0 ,null ,"TEXT"); and none of them working correctly.

How can I append my text like I'm typing?

REEdit Numbering and Bullets

when reediting numbering and bullets, the editor render will show the list but it will change and use the first value in the list for all list item. Please help me solve this issue. thanks

Not wokring in Landscape mode

When we try to edit the layout in landscape mode the keyboard cover the whole screen and we are not able to style our text in landscape mode

authentication during upload

our server forbids upload from anonymous users and in order to upload, you must login first.
in upload process, I must send credentials as http headers to server so that it recognize me and accept uploading.
please add a method to set http headers
something like this:

editor.setHttpHeader(Map<String,String> headers)

imagepicker wont work with fragment

the imagepicker uses startActivityForResult from editorCore which uses the context of the view
and therefor the activity. when used inside a fragment the fragment wont recieve the onActivityResult call.
i added 2 methods for this :

//my addition for fragment handle
        public void OpenFragmentImagePicker(Fragment fragment) {
            getImageExtensions().OpenFragmentImageGallery(fragment);
        }

/my extention for fragment handling
    public void OpenFragmentImageGallery(Fragment fragment) {
        int Index=this.editorCore.determineIndex(EditorType.none);
        EditorContent state= editorCore.getContent();
        Intent intent = new Intent();
// Show only images, no videos or anything else
        intent.setType("image/*");
        intent.setAction(Intent.ACTION_GET_CONTENT);
    // Always show the chooser (if there are multiple options available)
        fragment.startActivityForResult(Intent.createChooser(intent, "Select an image"), editorCore.PICK_IMAGE_REQUEST);
    }

my method is crude and this probably needs to be handled in the project

Render images in html

In the render mode images are not shown. Is it a bug or the module has not this feature? I am using v2.0.0.

Copy/Paste multiline text issue

When the copied text is a continuous paragraph, then paste works fine. However, if the copied text is multi-lined, then weirdly it takes the last sentence of the text and pastes it many times in between.

Please help. I tried using both English and Korean text

Text editor starts with premade text

Hi, I wanted to pass a string from an activity to the text editor activity.
I have moved the String but when I tried to make the editor start with a predefined String I can't.
Is there an option to add a method that let's the text editor start with a text that you can edit?

Exception when I add new empty line twice

08-29 13:56:35.417 10860-10860/com.example.abdulkader.e_document_android_project E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.abdulkader.e_document_android_project, PID: 10860
java.lang.StringIndexOutOfBoundsException
at android.text.SpannableStringBuilder.(SpannableStringBuilder.java:58)
at android.text.SpannableStringBuilder.subSequence(SpannableStringBuilder.java:907)
at com.github.irshulx.Components.InputExtensions$3.afterTextChanged(InputExtensions.java:211)
at android.widget.TextView.sendAfterTextChanged(TextView.java:7695)
at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9483)
at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:972)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:454)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:33)
at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685)
at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197)
at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:184)
at android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:286)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

How do I change text color?

Hi
Thank you for this great library.
Please, I would like to change the text color of the editor from black. How can I do that?

method(setLineSpacing) is not work

Thanks to it, I use it well.
I have a problem with high word height.

method(setLineSpacing) is not work.
editor.setLineSpacing(float) = cannot resolve method setLineSpacing

Thank you very much.

(Google Translator)

HTML render problem.

editor.render("HTML CONTENT") renders randomly and updates the editor. How can i render the html content serially as per original html content one by one?

example:
original html -> input-image-input-image
rendered -> input-image-image-input.

How can i get it to render properly as per the original html content?

OutofMemoryError

when I try to add one more photo I got OutofMemoryError.

java.lang.OutOfMemoryError: Failed to allocate a 63701004 byte allocation with 16777216 free bytes and 48MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:639)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:615)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:653)
at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:845)
at com.pixeldirects.projectb.activity.WritePostActivity.onActivityResult(WritePostActivity.kt:72)
at android.app.Activity.dispatchActivityResult(Activity.java:6243)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3577)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3624)
at android.app.ActivityThread.access$1300(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

Copy Paste Issue

when copy multiple line.its not handling (ANR) how to reslove this issue

Not able to update/render OL and UL

Query 1 :
I am not able to edit/render order and unorder list.

# Edit text :

String dummyText =
                "<p>Genertaing &nbsp;html from ckeditor blah blah blah<br>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod<br>tempor " +
                        "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,<br>quis nostrud exercitation ullamco laboris nisi ut aliquip " +
                        "ex ea commodo<br>consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse<br>cillum dolore eu fugiat nulla pariatur" +
                        ". Excepteur sint occaecat cupidatat non<br>proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>&nbsp;" +
                        "</p><ol><li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod<br>tempor incididunt ut labore et dolore magna " +
                        "aliqua. Ut enim ad minim veniam,<br>quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo<br>consequat. Duis aute " +
                        "irure dolor in reprehenderit in voluptate velit esse<br>cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat " +
                        "non<br>proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br><strong>ohh bold text<br><em>Why not " +
                        "italicize</em></strong><br>&nbsp;</li><li><strong><em>no</em></strong></li><li><strong><em>no</em></strong></li><li><strong><em>no" +
                        "</em></strong></li></ol>";

When i try to render this text, it repeats the data 4 times in order list format. Expected result : 2 order list items and 2 unorder list items

String dummy2 ="<p><strong>abcasd sad</strong></p><ol><li>12345</li><li>9833232</li></ol><ul><li>bullet</li><li>ok " +
            "http</li></ul><p><em>asd1111221</em></p><p><em><a href=\\\"http://abc.com\\\">http://abc.com</a></em></p>";

When i try to render this text, it repeats the same data items in order and underorder list format. Expected result : order/unorder list items have different items. It should repeated data.

Query 2 :
Will the performace hamper if I use this editor for each row-item in recyclerview. There could n no of instance of editor in recyclerview. Do you recommend to use inside recyclerview?

What is the Proguard rules?

Hey. Firstly, thank you for this amazing library. But When use minify enable, what proguard rules am I have to use ?. This error coming from jsoup I think. Stack trace is below. Thanks!

`

    at org.a.b.h.a(Entities.java:18)
    at org.a.b.h$a.<clinit>(Entities.java:21) 
    at org.a.b.e$a.<init>(Document.java:226) 
    at org.a.b.e.<init>(Document.java:18) 
    at org.a.c.l.b(TreeBuilder.java:27) 
    at org.a.c.l.a(TreeBuilder.java:40) 
    at org.a.c.b.a(HtmlTreeBuilder.java:55) 
    at org.a.c.f.a(Parser.java:90)
    at org.a.a.a(Jsoup.java:58)
    at com.github.irshulx.Components.HTMLExtensions.parseHtml(HTMLExtensions.java:29)
    at com.github.irshulx.EditorCore.renderEditorFromHtml(EditorCore.java:543)
    at com.github.irshulx.Editor.render(Editor.java:76)`

upload pdf, zip, video and even record audio!

It is desirable to have some button next to upload image that after click, selects a file and uploads it to server and inserts it's link at a new line.
of a button that after click, we record an audio and upload it to server and embed it to the document with tag.
and two buttons to select and upload audio and video as well.
all you should do putting some ImageButtons and implementing these methods:
editor.insertLink(String displayName ,String url)
editor.insertAudio(Uri file, String url, String fileName)
editor.insertVideo(Uri file, String url, String fileName)
all that elements will be displayed in new line

Manifest - Backup

Is there a reason to have the backup enabled? Manifest merger exception when attempting to add to a project with backup set to false.

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.