amulyakhare / TextDrawable

This light-weight library provides images with letter/text like the Gmail app. It extends the Drawable class thus can be used with existing/custom/network ImageView classes. Also included is a fluent interface for creating drawables and a customizable ColorGenerator.
MIT License
3.16k stars 622 forks source link

Selected drawable like Gmail #6

Closed AkshayChordiya closed 9 years ago

AkshayChordiya commented 9 years ago

Hey,

Thank for such an amazing & simple to use library. I was checking the screenshots in the Readme & 2nd screenshot got my attention. It shows a list of items & few of them are selected & there is a selected image over the image view. I want to achieve that effect.

Can you tell me how did you achieve it using your library?

amulyakhare commented 9 years ago

I do a little trick to get this effect. Basically there are two ImageViews that overlap. One shows the text and other has the tick image. Now depending on the user click, I toggle the visibility of the tick. You can find this code here:

https://github.com/amulyakhare/TextDrawable/blob/master/sample/src/main/java/com/amulyakhare/td/sample/ListActivity.java#L146

This is not the best way to get an effect like this. I use it just for demo purpose.

AkshayChordiya commented 9 years ago

@amulyakhare Thank you