Friday, October 3, 2014

Image Button Listener

Today I made a listener file which is basically a file with certain conditions that changes something when the conditions are met. So in this case I made a listener file for a image file so that the image is can change under certain circumstances. 

For example the back button now has 2 different states
  • A normal state where when nothing is happening the image will stay the same
    •  <item android:drawable="@drawable/back_normal" /> <!-- default -->
      
       
  • A pressed state for when the button is clicked so you can highlight it(the first line is the condition and the second line is the image it changes to)
    •  <item android:state_pressed="true"
                 android:drawable="@drawable/back_pressed" /> <!-- pressed -->
      
       
  • A focused state for when the button has a cursor over it but this won't apply to android apps
I can't actually test it right now though because it takes ages for the project to index so I can't run it.

1 comment:

  1. Please see my comment from yesterday. Since I don't know what your high level goal is, I don't understand how a listener file fits into the project.

    ReplyDelete