Java Code Examples for android.support.v7.widget.RecyclerView#removeCallbacks()

The following examples show how to use android.support.v7.widget.RecyclerView#removeCallbacks() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PicassoOnScrollListener.java    From AndroidAgeraTutorial with Apache License 2.0 6 votes vote down vote up
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int scrollState) {
    if(scrollState == RecyclerView.SCROLL_STATE_IDLE) {
        recyclerView.removeCallbacks(mSettlingResumeRunnable);
        sPicasso.resumeTag(TAG);

    } else if(scrollState == RecyclerView.SCROLL_STATE_SETTLING) {
        mSettlingResumeRunnable = new Runnable() {
            @Override
            public void run() {
                sPicasso.resumeTag(TAG);
            }
        };

        recyclerView.postDelayed(mSettlingResumeRunnable, SETTLING_DELAY);

    }
    //else {
    //    sPicasso.pauseTag(TAG);
    //}
}
 
Example 2
Source File: TangramEngine.java    From Tangram-Android with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void unbindView() {

    RecyclerView contentView = getContentView();

    if (contentView != null && mSwipeItemTouchListener != null) {
        contentView.removeOnItemTouchListener(mSwipeItemTouchListener);
        mSwipeItemTouchListener = null;
        contentView.removeCallbacks(updateRunnable);
    }
    super.unbindView();
}
 
Example 3
Source File: TangramEngine.java    From Tangram-Android with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void destroy() {
    RecyclerView contentView = getContentView();
    if (contentView != null) {
        contentView.removeCallbacks(updateRunnable);
    }
    super.destroy();
}
 
Example 4
Source File: TangramEngine.java    From Tangram-Android with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void unbindView() {

    RecyclerView contentView = getContentView();

    if (contentView != null && mSwipeItemTouchListener != null) {
        contentView.removeOnItemTouchListener(mSwipeItemTouchListener);
        mSwipeItemTouchListener = null;
        contentView.removeCallbacks(updateRunnable);
    }
    super.unbindView();
}
 
Example 5
Source File: TangramEngine.java    From Tangram-Android with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void destroy() {
    RecyclerView contentView = getContentView();
    if (contentView != null) {
        contentView.removeCallbacks(updateRunnable);
    }
    super.destroy();
}