From 17e6ed00e3f05aebabeac503a8e3d91de5d9cc14 Mon Sep 17 00:00:00 2001 From: Leif Larsson Date: Wed, 11 Nov 2015 15:54:40 +0100 Subject: [PATCH 1/3] Translated using Weblate (Swedish) Currently translated at 99.3% (1797 of 1809 strings) --- OsmAnd/res/values-sv/strings.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index e6b6a9fa51..785eb1d253 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -1,4 +1,4 @@ - + För att låsa upp skärmen tryck på låsikonen Välj land @@ -1969,4 +1969,8 @@ Läs mer Nyheter Dölj föreslagna objekt - +Lågtyska + Makedonska + Frisiska + Albanska (Toskiska) + From f08489f5c2fca0aeb929ffbb342f152b6935b2ac Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Wed, 11 Nov 2015 18:07:27 +0200 Subject: [PATCH 2/3] Secondary color --- OsmAnd/res/values/styles.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index ec0eebe927..83ec7de0e1 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -114,7 +114,7 @@ @style/OsmandLightTheme.DarkActionbar @style/OsmandLightTheme.Toolbar @style/OsmandLightTheme.NewAppTheme - @color/dashboard_black + @color/icon_color @color/map_widget_blue @@ -207,7 +207,7 @@ @style/OsmandDarkTheme.DarkActionbar @style/OsmandDarkTheme @style/OsmandDarkTheme - @color/map_widget_light + @color/dash_search_icon_dark @color/osmand_orange From 3c6d2398b49cfc52e9140d197668f394e757bd4f Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 11 Nov 2015 19:08:13 +0300 Subject: [PATCH 3/3] Fix bug with context menu on the center of screen --- .../plus/mapcontextmenu/MapContextMenu.java | 21 ++++++++-------- .../MapContextMenuFragment.java | 25 +++++++++++++++---- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3b567f7a05..af620089f4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -7,7 +7,6 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.ContextMenuAdapter; -import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities.WptPt; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; @@ -520,21 +519,23 @@ public class MapContextMenu extends MenuTitleController { } public void updateMyLocation(net.osmand.Location location) { - if (location != null) { + if (location != null && active && displayDistanceDirection()) { myLocation = new LatLon(location.getLatitude(), location.getLongitude()); updateLocation(false, true, false); } } public void updateCompassValue(float value) { - // 99 in next line used to one-time initialize arrows (with reference vs. fixed-north direction) - // on non-compass devices - float lastHeading = heading != null ? heading : 99; - heading = value; - if (Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 5) { - updateLocation(false, false, true); - } else { - heading = lastHeading; + if (active && displayDistanceDirection()) { + // 99 in next line used to one-time initialize arrows (with reference vs. fixed-north direction) + // on non-compass devices + float lastHeading = heading != null ? heading : 99; + heading = value; + if (Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 5) { + updateLocation(false, false, true); + } else { + heading = lastHeading; + } } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 18bb4ab1c1..1de2edb66a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -74,6 +74,9 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { private int menuFullHeight; private int menuFullHeightMax; + private int screenHeight; + private int viewHeight; + private int fabPaddingTopPx; private int markerPaddingPx; private int markerPaddingXPx; @@ -126,6 +129,9 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + screenHeight = getScreenHeight(); + viewHeight = screenHeight - getStatusBarHeight(); + fabPaddingTopPx = dpToPx(FAB_PADDING_TOP_DP); markerPaddingPx = dpToPx(MARKER_PADDING_DP); markerPaddingXPx = dpToPx(MARKER_PADDING_X_DP); @@ -704,26 +710,26 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { private int getPosY(boolean needCloseMenu) { if (needCloseMenu) { - return getScreenHeight(); + return screenHeight; } int destinationState; int minHalfY; if (menu.isExtended()) { destinationState = menu.getCurrentMenuState(); - minHalfY = view.getHeight() - (int)(view.getHeight() * menu.getHalfScreenMaxHeightKoef()); + minHalfY = viewHeight - (int)(viewHeight * menu.getHalfScreenMaxHeightKoef()); } else { destinationState = MenuController.MenuState.HEADER_ONLY; - minHalfY = view.getHeight(); + minHalfY = viewHeight; } int posY = 0; switch (destinationState) { case MenuController.MenuState.HEADER_ONLY: - posY = view.getHeight() - (menuTitleHeight - dpToPx(SHADOW_HEIGHT_BOTTOM_DP)); + posY = viewHeight - (menuTitleHeight - dpToPx(SHADOW_HEIGHT_BOTTOM_DP)); break; case MenuController.MenuState.HALF_SCREEN: - posY = view.getHeight() - menuFullHeightMax; + posY = viewHeight - menuFullHeightMax; posY = Math.max(posY, minHalfY); break; case MenuController.MenuState.FULL_SCREEN: @@ -925,6 +931,15 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { return dm.heightPixels; } + public int getStatusBarHeight() { + int result = 0; + int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = getResources().getDimensionPixelSize(resourceId); + } + return result; + } + public void updateLocation(boolean centerChanged, boolean locationChanged, boolean compassChanged) { updateDistanceDirection(); }