THIS PROJECT IS DISCONTINUED — USE AT YOUR OWN RISK
So you want to have a ListView
that, among other things,
displays thumbnail images off the Internet. Doing that in
a performant fashion is a pain, since you have to do the
HTTP requests in the background so as not to tie up the UI
thread. Matching those requests up to their corresponding
ImageView
s -- and only for those rows presently visible --
is quite annoying.
Unless you use ThumbnailAdapter
.
ThumbnailAdapter
handles all of that mess for you. All you
need to do is wrap your regular ListAdapter
in a ThumbnailAdapter
,
supplying a SimpleWebImageCache
(from the CWAC Cache module)
and the IDs of the ImageView
s in each row. Then, when you bind
your rows, tuck the URL for the image into the ImageView
itself
via setTag()
. ThumbnailAdapter
handles the rest.
Full instructions for using this module are forthcoming. Stay tuned!
This project requires the CWAC Task module, the
CWAC Bus module, CWAC AdapterWrapper,
and the CWAC Cache module.
A copy of compatible JARs can be found in the libs/
directory
of the project, though you are welcome to try newer ones, or
ones that you have patched yourself.
This is version 0.1 of this module, meaning it is pretty darn new.
In the com.commonsware.cwac.thumbnail.demo
package you will find
a sample activity that demonstrates the use of ThumbnailAdapter
.
Note that when you build the JAR via ant jar
, the sample
activity is not included, nor any resources -- only the
compiled classes for the actual library are put into the JAR.
The code in this project is licensed under the Apache Software License 2.0, per the terms of the included LICENSE file.
THIS PROJECT IS UNSUPPORTED