Closed Bug 914872 Opened 11 years ago Closed 3 years ago

Thumbnails should fade-in

Categories

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

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: sriram, Unassigned)

References

Details

Attachments

(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:
https://hg.mozilla.org/mozilla-central/file/tip/mobile/android/base/animation/PropertyAnimator.java#l164

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?(lucasr.at.mozilla)
Comment on attachment 802619 [details] [diff] [review]
Patch

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?(lucasr.at.mozilla)
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](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 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.