NOTE: Smoothie is currently just a draft API. Do not rely on it for production code. Feedback is very welcome.
Easy async loading for Android's ListView/GridView.
- 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.
-
Add Smoothie's jar as a dependency to your project.
-
Implement an ItemEngine. You're only required to implement two methods: loadItem() and displayItem().
-
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());
-
On your adapter's getView(), call Smoothie's loadItem() passing the item view and the loading parameters necessary to load the item asynchronously.
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.