diff options
author | Alexander Martinz <amartinz@shiftphones.com> | 2018-04-09 20:02:35 +0200 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2019-10-20 14:00:37 +0100 |
commit | 2c8118585a5e5dacfbce8726ad5389af354fa4e8 (patch) | |
tree | e9d5839e49d84699821442501dcc3427a34b5cae | |
parent | 588265ff1c50f49fce3b3bc3e263c6ee4ecb54e4 (diff) | |
download | android_packages_apps_Trebuchet-2c8118585a5e5dacfbce8726ad5389af354fa4e8.tar.gz android_packages_apps_Trebuchet-2c8118585a5e5dacfbce8726ad5389af354fa4e8.tar.bz2 android_packages_apps_Trebuchet-2c8118585a5e5dacfbce8726ad5389af354fa4e8.zip |
DeviceProfile: fix divide by zero
Change-Id: I8deeeb053a43bac0941950a0c25770b4cc565405
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 883e8c642..91a7ab20a 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -526,9 +526,15 @@ public class DeviceProfile { } public static int calculateCellWidth(int width, int countX) { + if (countX == 0) { + countX = 4; + } return width / countX; } public static int calculateCellHeight(int height, int countY) { + if (countY == 0) { + countY = 5; + } return height / countY; } |