mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Merge "Replace Long.compare() with implementation." into ub-launcher3-burnaby-polish
This commit is contained in:
@@ -2387,7 +2387,7 @@ public class LauncherModel extends BroadcastReceiver
|
||||
Collections.sort(allWorkspaceItems, new Comparator<ItemInfo>() {
|
||||
@Override
|
||||
public int compare(ItemInfo lhs, ItemInfo rhs) {
|
||||
return Long.compare(lhs.container, rhs.container);
|
||||
return Utilities.longCompare(lhs.container, rhs.container);
|
||||
}
|
||||
});
|
||||
for (ItemInfo info : allWorkspaceItems) {
|
||||
@@ -2469,7 +2469,7 @@ public class LauncherModel extends BroadcastReceiver
|
||||
lhs.cellY * cellCountX + lhs.cellX);
|
||||
long rr = (rhs.container * containerOffset + rhs.screenId * screenOffset +
|
||||
rhs.cellY * cellCountX + rhs.cellX);
|
||||
return Long.compare(lr, rr);
|
||||
return Utilities.longCompare(lr, rr);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -747,4 +747,11 @@ public final class Utilities {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement for Long.compare() which was added in API level 19.
|
||||
*/
|
||||
public static int longCompare(long lhs, long rhs) {
|
||||
return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class ManagedProfileHeuristic {
|
||||
|
||||
@Override
|
||||
public int compare(ShortcutInfo lhs, ShortcutInfo rhs) {
|
||||
return Long.compare(lhs.firstInstallTime, rhs.firstInstallTime);
|
||||
return Utilities.longCompare(lhs.firstInstallTime, rhs.firstInstallTime);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user