TreeView icon indicating copy to clipboard operation
TreeView copied to clipboard

Highlight selected item

Open fmeneuhe opened this issue 3 years ago • 1 comments

Hi, thanks a lot for this useful library. Is possible to highlight a selected item? select a single choice item. Thanks

fmeneuhe avatar Dec 29 '22 16:12 fmeneuhe

Hello @fmeneuhe,

Thank you for your review,

Yes it is possible, in TreeNode class there is an attribute that tells you if it is selected or not, also if it is expanded or not

https://github.com/AmrDeveloper/TreeView/blob/c8725943cd17d916ce3c5cbae93de8d8b572caa8/treeview/src/main/java/com/amrdeveloper/treeview/TreeNode.java#L40

So in the view holder, you can the background color if it selected and another color if it not selected you can choose any color and also change text colour, icons ...etc

Thanks Amr Hesham

AmrDeveloper avatar Dec 29 '22 20:12 AmrDeveloper