3

I'm building 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>

That gives me a desired output:

Desired output

However I can't implement single check behavior on all of those items. I tried to hold previously checked item on the variable and uncheck it before checking another but it works funny for the middle section. When I check one of the middle section items I cannot check the second one then. The first one stays checked. I can't see any logic in that. Is that even achievable with Design Library?

4

0 回答 0