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
Issue details / Repro steps / Use case background:
for image selection i use:
implementation 'com.github.akshaaatt:Cropper:1.00'
@Composable
fun SelectAvatar() {
var avatarUri by rememberSaveable { mutableStateOf<Uri?>(null) }
val selectAvatarLauncher = rememberLauncherForActivityResult(CropImageContract()) { result ->
if (result.isSuccessful) {
avatarUri = result.uriContent
}
}
fun selectAvatar() {
selectAvatarLauncher.launch(options {})
}
Column{
TextButton(onClick = ::selectAvatar) {Text(text="Select Avatar")}
if (avatarUri != null)
GlideImage(model = avatarUri, modifier = Modifier.size(100.dp), contentDescription = "")
}
}
When i click button first time and select image - it appears correctly, but when i click button second time and select new image GlideImage does not redraw itself and i see old picture.
I checked with Logs - avatarUri updated correctly and Compose recomposed.
The text was updated successfully, but these errors were encountered:
Yeah in particular, the model is supposed to be part of RequestBuilder, but it's not included in RequestBuilder's equals/hashcode method.
In fact a few things in RequestBuilder are not included and it's kind of unsafe by default because RequestBuilder inherits from a class that does implement equals/hashcode.
…ncrete classes.
It's a little tricky to get this right because we've defined
equals/hashcode in the base classes, but are implementing them in the
concrete classes. I think this implementation is actually safe because
the base classes are abstract. However making equals transitive requires
the weird equals() only implementations in the classes that have no
properties but are concrete implementations of the base classes.
A safer way to do this would be to move the the equals/hashcode
implementation out of the base class and re-implement it in each
subclass. However that would require exposing a bunch of internal
instance variables to subclasses. Given the existing structure and the
public nature of the base classes, this seems like a reasonable
compromise.
Fixes#4916
Glide Version: Glide 4.14.1, glide:compose:1.0.0-alpha.0
Issue details / Repro steps / Use case background:
for image selection i use:
implementation 'com.github.akshaaatt:Cropper:1.00'
When i click button first time and select image - it appears correctly, but when i click button second time and select new image GlideImage does not redraw itself and i see old picture.
I checked with Logs - avatarUri updated correctly and Compose recomposed.
The text was updated successfully, but these errors were encountered: