Code Monkey home page Code Monkey logo

cwac-thumbnail's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.