###Upgrade Notes
- the identifier was changed from
inttolongas the internal adapter (FastAdapter) useslongto identify items (as theAdapterdoes) - v5.0.0 no longer sets the
FULL_SCREENflag to get the drawer below theStatusBarit now uses thefitsSystemWindowseverywhere. This should improve compatiblity with a lot of things like theCoordinatorLayoutand should also improve compatiblity with future Android updates - removed the following methods:
- DrawerUIUtils.getScreenWidth -> moved to UIUtils from the
Materializelibrary - DrawerBuilder.withTranslucentStatusBarProgrammatically -> no longer necessary as we now depend on the
fitsSystemWindowsflag StatusBarColorcan now be set via theDrawer.getDrawerLayout().setStatusBarBackgroundColor(color)- DrawerBuilder.keyboardSupportEnabled ->
KeyboardUtilshould no longer be necessary StatusBaron API < 21 is no longer colored, because of the changed way how we display theDrawerunder theStatusBarDrawerItemschanged. Please take a look at theCustomDrawerItemsfrom the sample or the default ones, to add the changes to yourCustomDrawerItems- ...
- it is now possible to let the
Drawermanage theMiniDrawer. Enable this viawithGenerateMiniDrawer(true). Afterwards remove theMiniDrawercalls inside the listeners, those are now done within theDrawer. You can get theMiniDrawerresult object viaDrawer.getMiniDrawer();
- added new method
withHeaderPaddingto the drawer andwithPaddingBelowHeaderto the header to control the padding separately from thedividerwhich can be controlled viawithHeaderDivider
- depends on the latest
v23.1.0support libraries. Those also require you to havecompileSDKVersion 23
- new
placeholder(Context ctx, String tag)to theIDrawerImageLoaderinterface - new
AbstractDrawerImageLoaderto simplify theDrawerImageLoaderusage. See the new implementation in theCustomApplication - to keep the old behavior just change from
new DrawerImageLoader.IDrawerImageLoader() {tonew AbstractDrawerImageLoader() {for theDrawerImageLoader.init - add new
tagto the placeholder, to be able to define different placeholders for different targets
- no more need to define an identifier for the items, they get one automatically. if you do not have logics which require you to do so, you are safe to forget about the identifier now.
- renamed
setDivider()towithDivider - remove
setTypeface()usewithTypeface()instead
getCurrentSelection()will now return theidentifierof the current selection ornullgetCurrentSelectedPosition()was added- renamed all
*Footer*methods to*StickyFooter*to prevent confusion
#####Common changes
- depends on the latest
v23support libraries. Those also require you to havecompileSDKVersion 23 - change the
onItemClicklistener toonItemClick(View view, int i, IDrawerItem iDrawerItem) - modify the import of the
AccountHeaderandAccountHeaderBuilderto
import com.mikepenz.materialdrawer.AccountHeader
import com.mikepenz.materialdrawer.AccountHeaderBuilder- the
identifiershould now be set for theDrawerItemsas it is used now as default for all update/modify/.. actions - rename
withCheckable()towithSelectable() - rename
set*methods of theDrawerItemstowith*methods as those were renamed - rename all methods like
setSelection,setFooterSelection,removeItem, ... to*ByPosition(added the ByPosition) - rename all methods like
setSelectionByIdentifier,setFooterSelectionByIdentifier, ... tosetSelection,setFooterSelection(removed the ByIdentifier) - change
updateName,updateIcon,updateBadgethose methods take now anidentifierand the specificHolderobject - all
get*methods of theDrawerItemswill now return aHolderobject for the specific type, making it easier to work with types likeString,StringRes,Color,ColorRes,ColorInt, ..
#####Android-Iconics (icon font)
- the MaterialDrawer now only includes the
coreof the Android-Iconics project - add the fonts you use https://github.com/mikepenz/Android-Iconics#2-choose-your-desired-fonts
- pre MaterialDrawer v4.0.0 following fonts were included
compile 'com.mikepenz:google-material-typeface:1.2.0.1@aar' //Google Material Design Icons
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar' //FontAwesome **NOTE:** the packagename changed for this font#####Advanced usage changes
- changed the
ListViewto aRecyclerView - rename methods with
*ListView*to*RecyclerView* - the
IDrawerIteminterface was extended to better reflect aRecyclerViewand to improve performance - added an
AbstractDrawerItemto implement some common methods - see the SectionDrawerItem for an easy example