Fetch and use thumbnail across the app #2906
Merged
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.
Description (required)
Why we are replacing
MediaWikiImageView
(which extendsSimpleDraweeView
) withSimpleDraweeView
?MediaWikiImageView
takes a filename and does an API call to fetch its thumbnail using an API call iefindThumbnailByFilename
and then maintains a filename to thumbnail URL cache.As the behavior of fetching the thumbnail was part of the view itself, the thumbnail is fetched every time the view is rendered(if not already in the cache). That results in an extra API call being made for every single image.
Now, as the app is consuming the
imageinfo
API, we already have the thumbnail URL for most of the images ie explore, search, POTD and media detail. Only contribution list doesn't have thumbnail as of now. If we implement #2904, even the contribution list will have thumbnail beforehand. Until then contribution view holder can fetch and display the thumbnail.Fixes #2898
How?
Earlier
MediaWikiImageView
was used in media detail and as per the behaviour ofMediaWikiImageView
, it was showing thumbnails.Fixes #2820
How?
The change in
appendMediaProperties
automatically gets 640 width thumbs for all media. This is in addition to the original url.Fixes #2907
How?
Using Fresco's image controller, we are loading low and res images to a simple drawee view.