Android Open Source - Android-Lib-AsyncImageLoader Pause On Scroll






From Project

Back to project page Android-Lib-AsyncImageLoader.

License

The source code is released under:

Apache License

If you think the Android project Android-Lib-AsyncImageLoader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package android.lib.asyncimageloader;
//from w  w  w  . j  av  a  2 s. c  o m
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;

public class PauseOnScroll implements OnScrollListener {
    private final AsyncImageLoader imageLoader;

    public PauseOnScroll(final AsyncImageLoader imageLoader) {
        this.imageLoader = imageLoader;
    }

    @Override
    public void onScroll(final AbsListView view, final int firstVisibleItem, final int visibleItemCount, final int totalItemCount) {
    }

    @Override
    public void onScrollStateChanged(final AbsListView view, final int scrollState) {
        if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
            this.imageLoader.resume();
        } else {
            this.imageLoader.pause();
        }
    }
}




Java Source Code List

android.lib.asyncimageloader.AsyncImageLoader.java
android.lib.asyncimageloader.BitmapCache.java
android.lib.asyncimageloader.DiskCache.java
android.lib.asyncimageloader.GalleryAdapter.java
android.lib.asyncimageloader.OnImageLoadedListener.java
android.lib.asyncimageloader.PauseOnScroll.java
android.lib.asyncimageloader.UpdateImageView.java
android.lib.asyncimageloader.WorkItem.java