Loading src/com/android/launcher3/util/CellContentDimensions.kt +11 −0 Original line number Diff line number Diff line Loading @@ -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 } Loading src/com/android/launcher3/util/IconSizeSteps.kt +4 −0 Original line number Diff line number Diff line Loading @@ -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 } } Loading
src/com/android/launcher3/util/CellContentDimensions.kt +11 −0 Original line number Diff line number Diff line Loading @@ -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 } Loading
src/com/android/launcher3/util/IconSizeSteps.kt +4 −0 Original line number Diff line number Diff line Loading @@ -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 } }