Here's what I need.
Let's say we have objects A, B. Initially object B has visibility set to GONE and object A has visibility set to VISIBLE.
Touching object A must make A GONE and B VISIBLE. Releasing B must make B GONE and A VISIBLE. Problem is that it must be done without pressing B again.
Here's what I tried.
Set on touch event
ACTION_DOWNon A andACTION_UPon same A, that appears and hides B just like described. This cannot work, becauseACTION_UPis not triggered after setting visibility of A toGONE.Set on touch event
ACTION_DOWNon A that will make AGONEand make BVISIBLE, at same time new event listener is set such thatACTION_UPon B would inverse visibility of the objects. This doesn't work either since after B appears, I need to release, press B again and then release to make it work.
My questions.
Is it possible to to set onTouch listener in such way that object is assumed to be touched? So that there would be no need to press it again?
Is it possible to detect onTouch
ACTION_UPevent after visibility of object is set toGONE?
All ideas, examples, links will be appreciated. Thanks for help!
Try this
I don't know if when the button A gone this will detect the MotionEvent.ACTION_UP.