Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Sort NEAREST above all else
Browse files Browse the repository at this point in the history
  • Loading branch information
schilit committed Nov 23, 2014
1 parent 89c30b7 commit e92195d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ public int compareTo(@NonNull DeviceSighting other) {
final String otherAddress = other.scanResult.getDevice().getAddress();
// Sort by the stabilized region of the device, unless
// they are the same, in which case sort by distance.
final String nearest = mRegionResolver.getNearestAddress();
if (address.equals(nearest)) {
return -1;
}
if (otherAddress.equals(nearest)) {
return 1;
}
int r1 = mRegionResolver.getRegion(address);
int r2 = mRegionResolver.getRegion(otherAddress);
if (r1 != r2) {
Expand Down

0 comments on commit e92195d

Please sign in to comment.