Search code examples
androidhoverslideandroid-viewandroid-event

Which listener to use to implement selection of multiple views by sliding the finger over them?


I am confused about what I should use to listen for the event of sliding the finger across views and selecting those views. Is this a hover event? Android doc says The hover may be generated via exploring the screen by touch or via a pointing device. Or should I rather try to pull this off using just the onTouch events?


Solution

  • the hover event is for devices with a pointing device. Examples are the Transformer Prime which has a keyboard with a mouse. Or the Samsung Note devices, with a stylus. You can use the stylus to hover (e.g. holding the pen above the screen, without touching) buttons/textviews etc etc.

    When actually touching the device with a finger, your buttons will go to the pressed, selected or focussed states... Good luck