Repeat
DSL function to repeat content N times
Repeat
Module: jindong-compose | Package: io.github.compose.jindong.dsl
Repeats the content block a specified number of times.
Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
count | Int | Number of times to repeat |
content | @Composable JindongScope.() -> Unit | The pattern to repeat |
Description
Repeat executes the content block multiple times. Each repetition starts after the previous one completes, creating a sequential chain of the pattern.
Usage
Basic Usage
With Delay
Nested Repeat
Examples
Triple Tap
Error Alert
Notification Buzz
Complex Pattern
Timing Calculation
The total duration is count × (content duration):
vs RepeatWithIndex
Use Repeat when each iteration is identical:
Use RepeatWithIndex when iterations need to vary:
Notes
countof 0 produces no output- If count is negative, it can cause app crash.
- Each iteration runs sequentially
- Content block is evaluated
counttimes at composition - All iterations have the same pattern