diff --git a/OsmAnd-java/src/net/osmand/osm/AbstractPoiType.java b/OsmAnd-java/src/net/osmand/osm/AbstractPoiType.java
index 3e026f54e8..4935288527 100644
--- a/OsmAnd-java/src/net/osmand/osm/AbstractPoiType.java
+++ b/OsmAnd-java/src/net/osmand/osm/AbstractPoiType.java
@@ -22,7 +22,7 @@ public abstract class AbstractPoiType {
}
public String getIconKeyName() {
- return keyName.replace(':', '_');
+ return getKeyName().replace(':', '_');
}
diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml
index cfd51a6716..2cae6a86c9 100644
--- a/OsmAnd/res/layout-land/map_hud_bottom.xml
+++ b/OsmAnd/res/layout-land/map_hud_bottom.xml
@@ -105,17 +105,31 @@
android:layout_width="@dimen/map_ruler_width"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
+
+
-
+
+
+
+
-
-
+ android:layout_gravity="center" >
+
+
+
+
+
+
+
-
+ android:layout_weight="1" >
+
+
+
+
+
-
-
+
+
-
-
-
-
+ android:layout_weight="1" >
+
+
+
+
+
+ android:layout_marginLeft="@dimen/map_button_shadow_margin" >
+
+
+ android:textStyle="bold" />
+
+ android:layout_gravity="center" />
-
+
-
-
+
+
+
+
+
+
+
+
+
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:background="@drawable/ruler" />
diff --git a/OsmAnd/res/layout/map_hud_top.xml b/OsmAnd/res/layout/map_hud_top.xml
index e6f6c42e90..601e9504ae 100644
--- a/OsmAnd/res/layout/map_hud_top.xml
+++ b/OsmAnd/res/layout/map_hud_top.xml
@@ -2,7 +2,7 @@
+ android:orientation="vertical" >
@@ -14,21 +14,37 @@
android:minHeight="@dimen/map_address_height" >
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+ android:src="@drawable/ic_action_test_light" />
+
+
@@ -147,7 +182,7 @@
android:layout_weight="0.6" >
-
+
+
@@ -197,7 +233,7 @@
-
+
+ android:orientation="vertical"
+ android:visibility="gone" >
-
+ android:layout_weight="1" >
+
+
+
+
+
-
+ android:visibility="gone" />
+
+ android:visibility="gone" />
-
+ android:layout_weight="1" >
-
+
+
+
+
+
+ android:layout_marginRight="4dp" >
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index 0798a867a7..eb2c7b6150 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -90,6 +90,7 @@
18sp
25sp
1sp
+ 3sp
4dp
2dp
diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
index 2d5ee1b1d3..9b5c601975 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
@@ -60,6 +60,7 @@ public class WaypointDialogHelper {
WaypointHelper wh = app.getWaypointHelper();
final LocationPoint point = ps.getPoint();
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
+ TextView textShadow = (TextView) localView.findViewById(R.id.waypoint_text_shadow);
localView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -86,7 +87,11 @@ public class WaypointDialogHelper {
} else {
textDist.setText("");
}
- text.setText(PointDescription.getSimpleName(point, app));
+ String descr = PointDescription.getSimpleName(point, app);
+ text.setText(descr);
+ if(textShadow != null) {
+ textShadow.setText(descr);
+ }
// ((Spannable) text.getText()).setSpan(
// new ForegroundColorSpan(ctx.getResources().getColor(R.color.color_distance)), 0, distance.length() - 1,
// 0);
diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
index 26adc497c2..2df69e7151 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
@@ -173,8 +173,7 @@ public class MapControlsLayer extends OsmandMapLayer {
private void initTopControls() {
View configureMap = mapActivity.findViewById(R.id.map_layers_button);
- controls.add(createHudButton((ImageView) configureMap, R.drawable.map_layer_dark).setIconColorId(0).setBg(
- R.drawable.btn_inset_circle, R.drawable.btn_inset_circle_night));
+ controls.add(createHudButton((ImageView) configureMap, R.drawable.map_layer_dark).setIconColorId(0));
configureMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -184,8 +183,7 @@ public class MapControlsLayer extends OsmandMapLayer {
});
View compass = mapActivity.findViewById(R.id.map_compass_button);
- compassHud = createHudButton((ImageView) compass, R.drawable.map_compass).setIconColorId(0).setBg(
- R.drawable.btn_inset_circle, R.drawable.btn_inset_circle_night);
+ compassHud = createHudButton((ImageView) compass, R.drawable.map_compass).setIconColorId(0);
compassHud.compass = true;
controls.add(compassHud);
compass.setOnClickListener(new View.OnClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java
index a344ae76c7..e0833a9935 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java
@@ -221,7 +221,7 @@ public class MapInfoLayer extends OsmandMapLayer {
if (!transparent && !nightMode) {
ts.textShadowColor = Color.TRANSPARENT;
}
- ts.textShadowRadius = ts.textShadowColor == 0 ? 0 : 15;
+ ts.textShadowRadius = (int) (ts.textShadowColor == 0 ? 0 : 4 * view.getDensity());
if (transparent) {
ts.boxTop = R.drawable.btn_flat_transparent;
ts.rightRes = R.drawable.btn_left_round_transparent;
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
index 2d686058d7..5cf9125524 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
@@ -168,6 +168,7 @@ public class MapInfoWidgetsFactory {
private final MapActivity map;
private View topBar;
private TextView addressText;
+ private TextView addressTextShadow;
private OsmAndLocationProvider locationProvider;
private WaypointHelper waypointHelper;
private OsmandSettings settings;
@@ -178,6 +179,7 @@ public class MapInfoWidgetsFactory {
public TopTextView(OsmandApplication app, MapActivity map) {
topBar = map.findViewById(R.id.map_top_bar);
addressText = (TextView) map.findViewById(R.id.map_address_text);
+ addressTextShadow = (TextView) map.findViewById(R.id.map_address_text_shadow);
waypointInfoBar = map.findViewById(R.id.waypoint_info_bar);
this.routingHelper = app.getRoutingHelper();
locationProvider = app.getLocationProvider();
@@ -206,9 +208,11 @@ public class MapInfoWidgetsFactory {
}
public void updateTextColor(boolean nightMode, int textColor, int textShadowColor, boolean bold, int rad) {
- updateTextColor(addressText, textColor, textShadowColor, bold, rad);
- updateTextColor((TextView) waypointInfoBar.findViewById(R.id.waypoint_text), textColor, textShadowColor,
- bold, rad);
+ TextInfoWidget.updateTextColor(addressText, addressTextShadow, textColor, textShadowColor, bold, rad);
+ TextInfoWidget.updateTextColor((TextView) waypointInfoBar.findViewById(R.id.waypoint_text),
+ (TextView) waypointInfoBar.findViewById(R.id.waypoint_text_shadow),
+ textColor, textShadowColor, bold, rad);
+
ImageView all = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_more);
ImageView remove = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_close);
all.setImageDrawable(map.getMyApplication().getIconsCache()
@@ -217,11 +221,7 @@ public class MapInfoWidgetsFactory {
.getActionBarIcon(R.drawable.ic_action_remove_dark, !nightMode));
}
- private void updateTextColor(TextView tv, int textColor, int textShadowColor, boolean textBold, int rad) {
- tv.setTextColor(textColor);
- tv.setShadowLayer(rad, 0, 0, textShadowColor);
- tv.setTypeface(Typeface.DEFAULT, textBold ? Typeface.BOLD : Typeface.NORMAL);
- }
+
public boolean updateInfo(DrawSettings d) {
String text = null;
@@ -266,22 +266,29 @@ public class MapInfoWidgetsFactory {
if(!showNextTurn && updateWaypoint()) {
updateVisibility(true);
updateVisibility(addressText, false);
+ updateVisibility(addressTextShadow, false);
} else if(text == null) {
updateVisibility(false);
} else {
updateVisibility(true);
updateVisibility(waypointInfoBar, false);
updateVisibility(addressText, true);
+ updateVisibility(addressTextShadow, true);
boolean update = turnDrawable.setTurnType(type[0]);
+
int h = addressText.getHeight() / 4 * 3;
if (h != turnDrawable.getBounds().bottom) {
turnDrawable.setBounds(0, 0, h, h);
}
if (update) {
if (type[0] != null) {
+ addressTextShadow.setCompoundDrawables(turnDrawable, null, null, null);
addressText.setCompoundDrawables(turnDrawable, null, null, null);
+ addressText.setCompoundDrawablePadding(4);
+ addressTextShadow.setCompoundDrawablePadding(4);
} else {
addressText.setCompoundDrawables(null, null, null, null);
+ addressTextShadow.setCompoundDrawables(null, null, null, null);
}
}
if (!text.equals(addressText.getText().toString())) {
@@ -291,6 +298,7 @@ public class MapInfoWidgetsFactory {
topBar.setContentDescription(map.getResources().getString(R.string.map_widget_top_text));
}
addressText.setText(text);
+ addressTextShadow.setText(text);
return true;
}
}
@@ -307,6 +315,7 @@ public class MapInfoWidgetsFactory {
return false;
} else {
updateVisibility(addressText, false);
+ updateVisibility(addressTextShadow, false);
boolean updated = updateVisibility(waypointInfoBar, true);
// pass top bar to make it clickable
WaypointDialogHelper.updatePointInfoView(map.getMyApplication(), map, topBar,
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
index 3c9b7343b2..c72c0edcd0 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
@@ -520,6 +520,7 @@ public class RouteInfoWidgetsFactory {
private OsmandSettings settings;
private ImageView lanesView;
private TextView lanesText;
+ private TextView lanesShadowText;
private OsmandApplication app;
private int dist;
private LanesDrawable lanesDrawable;
@@ -529,6 +530,7 @@ public class RouteInfoWidgetsFactory {
public LanesControl(final MapActivity map, final OsmandMapTileView view) {
lanesView = (ImageView) map.findViewById(R.id.map_lanes);
lanesText = (TextView) map.findViewById(R.id.map_lanes_dist_text);
+ lanesShadowText = (TextView) map.findViewById(R.id.map_lanes_dist_text_shadow);
centerInfo = (View) map.findViewById(R.id.map_center_info);
progress = (View) map.findViewById(R.id.map_horizontal_progress);
lanesDrawable = new LanesDrawable(map, map.getMapView().getScaleCoefficient());
@@ -541,9 +543,7 @@ public class RouteInfoWidgetsFactory {
}
public void updateTextSize(boolean isNight, int textColor, int textShadowColor, boolean textBold, int shadowRadius) {
- lanesText.setTextColor(textColor);
- lanesText.setTypeface(Typeface.DEFAULT, textBold ? Typeface.BOLD : Typeface.NORMAL);
- lanesText.setShadowLayer(shadowRadius, 0, 0, textShadowColor);
+ TextInfoWidget.updateTextColor(lanesText, lanesShadowText, textColor, textShadowColor, textBold, shadowRadius);
}
public boolean updateInfo(DrawSettings drawSettings) {
@@ -604,13 +604,17 @@ public class RouteInfoWidgetsFactory {
this.dist = dist;
if(dist == 0) {
lanesText.setText("");
+ lanesShadowText.setText("");
} else {
lanesText.setText(OsmAndFormatter.getFormattedDistance(dist, app));
+ lanesShadowText.setText(OsmAndFormatter.getFormattedDistance(dist, app));
}
lanesText.invalidate();
+ lanesShadowText.invalidate();
}
}
updateVisibility(lanesText, visible);
+ updateVisibility(lanesShadowText, visible);
updateVisibility(lanesView, visible);
updateVisibility(centerInfo, visible || progress.getVisibility() == View.VISIBLE);
return true;
@@ -715,6 +719,7 @@ public class RouteInfoWidgetsFactory {
private View layout;
private ImageView icon;
private TextView text;
+ private TextView textShadow;
private MapActivity ma;
private String cacheRulerText;
private int maxWidth;
@@ -728,13 +733,13 @@ public class RouteInfoWidgetsFactory {
layout = ma.findViewById(R.id.map_ruler_layout);
icon = (ImageView) ma.findViewById(R.id.map_ruler_image);
text = (TextView) ma.findViewById(R.id.map_ruler_text);
+ textShadow = (TextView) ma.findViewById(R.id.map_ruler_text_shadow);
maxWidth = ma.getResources().getDimensionPixelSize(R.dimen.map_ruler_width);
orientationPortrait = ScreenOrientationHelper.isOrientationPortrait(ma);
}
public void updateTextSize(boolean isNight, int textColor, int textShadowColor, int shadowRadius) {
- text.setTextColor(textColor);
- text.setShadowLayer(shadowRadius, 0, 0, textShadowColor);
+ TextInfoWidget.updateTextColor(text, textShadow, textColor, textShadowColor, false, 3);
icon.setBackgroundResource(isNight ? R.drawable.ruler_night : R.drawable.ruler);
}
@@ -759,6 +764,7 @@ public class RouteInfoWidgetsFactory {
int cacheRulerDistPix = (int) (pixDensity * roundedDist);
cacheRulerText = OsmAndFormatter.getFormattedDistance((float) roundedDist, view.getApplication());
text.setText(cacheRulerText);
+ textShadow.setText(cacheRulerText);
ViewGroup.LayoutParams lp = layout.getLayoutParams();
lp.width = cacheRulerDistPix;
layout.setLayoutParams(lp);
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/TextInfoWidget.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/TextInfoWidget.java
index fe325be093..6bedce4160 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/TextInfoWidget.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/TextInfoWidget.java
@@ -4,6 +4,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import android.app.Activity;
+import android.graphics.Paint.Style;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.view.View;
@@ -17,7 +18,9 @@ public class TextInfoWidget {
private View view;
private ImageView imageView;
private TextView textView;
+ private TextView textViewShadow;
private TextView smallTextView;
+ private TextView smallTextViewShadow;
private ImageView topImageView;
private TextView topTextView;
private boolean explicitlyVisible;
@@ -35,6 +38,8 @@ public class TextInfoWidget {
topTextView = (TextView) view.findViewById(R.id.widget_top_icon_text);
imageView = (ImageView) view.findViewById(R.id.widget_icon);
textView = (TextView) view.findViewById(R.id.widget_text);
+ textViewShadow = (TextView) view.findViewById(R.id.widget_text_shadow);
+ smallTextViewShadow = (TextView) view.findViewById(R.id.widget_text_small_shadow);
smallTextView = (TextView) view.findViewById(R.id.widget_text_small);
}
@@ -121,13 +126,17 @@ public class TextInfoWidget {
// }
if(text == null) {
textView.setText("");
+ textViewShadow.setText("");
} else {
textView.setText(text);
+ textViewShadow.setText(text);
}
if(subtext == null) {
smallTextView.setText("");
+ smallTextViewShadow.setText("");
} else {
smallTextView.setText(subtext);
+ smallTextViewShadow.setText(subtext);
}
}
@@ -172,14 +181,26 @@ public class TextInfoWidget {
}
public void updateTextColor(int textColor, int textShadowColor, boolean bold, int rad) {
- updateTextColor(smallTextView, textColor, textShadowColor, bold, rad);
- updateTextColor(textView, textColor, textShadowColor, bold, rad);
- updateTextColor(topTextView, textColor, textShadowColor, bold, rad);
+ updateTextColor(smallTextView, smallTextViewShadow, textColor, textShadowColor, bold, rad);
+ updateTextColor(textView, textViewShadow, textColor, textShadowColor, bold, rad);
+ updateTextColor(topTextView, null, textColor, textShadowColor, bold, rad);
}
- private void updateTextColor(TextView tv, int textColor, int textShadowColor, boolean textBold, int rad) {
+ public static void updateTextColor(TextView tv, TextView shadow, int textColor, int textShadowColor, boolean textBold, int rad) {
+ if(shadow != null) {
+ if(rad > 0) {
+ shadow.setVisibility(View.VISIBLE);
+ shadow.setTypeface(Typeface.DEFAULT, textBold ? Typeface.BOLD : Typeface.NORMAL);
+ shadow.getPaint().setStrokeWidth(rad);
+ shadow.getPaint().setStyle(Style.STROKE);
+ shadow.setTextColor(textShadowColor);
+// tv.getPaint().setStyle(Style.FILL);
+ } else {
+// tv.getPaint().setStyle(Style.FILL_AND_STROKE);
+ shadow.setVisibility(View.GONE);
+ }
+ }
tv.setTextColor(textColor);
- tv.setShadowLayer(rad, 0, 0, textShadowColor);
tv.setTypeface(Typeface.DEFAULT, textBold ? Typeface.BOLD : Typeface.NORMAL);
}
diff --git a/OsmAnd/src/net/osmand/plus/widgets/TextViewEx.java b/OsmAnd/src/net/osmand/plus/widgets/TextViewEx.java
index 7ce2918b8e..e6ddf2ef47 100644
--- a/OsmAnd/src/net/osmand/plus/widgets/TextViewEx.java
+++ b/OsmAnd/src/net/osmand/plus/widgets/TextViewEx.java
@@ -1,14 +1,15 @@
package net.osmand.plus.widgets;
+import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
+import android.graphics.Canvas;
import android.graphics.Typeface;
import android.os.Build;
import android.support.v7.internal.text.AllCapsTransformationMethod;
import android.util.AttributeSet;
import android.widget.TextView;
-
import net.osmand.plus.R;
import net.osmand.plus.helpers.FontCache;
@@ -71,7 +72,7 @@ public class TextViewEx extends TextView {
public static void setAllCapsCompat(TextView target, boolean allCaps) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- target.setAllCaps(allCaps);
+ updateAllCapsNewAPI(target, allCaps);
return;
}
@@ -82,6 +83,11 @@ public class TextViewEx extends TextView {
}
}
+ @SuppressLint("NewApi")
+ private static void updateAllCapsNewAPI(TextView target, boolean allCaps) {
+ target.setAllCaps(allCaps);
+ }
+
public void setAllCapsCompat(boolean allCaps) {
setAllCapsCompat(this, allCaps);
}
@@ -99,4 +105,5 @@ public class TextViewEx extends TextView {
}
setAllCapsCompat(target, true);
}
+
}