0

I have to implement a menu like the following:

Design

I am currently using a nested menu in an item, but I can not make it look like the image.

Need to know how I can perform that cascade submenu effect shown to the right of the library menu item

How could I approach this problem?

I'm sorry for my English.

AskNilesh
  • 58,437
  • 15
  • 99
  • 129
  • Try to use ExpandableListView, like this: https://stackoverflow.com/questions/38765790/default-navigation-drawer-view-to-expandablelistview – Max Pinto Jun 06 '17 at 23:01
  • Thanks @MaxPinto, but the problem I have is that I do not know how to make the submenu look to the right of the parent menu, when you click on the parent (without this it disappears). – Danilo Peñaranda Castilla Jun 07 '17 at 00:03

1 Answers1

0

Change your xml. This is my xml for camera menu. One of the options allow changing the white balance. Within the white balance button, there a submenu of all the possible white balance settings. Hope this helped!

<item
        android:id="@+id/changeWhiteBalance"
        android:title="White Balance">

        <menu>
            <item
                android:id="@+id/changeToAutoWB"
                android:title="Auto">
            </item>
            <item
                android:id="@+id/lockWB"
                android:title="Lock White Balance">
            </item>
            <item
                android:id="@+id/changeToDirectSunlight"
                android:title="Direct Sunlight">
            </item>
            <item
                android:id="@+id/changeToCloudy"
                android:title="Cloudy">
            </item>
            <item
                android:id="@+id/changeToIncandescent"
                android:title="Incandescent">
            </item>
            <item
                android:id="@+id/changeToFluorescent"
                android:title="Fluorescent">
            </item>
            <item
                android:id="@+id/changeToTwilight"
                android:title="Twilight" />
            <item
                android:id="@+id/changeToShade"
                android:title="Shade" />
            <item
                android:id="@+id/changeToWarmFluorescent"
                android:title="Warm Fluorescent"/>
        </menu>
    </item>
  • The xml with the menu and the submenu I have it just as you tell me, but the problem I have is that I do not know how to do so when clicking on the Library item is shown on the right submenu. – Danilo Peñaranda Castilla Jun 07 '17 at 00:07
  • check this out: https://stackoverflow.com/questions/7042958/android-adding-a-submenu-to-a-menuitem-where-is-addsubmenu – Min Jae Kim Jun 07 '17 at 16:42