androidandroid-layoutandroid-imageviewandroid-gesture

Android "hover" event in custom layout


I have a custom layout that I have written that basically just displays a bunch of ImageViews. I am handing onTouch events for all the ImageViews in my layout.

However, if a user touches one imageView and then drags over another ImageView, I would like to be able to handle that as well.

How would I go about capturing this behaviour?


Solution

  • maybe this example is useful: http://www.anddev.org/viewtopic.php?p=11603

    it relies on tracking the event with MotionEvent.ACTION_MOVE. the coordinates could be checked to determine when the element enters/exits a cell.

    it uses drawview, but hopefully the same can be done w/imageview