8000 Compose GlideImage does not repaint Image when model changed · Issue #4916 · bumptech/glide · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Compose GlideImage does not repaint Image when model changed #4916
Closed
@vborodinramit

Description

@vborodinramit

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'

@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( {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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0