Change border of selected list item

Sorry I have to ask again.
How can I detect the selected item in a horizontal tiles list? I want to append a colorful border around the selcted item. But I can’t seem to make this work.

Firstly though, how do you define a “selected item”? What is your use case?

I’m not sure I’m following you. What do you mean by “use case”?

I mean if you’re not showing the details screen of a list, you must be setting some sort of value to know which one is “selected”, right? I just want to know more about your use case to understand the situation better.

First of all. My list, where I want to detect the selected row, is a horizontal tiles list of different basketball players. When a row has been selected an action changes a user-specific value in the users table.
The new value is the selected basketball players name. If you then click the selected row again, it clears the user-specific value.
It doesn’t support multiple selection.
Let me know if you need more info

have two sets of player’s images… when clicked, swap the picture… the new Glide upgrade makes it almost impossible to target a specific item of the list