-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve #254 #256
Resolve #254 #256
Conversation
Fix Crash when setting maxLines in Text
Fix isRichSpan method bug
Fix getBoundingBoxes returning emptyList when the last line is empty
Support add link to current selection
Support editing existing Link and deleting Link
Update links docs
Fix bug on adding new lines
Add WASM Support
Fix list items numbering issue
Fix bug with undo
Add list auto formatting
Support replacing selected text
Improve markdown encoding
Update version to 1.0.0-rc04
Update Compose to 1.6.1
Move test to desktopTest [Temp]
@@ -186,13 +186,15 @@ class RichTextState internal constructor( | |||
codeColor: Color = Color.Unspecified, | |||
codeBackgroundColor: Color = Color.Unspecified, | |||
codeStrokeColor: Color = Color.Unspecified, | |||
listIndent: Int = 38 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we need to have a special value to ignore which can be -1 in the case of Int.
So the default value here should be changed to -1.
) { | ||
richTextConfig = RichTextConfig( | ||
linkColor = if (linkColor.isSpecified) linkColor else richTextConfig.linkColor, | ||
linkTextDecoration = linkTextDecoration ?: richTextConfig.linkTextDecoration, | ||
codeColor = if (codeColor.isSpecified) codeColor else richTextConfig.codeColor, | ||
codeBackgroundColor = if (codeBackgroundColor.isSpecified) codeBackgroundColor else richTextConfig.codeBackgroundColor, | ||
codeStrokeColor = if (codeStrokeColor.isSpecified) codeStrokeColor else richTextConfig.codeStrokeColor, | ||
listIndent = listIndent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we need to keep the same value if the listIndent
is not changed.
So it's going to be something like this:
if (listIndent > -1) listIndent else richTextConfig .listIndent
@@ -11,6 +11,7 @@ import com.mohamedrejeb.richeditor.paragraph.RichParagraph | |||
|
|||
internal class OrderedList( | |||
number: Int, | |||
private val indent: Int = 38, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indent param here shouldn't have a default value. It should be passed by the state instead.
@@ -7,16 +7,18 @@ import com.mohamedrejeb.richeditor.annotation.ExperimentalRichTextApi | |||
import com.mohamedrejeb.richeditor.model.RichSpan | |||
import com.mohamedrejeb.richeditor.paragraph.RichParagraph | |||
|
|||
internal class UnorderedList : ParagraphType { | |||
internal class UnorderedList( | |||
private val indent: Int = 38 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indent param here shouldn't have a default value. It should be passed by the state instead.
Okay, then how i can pass value from config to constructors? |
I did the changes |
I think the build won't succeed. The indent is not passed to the lists on creation. |
Yes, that's what i asking for, i didn't know how to pass it 😢 |
This is not going to be a funny thing to do haha, so here in the RichTextState there's a creation of lists in many places. If you are using the IDE you will see errors, but if you are editing with github it will be hard. |
I editing through github now because i didn't know if it builds on my pc, in cause of multiplatform, but how soon this future will be? 👀 I can try with AS later, but there also misunterstanding of passing this |
As a fast and stupid workaround, you can create const field with 38 value, and i can change it in my code through reflection 🤡 |
No problem, I'll do it myself. Thanks for the contribution! |
Thanks! |
I've added this as parameters and config, but didn't know how to pass it to cinstructor from config