Repository navigation
MOBILE-557: Три исхода, стратегия загрузки и анимация появления встроенного блока #224
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
31f8f5a
MOBILE-557: Split the embedded block outcome into onLoad, onEmpty and…
e8cdeff
MOBILE-557: Let the block start hidden, with a placeholder, or by the…
ee276d8
MOBILE-557: Say that whitespace around a place name is the native blo…
122511f
MOBILE-557: Let the native block alone tell an automatic block its fi…
fd36c6b
MOBILE-557: Hand the host its callbacks at creation so the block's fi…
e679eda
Merge remote-tracking branch 'origin/mission/stories' into feature/MO…
23506b2
MOBILE-557: Keep every appearance and outcome event of an Android blo…
ac4b92a
MOBILE-557: Fade a host overlay out above the content it is replaced …
927deea
MOBILE-557: Say that a block waiting hidden draws no placeholder or e…
4f81660
MOBILE-557: Name what breaks for a host on 2.16.0-rc, under the heade…
b5a51fc
MOBILE-557: Log an unknown loading strategy on Android once the place…
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
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
31 changes: 31 additions & 0 deletions
31
android/src/main/java/com/mindboxsdk/embedded/EmbeddedBlockWire.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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.mindboxsdk.embedded | ||
|
|
||
| import cloud.mindbox.mobile_sdk.annotations.InternalMindboxApi | ||
| import cloud.mindbox.mobile_sdk.embedded.MindboxEmbeddedBlockAppearance | ||
| import cloud.mindbox.mobile_sdk.embedded.MindboxEmbeddedBlockLoadingStrategy | ||
|
|
||
| /** | ||
| * The words the block speaks to JS in: the same ones on iOS, the same ones the Flutter plugin | ||
| * uses. A contract with the JS side, not derived from anything. | ||
| */ | ||
| @OptIn(InternalMindboxApi::class) | ||
| internal object EmbeddedBlockWire { | ||
| const val OUTCOME_LOAD = "load" | ||
| const val OUTCOME_EMPTY = "empty" | ||
| const val OUTCOME_FAIL = "fail" | ||
|
|
||
| /** `null` for a word this SDK does not know; an empty word is the default, `automatic`. */ | ||
| fun loadingStrategyOf(word: String?): MindboxEmbeddedBlockLoadingStrategy? = when (word) { | ||
| null, "", "automatic" -> MindboxEmbeddedBlockLoadingStrategy.AUTOMATIC | ||
| "placeholder" -> MindboxEmbeddedBlockLoadingStrategy.PLACEHOLDER | ||
| "hidden" -> MindboxEmbeddedBlockLoadingStrategy.HIDDEN | ||
| else -> null | ||
| } | ||
|
|
||
| fun nameOf(appearance: MindboxEmbeddedBlockAppearance): String = when (appearance) { | ||
| MindboxEmbeddedBlockAppearance.PLACEHOLDER -> "placeholder" | ||
| MindboxEmbeddedBlockAppearance.CONTENT -> "content" | ||
| MindboxEmbeddedBlockAppearance.ERROR -> "error" | ||
| MindboxEmbeddedBlockAppearance.COLLAPSED -> "collapsed" | ||
| } | ||
| } |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.