Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0edd0c7
feat(ui): stories v2 components
Xyzcancer Sep 30, 2026
4eaceb2
feat(ui): stories v2 viewer and widget
Xyzcancer Sep 30, 2026
077549f
feat(demo): stories v2 exhibits
Xyzcancer Sep 30, 2026
bc1feaf
fix(ui): the stories viewer scrims every slide
Xyzcancer Sep 30, 2026
f205497
feat(ui): stories v2 mapping rules and per-shop seen store
Xyzcancer Oct 2, 2026
fbfb2ef
feat(ui): stories v2 viewer state machine
Xyzcancer Oct 2, 2026
41d5eea
feat(ui): stories v2 video cache, audio focus and texts
Xyzcancer Oct 2, 2026
cae9698
feat(ui): stories v2 viewer on the state machine
Xyzcancer Oct 2, 2026
5f86ade
feat(ui): compose wrapper for stories v2
Xyzcancer Oct 2, 2026
396f1de
feat(demo): stories v2 round 2 exhibits
Xyzcancer Oct 2, 2026
06d928a
fix(ui): sound button descriptions name the sound state
Xyzcancer Oct 2, 2026
bddea65
fix(ui): stories v2 navigation keeps the content padding
Xyzcancer Oct 2, 2026
4b2e10f
fix(ui): stories v2 close cross closes the viewer over the products s…
Xyzcancer Oct 2, 2026
b98ae92
fix(ui): stories v2 product picture opens the product
Xyzcancer Oct 2, 2026
5cd9ecc
fix(ui): stories v2 crossed price under a promo compares with the reg…
Xyzcancer Oct 2, 2026
fadd048
fix(ui): stories v2 preset line height is rounded
Xyzcancer Oct 2, 2026
8ff5e11
fix(ui): sound button exposes its state as selected
Xyzcancer Oct 2, 2026
cb587ea
fix(ui): stories v2 media timers stand still in background
Xyzcancer Oct 2, 2026
d6c6d09
fix(ui): stories v2 audio interruptions keep the sound choice
Xyzcancer Oct 2, 2026
58ed2a7
fix(ui): stories v2 open pages inside an open viewer
Xyzcancer Oct 2, 2026
9579f48
feat(ui): stories v2 show reports the viewer closing, stories open by…
Xyzcancer Oct 2, 2026
6959a5a
fix(ui): stories v2 controller keeps an open call until the widget shows
Xyzcancer Oct 2, 2026
a3258b8
feat(demo): stories v2 show reports the viewer closing
Xyzcancer Oct 2, 2026
5480aeb
fix(ui): stories v2 crosses out the regular price only above the prom…
Xyzcancer Oct 2, 2026
c468f0d
fix(ui): stories v2 drop repeated story ids
Xyzcancer Oct 2, 2026
13839c8
feat(ui): stories v2 plays gif slides with the slide clock
Xyzcancer Oct 6, 2026
1da639a
feat(demo): stories v2 sample gets a gif story
Xyzcancer Oct 6, 2026
0ad33eb
fix(ui): stories v2 product card shows the promo code of the slide's …
Xyzcancer Oct 7, 2026
ef60e67
feat(demo): stories v2 sample product slide carries a text block promo
Xyzcancer Oct 7, 2026
52d9dd5
fix(ui): story price keeps the promo caption and code whole without a…
Xyzcancer Oct 7, 2026
2b93cc6
fix(ui): stories v2 product picture no longer opens the product
Xyzcancer Oct 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
499 changes: 499 additions & 0 deletions demo-app/src/main/assets/uikit/stories_sample.json

Large diffs are not rendered by default.

Binary file added demo-app/src/main/assets/uikit/story_clock.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package com.personalization.demo

import android.content.Context
import android.widget.Toast
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedButton
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import com.personalization.OnClickListener
import com.personalization.Product
import com.personalization.ui.widgets.PersonalizationStories
import com.personalization.ui.widgets.PersonalizationStoriesController
import com.personalization.ui.widgets.PersonalizationStoriesWidget

/**
* The Compose wrapper of the Stories V2 block on the demo shop, driven by a controller (open a story
* by index — while the viewer is open it pages there), and the same block shown without the bar
* through PersonalizationStories.show(), which reports the viewer closing.
*/
@Composable
internal fun StoriesV2ComposeExhibit(storiesCode: String, shopId: String) {
val context = LocalContext.current
val controller = remember { PersonalizationStoriesController() }
var status by remember { mutableStateOf("Errors of the block and of show(), and its closing, appear here") }
val clicks = remember { DemoStoriesClicks(context) }

Column(modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
Text(
text = "Stories V2 — Compose PersonalizationStoriesWidget with a controller",
style = MaterialTheme.typography.caption,
color = MaterialTheme.colors.onBackground.copy(alpha = 0.6f)
)
PersonalizationStoriesWidget(
code = storiesCode,
shopId = shopId,
controller = controller,
onClickListener = clicks,
onError = { code, message -> status = "onError $code: $message" }
)
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
OutlinedButton(onClick = { controller.open(1) }) { Text("Open #2") }
OutlinedButton(onClick = {
PersonalizationStories.show(
context = context,
code = storiesCode,
shopId = shopId,
onClickListener = clicks,
onError = { code, message -> status = "show() onError $code: $message" },
onClose = { status = "show() viewer closed" }
)
}) { Text("Show without bar") }
}
Text(text = status, style = MaterialTheme.typography.caption)
}
}

/**
* Logs every link and product the stories hand to the host and lets the SDK open it — the V1
* OnClickListener contract: `true` means "SDK, open it", `false` means "the host handled it".
*/
internal class DemoStoriesClicks(private val context: Context) : OnClickListener {
override fun onClick(url: String): Boolean {
toast("Link: $url")
return false
}

override fun onClick(product: Product): Boolean {
toast("Product: ${product.name}")
return false
}

private fun toast(message: String) = Toast.makeText(context, message, Toast.LENGTH_SHORT).show()
}
Loading
Loading