Skip to content

Commit 4c8e62f

Browse files
committed
Update the bottom sheet color picker usage.
1 parent 9570fd1 commit 4c8e62f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ After you integrated the `KvColorPicker-Android` library, you can consume it as
4242
As a main functionality, consumer can use color picker bottom sheet in there application as follows.
4343
```
4444
// Create state variable to show and hide bottom sheet
45+
val showSheet = remember { mutableStateOf(false) }
4546
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
4647
4748
// Button click to open bottom-sheet
@@ -54,13 +55,15 @@ Button(
5455
}
5556
5657
// Color Picker bottom sheet UI
57-
KvColorPickerBottomSheet(
58-
showSheet = showSheet,
59-
sheetState = sheetState,
60-
onColorSelected = { selectedColor ->
61-
// Do anything when you have selected color
62-
}
63-
)
58+
if (showSheet.value) {
59+
KvColorPickerBottomSheet(
60+
showSheet = showSheet,
61+
sheetState = sheetState,
62+
onColorSelected = { selectedColor ->
63+
// Do anything when you have selected color
64+
}
65+
)
66+
}
6467
```
6568

6669
# Contribution

0 commit comments

Comments
 (0)