Skip to content

Commit 2e0039c

Browse files
committed
add param ( contentAlignment, propagateMinConstraints )
1 parent 80a801e commit 2e0039c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

gooey/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ afterEvaluate {
5959

6060
groupId = 'com.D000L'
6161
artifactId = 'Gooey'
62-
version = '0.0.3'
62+
version = '0.0.4'
6363
}
6464
}
6565
}

gooey/src/main/java/com/doool/gooey/GooeyBox.kt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Box
55
import androidx.compose.foundation.layout.fillMaxSize
66
import androidx.compose.runtime.Composable
77
import androidx.compose.runtime.remember
8+
import androidx.compose.ui.Alignment
89
import androidx.compose.ui.Modifier
910
import androidx.compose.ui.draw.DrawModifier
1011
import androidx.compose.ui.geometry.Offset
@@ -16,17 +17,24 @@ import androidx.compose.ui.graphics.drawscope.ContentDrawScope
1617
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
1718
import androidx.compose.ui.graphics.withSaveLayer
1819

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+
) {
2025
object Low : GooeyIntensity(10f)
2126
object Medium : GooeyIntensity(20f)
2227
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)
2430
}
2531

2632
@Composable
2733
fun GooeyBox(
2834
modifier: Modifier = Modifier,
2935
intensity: GooeyIntensity = GooeyIntensity.Medium,
36+
contentAlignment: Alignment = Alignment.TopStart,
37+
propagateMinConstraints: Boolean = false,
3038
content: @Composable GooeyScope.() -> Unit
3139
) {
3240
val gooeyModifier =
@@ -35,7 +43,9 @@ fun GooeyBox(
3543
Box(
3644
Modifier
3745
.fillMaxSize()
38-
.then(gooeyModifier)
46+
.then(gooeyModifier),
47+
contentAlignment,
48+
propagateMinConstraints
3949
) {
4050
Box(modifier) {
4151
val scope =

0 commit comments

Comments
 (0)