Skip to content

Commit

Permalink
Use independent Modifier with constraints for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Aug 1, 2023
1 parent 238a8c9 commit 36d5cd6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ private fun ColorPalettes(palette: Palette?) {
modifier = Modifier
.padding(horizontal = 8.dp)
.size(45.dp),
label = "ColorPalettes",
) {
Box(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public fun CoilImage(

is CoilImageState.Loading -> {
component.ComposeLoadingStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageOptions = imageOptions,
executor = { size ->
CoilThumbnail(
Expand All @@ -240,7 +240,7 @@ public fun CoilImage(

is CoilImageState.Failure -> {
component.ComposeFailureStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageOptions = imageOptions,
reason = coilImageState.reason,
)
Expand All @@ -249,7 +249,7 @@ public fun CoilImage(

is CoilImageState.Success -> {
component.ComposeSuccessStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageModel = imageRequest.invoke().data,
imageOptions = imageOptions,
imageBitmap = coilImageState.drawable?.toBitmap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public fun FrescoImage(

is FrescoImageState.Loading -> {
component.ComposeLoadingStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageOptions = imageOptions,
executor = { size ->
FrescoImageThumbnail(
Expand All @@ -148,7 +148,7 @@ public fun FrescoImage(

is FrescoImageState.Failure -> {
component.ComposeFailureStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageOptions = imageOptions,
reason = frescoImageState.reason,
)
Expand All @@ -157,7 +157,7 @@ public fun FrescoImage(

is FrescoImageState.Success -> {
component.ComposeSuccessStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageModel = imageUrl,
imageOptions = imageOptions,
imageBitmap = frescoImageState.imageBitmap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public fun GlideImage(

is GlideImageState.Loading -> {
component.ComposeLoadingStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageOptions = imageOptions,
executor = { size ->
GlideThumbnail(
Expand All @@ -178,7 +178,7 @@ public fun GlideImage(

is GlideImageState.Failure -> {
component.ComposeFailureStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageOptions = imageOptions,
reason = glideImageState.reason,
)
Expand All @@ -187,7 +187,7 @@ public fun GlideImage(

is GlideImageState.Success -> {
component.ComposeSuccessStatePlugins(
modifier = modifier,
modifier = Modifier.constraint(this),
imageModel = imageModel,
imageOptions = imageOptions,
imageBitmap = glideImageState.data.toImageBitmap(
Expand Down

0 comments on commit 36d5cd6

Please sign in to comment.