Merge pull request #9846 from osmandapp/minor_fixes

Minor UI fixes in plan route
This commit is contained in:
vshcherb 2020-09-18 16:10:24 +02:00 committed by GitHub
commit 281bf2e244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View file

@ -1960,12 +1960,14 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
setupDoneButton(view); setupDoneButton(view);
View shadow = view.getShadowView(); View shadow = view.getShadowView();
if (shadow != null) { if (shadow != null) {
shadow.setVisibility(View.GONE); AndroidUiHelper.updateVisibility(shadow, false);
} }
} }
private void setupDoneButton(TopToolbarView view) { private void setupDoneButton(TopToolbarView view) {
TextView done = view.getSaveView(); TextView done = view.getSaveView();
AndroidUiHelper.updateVisibility(done, isVisible());
Context ctx = done.getContext(); Context ctx = done.getContext();
done.setAllCaps(false); done.setAllCaps(false);
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) done.getLayoutParams(); ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) done.getLayoutParams();

View file

@ -182,13 +182,6 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
if (inMeasurementMode) { if (inMeasurementMode) {
lineAttrs.updatePaints(view.getApplication(), settings, tb); lineAttrs.updatePaints(view.getApplication(), settings, tb);
TrkSegment before = editingCtx.getBeforeTrkSegmentLine();
new Renderable.StandardTrack(new ArrayList<>(before.points), 17.2).
drawSegment(view.getZoom(), lineAttrs.paint, canvas, tb);
TrkSegment after = editingCtx.getAfterTrkSegmentLine();
new Renderable.StandardTrack(new ArrayList<>(after.points), 17.2).
drawSegment(view.getZoom(), lineAttrs.paint, canvas, tb);
if (editingCtx.isInApproximationMode()) { if (editingCtx.isInApproximationMode()) {
List<WptPt> originalTrackPointList = editingCtx.getOriginalTrackPointList(); List<WptPt> originalTrackPointList = editingCtx.getOriginalTrackPointList();
if (originalTrackPointList != null) { if (originalTrackPointList != null) {
@ -198,6 +191,15 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
drawSegment(view.getZoom(), lineAttrs.customColorPaint, canvas, tb); drawSegment(view.getZoom(), lineAttrs.customColorPaint, canvas, tb);
} }
} }
TrkSegment before = editingCtx.getBeforeTrkSegmentLine();
new Renderable.StandardTrack(new ArrayList<>(before.points), 17.2).
drawSegment(view.getZoom(), lineAttrs.paint, canvas, tb);
TrkSegment after = editingCtx.getAfterTrkSegmentLine();
new Renderable.StandardTrack(new ArrayList<>(after.points), 17.2).
drawSegment(view.getZoom(), lineAttrs.paint, canvas, tb);
drawPoints(canvas, tb); drawPoints(canvas, tb);
} }
} }
@ -206,7 +208,9 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL
public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings settings) { public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {
if (inMeasurementMode) { if (inMeasurementMode) {
lineAttrs.updatePaints(view.getApplication(), settings, tb); lineAttrs.updatePaints(view.getApplication(), settings, tb);
drawBeforeAfterPath(canvas, tb); if (!editingCtx.isInApproximationMode()) {
drawBeforeAfterPath(canvas, tb);
}
if (editingCtx.getSelectedPointPosition() == -1) { if (editingCtx.getSelectedPointPosition() == -1) {
drawCenterIcon(canvas, tb, settings.isNightMode()); drawCenterIcon(canvas, tb, settings.isNightMode());

View file

@ -148,7 +148,7 @@ public class SnapTrackWarningFragment extends BaseOsmAndFragment {
} }
}); });
UiUtilities.setupDialogButton(nightMode, cancelButton, SECONDARY, R.string.shared_string_cancel); UiUtilities.setupDialogButton(nightMode, cancelButton, SECONDARY, R.string.shared_string_cancel);
UiUtilities.setupDialogButton(nightMode, applyButton, PRIMARY, R.string.shared_string_apply); UiUtilities.setupDialogButton(nightMode, applyButton, PRIMARY, R.string.shared_string_continue);
AndroidUiHelper.updateVisibility(applyButton, true); AndroidUiHelper.updateVisibility(applyButton, true);
AndroidUiHelper.updateVisibility(view.findViewById(R.id.buttons_divider), true); AndroidUiHelper.updateVisibility(view.findViewById(R.id.buttons_divider), true);
} }