The trick is to keep track of when the user is flinging and when they are not. It seems like this is about the only distinction you can make because, like you said, the transitions from scrolling with a finger to idle are not recorded. Here s what I m talking about:
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (scrollState != OnScrollListener.SCROLL_STATE_FLING) {
flinging = false;
int count = view.getChildCount();
for (int i = 0; i < count; i++) {
View convertView = view.getChildAt(i);
Recipe recipe = (Recipe) convertView.getTag();
ImageView image = (ImageView) convertView.findViewById(R.id.icon);
if (recipe != null && recipe.getImageURL() != null) {
ImageLoader.loadImage(this, image, recipe.getImageURL());
}
}
} else {
flinging = true;
}
}
And then in the listView adapter:
public View getView(int position, View convertView, ViewGroup parent) {
// Bunch of code....
if (!flinging) {
ImageLoader.loadImage(BrowseRecipes.this, image, recipe.getImageURL());
}
}
So, instead of reacting to the change in the listener, just load the images (or whatever you need to do that s intensive) in the first place as long as there s no flinging going on.
This is all taken out of my project here: https://github.com/pkulak/mealfire_android