Updated on 2026-08-14

This commit is contained in:
Tangem 2025-01-14 10:09:45 +05:00
commit 41c98cfee7
22 changed files with 186 additions and 18 deletions

View file

@ -56,15 +56,19 @@ inline fun <reified T : StoryConfig> StoriesContainer(
onNextStory = storyState::nextStory,
)
currentStoryContent(storyState.currentStory, isPaused)
StoriesProgressBar(
steps = storyState.steps,
currentStep = storyState.currentIndex.intValue,
stepDuration = storyState.currentStory.duration,
paused = isPaused,
onStepFinish = storyState::nextStory,
onStepFinish = {
if (storyState.nextStory()) {
config.onClose()
}
},
)
currentStoryContent(storyState.currentStory, isPaused)
}
}
@ -97,6 +101,7 @@ private data class StoryContainerPreviewProviderData(
StoryConfigPreviewProviderData(title = "Wallet"),
),
override val isRestartable: Boolean = true,
override val onClose: () -> Unit = {},
) : StoriesContentConfig<StoryConfigPreviewProviderData>
private data class StoryConfigPreviewProviderData(

View file

@ -80,6 +80,7 @@ fun StoriesProgressBar(
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.statusBarsPadding()
.padding(
start = 16.dp,
end = 16.dp,

View file

@ -11,6 +11,7 @@ import kotlinx.collections.immutable.ImmutableList
interface StoriesContentConfig<T : StoryConfig> {
val stories: ImmutableList<T>
val isRestartable: Boolean
val onClose: () -> Unit
}
interface StoryConfig {