AcidFlow / sticky-header-recyclerview

Sticky-header-recyclerview is an Android library that helps you create sticky headers on a RecyclerView. This is compatible with GridLayoutManager and LinearLayoutManager.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve condition to update the sticky content

AcidFlow opened this issue · comments

If the update is not required, reset the translation if any:

 if ( !isHeaderUpdateRequired( ) ) {
            if(mStickyViewParent.getTranslationY() != 0){
                resetStickyHeaderTranslation();
            }
            return;
        }

isHeaderUpdateRequired() should be true if we need to update the Sticky content :

private boolean isHeaderUpdateRequired( ) {
        return isHeader( mFirstVisiblePos ) || isCurrentHeaderPushed
                || mHeaderPosition == RecyclerView.NO_POSITION
                || shouldUpdateStickyHeaderContent();
    }

Closed in 0.1.2