Fix sharesheet scroll jankiness.
This CL makes the following changes: 1. Cache the itemViewType in the ViewHolder, so that we don't have to call it again from onBindViewHolder 2. Cache the result of shouldDisplayLandscape to reduce the number of IPC calls while scrolling the list, as this is called indirectly by the ChooserGridAdapter's getRowCount and getItemCount. It calls Activity#isInMultiWindowMode which makes an IPC call to the ActivityTaskManager. 3. Cache the work profile user handle to reduce the number of IPC calls while scrolling the list, as this is called indirectly by ChooserGridAdapter's getRowCount and getItemCount. Test: atest ChooserActivityTest Test: atest ResolverActivityTest Test: manually verify there is no jankiness when scrolling Test: manually change orientation between portrait and landscape to make sure screen orientation cache gets invalidated Test: launched share sheet in multi-window mode and then removed one window - sharesheet properly updated its views Fixes: 151117747 Fixes: 154766645 Change-Id: Ib8e329b534f3de1d4906f6a07908cc7879dcaa47
Loading
Please register or sign in to comment