I've got a component that I want to make various changes to content and 
display when touched, and revert when the finger goes back up.  The 
following works in general, but if the user's finger wanders out off the 
component itself before lifting, ACTION_UP never fires, so it never reverts 
to the "up" state.

public class MyComponent extends SomeLayout {
// ... stuff
@Override
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getAction() & MotionEvent.ACTION_MASK;
switch (action) {
case MotionEvent.ACTION_DOWN :
// do something...
break; 
case MotionEvent.ACTION_UP :
// do something else...
break; 
} 
return super.onTouchEvent(event);
}
}

This ViewGroup has complex content, and is not something that'd be 
appropriate for StateDrawables.

Any suggestions?

TYIA

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to