launcher: create more space options

The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
This commit is contained in:
Thales Lima
2021-09-30 11:29:06 +01:00
parent bfb6996484
commit 78d00adcbe
14 changed files with 246 additions and 125 deletions

View File

@@ -422,8 +422,8 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
*/
private void resizeWidgetIfNeeded(boolean onDismiss) {
DeviceProfile dp = mLauncher.getDeviceProfile();
float xThreshold = mCellLayout.getCellWidth() + dp.cellLayoutBorderSpacingPx;
float yThreshold = mCellLayout.getCellHeight() + dp.cellLayoutBorderSpacingPx;
float xThreshold = mCellLayout.getCellWidth() + dp.cellLayoutBorderSpacePx.x;
float yThreshold = mCellLayout.getCellHeight() + dp.cellLayoutBorderSpacePx.y;
int hSpanInc = getSpanIncrement((mDeltaX + mDeltaXAddOn) / xThreshold - mRunningHInc);
int vSpanInc = getSpanIncrement((mDeltaY + mDeltaYAddOn) / yThreshold - mRunningVInc);
@@ -508,8 +508,8 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
private void onTouchUp() {
DeviceProfile dp = mLauncher.getDeviceProfile();
int xThreshold = mCellLayout.getCellWidth() + dp.cellLayoutBorderSpacingPx;
int yThreshold = mCellLayout.getCellHeight() + dp.cellLayoutBorderSpacingPx;
int xThreshold = mCellLayout.getCellWidth() + dp.cellLayoutBorderSpacePx.x;
int yThreshold = mCellLayout.getCellHeight() + dp.cellLayoutBorderSpacePx.y;
mDeltaXAddOn = mRunningHInc * xThreshold;
mDeltaYAddOn = mRunningVInc * yThreshold;