-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(android): reduce tableView updates #13526
Conversation
Pretty smart! Could this also be an issue with list views or are those not affected? |
no, the update in the ListView isn't called in a loop as far as I see. |
Any community users that can test this with a more advanced case? We also only use list views |
Finally have a client app with some tableviews 😄 Added the log again and could see:
👍 tableview didn't look different compared to 12.0.0. Sadly not that much data so couldn't test if it will improve the performance much. But at least 10 less updates! |
Can we get this tested by someone with more complex table views? We also only use it for a maximum of like 12 cells |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! APPROVED
Tested, didn't crash, lets go! |
During older TableView tests I saw that this update function
https://github.com/tidev/titanium_mobile/blob/918388a75a98c3f5458d27f6ed035f11883b303e/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewProxy.java#L532
is called multiple times. The
shouldUpdate
around it doesn't catch all loops.Putting a log in the update function showed:
for the example below.
Change:
Calling
appendRow
from Ti doesn't change. Only the internalappendRow
calls won't trigger theupdate()
during the loop. It is called at the end of the loop anyways: https://github.com/tidev/titanium_mobile/blob/918388a75a98c3f5458d27f6ed035f11883b303e/android/modules/ui/src/java/ti/modules/titanium/ui/TableViewProxy.java#L532Also fixed a potential null pointer exception.
Demo
Note
I've only tested some demo tableViews since I don't have an app with an advanced TableView 😄 (ListView FTW!)
So if you have an app with some tables where you add and remove data it would be nice to hear if the updates are quicker now and everything still works.