From 2dbf04b7daa8127fca0f04abfc54b0c40a52bfa3 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 27 Oct 2017 19:03:57 +0300 Subject: [PATCH] Fixes --- .../fragment_coordinate_input_dialog.xml | 6 + .../fragment_coordinate_input_dialog.xml | 6 + .../net/osmand/plus/OsmandTextFieldBoxes.java | 11 +- ...rdinateInputBottomSheetDialogFragment.java | 8 +- .../CoordinateInputDialogFragment.java | 105 +++++++++++------- .../adapters/CoordinateInputAdapter.java | 19 ---- 6 files changed, 81 insertions(+), 74 deletions(-) diff --git a/OsmAnd/res/layout-land/fragment_coordinate_input_dialog.xml b/OsmAnd/res/layout-land/fragment_coordinate_input_dialog.xml index 3e80714dbf..6ae140aa0a 100644 --- a/OsmAnd/res/layout-land/fragment_coordinate_input_dialog.xml +++ b/OsmAnd/res/layout-land/fragment_coordinate_input_dialog.xml @@ -37,6 +37,12 @@ android:layout_marginRight="16dp" android:layout_marginEnd="16dp"/> + + + + 0 ? mapMarkers.get(mapMarkers.size() - 1).colorIndex : -1; + if (colorIndex == -1) { + colorIndex = 0; + } else { + colorIndex = (colorIndex + 1) % MAP_MARKERS_COLORS_COUNT; + } + MapMarker mapMarker = new MapMarker(latLon, pointDescription, colorIndex, false, 0); + mapMarker.history = false; + mapMarker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE; + mapMarkers.add(mapMarker); + adapter.notifyDataSetChanged(); + } + private MapActivity getMapActivity() { return (MapActivity) getActivity(); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/CoordinateInputAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/CoordinateInputAdapter.java index 77e8cc44bc..88a80266b2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/CoordinateInputAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/CoordinateInputAdapter.java @@ -7,19 +7,15 @@ import android.view.View; import android.view.ViewGroup; import net.osmand.data.LatLon; -import net.osmand.data.PointDescription; import net.osmand.plus.IconsCache; import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.DashLocationFragment; import net.osmand.plus.helpers.AndroidUiHelper; -import net.osmand.plus.mapmarkers.MapMarkersDbHelper; import java.util.List; -import static net.osmand.plus.MapMarkersHelper.MAP_MARKERS_COLORS_COUNT; - public class CoordinateInputAdapter extends RecyclerView.Adapter { private MapActivity mapActivity; @@ -118,19 +114,4 @@ public class CoordinateInputAdapter extends RecyclerView.Adapter 0 ? mapMarkers.get(mapMarkers.size() - 1).colorIndex : -1; - if (colorIndex == -1) { - colorIndex = 0; - } else { - colorIndex = (colorIndex + 1) % MAP_MARKERS_COLORS_COUNT; - } - MapMarker mapMarker = new MapMarker(latLon, pointDescription, colorIndex, false, 0); - mapMarker.history = false; - mapMarker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE; - mapMarkers.add(mapMarker); - notifyDataSetChanged(); - } }