How to implement Expandable android navigation drawer with subitems?
Asked Answered
C

1

10

How to implement android navigation drawer like this?

TopLevelView1 ~ TopLevelView4 can select and no children
TopVevelView5 can collaspe

My question is that if my group structure like this for example

All
Stared
Category
----mp3
----txt
----doc
----pdf

when I select all then show all file.

when I select stared then show stared file only.

when I select mp3 then show only mp3 files.

and Category can expand and collapse.

https://static.mcmap.net/file/mcmap/ZG-AbGLDKwfkX7XlaFfeX79QWV2kbmfpXC2jaRA/design/media/navigation_drawer_collapse.png

Catholicism answered 21/4, 2014 at 10:41 Comment(3)
Looks like an ExpandableListView. Aside from that you implement it exactly the same as you would with a normal ListView. The image is from the android developer page. Why don't you follow the tutorial there? Here it isUniformity
You probably want to use an ExpandableListView... here's an example: androidhive.info/2013/07/android-expandable-list-view-tutorialFoolscap
Sorry for not describing my question clearly.I have updated my question.Catholicism
D
3

For navigation:

  • Alternative 1:

    Sliding Menu, which I would definitely go with. Even used by popular application like LinkedIn and Foursquare and easy to implement and use. Full explanation and example source codes: SlidingMenu - GitHub

  • Alternative 2:

    Android Navigation Drawer. If you want to fully customise everything yourself without using any libraries, this is your option. You can check codes and how to do it from Android Developers website: Creating a Navigation Drawer

View inside your navigation drawer / sliding menu:

  • Alternative 1:

    Android default ExpandableListView. Links: Android Developers , androidhive

  • Alternative 2:

    AnimatedExpandableListView, which is implemented from ExpandableListView, but when an item is clicked, the expand is done with a smooth animation which you may prefer to use for a better look. AnimatedExpandableListView

Denominator answered 21/4, 2014 at 11:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.