Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itemMediaView image flicker when loading image #2649

Open
FikriMilano opened this issue Jul 29, 2024 · 3 comments · May be fixed by #2650
Open

itemMediaView image flicker when loading image #2649

FikriMilano opened this issue Jul 29, 2024 · 3 comments · May be fixed by #2650
Assignees
Labels
effort:xsmall Extra small effort - 1 day P2 Medium priority issue

Comments

@FikriMilano
Copy link
Collaborator

FikriMilano commented Jul 29, 2024

Describe the bug
itemMediaView image flicker when loading image.

Component
SDC library

To Reproduce
Steps to reproduce the behavior:

  1. Have a questionnaire that loads image using itemMedia
  2. Open it

Expected behavior
Should not flicker.

Video

blinking_imageview.webm

Smartphone (please complete the following information):

  • Device: [e.g. Pixel4a emulator]
  • Android version: [e.g. Settings -> About phone -> Android version]
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 22]

Additional context
N/A

Would you like to work on the issue?
Yes

@FikriMilano
Copy link
Collaborator Author

I think the easiest way is to revert back to:

imageAttachment.setImageBitmap(image)

I've tried to fix Glide itself by following these tickets below, but none works:
bumptech/glide#755
bumptech/glide#527

@FikriMilano FikriMilano linked a pull request Jul 29, 2024 that will close this issue
7 tasks
@MJ1998
Copy link
Collaborator

MJ1998 commented Jul 29, 2024

I suspect it could be because of the reason in this comment which says

The flickering is caused by you loading images into the same view in quick succession.

Maybe the bind function is being called unnecessarily in quick succession? Not sure if that is solvable but can you investigate ? Thanks @FikriMilano

@MJ1998 MJ1998 added P2 Medium priority issue effort:xsmall Extra small effort - 1 day labels Jul 29, 2024
@jingtang10
Copy link
Collaborator

I think the easiest way is to revert back to:

imageAttachment.setImageBitmap(image)

I've tried to fix Glide itself by following these tickets below, but none works: bumptech/glide#755 bumptech/glide#527

why did we use glide in the first place?

i think what's happening is reflow caused by glide loading up the image after thee text is loaded.

a potential fix (i'm not saying it's better) to consider is reserving the space on screen so that the text doesn't get moved down - this would probably alleviate the blinking effect.

if we remove the use of glide here, should we remove it as a dependency? do we use it elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:xsmall Extra small effort - 1 day P2 Medium priority issue
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

3 participants