Update text visibility in routing mode
This commit is contained in:
parent
c06b390993
commit
bbaeeaa0d8
4 changed files with 19 additions and 9 deletions
|
@ -134,7 +134,7 @@ public class MainMenuActivity extends Activity {
|
|||
SharedPreferences prefs = activity.getApplicationContext().getSharedPreferences("net.osmand.settings", MODE_WORLD_READABLE);
|
||||
|
||||
// only one commit should be with contribution version flag
|
||||
// prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit();
|
||||
// prefs.edit().putBoolean(CONTRIBUTION_VERSION_FLAG, true).commit();
|
||||
if (prefs.contains(CONTRIBUTION_VERSION_FLAG)) {
|
||||
SpannableString content = new SpannableString(textVersion);
|
||||
content.setSpan(new ClickableSpan() {
|
||||
|
|
|
@ -718,7 +718,7 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
}
|
||||
|
||||
// location not null!
|
||||
private void updateSpeedBearing(Location location) {
|
||||
private void updateSpeedBearingEmulator(Location location) {
|
||||
// For network/gps it's bad way (not accurate). It's widely used for testing purposes
|
||||
// possibly keep using only for emulator case
|
||||
PointLocationLayer locationLayer = mapLayers.getLocationLayer();
|
||||
|
@ -768,12 +768,12 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
updateSpeedBearing(location);
|
||||
// only for emulator
|
||||
updateSpeedBearingEmulator(location);
|
||||
}
|
||||
|
||||
boolean enableSensorNavigation = routingHelper.isFollowingMode() && location != null?
|
||||
location.hasBearing() : false;
|
||||
boolean enableSensorNavigation = routingHelper.isFollowingMode() ?
|
||||
location == null || !location.hasBearing() : false;
|
||||
registerUnregisterSensor(location, enableSensorNavigation);
|
||||
|
||||
if(routingHelper.isFollowingMode()){
|
||||
|
|
|
@ -211,7 +211,9 @@ public class RoutingHelper {
|
|||
locationProjection.setLongitude(project.getLongitude());
|
||||
float bearingTo = locationProjection.bearingTo(nextLocation);
|
||||
// we need to update bearing too
|
||||
locationProjection.setBearing(bearingTo);
|
||||
if(locationProjection.hasBearing()) {
|
||||
locationProjection.setBearing(bearingTo);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 3. Identify wrong movement direction (very similar to 2?)
|
||||
|
|
|
@ -98,14 +98,14 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
paintSmallText = new Paint();
|
||||
paintSmallText.setStyle(Style.FILL_AND_STROKE);
|
||||
paintSmallText.setColor(Color.BLACK);
|
||||
paintSmallText.setTextSize(15 * scaleCoefficient);
|
||||
paintSmallText.setTextSize(18 * scaleCoefficient);
|
||||
paintSmallText.setAntiAlias(true);
|
||||
paintSmallText.setStrokeWidth(4);
|
||||
|
||||
paintSmallSubText = new Paint();
|
||||
paintSmallSubText.setStyle(Style.FILL_AND_STROKE);
|
||||
paintSmallSubText.setColor(Color.BLACK);
|
||||
paintSmallSubText.setTextSize(12 * scaleCoefficient);
|
||||
paintSmallSubText.setTextSize(13 * scaleCoefficient);
|
||||
paintSmallSubText.setAntiAlias(true);
|
||||
|
||||
paintImg = new Paint();
|
||||
|
@ -207,6 +207,14 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
|
||||
@Override
|
||||
public void onDraw(Canvas canvas, RectF latlonBounds, RectF tilesRect, DrawSettings nightMode) {
|
||||
boolean bold = routeLayer.getHelper().isFollowingMode();
|
||||
if(paintText.isFakeBoldText() != bold) {
|
||||
// TODO night view
|
||||
paintText.setFakeBoldText(true);
|
||||
paintSubText.setFakeBoldText(true);
|
||||
paintSmallText.setFakeBoldText(true);
|
||||
paintSmallSubText.setFakeBoldText(true);
|
||||
}
|
||||
// update data on draw
|
||||
rightStack.updateInfo();
|
||||
leftStack.updateInfo();
|
||||
|
|
Loading…
Reference in a new issue