File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
library/src/main/java/com/mikepenz/materialdrawer Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,21 @@ public Result build() {
406406 }
407407 }
408408
409+ // set the header (do this before the setAdapter because some devices will crash else
410+ if (mFooterView != null ) {
411+ if (mListView == null ) {
412+ throw new RuntimeException ("can't use a footerView without a listView" );
413+ }
414+
415+ if (mHeaderDivider ) {
416+ LinearLayout footerContainer = (LinearLayout ) mActivity .getLayoutInflater ().inflate (R .layout .drawer_item_footer , null , false );
417+ footerContainer .addView (mFooterView , 1 );
418+ mListView .addFooterView (footerContainer );
419+ } else {
420+ mListView .addFooterView (mFooterView );
421+ }
422+ }
423+
409424 //after adding the header do the setAdapter and set the selection
410425 if (mAdapter != null ) {
411426 //set the adapter on the listView
You can’t perform that action at this time.
0 commit comments