You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Device/Android Version: N/A (but it happens in both Samsung Galaxy S20 Ultra and emulator)
Issue details / Repro steps / Use case background:
If we're trying to load an image where one size is constrained and the other is not plus, if we first pass a null on the model (because we don't yet know what is the URL) and later replace with the actual URL, the view will end up taking all the available parent space instead of wrapping around the content on the dimension that is not constrained.
Given this code:
Row(
verticalAlignment =Alignment.CenterVertically,
modifier =Modifier
.height(56.dp)
.padding(horizontal =16.dp)
) {
Text(
text ="pre",
color =Color.White
)
GlideImage(
model = url,
contentDescription =null,
contentScale =ContentScale.FillHeight,
modifier =Modifier
.height(32.dp),
)
Text(
text ="after",
modifier =Modifier.fillMaxWidth(),
color =Color.White
)
}
Suppose that url = null at the start and is later changed into an actual url. What ends up happening:
If we don't call GlideImage with null at the start:
url?.let {
GlideImage(...)
}
It'll be correct:
This seems to be because the size is not invalidated when the model changes. I tried to hack around this with the following:
Tested latest snapshot (1.0.0-alpha.4-20230817.020857-63) and it seems worse. Now its not even based on that url == null. Since I don't specify a width, only a height, it'll always take the full available width. So a proper "wrap_content" is not working.
Glide Version: 4.15.1 / 1.0.0-alpha.3 (Compose)
Integration libraries: N/A
Device/Android Version: N/A (but it happens in both Samsung Galaxy S20 Ultra and emulator)
Issue details / Repro steps / Use case background:
If we're trying to load an image where one size is constrained and the other is not plus, if we first pass a null on the model (because we don't yet know what is the URL) and later replace with the actual URL, the view will end up taking all the available parent space instead of wrapping around the content on the dimension that is not constrained.
Given this code:
Suppose that
url = null
at the start and is later changed into an actual url. What ends up happening:If we don't call
GlideImage
with null at the start:It'll be correct:
This seems to be because the size is not invalidated when the model changes. I tried to hack around this with the following:
And it fixes the issue.
Possibly related with #4916.
Thanks!
The text was updated successfully, but these errors were encountered: