Skip to content

Commit 0e03b0e

Browse files
feat: Update Kotlin SDK and fix all breaking changes (#36)
* chore: use newest Kotlin SDK version * fix: update all breaking changes
1 parent 66cf642 commit 0e03b0e

4 files changed

Lines changed: 34 additions & 26 deletions

File tree

android/build.gradle

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
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'
@@ -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
}

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
)

android/src/main/java/com/youversion/reactnativesdk/views/YVPSignInWithYouVersionButton.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import com.youversion.platform.ui.views.SignInWithYouVersionButton
1111
import com.youversion.platform.ui.views.SignInWithYouVersionButtonDefaults
1212
import com.youversion.platform.ui.views.SignInWithYouVersionButtonMode
1313
import expo.modules.kotlin.AppContext
14-
import expo.modules.kotlin.viewevent.EventDispatcher
1514
import expo.modules.kotlin.views.AutoSizingComposable
1615
import expo.modules.kotlin.views.ComposeProps
1716
import expo.modules.kotlin.views.Direction
@@ -28,17 +27,17 @@ data class SignInWithYouVersionButtonProps(
2827
class YVPSignInWithYouVersionButton(context: Context, appContext: AppContext) :
2928
ExpoComposeView<SignInWithYouVersionButtonProps>(context, appContext, withHostingView = true) {
3029
override val props = SignInWithYouVersionButtonProps()
31-
private val onTap by EventDispatcher()
30+
// private val onTap by EventDispatcher()
3231

3332
@Composable
3433
override fun Content(modifier: Modifier) {
3534
AutoSizingComposable(shadowNodeProxy, axis = EnumSet.of(Direction.HORIZONTAL, Direction.VERTICAL)) {
3635
SignInWithYouVersionButton(
37-
onClick = { onTap(mapOf()) },
3836
mode = mode(),
3937
stroked = stroked(),
4038
shape = shape(),
41-
dark = isDark()
39+
dark = isDark(),
40+
permissions = { HashSet() }
4241
)
4342
}
4443
}

0 commit comments

Comments
 (0)