Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28565] Android: ListView item containing several ImageViews can cause bad scroll performance as of 9.3.0

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-11-02T01:24:32.000+0000
Affected Version/sRelease 9.3.0
Fix Version/sRelease 10.2.0
ComponentsAndroid
LabelsImageView, ListView, android, performance, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-10-22T01:45:04.000+0000
Updated2021-11-02T01:24:32.000+0000

Description

*Summary:* If a ListView item template contains a lot of ImageViews (say 16 or more), then this can cause bad scroll performance as of Titanium 9.3.0. This issue is caused by the number of image views. The more image views a single list item has, the worse it gets... even if the no images are assigned (ie: empty image views). *Steps to reproduce:*

Create a Classic app project from template. (Provides needed tab images.)

Use [^ListViewTemplateManyImagesTest.js] as the "app.js".

Build and run on Android.

Fling the ListView and note the scroll performance.

*Cause:* This issue is caused by the ZoomControl added to every Ti.UI.ImageView [here](https://github.com/appcelerator/titanium_mobile/blob/ead1713e5e36b4632b692ce6fcc9a9785b91ad26/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiImageView.java#L143). Removing the ZoomControl solves the performance issue. *Work-Around 1:* Set ImageView property "touchEnabled" to false. This improves scroll performance, but "Work-Around 2" is even faster. *Work-Around 2:* Instead of using a Ti.UI.ImageView, use a Ti.UI.View and its backgroundImage instead... but this also means you need to hard-code the "width" and "height" properties to match the image size.

Attachments

FileDateSize
ListViewTemplateManyImagesTest.js2021-10-22T01:42:56.000+00001336

Comments

  1. Joshua Quick 2021-10-26

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/13146

JSON Source