Skip to content

Conversation

@rjrjr
Copy link
Collaborator

@rjrjr rjrjr commented Feb 21, 2025

 val composeWorkflow = ComposeWorkflow<String> {
    var count by remember { mutableStateOf(0) }

    LaunchedEffect(Unit) {
      while (true) {
        delay(1_000)
        count++
      }
    }

    count.toString()
  }

  val composeWorkflow = ComposeWorkflow.asWorkflow()

  override fun render(
    renderProps: Unit,
    renderState: State,
    context: RenderContext
  ): BodyAndOverlaysScreen<*, *> {
    val count = context.renderChild(composeWorkflow)

    // The rendering that will be displayed in the "Body" layer. This is the root of our Workflow
    // and will always be displayed.
    val body = BodyScreen(
      sillyText = count,
data class BodyScreen(
  val sillyText: String,
  // ...
) : ComposeScreen {

  @Composable override fun Content() {
    BasicTextField(
      value = "Ta da: $sillyText",
      onValueChange = {},
      modifier = Modifier.fillMaxWidth()
    )

rjrjr and others added 2 commits February 21, 2025 21:43
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@rjrjr rjrjr closed this May 8, 2025
@rjrjr rjrjr deleted the ray/cp branch May 8, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants