Play animated GIF avatars in the contact/group detail header and fullscreen preview - #14913
Open
br4yd wants to merge 3 commits into
Open
Play animated GIF avatars in the contact/group detail header and fullscreen preview#14913br4yd wants to merge 3 commits into
br4yd wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributor checklist
Fixes #1234syntax(no tracked issue for this — not filed as a bug, just noticed the behavior)
Description
Signal Desktop renders avatars as a plain
<img>/CSSbackground-image, so an animated GIF avatar (e.g. a phone's system contact photo synced to a linked device, or an animated Signal profile photo) plays natively via Chromium. On Android, every avatar is frozen to its first frame regardless of source format, becauseAvatarImageView.setAvatar()unconditionally calls Glide's.dontAnimate().Animating every avatar everywhere needs system resources. GIFs decode and redraw every frame, which is real cost in a scrolling list with dozens of recycled avatar views on screen at once. So instead of removing
dontAnimate()globally, this adds an opt-inAvatarOptions.animateAvatarflag (defaultfalse, so every existing call site keeps today's behavior unchanged) and only turns it on in the two places where exactly one avatar is ever shown at a time:ConversationSettingsFragment).AvatarPreviewActivity), which previously always requested.asBitmap(). It has been sitched to a plainDrawablerequest so an animatedGifDrawablecan be returned there at all.Chat list rows, contact lists, group member lists, call log, etc. are untouched. They keep
dontAnimate()to save system resources and keep performance.Known limitation: this only helps animated GIF avatars. Signal Android's Glide setup (
SignalGlideComponents) registers a decoder forInputStream -> GifDrawable, but has no equivalent for animated WebP. An animated-WebP avatar would still render as static after this change.Adding that would mean registering a separate animated-WebP decoder in the Glide pipeline, which felt like a bigger, separate change for me and is IMO out of scope here.
Testing
Tested on a real device with a contact whose avatar is an animated GIF: it now plays in both the conversation-settings header and the fullscreen preview, while chat-list/contact-list rows remain static as intended.