How could I do something like this?
Two expandable listview inside navigation drawer. I tryed to add it inside my xml but without luck. What I want is a view with only one scrollbar, but I don't' know how to do it..
this is my navigation drawer layout:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/Bianco"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="16dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/tvHomeActions"
android:id="@+id/textView" />
<ExpandableListView
android:id="@+id/elvHome"
android:layout_width="match_parent"
android:layout_marginTop="4dp"
android:layout_height="300dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/tvHomeNavigations"
android:layout_marginTop="16dp"
android:id="@+id/textView2" />
<ExpandableListView
android:id="@+id/elvNavigateTo"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="4dp" />
</LinearLayout>
</ScrollView>
EDIT: I wanna create something like drawer in Gmail app
FYI the screen shot you have shown in your qsn also have Pinnned or sectioned listview.
ExpandableListView in navigation drawer:
Use this code DrawerLayoutTest for ExpandableListView in navigation drawer.
Update: Here is exactly what you looking for, give it at try for this michenux navigation-drawer , Git
Logic:
1>use ExpandableListView + michenux navigation-drawer drawer for design and Expandable list view and for that count of "3" items inside use jgilfelt's android-viewbadger lib.
2>You have to play around in getview(..) in the listview for disabling enabling the drop down icon of the expandable listview, it the item has no child (check for array or arraylist is null/empty) and make visible invisible the badger (drop down count icon/badger) thats it or simply change the list view item layout depending on the each item values Ex: for list row contains expandable childs load different layout with view badger !
Credits: Michenaud,Jgilfelt
Finally i have got it! This is the code I created to get an ExpandableListView with section titles. Now it's I can easily create three xml custom layouts for titles, groups and childrens.
It work for me, but I accept any code improvements to optimize memory usage, speed and so on.
Ps. thank you all