mozilla-vpn-client
mozilla-vpn-client copied to clipboard
VPN-6021: Improve "App Exculsions" screen load time by switching from Repeater to ListView
Description
The "App Exclusions" screen used a Repeater for the list items, which required all application names and their icons to be obtained when the screen was loaded. Obtaining icons is expensive, and slowed screen load. Switch this to ListView, which lazily loads list items as they become visible in the viewport. This allows icons to be obtained only when needed and improves screen load time.
The following additional changes were required to switch to ListView:
- The MZViewBase parent is a flickable and ListView is also a flickable. To prevent conflicts, the MZViewBase has been marked interactive:false.
- The ListView is implemented in MZList, with its own ensureVisible() which is used to scroll an item in the flickable into the visible part of the viewport.
- The controls before and after the list are moved into the ListView's header and footer, to allow the ListView flickable to scroll through all of them.
- Tab and Backtab navigation have been customized in places to account for the lazy loading of list items. The creation order of list items can no longer be depended upon for standard tabbing and this customization allows items to be navigated to by list index.
Reference
Checklist
- [x] My code follows the style guidelines for this project
- [x] I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
- [x] I have performed a self review of my own code
- [x] I have commented my code PARTICULARLY in hard to understand areas
- [ ] I have added thorough tests where needed