Skip to content
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

Sluggish scrolling on iOS (and Android) #2936

Closed
kutoman opened this issue Oct 21, 2019 · 11 comments
Closed

Sluggish scrolling on iOS (and Android) #2936

kutoman opened this issue Oct 21, 2019 · 11 comments
Assignees
Milestone

Comments

@kutoman
Copy link
Contributor

kutoman commented Oct 21, 2019

this issue began to happen around the time when I submitted #2928. Since I noticed that this is happening on any iOS version I decided to open a separate issue. Thus the fix of #2928 just had a quite small effect in fixing this. I still try to figure out what the cause is and try to code a sample for reproduction. For the meantime, I do know that under theses circumstances you might not be able to tackle this but nevertheless hopefully you might have a clue about the cause by viewing the demo below..

CN1 simulator on the left with smooth scrolling, iOS simulator on the right:

sluggish_ios_scrolling

Note: it's also working properly on Android. Furthermore, before the mentioned time of occurence it worked properly on iOS as well which I still can confirm on iOS devices where the older version of this app (also means older version of CN1) is still installed.

@codenameone codenameone added this to the Version 7.0 milestone Oct 23, 2019
@shannah
Copy link
Collaborator

shannah commented Oct 23, 2019

Since you're working in the Xcode simulator, I presume you have access to the source. See if disabling the gesture recognizer improves the performance for you.

You can do that by commenting out the contents of the following method in CN1TapGestureRecognizer.m

- (void) install:(CodenameOne_GLViewController*)ctrl {
    [self setCancelsTouchesInView:NO];
    self.delegate = self;
    [ctrl.view.window addGestureRecognizer:self];
    CN1useTapGestureRecognizer = YES;
    
    
}

@kutoman
Copy link
Contributor Author

kutoman commented Oct 23, 2019

@shannah this has no effect unfortunately. But I noticed the scrolling gets less sluggish the more I scroll down (when the background image is completely covered)

@shannah
Copy link
Collaborator

shannah commented Oct 23, 2019

What happens when you remove/omit the image altogether?

@kutoman
Copy link
Contributor Author

kutoman commented Oct 23, 2019

@shannah that isn't the cause either as it also happens without the image. I'm now kinda reconstructing that UI content. That was something I wanted to avoid in the first place as the UI is a bit complex and mostly built by the CN1 Designer, but it seems inevitable to fix this issue. Maybe the TableLayout with those switches is the reason for this..

@kutoman
Copy link
Contributor Author

kutoman commented Oct 27, 2019

@shannah
it took me a lot of exhausting iterations to finally come to this point. I was focussing on the wrong parts of the UI until I noticed the real black sheep. It's about the nested Tabs component (it's there where you see the 3 green slider dots). As you can see in the demo below, as soon as it's removed from the scrollable area, the scrolling works as smooth as I was used to before. Please note, that this slider can have up to 18 simple SpanLabels as tabs. Since this was not an issue in earlier days, some recent changes in the CN1 iOS implementation might be causing it though.

sluggishCause(2)

@kutoman
Copy link
Contributor Author

kutoman commented Nov 18, 2019

I was too focussed on the iOS side and trying to fix this issue so that I just recently realized that on the android side there is also a worse scrolling experience compared to our older builds. It is not as intense as it is in iOS but it is quite noticable. So I assume this is not only a iOS thing but rather something which is affected by the core CN1 implementation.

@kutoman kutoman changed the title Sluggish scrolling on iOS Sluggish scrolling on iOS (and Android) Nov 18, 2019
@shannah
Copy link
Collaborator

shannah commented Nov 18, 2019

Can you post a minimal test case that will demonstrate this issue?

@kutoman
Copy link
Contributor Author

kutoman commented Nov 20, 2019

@shannah I prepared one here:
https://gist.github.com/kutoman/5a7989bbb95d17fa0731dbf8853cf403

As there is nesting of Tabs components in our app , the sample is complexer than expected. In the struggle of reproducing the issue I noticed that the nesting seems to have an effect which made me put it in the sample. Please note that I duplicated the earlier mentioned slider in the sample to emphasize the none-smooth scrolling, even though it is noticable with a single slider too (slightly on Android though).

@kutoman
Copy link
Contributor Author

kutoman commented Nov 20, 2019

@shannah there is also another issue you may notice. The top slider kinda gets stretched vertically while scrolling even though the size should stay fix.

@shannah
Copy link
Collaborator

shannah commented Dec 11, 2019

That test case scrolls smoothly on my iPhone X.

@shannah
Copy link
Collaborator

shannah commented Jan 20, 2020

This issue was resolved by disabling enableLayoutOnPaint. d4ddcad

@shannah shannah closed this as completed Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants