If I set my ImageView to be both clickable and focusable, it works, but I have no way to tell which image is focused. What’s the best way to get it to draw an orange border around the view so the user knows it’s currently in focus?
I tried dropping it in a LinearLayout and setting that to be focusable and clickable instead, but didn’t have any luck. Even when I put a margin on it, there’s nothing to indicate that it was selected.
You can use a drawable with a selector as the background.
For example, I have gallery_image_bg.xml in res/drawable:
This creates three different-colored 3dp lines around the image. They are visible because the padding forces the image to render in a slightly smaller area.
Used in code like so: