File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
app/src/main/java/fr/free/nrw/commons Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 11package fr .free .nrw .commons .location ;
22
33import android .location .Location ;
4+ import android .net .Uri ;
45import android .support .annotation .NonNull ;
56
67public class LatLng {
@@ -129,4 +130,8 @@ public double getLongitude() {
129130 public double getLatitude () {
130131 return latitude ;
131132 }
133+
134+ public Uri getGmmIntentUri () {
135+ return Uri .parse ("geo:0,0?q=" + latitude + "," + longitude );
136+ }
132137}
Original file line number Diff line number Diff line change @@ -42,6 +42,18 @@ public void setDistance(String distance) {
4242 this .distance = distance ;
4343 }
4444
45+ public boolean hasWikipediaLink () {
46+ return !(siteLinks == null || Uri .EMPTY .equals (siteLinks .getWikipediaLink ()));
47+ }
48+
49+ public boolean hasWikidataLink () {
50+ return !(siteLinks == null || Uri .EMPTY .equals (siteLinks .getWikidataLink ()));
51+ }
52+
53+ public boolean hasCommonsLink () {
54+ return !(siteLinks == null || Uri .EMPTY .equals (siteLinks .getCommonsLink ()));
55+ }
56+
4557 @ Override
4658 public boolean equals (Object o ) {
4759 if (o instanceof Place ) {
You can’t perform that action at this time.
0 commit comments