Merge "Fix All Apps Icons Count estimation" into main

This commit is contained in:
Fengjiang Li
2023-10-03 21:57:36 +00:00
committed by Android (Google) Code Review
3 changed files with 21 additions and 10 deletions
@@ -704,6 +704,17 @@ public class DeviceProfile {
return renderer;
}
/**
* Return maximum of all apps row count displayed on screen. Note that 1) Partially displayed
* row is counted as 1 row, and 2) we don't exclude the space of floating search bar. This
* method is used for calculating number of {@link BubbleTextView} we need to pre-inflate. Thus
* reasonable over estimation is fine.
*/
public int getMaxAllAppsRowCount() {
return (int) (Math.ceil((availableHeightPx - allAppsTopPadding)
/ (float) allAppsCellHeightPx));
}
/**
* QSB width is always calculated because when in 3 button nav the width doesn't follow the
* width of the hotseat.