summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Martinz <amartinz@shiftphones.com>2018-04-09 18:02:35 (GMT)
committerBruno Martins <bgcngm@gmail.com>2019-10-20 13:00:37 (GMT)
commit2c8118585a5e5dacfbce8726ad5389af354fa4e8 (patch)
treee9d5839e49d84699821442501dcc3427a34b5cae
parent588265ff1c50f49fce3b3bc3e263c6ee4ecb54e4 (diff)
downloadandroid_packages_apps_Trebuchet-2c8118585a5e5dacfbce8726ad5389af354fa4e8.zip
android_packages_apps_Trebuchet-2c8118585a5e5dacfbce8726ad5389af354fa4e8.tar.gz
android_packages_apps_Trebuchet-2c8118585a5e5dacfbce8726ad5389af354fa4e8.tar.bz2
DeviceProfile: fix divide by zero
Change-Id: I8deeeb053a43bac0941950a0c25770b4cc565405 Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
-rw-r--r--src/com/android/launcher3/DeviceProfile.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 883e8c6..91a7ab2 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;
}