Page 1 of 1

Unity Android--Touch Event troubles on ListViewItem

Posted: 02 Jul 2020, 10:08
by Jamieh
So I had this problem in 2.2. I just upgraded to 3.0 in hopes that it would work, but I'm still having the issue.

In my Android build, the Touch events on a ListViewItem don't seem to be firing consistently. I usually get TouchDown, but I rarely get TouchUp. I see it sometimes, but most of the time I do not.

I am sure I'm just doing this wrong. If there is a sample/correct way to do this that would be great.

I have uploaded a sample project showing this issue:

https://1drv.ms/u/s!AjEAlWO9Yl9unMIqSrE ... g?e=I68QjL

I put debug messages on both down and up, and I'm watching LogCat to see when the events are firing.

Thanks!

Re: Unity Android--Touch Event troubles on ListViewItem

Posted: 06 Jul 2020, 17:27
by sfernandez
ListView's ScrollViewer is capturing touch events because you set PanningMode="Both", if you change it to "None" then both down/up messages are logged to the console. But you don't want to lose touch panning in your list for sure, so please let me know what are you trying to accomplish with your list view items and touch, I'll try to help.

Re: Unity Android--Touch Event troubles on ListViewItem

Posted: 06 Jul 2020, 18:53
by Jamieh
Hmm, yeah, I think I want to leave panning support in. If I pulled that, it would remove touch scrolling right?

Our Webassembly version has tooltips that appear if the user hovers over a ListViewItem. Obviously that doesn't work in a touch enviornment. I'm trying to replace that behavior on Android/iOS with something else, and my first thought was to detect a "touch and hold" on the item (say somewhere in the 1 sec range). But to do that I would need to always get the touch up event to know how long the user was touching the element.

I am open to any suggestions here. I'm just trying to give our tablet users a good touch experience. I'm not even sure the touch and hold is the best idea, I just couldn't think of another way to replace Hover tooltips.

Thanks!

Re: Unity Android--Touch Event troubles on ListViewItem

Posted: 06 Jul 2020, 20:57
by sfernandez
If I pulled that, it would remove touch scrolling right?
Yes, you should leave PanningMode="Both" or "VerticalFirst".

Using a UI designed for desktop in touch environments without changing anything will always provide a bad experience.

Finding a good approach to translate hover tooltips to touch depends on each scenario. Using touch and hold can't be an option in your case with current touch implementation in Noesis, as ScrollViewer will capture touch events to perform the scrolling. We are working on improving that implementation and also providing events like Tapped, RightTapped, Holding... for advanced touch interactions.

Another approach could be showing extra information with a Expander, so the experience will be the same in Desktop and Touch.

Or you can show an info (?) icon that shows a Popup when mouse is hovered (for Desktop), or show it when tapped (for Touch).

I hope this helps.

Re: Unity Android--Touch Event troubles on ListViewItem

Posted: 06 Jul 2020, 23:58
by Jamieh
That does help. I believe the answer is to stop trying to do what I'm doing. :)

We won't die without the hover event in the listview. You can get to the same data by tapping anyway. WIth the mouse it is much easier to scan though multiple pieces of data with the hover, but we can just have the touch users tap to get the info on the "more info" page.

It sounds like I should be able to do my "touch and hold" strategy on other UI elements that don't scroll? That will probably be sufficient. There are some places where tooltips are the only way to get to the info, so we can implement touch and hold for these places.

Thanks!