diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-02-20 23:08:36 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-02-22 22:22:03 +0000 |
commit | 238124eb173e3162ae4ebcfb56913fecebbc2b38 (patch) | |
tree | 000e7bdd5ad3e8c7ab2255c19d74612e31aacb48 /src | |
parent | 9ad094c626f54cb1078e1f5dce4f9b0a417e5bfa (diff) | |
download | android_packages_apps_Trebuchet-238124eb173e3162ae4ebcfb56913fecebbc2b38.tar.gz android_packages_apps_Trebuchet-238124eb173e3162ae4ebcfb56913fecebbc2b38.tar.bz2 android_packages_apps_Trebuchet-238124eb173e3162ae4ebcfb56913fecebbc2b38.zip |
Ensure that icon and cached display size is always non-zero
Bug: 119290867
Change-Id: If9309df2f62f707b7ebd0c5808d4d872f6d63c61
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 7aea87039..01535b0d8 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -322,7 +322,7 @@ public class DeviceProfile { // Workspace final boolean isVerticalLayout = isVerticalBarLayout(); float invIconSizePx = isVerticalLayout ? inv.landscapeIconSize : inv.iconSize; - iconSizePx = (int) (Utilities.pxFromDp(invIconSizePx, dm) * scale); + iconSizePx = Math.max(1, (int) (Utilities.pxFromDp(invIconSizePx, dm) * scale)); iconTextSizePx = (int) (Utilities.pxFromSp(inv.iconTextSize, dm) * scale); iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale); |