From 46a06da01cded4ba355381be41455f85f85369fa Mon Sep 17 00:00:00 2001 From: Winson Date: Tue, 29 Sep 2015 16:58:02 -0700 Subject: Fixing other missing cases of truncated sorts. Bug: 24505761 Change-Id: I9b9358e8b134f0c4aac32ac536d9c8a1f0629957 --- src/com/android/launcher3/InvariantDeviceProfile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher3/InvariantDeviceProfile.java') diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index ae204c40c..ae430e049 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -252,8 +252,8 @@ public class InvariantDeviceProfile { ArrayList pointsByNearness = points; Collections.sort(pointsByNearness, new Comparator() { 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)); } }); -- cgit v1.2.3