https://kotlinlang.org logo
Title
a

Adib Faramarzi

12/24/2021, 12:19 PM
Is
.hoverable
a desktop-only modifier? It doesn't seem to work (
isHoveredState
is always false even though a finger is pressing and hovering over the element)
s

seb

12/24/2021, 4:30 PM
If it's pressed it's not hovered if I am not mistaken. As far as I know, hovered as a state only makes sense when you use a pointing device like a mouse, since it means "the pointer is above this composable but not pressing it"
a

Adib Faramarzi

12/24/2021, 8:34 PM
That is right.
I'm currently looking for an API to have some kind of hover-like behavior in when user is touching. Something like a touch that can be left unconsumed (and everyone can "watch" it)
a

Andy Himberger

12/27/2021, 5:44 AM
I would assume hoverable on mobile behaves like the hover motionevent, which happen if you're using a Pen input device hovered over the screen (and also talkback sends a hovered event before press)
s

seb

12/27/2021, 8:33 AM
Yeah pens and mice do have hovered events. And you can have pens and mice on mobile. In that case I'd expect to get hovered events. When you do not get those events is when using touch, as there is no such thing as hovering in that case. As far as the OS is concerned, the touch "pointers" don't exist when the user is not pressing, and if they're pressing, it's not a hover.