-
Notifications
You must be signed in to change notification settings - Fork 1
YPE-1124: Implement Android view modules with Kotlin SDK composables #37
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
Replace placeholder implementations with actual Kotlin SDK composables: - YVPBibleTextView now uses BibleText composable with full prop mapping - YVPVotdView now uses VerseOfTheDay composable - YVPBibleWidgetView now uses BibleWidget composable - YVPBibleReaderView now uses BibleReader composable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Greptile OverviewGreptile SummaryThis PR successfully replaces placeholder implementations in Android view modules with actual Kotlin SDK composables. All four view modules (BibleText, BibleReader, BibleWidget, and VerseOfTheDay) now integrate with the platform SDK. Key changes:
Implementation notes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant RN as React Native
participant Module as RN View Module
participant View as YVP View (ExpoComposeView)
participant SDK as Kotlin SDK Composable
RN->>Module: Render view with props
Module->>View: Create view instance
View->>View: Store props in MutableState
RN->>View: Update props (versionId, bookUSFM, etc.)
View->>View: Props updated in MutableState
View->>View: Recompose triggered
View->>View: Call bibleReference()
View->>View: Call textOptions()/fontFamily()/etc.
View->>SDK: Render composable (BibleText/BibleReader/etc.)
SDK-->>View: Composable rendered
Note over SDK,View: User interaction (e.g., verse tap)
SDK->>View: onVerseTap callback
View->>View: Map to RN event format
View->>RN: Dispatch onTap event
|
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.
4 files reviewed, 1 comment
| private fun bibleReference(): BibleReference? { | ||
| val versionId = props.versionId.value ?: return null | ||
| val bookUSFM = props.bookUSFM.value ?: return null | ||
| val chapter = props.chapter.value ?: return null | ||
|
|
||
| val verseStart = props.verseStart.value | ||
| val verseEnd = props.verseEnd.value | ||
|
|
||
| return if (verseStart != null && verseEnd != null) { | ||
| BibleReference( | ||
| versionId = versionId, | ||
| bookUSFM = bookUSFM, | ||
| chapter = chapter, | ||
| verseStart = verseStart, | ||
| verseEnd = verseEnd, | ||
| ) | ||
| } else { | ||
| BibleReference( | ||
| versionId = versionId, | ||
| bookUSFM = bookUSFM, | ||
| chapter = chapter, | ||
| verse = props.verse.value, | ||
| ) | ||
| } | ||
| } |
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.
identical bibleReference() logic duplicated across YVPBibleTextView, YVPBibleReaderView, and YVPBibleWidgetView - consider extracting to shared utility
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleTextView.kt
Line: 69:93
Comment:
identical `bibleReference()` logic duplicated across YVPBibleTextView, YVPBibleReaderView, and YVPBibleWidgetView - consider extracting to shared utility
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.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.
My opinion, given that:
- iOS (the reference implementation) doesn't extract it
- The logic is trivial and stable
- It's only 3 files
I lean toward not extracting in this case. The duplication is minimal and the code is clear.
This work was initially done in #32 , but it was pointed at an outdated version of the Kotlin SDK. This is my follow up attempt after @sidorchukandrew updated to the latest version of the Kotlin SDK.
Summary
BibleTextcomposable with full prop mapping (font, colors, footnote mode, etc.)VerseOfTheDaycomposable with dark/light theme supportBibleWidgetcomposable with MaterialTheme wrapperBibleReadercomposable with optional reference supportTest plan
🤖 Generated with Claude Code