Skip to content
forked from lucasr/smoothie

Easy async loading for Android's ListView/GridView

Notifications You must be signed in to change notification settings

lgx0955/smoothie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: Smoothie is currently just a draft API. Do not rely on it for production code. Feedback is very welcome.

What is it?

Easy async loading for Android's ListView/GridView.

Features

  • Tiny API to implement asynchonous loading of items in Android's ListView and GridView.
  • Tight integration between user interaction and async loading of items i.e. stops loading items on fling, enables loading when panning with finger down, etc.
  • Prefetch items beyond the currently visible items to reduce the number of placeholder items while scrolling.

How do I use it?

  1. Add Smoothie's jar as a dependency to your project.

  2. Implement an ItemEngine. You're only required to implement two methods: loadItem() and displayItem().

  3. On Activity/Fragment creation, attach a Smoothie instance to your ListView/GridView passing the target view and your engine:

    Smoothie smoothie = new Smoothie(yourListOrGridView, new YourItemEngine());
  4. On your adapter's getView(), call Smoothie's loadItem() passing the item view and the loading parameters necessary to load the item asynchronously.

Want to help?

Here's a list of pending stuff on the library:

  • Proper prefetch support with a custom priority queue on ItemLoader's executor service.

File new issues to discuss specific aspects of the API and to propose new features.

About

Easy async loading for Android's ListView/GridView

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%