First, about Fresco
Github:https://github.com/facebook/fresco
Api:http://www.fresco-cn.org/javadoc/reference/packages.html
Fresco is a powerful picture loading component.
The Fresco is designed with a module called Image pipeline. It is responsible for loading images from the network, from the local file system, local resources. To maximize space and CPU time, it contains a level 3 cache design (level 2 memory, Level 1 files).
The Fresco design has a drawees module that conveniently displays the loading diagram, freeing up memory and space consumption when the picture is no longer displayed on the screen.
Fresco supports Android2.3 (API level 9) and above systems.
Second, the characteristics
Progressive rendering of images
Progressive JPEG image format has been popular for several years, progressive picture format first presents a rough outline of the picture, and then as the picture continues to download, showing a gradually clear picture, which for mobile devices, especially slow network has great positive, can bring a better user experience.
The image Library of Android itself does not support this format, but fresco supports it. When used, as always, just need to provide a picture of the URI, the rest of the matter, fresco will handle.
GIF graphs and WEBP formats
Yes, support for loading GIF graph, support WEBP format.
Rendering of images
Fresco's drawees design brings some useful features:
- Customize Center focus (very helpful for displaying pictures such as faces)
- Fillet chart, of course the circle is OK.
- After the download fails, click reproduce download
- Custom placeholder bitmap, custom overlay, or progress bar
- Specify the overlay when the user presses
Loading of images
Fresco's image pipeline design allows users to control the loading of images in multiple ways:
- Specify a different remote path for the same picture, or use a picture that already exists in the local cache
- Show a low-resolution image first, and then display high-definition image after download
- Load completion callback Notification
- For this map, if you have an EXIF thumbnail, you can display the thumbnail before the large map loading is complete.
- Zoom or rotate a picture
- Process a downloaded picture
- WebP Support
Iii. examples
1. Load network pictures using fresco
Fresco of Android image processing