Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - makes improve map url backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Jan 15, 2019
1 parent 5977d7b commit 59cfce3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

import android.support.annotation.Nullable;

import java.util.ArrayList;
import java.util.List;

public class Attribution {

private static final String OPENSTREETMAP = "OpenStreetMap";
private static final String OPENSTREETMAP_ABBR = "OSM";
static final String TELEMETRY = "Telemetry Settings";

static final String IMPROVE_MAP_URL = "https://www.mapbox.com/map-feedback/";
static final String MAPBOX_URL = "https://www.mapbox.com/about/maps/";
static final String TELEMETRY_URL = "https://www.mapbox.com/telemetry/";
static final List<String> IMPROVE_MAP_URLS = new ArrayList<>();

static {
// Using a List makes URL backwards compatible
IMPROVE_MAP_URLS.add("https://www.mapbox.com/feedback/");
IMPROVE_MAP_URLS.add("https://www.mapbox.com/map-feedback/");
}

private String title;
private String url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private String translateImproveThisMapAnchor(String anchor) {
* @return if the url is valid for improve this map
*/
private boolean isValidForImproveThisMap(@NonNull String url) {
return withImproveMap || !url.equals(Attribution.IMPROVE_MAP_URL);
return withImproveMap || !(Attribution.IMPROVE_MAP_URLS.contains(url));
}

/**
Expand Down

0 comments on commit 59cfce3

Please sign in to comment.