Reduce the iconSize to fit inside the cellSize when display size largest
For some cases, even after reducing the iconSize and iconTextSize the content of the cell does not fit inside the cell height. This issue leads the icons or labels of the folders and workspace to crop. To prevent the icons of cropping when the display size or font size is largest (for acessibility) we allow the icons and labels shrink until it fits inside the defined cell height. Bug: 314285621 Bug: 316087877 Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD Test: NexusLauncherImageTests Change-Id: Id8da3ee89658b9fc53a36d8605b9bd56ce168834
This commit is contained in:
1 parent
873d49937c
commit
10ce3f5fe2
2 files changed
+15
No files matched your search
@@ -58,6 +58,17 @@ class CellContentDimensions(
|
||||
}
|
||||
}
|
||||
|
||||
// For some cases, depending on the display size, the content might not fit inside the
|
||||
// cell height after considering the minimum icon and label size allowed.
|
||||
// For these extreme cases, we will allow the icon size to be smaller than
|
||||
// [IconSizeSteps.minimumIconSize] to fit inside the cell height without cropping.
|
||||
while (
|
||||
cellContentHeight > cellHeightPx && iconSizePx > IconSizeSteps.ICON_SIZE_STEP_EXTRA
|
||||
) {
|
||||
iconSizePx -= IconSizeSteps.ICON_SIZE_STEP_EXTRA
|
||||
cellContentHeight = getCellContentHeight()
|
||||
}
|
||||
|
||||
return cellContentHeight
|
||||
}
|
||||
|
||||
|
||||
@@ -49,5 +49,9 @@ class IconSizeSteps(res: Resources) {
|
||||
|
||||
companion object {
|
||||
internal const val TEXT_STEP = 1
|
||||
|
||||
// This icon extra step is used for stepping down logic in extreme cases when it's
|
||||
// necessary to reduce the icon size below minimum size available in [icon_size_steps].
|
||||
internal const val ICON_SIZE_STEP_EXTRA = 2
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user