@@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Box
5
5
import androidx.compose.foundation.layout.fillMaxSize
6
6
import androidx.compose.runtime.Composable
7
7
import androidx.compose.runtime.remember
8
+ import androidx.compose.ui.Alignment
8
9
import androidx.compose.ui.Modifier
9
10
import androidx.compose.ui.draw.DrawModifier
10
11
import androidx.compose.ui.geometry.Offset
@@ -16,17 +17,24 @@ import androidx.compose.ui.graphics.drawscope.ContentDrawScope
16
17
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
17
18
import androidx.compose.ui.graphics.withSaveLayer
18
19
19
- sealed class GooeyIntensity (val intensity : Float , val alpha : Float = intensity * 4f , val shift : Float = -250f * intensity) {
20
+ sealed class GooeyIntensity (
21
+ val intensity : Float ,
22
+ val alpha : Float = intensity * 4f ,
23
+ val shift : Float = -250f * intensity
24
+ ) {
20
25
object Low : GooeyIntensity(10f )
21
26
object Medium : GooeyIntensity(20f )
22
27
object High : GooeyIntensity(40f )
23
- class Custom (intensity : Float , alpha : Float , shift : Float ) : GooeyIntensity(intensity,alpha, shift)
28
+ class Custom (intensity : Float , alpha : Float , shift : Float ) :
29
+ GooeyIntensity (intensity, alpha, shift)
24
30
}
25
31
26
32
@Composable
27
33
fun GooeyBox (
28
34
modifier : Modifier = Modifier ,
29
35
intensity : GooeyIntensity = GooeyIntensity .Medium ,
36
+ contentAlignment : Alignment = Alignment .TopStart ,
37
+ propagateMinConstraints : Boolean = false,
30
38
content : @Composable GooeyScope .() -> Unit
31
39
) {
32
40
val gooeyModifier =
@@ -35,7 +43,9 @@ fun GooeyBox(
35
43
Box (
36
44
Modifier
37
45
.fillMaxSize()
38
- .then(gooeyModifier)
46
+ .then(gooeyModifier),
47
+ contentAlignment,
48
+ propagateMinConstraints
39
49
) {
40
50
Box (modifier) {
41
51
val scope =
0 commit comments