Conversation
…r-android # Conflicts: # android/src/main/java/com/swmansion/enriched/common/parser/EnrichedParser.java # android/src/main/java/com/swmansion/enriched/common/spans/EnrichedCheckboxListSpan.kt # android/src/main/java/com/swmansion/enriched/textinput/EnrichedTextInputView.kt # android/src/main/java/com/swmansion/enriched/textinput/watchers/EnrichedSpanWatcher.kt
…ched-text # Conflicts: # src/index.tsx # src/types.ts # src/utils/normalizeHtmlStyle.ts
…ched-text # Conflicts: # apps/example/src/App.tsx
| fun setFontWeight(weight: String?) { | ||
| val fontWeight = parseFontWeight(weight) | ||
|
|
||
| if (fontWeight != fontStyle) { |
There was a problem hiding this comment.
| if (fontWeight != fontStyle) { | |
| if (fontWeight != this.fontWeight) { |
| val text = value ?: return | ||
| val style = enrichedStyle ?: return | ||
| if (!valueDirty) return |
There was a problem hiding this comment.
| val text = value ?: return | |
| val style = enrichedStyle ?: return | |
| if (!valueDirty) return | |
| if (!valueDirty) return | |
| val text = value ?: return | |
| val style = enrichedStyle ?: return |
There was a problem hiding this comment.
Nit: We do not need to check for text and style if valueDirty == false
| super.setPadding(view, left, top, right, bottom) | ||
|
|
||
| view?.setPadding(left, top, right, bottom) |
There was a problem hiding this comment.
Do we need to call setPadding twice with super and view. here?
| val parsed = EnrichedParser.fromHtml(text, enrichedStyle, factory) | ||
| return parsed.trimEnd('\n') |
There was a problem hiding this comment.
I think that we should put deletion of last newline:.trimEnd('\n') into fromHtml function because everywhere where we are using fromHtml we also delete last newline after parsing.
| focus: () => { | ||
| nullthrows(nativeRef.current).focus(); | ||
| }, | ||
| blur: () => { | ||
| nullthrows(nativeRef.current).blur(); | ||
| }, |
There was a problem hiding this comment.
Should't we omit those methods? EnrichedText is only renderer so those methods have no effect on it?
|
Not sure how hard this would be, but it’d be great if styles were preserved when copying from EnrichedText into EnrichedTextInput. Screen.Recording.2026-04-16.at.11.58.59.mov |
@pkaramon nice idea, but it will be better to add it in separate PR ;) |
Co-authored-by: Piotr Karamon <33125365+pkaramon@users.noreply.github.com>
|
When Screen.Recording.2026-04-16.at.14.41.08.movI've asked AI about this and apparently:
|
@pkaramon can you test it right now? I pushed the fix for that |
Summary
Implements
EnrichedTextcomponent which can be used for displaying text created byEnrichedTextInput.Tackles: #374
Test Plan
Verify that
EnrichedTextcomponent is rendered properly, styles can be customized and any valid html or raw text is displayed properlyScreenshots / Videos
Screen.Recording.2026-01-27.at.15.01.03.mov
Compatibility