Android-RTEditor | Android RTEditor is a rich text editor component | Editor library
kandi X-RAY | Android-RTEditor Summary
kandi X-RAY | Android-RTEditor Summary
The Android RTEditor is a rich text editor component for Android that can be used as a drop in for EditText
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Called when a touch event occurs
- Determines the number of edges to be hit
- Grow the rectangle by a given amount
- Moves the view to the center of the highlights
- Scan HTML source
- Save the buffer
- Returns spans of the specified type
- Returns the flags associated with the specified markup object or 0 if none
- Called when a selection is changed
- Returns the values of the currently selected text in the editor
- This method is called when the activity is saved
- Override this method to display the result
- Parses an XML document type definition
- Create the instance dialog
- Read the initial state from the intent
- Called when an option item is selected
- Create and initialize the view
- Unescapes a string
- Applies the given text to the editor
- Invoked when the activity is created
- Translate a character sequence into the output
- Configure the action buttons
- Initializes the initial state
- Set click on button
- Applies the current text to the selected paragraphs
- Initializes the crop image
Android-RTEditor Key Features
Android-RTEditor Examples and Code Snippets
Community Discussions
Trending Discussions on Android-RTEditor
QUESTION
We allow the user to create some text that will get converted to HTML, using a rich-text editor library (called Android-RTEditor).
The output HTML text is saved as is on the server and the device.
Because on some end cases, there is a need to show a lot of this content (multiple instances), we wish to also save a "preview" version of this content, meaning it will be much shorter in length (say 120 of normal characters, excluding the extra characters for the HTML tags, which are not counted).
What we want is a minimized version of the HTML. Some tags might optionally be removed, but we still want to see lists (numbered/bullets), no matter what we choose to do, because lists do show like text to the user (the bullet is a character, and so do the numbers with the dot).
The tag of going to next line should also be handled , as it's important to go to the next line.
The problemAs opposed to a normal string, where I can just call substring
with the required number of characters, on HTML it might ruin the tags.
I've thought of 2 possible solutions for this:
Convert to plain text (while having some tags handled), and then truncate : Parse the HTML, and replacing some tags with Unicode alternatives, while removing the others. For example, instead of a bullet-list, put the bullet character (maybe this), and same for numbered list (put numbers instead). All the other tags would be removed. Same goes for the tag of going to the next line ("
"), which should be replaced with "\n". After that, I could safely truncate the normal text, because there are no more tags that could be ruined.Truncate nicely inside the HTML : Parse the HTML, while identifying the text within it, and truncate it there and closing all tags when reaching the truncation position. This might even be harder.
I'm not sure which is easier, but I can think of possible disadvantages for each. It is just a preview though, so I don't think it matters much.
I've searched the Internet for such solutions, to see if others have made it. I've found some links that talk about "cleaning" or "optimizing" HTML, but I don't see they can handle replacing them or truncating them. Not only that, but since it's HTML, most are not related to Android, and use PHP, C#, Angular and others as their language.
Here are some links that I've found:
The questionsAre those solutions that I've written possible? If so, is there maybe a known way to implement them? Or even a Java/Kotlin/Android library? How hard would it be to make such a solution?
Maybe other solution I haven't thought about?
EDIT: I've also tried using an old code I've made in the past (here), which parses XML. Maybe it will work. I also try now to investigate some third party libraries for parsing HTML, such as Jsoup. I think it can help with the truncating, while supporting "faulty" HTML inputs.
...ANSWER
Answered 2018-Mar-07 at 11:35OK, I think I got it, using my old code for converting XML string into an object . It would still be great to see more robust solutions, but I think what I got is good enough, at least for now.
Below code uses it (origininal XmlTag class available here) :
XmlTagTruncationHelper.kt
QUESTION
i'm having a probleme when creating the APK
When i run the app, it works fine but when i build the apk it says
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/location/places/PlaceReport.class
gradle file
...ANSWER
Answered 2017-Mar-15 at 11:37So i had to create a new empty project and copy all the libs in it, and try one by one to find which one was containing the problem. the error was coming from the com.github.irshulx:laser-native-editor:0.3.5
, it worked after i deleted it, then i modified the whole project and used another work around.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Android-RTEditor
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page