[TIMOB-28573] Android: Complex items added to ListView after window open can cause scroll performance issues as of 9.3.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-11-03T01:04:49.000+0000 |
Affected Version/s | Release 9.3.0 |
Fix Version/s | Release 10.1.1 |
Components | Android |
Labels | ListView, android, performance, regression |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2021-11-02T23:25:23.000+0000 |
Updated | 2021-11-17T10:58:55.000+0000 |
Description
*Summary:*
As of Titanium 9.3.0, list items added to a Fling the
ListView
after the window has opened can cause a huge scroll performance issue. This is only noticeable if the list item templates contain a lot of child views, such as 16 or more. This is not an issue if items are added before the window has opened.
*Note:*
This is an issue with TableView
as well.
*Steps to reproduce:*
Build and run [^ListViewTemplateManyViewsTest.js] on Android.
Fling the ListView
down.
Notice how bad the scrolling stutters.
*Cause:* All Titanium proxy objects are assigned the root activity by default, which is the splash screen window. https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java#L173 The issue with this is thatListView
will notice that the ListItem
's activity does not match the activity the ListView
is attached to and will *+correctly+* update the ListItem
's activity and release its old views. This behavior is correct because the item needs to use the same theme as the ListView
, but the item should favor the top-most activity and not the root activity when created.
https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java#L165-L168
*Work-Around:*
Add the items before the window opens, such as during ListView
or ListSection
creation.
Attachments
File | Date | Size |
---|---|---|
ListViewTemplateManyViewsTest.js | 2021-11-02T23:23:51.000+0000 | 1976 |
PR (master): https://github.com/appcelerator/titanium_mobile/pull/13163
Backport PR: https://github.com/appcelerator/titanium_mobile/pull/13183