Skip to content

Conversation

@mic-mart
Copy link
Collaborator

@mic-mart mic-mart commented Feb 1, 2026

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

  • Replace placeholder implementations in Android view modules with actual Kotlin SDK composables
  • YVPBibleTextView now uses BibleText composable with full prop mapping (font, colors, footnote mode, etc.)
  • YVPVotdView now uses VerseOfTheDay composable with dark/light theme support
  • YVPBibleWidgetView now uses BibleWidget composable with MaterialTheme wrapper
  • YVPBibleReaderView now uses BibleReader composable with optional reference support

Test plan

  • Run example app on Android emulator/device
  • Verify BibleTextView renders Bible text correctly
  • Verify VotdView displays verse of the day
  • Verify BibleWidgetView shows Bible widget with header and copyright
  • Verify BibleReaderView shows full reader experience
  • Test dark/light color scheme switching
  • Verify onTap events fire correctly from BibleTextView

🤖 Generated with Claude Code

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>
@mic-mart mic-mart marked this pull request as ready for review February 1, 2026 00:20
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@greptile-apps
Copy link

greptile-apps bot commented Feb 1, 2026

Greptile Overview

Greptile Summary

This 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:

  • YVPBibleTextView: Integrated BibleText composable with comprehensive prop mapping including font families (serif, sans-serif, monospace, cursive), colors (text, words of Christ), footnote modes (none, inline, marker, letters, image), line spacing, and verse tap event handling
  • YVPBibleReaderView: Integrated BibleReader composable with optional reference support via hasReference flag and proper null safety
  • YVPBibleWidgetView: Integrated BibleWidget composable wrapped in MaterialTheme with dark/light color scheme support
  • YVPVotdView: Integrated VerseOfTheDay composable with theme detection (dark/light/system)

Implementation notes:

  • All views properly handle nullable props with fallback defaults (e.g., default font size 16f for BibleText, 23f for BibleWidget, version 111 for VOTD)
  • Bible reference construction is duplicated across three files but follows consistent logic: creates verse range if both verseStart and verseEnd are provided, otherwise creates single verse reference
  • Color scheme detection uses case-insensitive string matching with system theme fallback
  • Event handling in BibleTextView correctly maps Kotlin SDK callbacks to React Native event format

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward and well-structured with proper null safety, sensible defaults, and consistent patterns across all view modules. The changes replace placeholder code with real SDK integrations without introducing breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleTextView.kt Replaced placeholder with BibleText composable, added comprehensive prop mapping for fonts, colors, footnotes, and verse tap events
android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleReaderView.kt Replaced placeholder with BibleReader composable, added optional reference handling with proper null checks
android/src/main/java/com/youversion/reactnativesdk/views/YVPBibleWidgetView.kt Replaced placeholder with BibleWidget composable wrapped in MaterialTheme for proper theme support
android/src/main/java/com/youversion/reactnativesdk/views/YVPVotdView.kt Replaced placeholder with VerseOfTheDay composable, added dark/light theme detection

Sequence Diagram

sequenceDiagram
    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

Loading

Copy link

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Comment on lines +69 to 93
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,
)
}
}
Copy link

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My opinion, given that:

  1. iOS (the reference implementation) doesn't extract it
  2. The logic is trivial and stable
  3. It's only 3 files

I lean toward not extracting in this case. The duplication is minimal and the code is clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants