Adding on touch event to images inside gridview
- by Steve
I have a gridview where each item has a image and a textview (an app), i added the onItemClick to the gridview in order to launch the app, i also removed the orange selection and made selector in xml so when pressed the text would change to grey and on release it would return to white.
My problem is that i need the image to apply an alpha value when pressed and restore the previous alpha on release i tested a lot of ways and none did worked correctly.
I came close with the updated answer from the autor of the question: How to set alpha value for drawable in a StateListDrawable?, but some how the state pressed never gets called, i don´t know if this is because i am using the onitemClick to launch the app or not.
Also i since i can´t define the alpha on imageview xml i don´t know what else to do
Any help will be appreciated