Skip to content

Commit 5c30974

Browse files
committed
Fixed davideas#128 - Behavior for which getStickySectionHeadersHolder() should return a ViewGroup with LayoutParams coherent and initialized by the user who knows how these params has to be initialized. An exception will be raised if params are nulls.
1 parent dd83f11 commit 5c30974

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flexible-adapter/src/main/java/eu/davidea/flexibleadapter/helpers/StickyHeaderHelper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ private void initStickyHeadersHolder() {
111111
//Initialize Holder Layout and show sticky header if exists already
112112
mStickyHolderLayout = mAdapter.getStickySectionHeadersHolder();
113113
if (mStickyHolderLayout != null) {
114+
if (mStickyHolderLayout.getLayoutParams() == null) {
115+
throw new IllegalStateException("The ViewGroup provided, doesn't have LayoutParams correctly set, please initialize the ViewGroup accordingly");
116+
}
114117
mStickyHolderLayout.setClipToPadding(false);
115118
mStickyHolderLayout.setAlpha(0);
116119
updateOrClearHeader(false);

0 commit comments

Comments
 (0)