summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2015-09-09 18:40:27 +0200
committerJustin R. Miller <incanus@codesorcery.net>2015-09-11 15:12:21 -0700
commita5ae3a57bc7db1d59ef58101de5c912d533ca9c7 (patch)
tree4584d5cd0014444d399ddb5ce04d4d9d248cae66 /android
parentfcfefadfda2873c4796bac93500a22144474be79 (diff)
downloadqtlocation-mapboxgl-a5ae3a57bc7db1d59ef58101de5c912d533ca9c7.tar.gz
Moved icon to the right of Mapbox logo
Diffstat (limited to 'android')
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
index d21dc81f42..823424be77 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java
@@ -118,10 +118,12 @@ public class MapView extends FrameLayout implements LocationListener {
private static final String STATE_ATTRIBUTION_MARGIN_BOTTOM = "atrrMarginBottom";
// Used for positioning views
- private static final float DIMENSION_SIXTEEN_DP = 16f;
+ private static final float DIMENSION_SEVEN_DP = 7f;
private static final float DIMENSION_TEN_DP = 10f;
+ private static final float DIMENSION_SIXTEEN_DP = 16f;
+ private static final float DIMENSION_SEVENTYSIX_DP = 76f;
- private static final int IMPROVE_THIS_MAP_INDEX = 2;
+ private static final int ATTRIBUTION_INDEX_IMPROVE_THIS_MAP = 2;
/**
* Every annotation that has been added to the map.
@@ -423,7 +425,11 @@ public class MapView extends FrameLayout implements LocationListener {
// Setup Attributions control
mAttributionsView = new ImageView(mContext);
- mAttributionsView.setBackgroundResource(R.drawable.ic_info_selector);
+ mAttributionsView.setClickable(true);
+ mAttributionsView.setImageResource(R.drawable.ic_info_selector);
+ int attrPadding = (int) (DIMENSION_SEVEN_DP * mScreenDensity);
+ mAttributionsView.setPadding(attrPadding, attrPadding, attrPadding, attrPadding);
+ mAttributionsView.setAdjustViewBounds(true);
mAttributionsView.setContentDescription(getResources().getString(R.string.attributionsIconContentDescription));
LayoutParams attrParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
mAttributionsView.setLayoutParams(attrParams);
@@ -479,11 +485,11 @@ public class MapView extends FrameLayout implements LocationListener {
, typedArray.getDimension(R.styleable.MapView_logoMarginBottom, DIMENSION_SIXTEEN_DP));
// Attribution
- setAttributionGravity(typedArray.getInt(R.styleable.MapView_attributionGravity, Gravity.BOTTOM | Gravity.END));
- setWidgetMargins(mAttributionsView, typedArray.getDimension(R.styleable.MapView_attributionMarginLeft, DIMENSION_SIXTEEN_DP)
- , typedArray.getDimension(R.styleable.MapView_attributionMarginTop, DIMENSION_SIXTEEN_DP)
- , typedArray.getDimension(R.styleable.MapView_attributionMarginRight, DIMENSION_SIXTEEN_DP)
- , typedArray.getDimension(R.styleable.MapView_attributionMarginBottom, DIMENSION_SIXTEEN_DP));
+ setAttributionGravity(typedArray.getInt(R.styleable.MapView_attributionGravity, Gravity.BOTTOM));
+ setWidgetMargins(mAttributionsView, typedArray.getDimension(R.styleable.MapView_attributionMarginLeft, DIMENSION_SEVENTYSIX_DP)
+ , typedArray.getDimension(R.styleable.MapView_attributionMarginTop, DIMENSION_SEVEN_DP)
+ , typedArray.getDimension(R.styleable.MapView_attributionMarginRight, DIMENSION_SEVEN_DP)
+ , typedArray.getDimension(R.styleable.MapView_attributionMarginBottom, DIMENSION_SEVEN_DP));
setMyLocationEnabled(typedArray.getBoolean(R.styleable.MapView_myLocationEnabled, false));
} finally {
@@ -2072,7 +2078,7 @@ public class MapView extends FrameLayout implements LocationListener {
public void onClick(DialogInterface dialog, int which) {
Context context = ((Dialog) dialog).getContext();
String url = context.getResources().getStringArray(R.array.attribution_links)[which];
- if (which == IMPROVE_THIS_MAP_INDEX) {
+ if (which == ATTRIBUTION_INDEX_IMPROVE_THIS_MAP) {
LatLng latLng = mMapView.getCenterCoordinate();
url = String.format(url, latLng.getLongitude(), latLng.getLatitude(), (int) mMapView.getZoomLevel());
}