Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28573

Android: Complex items added to ListView after window open can cause scroll performance issues as of 9.3.0

    Details

    • Story Points:
      5

      Description

      Summary:
      As of Titanium 9.3.0, list items added to a 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:

      1. Build and run ListViewTemplateManyViewsTest.js on Android.
      2. Fling the ListView down.
      3. 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 that ListView 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

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration