From 70184500a41ae8df7131fb5134c55cd8d340c544 Mon Sep 17 00:00:00 2001 From: Shivam Dhuria Date: Sun, 6 Feb 2022 02:00:52 +0530 Subject: [PATCH] added optional z index --- .../src/main/java/com/elixer/palette/composables/Palette.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/palette/src/main/java/com/elixer/palette/composables/Palette.kt b/palette/src/main/java/com/elixer/palette/composables/Palette.kt index 5799216..6ef58f6 100644 --- a/palette/src/main/java/com/elixer/palette/composables/Palette.kt +++ b/palette/src/main/java/com/elixer/palette/composables/Palette.kt @@ -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) } @@ -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(