-
Notifications
You must be signed in to change notification settings - Fork 2
chore: Upgrade Kotlin side to match YouVersion Kotlin SDK 1.0.1 #41
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: as/expo-55-upgrade
Are you sure you want to change the base?
Changes from all commits
56f920f
d08b8dd
502cc3a
44cca46
60270f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,17 @@ import com.youversion.platform.core.bibles.domain.BibleVersionRepository | |
|
|
||
| object YVPBibleApi { | ||
| suspend fun versions(languageTag: String?): List<BibleVersionRecord> { | ||
| val response = YouVersionApi.bible.versions(languageTag) | ||
| val records = response.map { BibleVersionRecord(it) } | ||
| return records | ||
| val allResults = mutableListOf<BibleVersionRecord>() | ||
| var pageToken: String? = null | ||
|
|
||
| do { | ||
| val response = YouVersionApi.bible.versions(languageTag, pageToken = pageToken) | ||
| allResults.addAll(response.data.map { BibleVersionRecord(it) }) | ||
|
|
||
| pageToken = response.nextPageToken | ||
| } while (pageToken != null) | ||
|
|
||
| return allResults | ||
| } | ||
|
|
||
| suspend fun version(versionId: Int): BibleVersionRecord { | ||
|
|
@@ -19,14 +27,13 @@ object YVPBibleApi { | |
| } | ||
|
|
||
| suspend fun chapter(bibleReference: BibleReferenceRecord, context: Context): String { | ||
| val response = BibleVersionRepository(context).chapter( | ||
| reference = BibleReference( | ||
| versionId = bibleReference.versionId, | ||
| bookUSFM = bibleReference.bookUSFM, | ||
| chapter = bibleReference.chapter, | ||
| ) | ||
| val passageId = bibleReference.bookUSFM + "." + bibleReference.chapter.toString() | ||
|
|
||
| val response = YouVersionApi.bible.passage( | ||
| versionId = bibleReference.versionId, | ||
| passageId = passageId | ||
| ) | ||
|
|
||
| return response | ||
| return response.content | ||
|
Comment on lines
+30
to
+37
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Unused The Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,9 @@ | |
| { | ||
| "ios": { | ||
| "deploymentTarget": "17.0" | ||
| }, | ||
| "android": { | ||
| "kotlinVersion": "2.3.0" | ||
| } | ||
| } | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,15 @@ | ||
| import { Host } from "@expo/ui/swift-ui"; | ||
| import { Host as AndroidHost } from "@expo/ui/jetpack-compose"; | ||
| import { Host as IosHost } from "@expo/ui/swift-ui"; | ||
| import { requireNativeView } from "expo"; | ||
| import { StyleSheet } from "react-native"; | ||
| import { Platform, StyleSheet } from "react-native"; | ||
|
|
||
| import { BibleReference } from "../types"; | ||
|
|
||
| const NativeView: React.ComponentType<NativeProps> = | ||
| requireNativeView("BibleReaderView"); | ||
|
|
||
| const PlatformHost = Platform.OS === "ios" ? IosHost : AndroidHost; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Incomplete platform-specific Host migration — 3 of 5 TSX components still use iOS-only Host The PR introduces the Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| /** | ||
| * A full-featured Bible reader component. | ||
| * It allows the user to control font customizations, switch Bible versions and access their verse highlights. | ||
|
|
@@ -15,13 +18,13 @@ const NativeView: React.ComponentType<NativeProps> = | |
| */ | ||
| export function BibleReaderView({ reference, ...props }: BibleReaderViewProps) { | ||
| return ( | ||
| <Host style={styles.view}> | ||
| <PlatformHost style={styles.view}> | ||
| <NativeView | ||
| hasReference={!!reference} | ||
| {...(reference || {})} | ||
| {...props} | ||
| /> | ||
| </Host> | ||
| </PlatformHost> | ||
| ); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| import { CommonViewModifierProps, Host } from "@expo/ui/swift-ui"; | ||
| import { Host as AndroidHost } from "@expo/ui/jetpack-compose"; | ||
| import { CommonViewModifierProps, Host as IosHost } from "@expo/ui/swift-ui"; | ||
| import { fixedSize } from "@expo/ui/swift-ui/modifiers"; | ||
| import { requireNativeView } from "expo"; | ||
| import { StyleProp, ViewStyle } from "react-native"; | ||
| import { Platform, StyleProp, ViewStyle } from "react-native"; | ||
|
|
||
| const PlatformHost = Platform.OS === "ios" ? IosHost : AndroidHost; | ||
|
|
||
| const NativeView: React.ComponentType<NativeProps> = requireNativeView( | ||
| "SignInWithYouVersionButton", | ||
|
|
@@ -61,7 +64,7 @@ export function SignInWithYouVersionButton({ | |
| ...props | ||
| }: SignInWithYouVersionButtonProps) { | ||
| return ( | ||
| <Host matchContents={{ vertical: true, horizontal: true }} style={style}> | ||
| <PlatformHost matchContents style={style}> | ||
| <NativeView | ||
| {...props} | ||
| mode={mode} | ||
|
|
@@ -71,6 +74,6 @@ export function SignInWithYouVersionButton({ | |
| onTap={onPress} | ||
| modifiers={[fixedSize()]} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Please verify that the |
||
| /> | ||
| </Host> | ||
| </PlatformHost> | ||
| ); | ||
| } | ||
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.
contextparameter and stale importsThe refactored
chapter()function no longer uses thecontext: Contextparameter or the two domain imports that were needed by the oldBibleVersionRepository-based implementation. These should be cleaned up to avoid dead code and potential compiler warnings.Also remove the two now-unused import lines at the top of the file: