Load icons and labels only once
The current implementation triggers icon loading each time a view gets bound and, as binding happens multiple times, icon and label loadings are unnecessarily duplicated. In addition, as a loading task never gets canceled, there’re cases (like in the associated ticket) when a view gets rapidly bound to multiple positions and all the icon loadings eventually catches up updating it, ending up in icons rapidly changing on the screen for the view. This change addresses this by simplifying the icon loading/binding logic: a view is always bound to the current data and the task is only updates the data with the missing piece of info once (and applied for both icons and label loading tasks). There is one extra change in ResolverActivity due to LoadIconTask interface change and cancellation logic for the tasks. Fix: 245934835 Test: Manual tests on a list which does not fit into the screen. Test: Manual tests with arficial delays added into the tasks. Test: atest FrameworksCoreTests:ResolverActivityTest Test: atest FrameworksCoreTests:ChooserActivityTest Change-Id: I76fe5663523232a74d4f505c535cd6dbcf7f8759
Loading
Please register or sign in to comment