Skip to content

Commit 911e4e4

Browse files
authored
Merge branch 'main' into YPE-1180-rn-android-create-ci-test-to-verify-build
2 parents a5505f4 + bd199d4 commit 911e4e4

16 files changed

Lines changed: 327 additions & 32 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
44

5+
## 0.9.0 (2026-01-31)
6+
7+
* feat: Update Kotlin SDK and fix all breaking changes (#36) ([0e03b0e](https://github.com/youversion/platform-sdk-reactnative/commit/0e03b0e)), closes [#36](https://github.com/youversion/platform-sdk-reactnative/issues/36)
8+
* feat (android): add view module stubs for RN bridging (#31) ([66cf642](https://github.com/youversion/platform-sdk-reactnative/commit/66cf642)), closes [#31](https://github.com/youversion/platform-sdk-reactnative/issues/31)
9+
510
## 0.8.0 (2026-01-16)
611

712
* chore: Depend on most recent Swift SDK version and update breaking changes (#27) ([a042211](https://github.com/youversion/platform-sdk-reactnative/commit/a042211)), closes [#27](https://github.com/youversion/platform-sdk-reactnative/issues/27)

android/build.gradle

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath("org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:${kotlinVersion}")
7+
}
8+
}
9+
110
apply plugin: 'com.android.library'
211

312
group = 'com.youversion.reactnativesdk'
4-
version = '0.8.0'
13+
version = '0.9.0'
514

615
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
716
apply from: expoModulesCorePlugin
@@ -36,7 +45,7 @@ android {
3645
namespace "com.youversion.reactnativesdk"
3746
defaultConfig {
3847
versionCode 1
39-
versionName "0.8.0"
48+
versionName "0.9.0"
4049
}
4150
buildFeatures {
4251
compose true
@@ -51,7 +60,7 @@ dependencies {
5160
implementation 'androidx.compose.foundation:foundation-android:1.9.1'
5261
implementation 'androidx.compose.material3:material3-android:1.3.2'
5362

54-
implementation 'com.youversion.platform:platform-core:0.5.0'
55-
implementation 'com.youversion.platform:platform-ui:0.5.0'
56-
implementation 'com.youversion.platform:platform-reader:0.5.0'
63+
implementation 'com.youversion.platform:platform-core:0.6.0'
64+
implementation 'com.youversion.platform:platform-ui:0.6.0'
65+
implementation 'com.youversion.platform:platform-reader:0.6.0'
5766
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.youversion.reactnativesdk
2+
3+
import com.youversion.reactnativesdk.views.YVPBibleReaderView
4+
import expo.modules.kotlin.modules.Module
5+
import expo.modules.kotlin.modules.ModuleDefinition
6+
7+
class RNBibleReaderViewModule : Module() {
8+
override fun definition() = ModuleDefinition {
9+
Name("BibleReaderView")
10+
11+
View(YVPBibleReaderView::class)
12+
}
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.youversion.reactnativesdk
2+
3+
import com.youversion.reactnativesdk.views.YVPBibleTextView
4+
import expo.modules.kotlin.modules.Module
5+
import expo.modules.kotlin.modules.ModuleDefinition
6+
7+
class RNBibleTextViewModule : Module() {
8+
override fun definition() = ModuleDefinition {
9+
Name("BibleTextView")
10+
11+
View(YVPBibleTextView::class) {
12+
Events("onTap")
13+
}
14+
}
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.youversion.reactnativesdk
2+
3+
import com.youversion.reactnativesdk.views.YVPBibleWidgetView
4+
import expo.modules.kotlin.modules.Module
5+
import expo.modules.kotlin.modules.ModuleDefinition
6+
7+
class RNBibleWidgetViewModule : Module() {
8+
override fun definition() = ModuleDefinition {
9+
Name("BibleWidgetView")
10+
11+
View(YVPBibleWidgetView::class)
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.youversion.reactnativesdk
2+
3+
import com.youversion.reactnativesdk.views.YVPVotdView
4+
import expo.modules.kotlin.modules.Module
5+
import expo.modules.kotlin.modules.ModuleDefinition
6+
7+
class RNVotdViewModule : Module() {
8+
override fun definition() = ModuleDefinition {
9+
Name("VotdView")
10+
11+
View(YVPVotdView::class)
12+
}
13+
}

android/src/main/java/com/youversion/reactnativesdk/api/YVPLanguagesApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.youversion.platform.core.api.YouVersionApi
44

55
object YVPLanguagesApi {
66
suspend fun languages(country: String?): List<LanguageRecord> {
7-
val response = YouVersionApi.language.languages(country)
7+
val response = YouVersionApi.languages.languages(country)
88
val records = response.map { LanguageRecord(it) }
99
return records
1010
}

android/src/main/java/com/youversion/reactnativesdk/api/YVPRecords.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ data class LanguageRecord(
4343
@Field
4444
val textDirection: String,
4545
@Field
46-
val defaultBibleVersionId: Int?
46+
val defaultBibleId: Int?
4747

4848
) : Record {
4949
constructor(language: Language) : this(
@@ -57,7 +57,7 @@ data class LanguageRecord(
5757
variants = language.variants,
5858
countries = language.countries,
5959
textDirection = language.textDirection,
60-
defaultBibleVersionId = language.defaultBibleVersionId
60+
defaultBibleId = language.defaultBibleVersionId
6161
)
6262
}
6363

@@ -67,9 +67,9 @@ data class BibleVersionRecord(
6767
@Field
6868
val abbreviation: String?,
6969
@Field
70-
val copyrightLong: String?,
70+
val promotionalContent: String?,
7171
@Field
72-
val copyrightShort: String?,
72+
val copyright: String?,
7373
@Field
7474
val languageTag: String?,
7575
@Field
@@ -87,13 +87,15 @@ data class BibleVersionRecord(
8787
@Field
8888
val books: List<BibleBookRecord>?,
8989
@Field
90-
val textDirection: String?
90+
val textDirection: String?,
91+
@Field
92+
val organizationId: String?
9193
) : Record {
9294
constructor(bibleVersion: BibleVersion) : this(
9395
id = bibleVersion.id,
9496
abbreviation = bibleVersion.abbreviation,
95-
copyrightLong = bibleVersion.copyrightLong,
96-
copyrightShort = bibleVersion.copyrightShort,
97+
promotionalContent = bibleVersion.promotionalContent,
98+
copyright = bibleVersion.copyright,
9799
languageTag = bibleVersion.languageTag,
98100
localizedAbbreviation = bibleVersion.localizedAbbreviation,
99101
localizedTitle = bibleVersion.localizedTitle,
@@ -102,47 +104,45 @@ data class BibleVersionRecord(
102104
title = bibleVersion.title,
103105
bookCodes = bibleVersion.bookCodes,
104106
books = bibleVersion.books?.map { BibleBookRecord(it) },
105-
textDirection = bibleVersion.textDirection
107+
textDirection = bibleVersion.textDirection,
108+
organizationId = bibleVersion.organizationId
106109
)
107110
}
108111

109112
data class BibleBookRecord(
110113
@Field
111-
val usfm: String?,
114+
val id: String?,
112115
@Field
113116
val title: String?,
114117
@Field
115118
val abbreviation: String?,
116119
@Field
117120
val canon: String?,
118121
@Field
119-
val chapters: List<BibleChapterRecord>?
122+
val chapters: List<BibleChapterRecord>?,
123+
@Field
124+
val fullTitle: String?
120125
) : Record {
121126
constructor(bibleBook: BibleBook) : this(
122-
usfm = bibleBook.usfm,
127+
id = bibleBook.id,
123128
title = bibleBook.title,
124129
abbreviation = bibleBook.abbreviation,
125130
canon = bibleBook.canon,
126-
chapters = bibleBook.chapters?.map { BibleChapterRecord(it) }
131+
chapters = bibleBook.chapters?.map { BibleChapterRecord(it) },
132+
fullTitle = bibleBook.fullTitle
127133
)
128134
}
129135

130136
data class BibleChapterRecord(
131137
@Field
132138
val id: String?,
133139
@Field
134-
val bookUSFM: String?,
135-
@Field
136-
val isCanonical: Boolean?,
137-
@Field
138140
val passageId: String?,
139141
@Field
140142
val title: String?
141143
) : Record {
142144
constructor(bibleChapter: BibleChapter) : this(
143145
id = bibleChapter.id,
144-
bookUSFM = bibleChapter.bookUSFM,
145-
isCanonical = bibleChapter.isCanonical,
146146
passageId = bibleChapter.passageId,
147147
title = bibleChapter.title
148148
)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package com.youversion.reactnativesdk.views
2+
3+
import android.content.Context
4+
import androidx.compose.foundation.layout.Box
5+
import androidx.compose.foundation.layout.fillMaxSize
6+
import androidx.compose.foundation.layout.padding
7+
import androidx.compose.material3.Text
8+
import androidx.compose.runtime.Composable
9+
import androidx.compose.runtime.MutableState
10+
import androidx.compose.runtime.mutableStateOf
11+
import androidx.compose.ui.Alignment
12+
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.graphics.Color
14+
import androidx.compose.ui.unit.dp
15+
import expo.modules.kotlin.AppContext
16+
import expo.modules.kotlin.views.ComposeProps
17+
import expo.modules.kotlin.views.ExpoComposeView
18+
19+
data class BibleReaderViewProps(
20+
// Bible reference
21+
val versionId: MutableState<Int?> = mutableStateOf(null),
22+
val bookUSFM: MutableState<String?> = mutableStateOf(null),
23+
val chapter: MutableState<Int?> = mutableStateOf(null),
24+
val verse: MutableState<Int?> = mutableStateOf(null),
25+
val verseStart: MutableState<Int?> = mutableStateOf(null),
26+
val verseEnd: MutableState<Int?> = mutableStateOf(null),
27+
28+
val appName: MutableState<String?> = mutableStateOf(null),
29+
val signInMessage: MutableState<String?> = mutableStateOf(null),
30+
val hasReference: MutableState<Boolean?> = mutableStateOf(false),
31+
) : ComposeProps
32+
33+
class YVPBibleReaderView(context: Context, appContext: AppContext) :
34+
ExpoComposeView<BibleReaderViewProps>(context, appContext, withHostingView = true) {
35+
36+
override val props = BibleReaderViewProps()
37+
38+
@Composable
39+
override fun Content(modifier: Modifier) {
40+
// TODO: Replace with actual BibleReaderView composable when Kotlin SDK is ready
41+
Box(
42+
modifier = modifier
43+
.fillMaxSize()
44+
.padding(16.dp),
45+
contentAlignment = Alignment.Center
46+
) {
47+
Text(
48+
text = "BibleReaderView placeholder\n" +
49+
"App: ${props.appName.value}\n" +
50+
"Reference: ${props.bookUSFM.value} ${props.chapter.value}",
51+
color = Color.Gray
52+
)
53+
}
54+
}
55+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.youversion.reactnativesdk.views
2+
3+
import android.content.Context
4+
import androidx.compose.foundation.layout.Box
5+
import androidx.compose.foundation.layout.fillMaxWidth
6+
import androidx.compose.foundation.layout.padding
7+
import androidx.compose.material3.Text
8+
import androidx.compose.runtime.Composable
9+
import androidx.compose.runtime.MutableState
10+
import androidx.compose.runtime.mutableStateOf
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.graphics.Color
13+
import androidx.compose.ui.unit.dp
14+
import expo.modules.kotlin.AppContext
15+
import expo.modules.kotlin.viewevent.EventDispatcher
16+
import expo.modules.kotlin.views.ComposeProps
17+
import expo.modules.kotlin.views.ExpoComposeView
18+
19+
data class BibleTextViewProps(
20+
// Styling
21+
val fontFamily: MutableState<String?> = mutableStateOf(null),
22+
val fontSize: MutableState<Float?> = mutableStateOf(16f),
23+
val lineSpacing: MutableState<Float?> = mutableStateOf(null),
24+
val paragraphSpacing: MutableState<Float?> = mutableStateOf(null),
25+
val textColor: MutableState<Int?> = mutableStateOf(null),
26+
val wocColor: MutableState<Int?> = mutableStateOf(null),
27+
val footnoteMode: MutableState<String?> = mutableStateOf("none"),
28+
val renderVerseNumbers: MutableState<Boolean?> = mutableStateOf(true),
29+
30+
// Bible reference
31+
val versionId: MutableState<Int?> = mutableStateOf(null),
32+
val bookUSFM: MutableState<String?> = mutableStateOf(null),
33+
val chapter: MutableState<Int?> = mutableStateOf(null),
34+
val verse: MutableState<Int?> = mutableStateOf(null),
35+
val verseStart: MutableState<Int?> = mutableStateOf(null),
36+
val verseEnd: MutableState<Int?> = mutableStateOf(null),
37+
) : ComposeProps
38+
39+
class YVPBibleTextView(context: Context, appContext: AppContext) :
40+
ExpoComposeView<BibleTextViewProps>(context, appContext, withHostingView = true) {
41+
42+
override val props = BibleTextViewProps()
43+
private val onTap by EventDispatcher()
44+
45+
@Composable
46+
override fun Content(modifier: Modifier) {
47+
// TODO: Replace with actual BibleText composable when Kotlin SDK is ready
48+
Box(
49+
modifier = modifier
50+
.fillMaxWidth()
51+
.padding(16.dp)
52+
) {
53+
Text(
54+
text = "BibleTextView placeholder - versionId: ${props.versionId.value}, " +
55+
"book: ${props.bookUSFM.value}, chapter: ${props.chapter.value}",
56+
color = Color.Gray
57+
)
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)