From 1e8b45f8f12a23ac4caa6b4c325304e372b58d0c Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Thu, 25 Aug 2022 11:50:59 -0400 Subject: [PATCH] Extract cell horizontal space to a method Fixes: 229100375 Test: DeviceProfileTest Change-Id: Ia2e560b37f4e9fbff9b5c2e7c0ef3fe710e55c29 --- src/com/android/launcher3/DeviceProfile.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 14a467ad65..a330fb3c7e 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -513,7 +513,7 @@ public class DeviceProfile { private int getIconToIconWidthForColumns(int columns) { return columns * getCellSize().x + (columns - 1) * cellLayoutBorderSpacePx.x - - (getCellSize().x - iconSizePx); // left and right cell space + - getCellHorizontalSpace(); } private int getHorizontalMarginPx(InvariantDeviceProfile idp, Resources res) { @@ -984,6 +984,13 @@ public class DeviceProfile { return result; } + /** + * Returns the left and right space on the cell, which is the cell width - icon size + */ + public int getCellHorizontalSpace() { + return getCellSize().x - iconSizePx; + } + /** * Gets the number of panels within the workspace. */