v8.0.0-a01
Pre-release
Pre-release
Warning
- This release contains a big amount of breaking changes, and will introduce an all new API to set-up the drawer.
- This is an alpha release and will most likely still receiver further breaking API changes. In addition it still contains
Drawer
.MiniDrawer
,AccountHeader
classes which will be removed as soon as we reach a stable API. - As a result of the updated API the main purpose of this library is to provide the
Slider
-View which is used within theDrawerLayout
. TheDrawerLayout
should be used as specified and documented in its documentation. - The drawer no longer automatically manages the
ActionBarDrawerToggle
refer to standardDrawerLayout
documentation on how to set-up
Breaking Changes
Drawer
,AccountHeader
classes will be removed- The drawer is no longer set-up via code only, it requires now a specification in the layouts
- Documentation is not yet updated (this will happen as soon as all samples are upgraded and working again)
(New) How to use
1.) Define DrawerLayout
and the SliderView
in the xml
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<!-- CONTENT -->
</androidx.constraintlayout.widget.ConstraintLayout>
<com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView
android:id="@+id/slider"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true" />
</androidx.drawerlayout.widget.DrawerLayout>
2.) Access view and fill with items
slider.apply {
itemAdapter.add(
// define items
)
onDrawerItemClickListener = { v, drawerItem, position ->
// listener action
false
}
withSavedInstance(savedInstanceState)
}
3.) Please see the sample application for more samples on how to use the new version
Feedback welcome
- The current state is super early alpha and APIs are about a change.
- The main goal of this rewrite is to not affect
fullscreen
flags andfitsSystemWindows
flags. Full control is on the developers side. The library should automatically detect insets and work as a transparent view as slider inside theDrawerLayout