Skip to content

Commit

Permalink
* add method to remove the Header from the drawer
Browse files Browse the repository at this point in the history
* FIX #246 if you add the header with the result
  • Loading branch information
mikepenz committed Apr 23, 2015
1 parent 569bff6 commit 907483f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,17 @@ public void setHeader(View view) {
}
getListView().addHeaderView(view);
getListView().setAdapter(adapter);
mDrawer.mHeaderOffset = 1;
}
}

/**
* method to remove the header of the list
*/
public void removeHeader() {
if (getListView() != null && getHeader() != null) {
getListView().removeHeaderView(getHeader());
mDrawer.mHeaderOffset = 0;
}
}

Expand Down

0 comments on commit 907483f

Please sign in to comment.