Smoothie is an open-source library that provides a simple API to load ListView/GridView items asynchronously, off the UI thread. Besides the obvious view recycling handling, Smoothie is gesture-aware and supports powerful features such as off-screen item pre-loading and multi-part items. In this session, you will get overview of Smoothie's features and implementation; and learn how to use it in your apps through a series of practical examples.
@lucasratmundo • +LucasRocha
Android and me
Firefox for Android
Children provided by an Adapter.
View recycling support.
ListView and GridView.
How ListView works
Async in ListView
Async vs View recycling.
Trivial to implement.
Preloading off-screen items.
Easy async item loading for
ListViews with all these non-trivial
bits built in.
Factored out from Pattrn.
Nice and simple API.
Not an image-loading library.
(But can be used to load images off UI thread)
How to use it
Add an AsyncListView to your layout.
Implement an ItemLoader with
your app-specific logic for loading
and displaying items.
Instantiate an ItemManager with
your ItemLoader and set it on the
Encapsulates async logic.
Behaves exactly like a ListView.
AsyncGridView is analogous.
1. Fetch parameters
2. Memory load
3. Async load
(Off main thread)
API assumes loaded items are
cached in memory.
Defines the async loading
behaviour for an AsyncListView.
ItemManager.Builder sample here
Async loading is disabled while the
ListView is scrolling with finger up.
Async loading is only enabled when
the ListView is either idle or scrolling
with finger down.
In-memory items are displayed
immediately in any ListView state.
Improve perceived performance
by showing placeholders less
Load off-screen items ahead of
Items that require multiple
async operations to load.
Sets relative priorities between
Inherit from ItemLoader instead.
Hard to blend with libraries using
custom ListViews or GridViews.
Hard to blend with your existing
async loading libraries e.g. Volley.
Preloading logic assumes user is
scrolling the list down.
Single type for multi-part items.
Dynamic priorities as the user
scrolls the view.
Checkpoints to invalidate
obsolete async operations.