From d190f7e3b1e09e0dff17847cb65f4795c4e13695 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Tue, 10 Oct 2017 12:02:53 +0300 Subject: [PATCH] Fix snap to road after opening in full screen; fix UI --- OsmAnd/res/layout/plan_route_toolbar_and_up_down_row.xml | 4 ---- .../src/net/osmand/plus/mapmarkers/PlanRouteFragment.java | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/layout/plan_route_toolbar_and_up_down_row.xml b/OsmAnd/res/layout/plan_route_toolbar_and_up_down_row.xml index e4588da4df..900a8c58c3 100644 --- a/OsmAnd/res/layout/plan_route_toolbar_and_up_down_row.xml +++ b/OsmAnd/res/layout/plan_route_toolbar_and_up_down_row.xml @@ -109,9 +109,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginEnd="@dimen/measurement_tool_text_margin_small" - android:layout_marginLeft="@dimen/measurement_tool_text_margin" android:layout_marginRight="@dimen/measurement_tool_text_margin_small" - android:layout_marginStart="@dimen/measurement_tool_text_margin" android:ellipsize="end" android:maxLines="1" android:textAppearance="@style/TextAppearance.ListItemTitle" @@ -134,8 +132,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginLeft="@dimen/measurement_tool_text_margin" - android:layout_marginStart="@dimen/measurement_tool_text_margin" android:ellipsize="end" android:maxLines="1" android:textColor="?android:textColorSecondary" diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index 2e3e50aa86..0cb5412410 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -78,6 +78,7 @@ public class PlanRouteFragment extends Fragment { private boolean nightMode; private boolean portrait; private boolean wasCollapseButtonVisible; + private boolean cancelSnapToRoad = true; private View mainView; private RecyclerView markersRv; @@ -305,7 +306,7 @@ public class PlanRouteFragment extends Fragment { } }); boolean isSmartphone = getResources().getConfiguration().smallestScreenWidthDp < 600; - markersRv.setPadding(0, 0, 0, AndroidUtils.dpToPx(mapActivity, isSmartphone ? 72 : 108)); + markersRv.setPadding(0, 0, 0, AndroidUtils.dpToPx(mapActivity, isSmartphone ? 8 : 12)); markersRv.setClipToPadding(false); markersRv.setLayoutManager(new LinearLayoutManager(getContext())); markersRv.setAdapter(adapter); @@ -539,7 +540,9 @@ public class PlanRouteFragment extends Fragment { mapActivity.getMapView().setMapPosition(previousMapPosition); - planRouteContext.cancelSnapToRoad(); + if (cancelSnapToRoad) { + planRouteContext.cancelSnapToRoad(); + } markersLayer.setRoute(null); mapActivity.refreshMap(); } @@ -610,6 +613,7 @@ public class PlanRouteFragment extends Fragment { private void showHideMarkersList() { MapActivity mapActivity = getMapActivity(); if (mapActivity != null && portrait) { + cancelSnapToRoad = false; planRouteContext.setMarkersListOpened(!planRouteContext.isMarkersListOpened()); int containerRes = planRouteContext.isMarkersListOpened() ? R.id.fragmentContainer : R.id.bottomFragmentContainer; mapActivity.getSupportFragmentManager().beginTransaction()