I've seen similar solutions but not quite what I'm looking for...
I have About 50+/- buttons in a layout. Each button is set to StatelistDrawable and has an 'enabled' and 'pressed' image assigned to it. Essentially the 'pressed' image is a slightly darker copy of the original 'enabled' image (that I did in a graphics editor). Of course this means that each button has two different images, and multiply that times 50 and it adds overhead to the app.
What I would like to do is assign the same bitmap (png) to the enabled and pressed states and programmatically adjust the alpha on the pressed image in order to make the button darker (or dimmed) when pressed.
Can this be done using reflection or any other trick? Just trying to reduce memory requirements and speed things up a bit if possible.
I have About 50+/- buttons in a layout. Each button is set to StatelistDrawable and has an 'enabled' and 'pressed' image assigned to it. Essentially the 'pressed' image is a slightly darker copy of the original 'enabled' image (that I did in a graphics editor). Of course this means that each button has two different images, and multiply that times 50 and it adds overhead to the app.
What I would like to do is assign the same bitmap (png) to the enabled and pressed states and programmatically adjust the alpha on the pressed image in order to make the button darker (or dimmed) when pressed.
Can this be done using reflection or any other trick? Just trying to reduce memory requirements and speed things up a bit if possible.