-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Implement all Compose views #42
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
Open
sidorchukandrew
wants to merge
13
commits into
as/new-kotlin-version
Choose a base branch
from
as/kotlin-widget-view
base: as/new-kotlin-version
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a8bb3a1
chore: refactor to follow Expo's guidance
sidorchukandrew 55e158a
chore: add icon assets for bottom nav
sidorchukandrew c1b8729
chore: use icons in bottom navigation
sidorchukandrew 7e21070
chore: refactor VOTD Compose to be functional component
sidorchukandrew def30f0
chore: refactor BibleReaderView to be functional component
sidorchukandrew 4f01b3b
feat: implement BibleTextView as functional component
sidorchukandrew 937b18f
feat: implement BibleWidgetView as functional component
sidorchukandrew f5fa256
chore: refactor sign in button as functional component
sidorchukandrew d686ebb
chore: use correct <Host /> for each platform
sidorchukandrew e89f49a
chore: implement onTap callback
sidorchukandrew 894aa4c
chore: remove unnecessary color utility function
sidorchukandrew 096df82
chore: swap order of styles to allow for overriding
sidorchukandrew cecf9a2
chore: update default Bible version to 3034
sidorchukandrew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 13 additions & 2 deletions
15
android/src/main/java/com/youversion/reactnativesdk/RNBibleTextViewModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,26 @@ | ||
| package com.youversion.reactnativesdk | ||
|
|
||
| import androidx.compose.runtime.remember | ||
| import com.youversion.reactnativesdk.api.VerseTappedEvent | ||
| import com.youversion.reactnativesdk.views.BibleTextViewProps | ||
| import com.youversion.reactnativesdk.views.YVPBibleTextView | ||
| import expo.modules.kotlin.modules.Module | ||
| import expo.modules.kotlin.modules.ModuleDefinition | ||
| import expo.modules.kotlin.viewevent.getValue | ||
|
|
||
| class RNBibleTextViewModule : Module() { | ||
| override fun definition() = ModuleDefinition { | ||
| Name("BibleTextView") | ||
|
|
||
| View(YVPBibleTextView::class) { | ||
| Events("onTap") | ||
| View( | ||
| name = "YVPBibleTextView", | ||
| events = { Events("onTap") } | ||
| ) { props: BibleTextViewProps -> | ||
| val onTap by remember { EventDispatcher<VerseTappedEvent>() } | ||
|
|
||
| YVPBibleTextView(props) { event: VerseTappedEvent -> | ||
| onTap(event) | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
android/src/main/java/com/youversion/reactnativesdk/RNSignInWithYouVersionButtonModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,27 @@ | ||
| package com.youversion.reactnativesdk | ||
|
|
||
| import androidx.compose.runtime.remember | ||
| import com.youversion.reactnativesdk.views.SignInWithYouVersionButtonProps | ||
| import com.youversion.reactnativesdk.views.YVPSignInWithYouVersionButton | ||
| import expo.modules.kotlin.modules.Module | ||
| import expo.modules.kotlin.modules.ModuleDefinition | ||
| import expo.modules.kotlin.viewevent.getValue | ||
|
|
||
| class RNSignInWithYouVersionButtonModule : Module() { | ||
| override fun definition() = ModuleDefinition { | ||
| Name("SignInWithYouVersionButton") | ||
|
|
||
| View(YVPSignInWithYouVersionButton::class) { | ||
| Events("onTap") | ||
| View( | ||
| name = "YVPSignInWithYouVersionButton", | ||
| events = { Events("onTap") } | ||
| ) { props: SignInWithYouVersionButtonProps -> | ||
| val onTap by remember { EventDispatcher<Unit>() } | ||
|
|
||
| YVPSignInWithYouVersionButton( | ||
| props = props | ||
| ) { | ||
| onTap(Unit) | ||
| } | ||
| } | ||
| } | ||
| } |
17 changes: 16 additions & 1 deletion
17
android/src/main/java/com/youversion/reactnativesdk/RNVotdViewModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,28 @@ | ||
| package com.youversion.reactnativesdk | ||
|
|
||
| import androidx.compose.runtime.remember | ||
| import com.youversion.reactnativesdk.views.VotdViewProps | ||
| import com.youversion.reactnativesdk.views.YVPVotdView | ||
| import expo.modules.kotlin.modules.Module | ||
| import expo.modules.kotlin.modules.ModuleDefinition | ||
| import expo.modules.kotlin.viewevent.getValue | ||
|
|
||
| class RNVotdViewModule : Module() { | ||
| override fun definition() = ModuleDefinition { | ||
| Name("VotdView") | ||
|
|
||
| View(YVPVotdView::class) | ||
| View( | ||
| name = "YVPVotdView", | ||
| events = { Events("onSharePress", "onFullChapterPress") } | ||
| ) { props: VotdViewProps -> | ||
| val onSharePress by remember { EventDispatcher<Unit>() } | ||
| val onFullChapterPress by remember { EventDispatcher<Unit>() } | ||
|
|
||
| YVPVotdView( | ||
| props = props, | ||
| onSharePress = { onSharePress(Unit) }, | ||
| onFullChapterPress = { onFullChapterPress(Unit) } | ||
| ) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
onTapcallback is never forwarded toBibleTextThe
onTap: () -> Unitparameter is accepted byYVPBibleTextViewbut is silently dropped — it is never passed to the underlyingBibleTextcomposable. As a result, theonTapevent wired up inRNBibleTextViewModulewill never fire for JS consumers.If
BibleTextexposes a tap/click parameter, it should be passed through here. If it doesn't, this parameter (and the correspondingEvents("onTap")declaration in the module) should be removed until the SDK supports it.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.
@sidorchukandrew I think this is legit
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.
I wasn't sure about implementing it in this PR because of some difference between what Kotlin and Swift have, but I've decided to add at least the base here: e89f49a