Single choice between sections in NavigationView

I am creating a NavigationView like this:

                       

        <item
            android:id="@+id/dress_fragment"
            android:checkable="true"
            android:icon="@drawable/ic_dress"
            android:title="@string/dresses" />
    </menu>
</item>
<item
    android:checkable="false"
    android:title="@string/More">
    <menu>
        <item
            android:id="@+id/settings"
            android:checkable="true"
            android:icon="@drawable/ic_settings_white_24dp"
            android:title="@string/settings" />
    </menu>
</item>

      

This gives me the desired output:

Desired output

However, I am unable to implement a single behavior check for all of these elements. I tried to hold the previously checked variable element and uncheck the checkbox before checking the other, but it works funny for the middle part. When I check one of the middle section members, I cannot check the second one. The first one is checked. I don't see any logic in this. Is this possible with a design library?

+3


source to share





All Articles