sd maid navigation drawer
-
21-12-2019 - |
문제
I have made a navigation drawer and tried a lot of things to change its layout and did a lot of research and i have made some good stuff, but i saw something nice in SD maid pro also in Samsung Watch On app they used a blue line when i choose an item in the navigation drawer this blue line appear on the left of the item as a signal that this item or tab or fragment is selected .
i believe they use state_activated but how it is done that's what i want to know so pl z anyone have any idea?
해결책
SD Maids navigation drawer contains a ListView which is populated with objects that hold have a boolean isSelected
value.
When an item in the list is clicked, the value of isSelected
is set to true
and all other items to false
.
In the adapters getView
method that value is checked and the list view entry is modified accordingly, in this case, a view with a set size and blue background is changed from INVISIBLE
to VISIBLE
.