@momo-kits/native-kits 0.89.10 → 0.89.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,18 +5,21 @@ import androidx.compose.ui.Alignment
|
|
|
5
5
|
import androidx.compose.ui.Modifier
|
|
6
6
|
import androidx.compose.ui.graphics.ColorFilter
|
|
7
7
|
import androidx.compose.ui.graphics.DefaultAlpha
|
|
8
|
+
import androidx.compose.ui.graphics.painter.Painter
|
|
8
9
|
import androidx.compose.ui.layout.ContentScale
|
|
9
10
|
import com.skydoves.landscapist.ImageOptions
|
|
10
11
|
import com.skydoves.landscapist.coil3.CoilImage
|
|
12
|
+
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
11
13
|
import vn.momo.kits.const.AppTheme
|
|
12
14
|
|
|
13
15
|
data class Options(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
val alignment: Alignment = Alignment.TopStart,
|
|
17
|
+
val contentScale: ContentScale = ContentScale.Crop,
|
|
18
|
+
val colorFilter: ColorFilter? = null,
|
|
19
|
+
val alpha: Float = DefaultAlpha,
|
|
18
20
|
)
|
|
19
21
|
|
|
22
|
+
@OptIn(ExperimentalResourceApi::class)
|
|
20
23
|
@Composable
|
|
21
24
|
fun Image(
|
|
22
25
|
source: String,
|
|
@@ -33,7 +36,6 @@ fun Image(
|
|
|
33
36
|
alpha = DefaultAlpha,
|
|
34
37
|
)
|
|
35
38
|
}
|
|
36
|
-
|
|
37
39
|
CoilImage(
|
|
38
40
|
modifier = modifier,
|
|
39
41
|
imageOptions = imageOptions,
|
|
@@ -48,4 +50,24 @@ fun Image(
|
|
|
48
50
|
)
|
|
49
51
|
}
|
|
50
52
|
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Composable
|
|
56
|
+
fun Image(
|
|
57
|
+
source: Painter,
|
|
58
|
+
modifier: Modifier = Modifier,
|
|
59
|
+
colorFilter: ColorFilter? = null,
|
|
60
|
+
alpha: Float = DefaultAlpha,
|
|
61
|
+
contentScale: ContentScale = ContentScale.Crop,
|
|
62
|
+
alignment: Alignment = Alignment.Center,
|
|
63
|
+
) {
|
|
64
|
+
androidx.compose.foundation.Image(
|
|
65
|
+
modifier = modifier,
|
|
66
|
+
painter = source,
|
|
67
|
+
contentDescription = null,
|
|
68
|
+
contentScale = contentScale,
|
|
69
|
+
alignment = alignment,
|
|
70
|
+
colorFilter = colorFilter,
|
|
71
|
+
alpha = alpha,
|
|
72
|
+
)
|
|
51
73
|
}
|