Sample android app for navigation menu with expandable list items in material design.
- Implemented using material design
- Easy to use
- Uses an expandable list view
Add a toolbar in your layout.
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Use a normal ExpandableListView in your drawer layout.
<ExpandableListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:dividerHeight="1dp"
android:divider="@color/list_divider"
android:listSelector="@drawable/list_selector"
android:background="@color/list_background" />
Make a new class with BaseExpandableListAdapter
public class NavAdapter extends BaseExpandableListAdapter{
actionBarDrawerToggle = new ActionBarDrawerToggle(this,drawer,toolbar,R.string.drawer_open,R.string.drawer_close )
- Ayush Pahwa
- AndroidHive introduction to material design for developing with material design
- PrashamTrivedi's repository The basic code for expandable list view
- Android Expandable List View Tutorial for editing the ExpandableListView