Closed Bug 914872 Opened 9 years ago Closed 2 years ago

Thumbnails should fade-in


(Firefox for Android Graveyard :: Theme and Visual Design, defect)

Not set


(Not tracked)



(Reporter: sriram, Unassigned)




(1 file)

As a part of bug 904172, the thumbnails were made to use a fixed space, and the animations were removed. As per UX, its better to fade-in the thumbnail and fade-out a default view.
Blocks: 904172
Attached patch PatchSplinter Review
This patch does the animation bits. There are two views -- placeholder and the actual thumbnail. The thumbnails faded-in while the placeholders fade-out.

There are few issues before landing this patch:
1. The second cursor update causes flickering. We need to make sure the favicon change of about:home doesnt trigger a cursor change.
2. There is a crash happening, on rotation, here:

I guess the isAlive() check should be inside onPreDraw(). Also, my view.crossFade() should happen after the binding is done. Though, we won't know when the binding is done. Is there a way to tie the crossfade to a layout animation or something? Or may be a view animation? Or make the property animator take care of it?
Attachment #802619 - Flags: feedback?(
Comment on attachment 802619 [details] [diff] [review]

Review of attachment 802619 [details] [diff] [review]:

This looks correct overall but TwoBookmarkItemView API could be much simpler.

Note how there are certain invariants there:
- The placeholder view never gets dynamic images (thumbnails or favicons)
- Showing placeholder always means hiding the thumbnail and vice-versa
- You only cross fade when you're going from placeholder to actual image (thumbnail or favicon)

With that said, here's what I suggest as the TwoBookmarkItemView API instead:
- displayPlaceholder() - Hides thumbnailview, show placeholderview, never animates
- displayFavicon(Bitmap), displayThumbnail(Bitmap) and displayThumbnail(resId) - Hides placeholderview, shows thumbnailview, only animates if it was showing placeholder for that URL before

No need to have a public API for crossfading. This is something that the displayFavicon/displayThumbnail should call implicitly I guess. 

This patch as is will trigger a crossfade on all getView() calls after the thumbnails are loaded, which is not ideal. This might not be an issue due to our fixed-size gridview approach but at least double-check that we're not constantly triggering an animator.

I would also investigate the possibility of simply using a TransitionDrawable in a single view to do the crossfading instead of having multiple views. Not sure if it will be trivial to use a TransitionDrawable and still do the special background color handling for favicons, but it's worth having a look.
Attachment #802619 - Flags: feedback?(
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly]( an issue can be reported at the [Fenix GitHub project]( If you want to discuss your report please use [Mozilla's chat]( server and join the [#fenix]( channel.
Closed: 2 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.