Fix wrong text color and distance in top bar waypoint
This commit is contained in:
parent
b1a268d978
commit
e0d85fdfb5
2 changed files with 8 additions and 6 deletions
|
@ -85,11 +85,13 @@ public class WaypointDialogHelper {
|
||||||
public static void updatePointInfoView(final OsmandApplication app, final Activity activity,
|
public static void updatePointInfoView(final OsmandApplication app, final Activity activity,
|
||||||
View localView, final LocationPointWrapper ps,
|
View localView, final LocationPointWrapper ps,
|
||||||
final boolean mapCenter, final boolean nightMode,
|
final boolean mapCenter, final boolean nightMode,
|
||||||
final boolean edit) {
|
final boolean edit, final boolean topBar) {
|
||||||
WaypointHelper wh = app.getWaypointHelper();
|
WaypointHelper wh = app.getWaypointHelper();
|
||||||
final LocationPoint point = ps.getPoint();
|
final LocationPoint point = ps.getPoint();
|
||||||
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
|
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
|
||||||
AndroidUtils.setTextPrimaryColor(activity, text, nightMode);
|
if (!topBar) {
|
||||||
|
AndroidUtils.setTextPrimaryColor(activity, text, nightMode);
|
||||||
|
}
|
||||||
TextView textShadow = (TextView) localView.findViewById(R.id.waypoint_text_shadow);
|
TextView textShadow = (TextView) localView.findViewById(R.id.waypoint_text_shadow);
|
||||||
if (!edit) {
|
if (!edit) {
|
||||||
localView.setOnClickListener(new View.OnClickListener() {
|
localView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -138,7 +140,7 @@ public class WaypointDialogHelper {
|
||||||
if (dist > 0) {
|
if (dist > 0) {
|
||||||
String dd = OsmAndFormatter.getFormattedDistance(dist, app);
|
String dd = OsmAndFormatter.getFormattedDistance(dist, app);
|
||||||
if (ps.deviationDistance > 0) {
|
if (ps.deviationDistance > 0) {
|
||||||
dd += " +" + OsmAndFormatter.getFormattedDistance(ps.deviationDistance, app);
|
dd += (topBar ? "\n" : " ") + "+" + OsmAndFormatter.getFormattedDistance(ps.deviationDistance, app);
|
||||||
}
|
}
|
||||||
textDist.setText(dd);
|
textDist.setText(dd);
|
||||||
if (!Algorithms.isEmpty(pointDescription)) {
|
if (!Algorithms.isEmpty(pointDescription)) {
|
||||||
|
@ -351,7 +353,7 @@ public class WaypointDialogHelper {
|
||||||
if (v == null || v.findViewById(R.id.info_close) == null) {
|
if (v == null || v.findViewById(R.id.info_close) == null) {
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
||||||
}
|
}
|
||||||
updatePointInfoView(app, ctx, v, point, true, nightMode, edit);
|
updatePointInfoView(app, ctx, v, point, true, nightMode, edit, false);
|
||||||
final View more = v.findViewById(R.id.all_points);
|
final View more = v.findViewById(R.id.all_points);
|
||||||
final View move = v.findViewById(R.id.info_move);
|
final View move = v.findViewById(R.id.info_move);
|
||||||
final View remove = v.findViewById(R.id.info_close);
|
final View remove = v.findViewById(R.id.info_close);
|
||||||
|
|
|
@ -320,8 +320,8 @@ public class MapInfoWidgetsFactory {
|
||||||
updateVisibility(addressTextShadow, false);
|
updateVisibility(addressTextShadow, false);
|
||||||
boolean updated = updateVisibility(waypointInfoBar, true);
|
boolean updated = updateVisibility(waypointInfoBar, true);
|
||||||
// pass top bar to make it clickable
|
// pass top bar to make it clickable
|
||||||
WaypointDialogHelper.updatePointInfoView(map.getMyApplication(), map, topBar,
|
WaypointDialogHelper.updatePointInfoView(map.getMyApplication(), map, topBar, pnt, true,
|
||||||
pnt, true, !map.getMyApplication().getSettings().isLightContent(), false);
|
map.getMyApplication().getDaynightHelper().isNightModeForMapControls(), false, true);
|
||||||
if (updated || changed) {
|
if (updated || changed) {
|
||||||
ImageView all = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_more);
|
ImageView all = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_more);
|
||||||
ImageView remove = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_close);
|
ImageView remove = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_close);
|
||||||
|
|
Loading…
Reference in a new issue