public static class TouchListener implements View.OnTouchListener {
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
// touch down code
v.setAlpha(0.5f);
isTouched = true;
break;
case MotionEvent.ACTION_MOVE:
// touch move code
isTouched = false;
break;
case MotionEvent.ACTION_UP:
// touch up code
v.setAlpha(1);
isTouched = false;
break;
}
return true;
}
}