Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CommonsWare Android Components: ThumbnailAdapter
Java
Branch: master

project terminated

latest commit 81e55a0456
Mark Murphy authored

README.markdown

CWAC Thumbnail: Images in Lists, Without the Wait

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 ImageViews -- 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 ImageViews 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.

Usage

Full instructions for using this module are forthcoming. Stay tuned!

Dependencies

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.

Version

This is version 0.1 of this module, meaning it is pretty darn new.

Demo

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.

License

The code in this project is licensed under the Apache Software License 2.0, per the terms of the included LICENSE file.

Questions

THIS PROJECT IS UNSUPPORTED

Something went wrong with that request. Please try again.