문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top