Skip to content

Commit

Permalink
added optional z index
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivam Dhuria authored and Shivam Dhuria committed Feb 5, 2022
1 parent cf983de commit 7018450
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ fun Palette(
buttonColorChangeAnimationDuration: Int = 1000,
selectedArchAnimationDuration: Int = 1000,
onColorSelected: (Color) -> Unit = {},
colorWheelZIndexOnWheelDisplayed:Float = 0f,
colorWheelZIndexOnWheelHidden:Float = 0f
) {

val isPaletteDisplayed = remember { mutableStateOf(false) }
Expand Down Expand Up @@ -152,7 +154,7 @@ fun Palette(

BoxWithConstraints(
modifier = Modifier
.zIndex(if (isPaletteDisplayed.value) Float.MAX_VALUE else 0f)
.zIndex(if (isPaletteDisplayed.value) colorWheelZIndexOnWheelDisplayed else colorWheelZIndexOnWheelHidden)
.fillMaxSize()
.pointerInput(Unit) {
detectDragGestures(
Expand Down

0 comments on commit 7018450

Please sign in to comment.