-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Android support and custom menu with HTML rendering logic #114
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
base: main
Are you sure you want to change the base?
Conversation
- add Android Nitro module with Kotlin view, Fabric state updater, and JNI bridge - share component descriptor/state logic so Fabric can hydrate props on Android - update TypeScript entrypoint, codegen pipeline, and example app for Android support
* feat(android): add NitroText HybridView implementation - add Android Nitro module with Kotlin view, Fabric state updater, and JNI bridge - share component descriptor/state logic so Fabric can hydrate props on Android - update TypeScript entrypoint, codegen pipeline, and example app for Android support * feat: add support for `onTextLayout` * feat: implement fragment background color support in NitroText
- Add Android native implementation for NitroText - Implement custom menu support with MenuItem type - Add menus prop to NitroText component - Update Android build configuration - Add MenuItem bridge code for Android - Update component descriptors and specs for menu support
- Remove old renderer system (NitroRenderer, RichTextStyle, RichTextStyleRule) - Add new Renderer type for HTML and plaintext rendering - Update renderer prop support in native implementations - HTML parsing is now handled in JS/TS layer - Add renderer bridge code for Android
- Remove BulletListSpan, NumberedListSpan, VerticalMarginSpan, LetterSpacingSpan - Remove duplicate NitroLineHeightSpan from parent directory - Keep only NitroLineHeightSpan and UrlSpanNoUnderline which are actively used
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| HybridObjectRegistry::registerHybridObjectConstructor( | ||
| "NitroText", | ||
| []() -> std::shared_ptr<HybridObject> { | ||
| static DefaultConstructableObject<JHybridNitroTextSpec::javaobject> object("com/margelo/nitro/nitrotext/HybridNitroText"); | ||
| auto instance = object.create(); |
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.
Fix Android HybridNitroText registration package
The Android JNI bootstrap still registers NitroText using the generated class path com/margelo/nitro/nitrotext/HybridNitroText, but the actual Kotlin implementation lives in com.nitrotext (see android/src/main/java/com/nitrotext/HybridNitroText.kt). At runtime the HybridObjectRegistry will attempt to construct a class that does not exist, so the Android view cannot be created unless a manual post-processing script rewrites this string. The registration should point at the real package.
Useful? React with 👍 / 👎.
- Updated the default link color assignment in NitroTextImpl to maintain consistency with the intended design, ensuring that the system link color is applied correctly when no explicit color is provided.
- Modify UrlSpanNoUnderline to not apply default link color - Apply color span after URLSpan to ensure custom colors take precedence - Support both custom link colors and default blue when no color specified
…tion - Implemented a layout change listener in NitroTextView to ensure proper height adjustment for content expansion. - Renamed createCustomActionModeCallback to configureActionModeCallback for clarity in action mode handling. - Updated NitroText interface to use consistent object notation for platform specifications.
…support - Added support for text alignment in NitroTextImpl, allowing fragments to specify alignment (left, right, center, justify). - Updated applyDecorationSpans to accept a decoration color parameter, enabling custom colors for text decorations. - Modified example screens to demonstrate new text alignment and decoration features.
This PR adds Android support for NitroText with custom menu implementation and HTML rendering logic.