Jamieh
Topic Author
Posts: 35
Joined: 12 Apr 2019, 00:30

Unity Android--Touch Event troubles on ListViewItem

02 Jul 2020, 10:08

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!

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1881
Joined: 22 Dec 2011, 19:20

Re: Unity Android--Touch Event troubles on ListViewItem

06 Jul 2020, 17:27

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.
 
Jamieh
Topic Author
Posts: 35
Joined: 12 Apr 2019, 00:30

Re: Unity Android--Touch Event troubles on ListViewItem

06 Jul 2020, 18:53

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!
 
User avatar
sfernandez
Site Admin
Posts: 1881
Joined: 22 Dec 2011, 19:20

Re: Unity Android--Touch Event troubles on ListViewItem

06 Jul 2020, 20:57

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.
 
Jamieh
Topic Author
Posts: 35
Joined: 12 Apr 2019, 00:30

Re: Unity Android--Touch Event troubles on ListViewItem

06 Jul 2020, 23:58

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!

Who is online

Users browsing this forum: ck_russ and 3 guests