-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lead component action listener on Contact Row disables Scrolling #3079
Comments
I've pulled this from your sample:
There are a couple of problems here:
If you can produce a self-contained test case (e.g. single file, no dependencies, ..) it will make it easier for me to look into this. |
I added a test case for this issue. Please try to modify this test case to reproduce the problem. So far seems to work OK. Closing this for now. If you can reproduce the problem in test case, I'll reopen. |
Steve - Thanks for your suggestions and your test code. It works as desired, other than the rows aren’t swipeable. Is that expected? This seems like a situation where my non-standard coding got-by before but doesn’t work with the latest CN1 build version. I’m pretty slow at coding so rather than taking another day or so to replicate the problem in another test case, I’ve tried to replicate your solution in my code and the good news is that worked. Sort of. I was able to keep the scrolling working with the “offending code” included by just adding before the setLeadComponent line….
But unfortunately each row with that lead component now became unswipeable. This approach also fixed the scrolling on my actual code and the action listener worked but swipeability stopped working and also, each row that has this lead component set is now covered in solid blue and nothing underneath is visible. Any ideas why those two problems happen and how to solve? Thanks for your help, |
The sample didn't include any components in the right or left of the swipe container so, yes that was expected. I've updated the sample to include such components so you can verify that swiping still works.
I think this is actually the crux of the issue. The SwipeContainer is a bit of a special container that may have its only pointer handling. When you set a lead component on a container, it delegates all pointer events for the container to the lead component - which may be problematic. You should set the button as the lead component on "center" container of the SwipeContainer and not the SwipeContainer itself. |
Thanks Steve. I see the swipeability works in your demo. To prevent the action listening button from covering up the whole row in my code, I created a transparent button, ButtonTrans, in theme.res and then added
to my code and that did the trick. All good now. Thanks again. |
Swipeable container with a lead component action listener seems to deactivate scrollability. This was working with previous CN1 build versions. The first 3 rows in the screenshot below have URLImages and at the same time include an action listener so that the user can zoom in on the icon if needed. Scrolling on the first 3 rows doesn’t work but works fine on the rest of the rows where there is no lead component action listener.
![image](https://user-images.githubusercontent.com/50466171/79055814-1cedff80-7c0d-11ea-89f7-13d89709797c.png)
I thought the problem was the URLImages but it’s actually the lead component action listener that was getting added only to rows that also have URLImages.
How to replicate:
See attached code (change .txt to .java) based on the CN1 Contacts Demo described here Find the section labelled “offending code”. Commenting out the offending code solves the problem. Uncommenting it replicates the problem.
MySQLContactsDemo.txt
This is my first time opening an issue. Apologies if I didn't do it quite right. Thx, Mike
The text was updated successfully, but these errors were encountered: