diff options
-rw-r--r-- | src/com/android/launcher3/InvariantDeviceProfile.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 688130723..9e46a84e7 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -252,8 +252,8 @@ public class InvariantDeviceProfile { ArrayList<InvariantDeviceProfile> pointsByNearness = points; Collections.sort(pointsByNearness, new Comparator<InvariantDeviceProfile>() { public int compare(InvariantDeviceProfile a, InvariantDeviceProfile b) { - return (int) (dist(width, height, a.minWidthDps, a.minHeightDps) - - dist(width, height, b.minWidthDps, b.minHeightDps)); + return Float.compare(dist(width, height, a.minWidthDps, a.minHeightDps), + dist(width, height, b.minWidthDps, b.minHeightDps)); } }); diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 27cfd632e..97a55590b 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -2445,11 +2445,11 @@ public class LauncherModel extends BroadcastReceiver lhs.cellY * screenCols + lhs.cellX); long rr = (rhs.screenId * screenCellCount + rhs.cellY * screenCols + rhs.cellX); - return (int) (lr - rr); + return Long.compare(lr, rr); } case LauncherSettings.Favorites.CONTAINER_HOTSEAT: { // We currently use the screen id as the rank - return (int) (lhs.screenId - rhs.screenId); + return Long.compare(lhs.screenId, rhs.screenId); } default: if (ProviderConfig.IS_DOGFOOD_BUILD) { @@ -2460,7 +2460,7 @@ public class LauncherModel extends BroadcastReceiver } } else { // Between containers, order by hotseat, desktop - return (int) (lhs.container - rhs.container); + return Long.compare(lhs.container, rhs.container); } } }); |