diff options
author | Jonathan Miranda <jonmiranda@google.com> | 2018-11-15 00:35:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-11-15 00:35:55 +0000 |
commit | a5c67901f8075fd56d179567258510201ae40841 (patch) | |
tree | 6931b8b0b8723b6d066570e189bd57b8e66bdf66 /src/com | |
parent | 3386fbf6741abc2a9e3713b96f093650de0a95f6 (diff) | |
parent | 4f1545ddee5834cab1061b65964207f7f098aa8b (diff) | |
download | android_packages_apps_Trebuchet-a5c67901f8075fd56d179567258510201ae40841.tar.gz android_packages_apps_Trebuchet-a5c67901f8075fd56d179567258510201ae40841.tar.bz2 android_packages_apps_Trebuchet-a5c67901f8075fd56d179567258510201ae40841.zip |
Merge "Clean up span calculations in LauncherAppWidgetProviderInfo." into ub-launcher3-master
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetProviderInfo.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java b/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java index b2b05b17b..228c07ec4 100644 --- a/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java +++ b/src/com/android/launcher3/LauncherAppWidgetProviderInfo.java @@ -58,19 +58,13 @@ public class LauncherAppWidgetProviderInfo extends AppWidgetProviderInfo public void initSpans(Context context) { InvariantDeviceProfile idp = LauncherAppState.getIDP(context); - Point paddingLand = idp.landscapeProfile.getTotalWorkspacePadding(); - Point paddingPort = idp.portraitProfile.getTotalWorkspacePadding(); + Point landCellSize = idp.landscapeProfile.getCellSize(); + Point portCellSize = idp.portraitProfile.getCellSize(); // Always assume we're working with the smallest span to make sure we // reserve enough space in both orientations. - float smallestCellWidth = DeviceProfile.calculateCellWidth(Math.min( - idp.landscapeProfile.widthPx - paddingLand.x, - idp.portraitProfile.widthPx - paddingPort.x), - idp.numColumns); - float smallestCellHeight = DeviceProfile.calculateCellWidth(Math.min( - idp.landscapeProfile.heightPx - paddingLand.y, - idp.portraitProfile.heightPx - paddingPort.y), - idp.numRows); + float smallestCellWidth = Math.min(landCellSize.x, portCellSize.x); + float smallestCellHeight = Math.min(landCellSize.y, portCellSize.y); // We want to account for the extra amount of padding that we are adding to the widget // to ensure that it gets the full amount of space that it has requested. |