I’m scratching my head to find the correct way to implement a dynamic sliding/expanding menu (not sure the name is correct though) in android.
An image showing what i’m trying to achieve :

(source: teneuesdigital.com)
In the image you can see the ipad version behind has an expandable menu. when you click in an item in the root menu, it automatically expands to the right, displaying the sub-menu items. This is repeatable for each sub-menu : each time a new sub-menu appears to the right.
Now, I’m designing this app for both tablets and phones. So the idea is that on tablets the menu would expand to the right, filling the available screen space, BUT on phones, the currently displayed menu ( ListView) should be replaced by the clicked Sub-Menu’s List.
I started playing with fragments and ListFragment without success…
I guess fragments are the way to go (but I could be wrong) since the layout is completely different depending on the screen size.
For the Tablet version :
My idea would be to first display the root menu as a first ListFragment, then when an item is clicked, have a new Fragment created and sliding to the right of the first. Would that work ? How would you do it?
For the phone (mdpi) version :
The currently displayed menu fragment is always replaced with the sub-menu fragment … I guess that’s easy enough with fragment transactions.
Now another question I’m asking myself is how do I implement this in the same activity ?
Do I need to detect screen resolution to manage the different FragmentTransaction types depending if we have to expand the menu or replace the currently visible one?
How can this be done in an efficient way?
Many thanks for all your ideas and comments.
As an idea, you can use ListViews with Visibility:gone in A Realtive layout, Or Expandable ListView. I implemented the first one & it is the simplest.