How do I change the color of an unchecked menu item in a toolbar's submenu?
I know that the checked state is defined by the accentColor
of the corresponding theme. But I couldn't find a way to define a color for the unchecked state.
Just to be clear: I can't define a toolbar's menu item using a custom layout XML and I do not have direct access to the view object and the checkbox.
A menu like this is defined like so:
<menu>
<item
android:id="@+id/sortByDescriptionDescendingAction_mediumDark"
android:icon="@drawable/ic_sort_white_24dp"
android:title="@string/sortByDescriptionDescendingAction"
android:checkable="true"/>
<item
android:id="@+id/sortByDescriptionAscendingAction_mediumDark"
android:icon="@drawable/ic_sort_white_24dp"
android:title="@string/sortByDescriptionAscendingAction"
android:checkable="true"/>
<item
android:id="@+id/sortByDateDescendingAction_mediumDark"
android:icon="@drawable/ic_sort_white_24dp"
android:title="@string/sortByDateDescendingAction"
android:checkable="true"
android:checked="true"/>
<item
android:id="@+id/sortByDateDescAction_mediumDark"
android:icon="@drawable/ic_sort_white_24dp"
android:title="@string/sortByDateAscendingAction"
android:checkable="true"/>
</menu>