diff options
author | Alexander Martinz <amartinz@shiftphones.com> | 2018-04-09 20:02:35 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-12 15:18:16 +0200 |
commit | aba1f18b9cc5bae1e0bb17e66b59cb447643173b (patch) | |
tree | 4c0a2969208f1dce57a9aa8bf32e6b7156a7e44e | |
parent | 753d0e9d1e95736431a5f00b19249f94bc847702 (diff) | |
download | packages_apps_Trebuchet-aba1f18b9cc5bae1e0bb17e66b59cb447643173b.tar.gz packages_apps_Trebuchet-aba1f18b9cc5bae1e0bb17e66b59cb447643173b.tar.bz2 packages_apps_Trebuchet-aba1f18b9cc5bae1e0bb17e66b59cb447643173b.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; } |