I have a plain white background with a few clouds on it. When the user clicks an object on screen the white part of the background image changes color. The clouds remain untouched by the color change.
Until now I had been making each individual backgroud image in photoshop and loading them into the onclick method. But now I’m wondering is it possible to have just one background image and when the user clicks an object android can change the background color of the image using the predefined colors.xml file?
3
Answers
Have an image for cloud and make the background color for your layout to White color. When the user clicks object have a listener on the view to listen click and change the color of layout dynamically.
Your Activity file:
It’s depends how did you draw the image. If the background you want to change is transparent you can do:
No, I don’t think so it is possible.