Fix snap to road after opening in full screen; fix UI

This commit is contained in:
Alexander Sytnyk 2017-10-10 12:02:53 +03:00
parent f2a1da4ed7
commit d190f7e3b1
2 changed files with 6 additions and 6 deletions

View file

@ -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"

View file

@ -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()