Highlight composable views of your App using Jetpack Compose.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.pdrozz:tutorialbox-compose:1.1.0'
}
Wrap your compose content with TutorialBox
val showTutorial = remember {
mutableState = true
}
TutorialBox(
state = rememberTutorialBoxState(),
showTutorial = showTutorial,
onTutorialCompleted = {
showTutorial = false
}
){
Column(){
Text("Text 1")
Text("Text 2")
Button(onClick = {}){
Text("Click me")
}
}
}
Inside the TutorialBoxScope adds the Modifier.markForTutorial() in the content
.markForTutorial(
index = 0,
title = "Profile icon",
description = "This is profile icon description"
)
or there is two ways to customize with your compose layout.
TutorialBox(
state = rememberTutorialBoxState(),
showTutorial = showTutorial,
onTutorialCompleted = {
showTutorial = false
},
tutorialTarget = { index ->
CustomCompose(index)
}
){
.markForTutorial(
index = 0,
content = {
CustomTutorialCompose()
}
)
Adjust the index according to the display order
val showTutorial = remember {
mutableState = true
}
TutorialBox(
state = rememberTutorialBoxState(),
showTutorial = showTutorial,
onTutorialCompleted = {
showTutorial = false
}
){
Column(){
Text(
modifier = Modifier
.markForTutorial(
index = 0,
title = "Text 1 Title",
description = "This is text 1 description"
)
text = "Text 1"
)
Text(
modifier = Modifier
.markForTutorial(
index = 1,
title = "Text 2 Title",
description = "This is text 2 description"
)
text = "Text 2"
)
Button(onClick = {}){
Text("Click me")
}
}
}
For bugs, questions and discussions please use the Github Issues.