@@ -26,6 +26,7 @@ public class HeaderListView extends RelativeLayout {
26
26
private InternalListView mListView ;
27
27
private SectionAdapter mAdapter ;
28
28
private RelativeLayout mHeader ;
29
+ private View mHeaderConvertView ;
29
30
private FrameLayout mScrollView ;
30
31
private AbsListView .OnScrollListener mExternalOnScrollListener ;
31
32
@@ -259,15 +260,15 @@ private void addSectionHeader(int actualSection) {
259
260
}
260
261
261
262
if (mAdapter .hasSectionHeaderView (actualSection )) {
262
- View header = mAdapter .getSectionHeaderView (actualSection , null , null );
263
- header .setLayoutParams (new LayoutParams (LayoutParams .MATCH_PARENT , LayoutParams .WRAP_CONTENT ));
263
+ mHeaderConvertView = mAdapter .getSectionHeaderView (actualSection , mHeaderConvertView , mHeader );
264
+ mHeaderConvertView .setLayoutParams (new LayoutParams (LayoutParams .MATCH_PARENT , LayoutParams .WRAP_CONTENT ));
264
265
265
- header .measure (MeasureSpec .makeMeasureSpec (mHeader .getWidth (), MeasureSpec .EXACTLY ), MeasureSpec .makeMeasureSpec (0 , MeasureSpec .UNSPECIFIED ));
266
+ mHeaderConvertView .measure (MeasureSpec .makeMeasureSpec (mHeader .getWidth (), MeasureSpec .EXACTLY ), MeasureSpec .makeMeasureSpec (0 , MeasureSpec .UNSPECIFIED ));
266
267
267
- mHeader .getLayoutParams ().height = header .getMeasuredHeight ();
268
- header .scrollTo (0 , 0 );
268
+ mHeader .getLayoutParams ().height = mHeaderConvertView .getMeasuredHeight ();
269
+ mHeaderConvertView .scrollTo (0 , 0 );
269
270
mHeader .scrollTo (0 , 0 );
270
- mHeader .addView (header , 0 );
271
+ mHeader .addView (mHeaderConvertView , 0 );
271
272
} else {
272
273
mHeader .getLayoutParams ().height = 0 ;
273
274
mHeader .scrollTo (0 , 0 );
0 commit comments