Issue
I'm trying to add mouse/touchpad support to my app and that includes hover support. As per the android guidelines, which say:
Developers can make their app layouts feel polished and easier to use by handling hover events. This is especially true for custom views. The two most common examples of this are:
- Indicating to users if an element has interactive behavior, such as being clickable or editable, by changing the mouse pointer icon.
- Adding visual feedback to items in a large list or grid when the pointer is hovering over them
yourView.setOnHoverListener { view, _ ->
addVisualHighlighting(true)
view.pointerIcon =
PointerIcon.getSystemIcon(view.context,
PointerIcon.TYPE_HAND)
false // listener did not consume the event.
}
This is not working e.g. the pointer icon is not changing and a debug/print line is NOT being called, at least not on an emulator. I am unable to test on a real device so could this be a limitation of the android emulator or am I wrongly implementing this listener? Would it run correctly on the Windows 11 subsystem for android?
Solution
Well, I tried running my app on android x86 in VirtualBox and everything worked! Looks like the android studio emulator doesn't capture mouse pointers. I'm only wondering if this will work on the Windows 11 subsystem.
Answered By - A_Jayke
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.