Moved code to reduce feature envy.

This commit is contained in:
Paul Hawke 2017-12-29 08:32:58 -06:00
parent 1c43426579
commit 92e20b4cee
2 changed files with 17 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package fr.free.nrw.commons.location;
import android.location.Location;
import android.net.Uri;
import android.support.annotation.NonNull;
public class LatLng {
@ -129,4 +130,8 @@ public class LatLng {
public double getLatitude() {
return latitude;
}
public Uri getGmmIntentUri() {
return Uri.parse("geo:0,0?q=" + latitude + "," + longitude);
}
}

View file

@ -42,6 +42,18 @@ public class Place {
this.distance = distance;
}
public boolean hasWikipediaLink() {
return !(siteLinks == null || Uri.EMPTY.equals(siteLinks.getWikipediaLink()));
}
public boolean hasWikidataLink() {
return !(siteLinks == null || Uri.EMPTY.equals(siteLinks.getWikidataLink()));
}
public boolean hasCommonsLink() {
return !(siteLinks == null || Uri.EMPTY.equals(siteLinks.getCommonsLink()));
}
@Override
public boolean equals(Object o) {
if (o instanceof Place) {