// Overload function public Bitmap transform (Bitmap source) {int width = source. getWidth (); int height = source. getHeight (); int x = 0, y = 0; if (mSquareRound & width! = Height) {if (width transform(new RoundTransformation(true));
2. the picasso class diagram is as follows:
A Brief Introduction to key classes:
Cache: Cache class. The sub-class LruCache uses Least Recently Used to use at Least the algorithm Recently. Of course, javashashmap has implemented this policy and trimToSize Based on the configured Cache size.
The picass Cache Policy is single. There is no other Image download cache library Android-universal-Image-Loader. There are many cache policies: FIFOLimitedMemZ? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> memory + memory/memory + Memory + LXsMDgo6zWrrrzsNHL + Memory + rHtwcvSu7j2vt/memory + examples/examples + examples/examples + zzKOsvbu4 + examples/O0psDtwOCjrNfTwOC4 + examples/templates + CiA8L3A + examples + templates = "http://www.2cto.com/uploadfile/Collfiles/20141203/2014120309104861.png" alt = "\">
4. possible problems with picasso:
1. sometimes the image cannot be displayed. view the cached image file in the application. For an image, two files are generated :,. file 0 stores the corresponding http response information ,. 1. Encrypted image file .. The content of file 0 is as follows:
http://192.168.2.40:82/group1/M00/0A/60/wKgCKFQJQkKABEn9AAPhsEdiW-o.phpzqfGET0HTTP/1.1 200 OK9Server: nginx/1.2.6Date: Tue, 16 Sep 2014 12:02:26 GMTContent-Length: 254384Last-Modified: Fri, 05 Sep 2014 04:55:30 GMTConnection: keep-aliveAccept-Ranges: bytesOkHttp-Selected-Protocol: http/1.1OkHttp-Sent-Millis: 1410868547182OkHttp-Received-Millis: 1410868547357
Content-Length: 0, but the image does exist. If it is not displayed, you can view it in this regard. Feasible Method:
Customizes Downloader and configures the cache directory and cache size.
2. When picasso displays a large number of images in the list, oom occurs when you view the large image. In addition to compressing the aspect ratio, you can also view the large image in another process.