Creating a sequence of showcases in a specific order.

- Gradle
implementation("io.github.jocoand:showcase-sequence:1.1.1")
-
@Composable fun MyShowcaseDialog(text: String, onClick: () -> Unit) { Column( modifier = Modifier .background(Color.White, shape = RoundedCornerShape(12.dp)) .padding(16.dp), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.End ) { Text(text = text) Spacer(modifier = Modifier.height(8.dp)) Button( shape = RoundedCornerShape(8.dp), onClick = onClick ) { Text("Nice !") } } }
-
val sequenceShowcaseState = rememberSequenceShowcaseState() SequenceShowcase(state = sequenceShowcaseState) { Scaffold( ...
-
MyView1( // View to be highlighted modifier = Modifier .sequenceShowcaseTarget( // Mark with sequenceShowcaseTarget index = 0, content = { MyShowcaseDialog( // Dialog to be displayed text = "Hey, this is Greetings showcase", ) } ), onClick = { sequenceShowcaseState.start() } )
index
: the order to be shown in the sequencecontent
: dialog to be displayed -
LaunchButton( ... onClick = { sequenceShowcaseState.start() } )
index
: value to start at certain index (optional) -
MyView2( modifier = Modifier .sequenceShowcaseTarget( index = 1, content = { MyShowcaseDialog( text = "Hey, this is Article show case", onClick = { sequenceShowcaseState.next() // Navigate to next showcase } ) } ) )
-
You can also dismiss the the showcase using
dimiss()
-
See sample for more more details
-
position
Top Bottom Default
: relative to target position -
alignment
Start Center End Default
: relative to target position -
highlight
Rectangular Circular
- See MainActivity
In case you need more basic usage, you can you use ShowcaseView
Contribution are welcome! Feel free to open an issue or a pull request, if you find any bugs or have any suggestions.