Skip to content

Commit ce1b6b2

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 388b9b4 + e19144e commit ce1b6b2

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

README.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,19 @@ Add the dependency
2424
## How to use ?
2525
```
2626
@Composable
27-
fun showcaseSample() {
28-
val context = LocalContext.current
29-
27+
fun ShowcaseSample() {
3028
val targets = remember {
31-
mutableStateListOf<ShowcaseProperty>()
32-
}
33-
var isIntroCompleted by remember {
34-
mutableStateOf(false)
29+
mutableStateMapOf<String, ShowcaseProperty>()
3530
}
36-
3731
Box {
3832
FloatingActionButton(
39-
onClick = {
33+
onClick = {},
34+
modifier = Modifier.padding(16.dp).align(Alignment.BottomStart).onGloballyPositioned { coordinates ->
35+
targets["email"] = ShowcaseProperty(
36+
1, coordinates, "Check emails", "Click here to check/send emails"
37+
)
4038
},
41-
modifier = Modifier
42-
.align(Alignment.BottomStart)
43-
.padding(16.dp)
44-
.onGloballyPositioned { coordinates ->
45-
targets.add(
46-
ShowcaseProperty(
47-
"email", 1, coordinates, "Check emails", "Click here to check/send emails" )
48-
)
49-
},
39+
backgroundColor = ThemeColor,
5040
contentColor = Color.White,
5141
elevation = FloatingActionButtonDefaults.elevation(6.dp)
5242
) {
@@ -56,13 +46,12 @@ fun showcaseSample() {
5646
)
5747
}
5848
59-
if (!isIntroCompleted)
60-
IntroShowCase(targets) {
61-
targets.clear()
62-
isIntroCompleted = true
63-
}
49+
IntroShowCase(targets) {
50+
// Show case finished!!
51+
}
6452
}
65-
}
53+
}
54+
6655
```
6756
<img src="https://github.com/canopas/Intro-showcase-view/blob/master/gif/intro2.gif" height="480" />
6857

0 commit comments

Comments
 (0)