From e84a42173db657c83bda0d140cc1ad26350a1241 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Wed, 23 Sep 2015 15:21:01 +0200 Subject: [PATCH 1/6] Translated using Weblate (Italian) Currently translated at 99.9% (1777 of 1778 strings) --- OsmAnd/res/values-it/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index bf78a1af6d..c3e4957b9e 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -2178,4 +2178,5 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Conteggio delle linee Sei sicuro? Tutte le modifiche non salvate andranno perse. Continuare? - +Arresta la simulazione del percorso + From 2d390e66c0ee52ac1dabc3565e37c13d25ba4017 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 23 Sep 2015 15:23:08 +0200 Subject: [PATCH 2/6] Fix build --- .../net/osmand/plus/development/SettingsDevelopmentActivity.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java index bae056dfe4..c7c8d61a21 100644 --- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java @@ -67,7 +67,6 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity { pref.setTitle(R.string.simulate_your_location); updateTitle.run(); pref.setKey("simulate_your_location"); - sim.isRouteAnimating() pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { From ea12dc135462c3be5c35bb8ce937c82ba76dd286 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Wed, 23 Sep 2015 15:23:18 +0200 Subject: [PATCH 3/6] Translated using Weblate (Italian) Currently translated at 100.0% (1779 of 1779 strings) --- OsmAnd/res/values-it/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index c3e4957b9e..444c2c450f 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -2179,4 +2179,6 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Sei sicuro? Tutte le modifiche non salvate andranno perse. Continuare? Arresta la simulazione del percorso - + Simula utilizzando un GPX registrato o una percorso calcolato + %1$s download rimanenti + From c07f1d2d6a7bcced2eb9b787579db7b863586008 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Wed, 23 Sep 2015 15:26:45 +0200 Subject: [PATCH 4/6] Translated using Weblate (Italian) Currently translated at 100.0% (1779 of 1779 strings) --- OsmAnd/res/values-it/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 444c2c450f..d4eb1e7ffe 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -2102,7 +2102,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Gallego Estone Cebuano - Colore GPX + Colore traccia GPX Spessore traccia GPX Rosso traslucido Arancione traslucido From f1f192940957cd6c1b201054ab3bb28e55fa1b9d Mon Sep 17 00:00:00 2001 From: jan madsen Date: Wed, 23 Sep 2015 15:41:44 +0200 Subject: [PATCH 5/6] Translated using Weblate (Danish) Currently translated at 100.0% (1779 of 1779 strings) --- OsmAnd/res/values-da/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 1e5b0f01c5..13f5666328 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -2134,4 +2134,7 @@ Adressen kendes endnu ikke Eventuelle ikke-gemte ændringer vil gå tabt. Fortsæt? Sikker? - + Stop simulering af position + Simuler ved brug af indspillet GPX eller beregnet rute + %1$s downloads tilbage + From cfc260b921ffbed637f8767d307fd29310c18df1 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 23 Sep 2015 16:58:17 +0300 Subject: [PATCH 6/6] Context menu - use big icons scaled to 24dp --- OsmAnd/src/net/osmand/plus/IconsCache.java | 36 ++++++++++++++++--- .../plus/mapcontextmenu/MapContextMenu.java | 14 ++++---- .../MapContextMenuFragment.java | 2 +- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/IconsCache.java b/OsmAnd/src/net/osmand/plus/IconsCache.java index 3aede0382d..e62d3e5637 100644 --- a/OsmAnd/src/net/osmand/plus/IconsCache.java +++ b/OsmAnd/src/net/osmand/plus/IconsCache.java @@ -1,7 +1,11 @@ package net.osmand.plus; +import android.graphics.Bitmap; import android.graphics.PorterDuff; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; +import android.graphics.drawable.ScaleDrawable; +import android.view.Gravity; import gnu.trove.map.hash.TLongObjectHashMap; @@ -13,13 +17,33 @@ public class IconsCache { public IconsCache(OsmandApplication app) { this.app = app; } - - + + public Drawable scaleImage(Drawable image, float scaleFactor) { + if ((image == null) || !(image instanceof BitmapDrawable)) { + return image; + } + Bitmap b = ((BitmapDrawable)image).getBitmap(); + + int sizeX = Math.round(image.getIntrinsicWidth() * scaleFactor); + int sizeY = Math.round(image.getIntrinsicHeight() * scaleFactor); + + Bitmap bitmapResized = Bitmap.createScaledBitmap(b, sizeX, sizeY, false); + return new BitmapDrawable(app.getResources(), bitmapResized); + } + private Drawable getDrawable(int resId, int clrId) { - long hash = ((long)resId << 31l) + clrId; + return getDrawable(resId, clrId, 0); + } + + private Drawable getDrawable(int resId, int clrId, float scale) { + long hash = ((long)resId << 31l) + clrId + (int)(scale * 10000f); Drawable d = drawable.get(hash); if(d == null) { - d = app.getResources().getDrawable(resId).mutate(); + if (scale > 0) { + d = scaleImage(app.getResources().getDrawable(resId).mutate(), scale); + } else { + d = app.getResources().getDrawable(resId).mutate(); + } d.clearColorFilter(); if (clrId != 0) { d.setColorFilter(app.getResources().getColor(clrId), PorterDuff.Mode.SRC_IN); @@ -49,12 +73,14 @@ public class IconsCache { return getDrawable(id, colorId); } + public Drawable getIcon(int id, int colorId, float scale) { + return getDrawable(id, colorId, scale); + } public Drawable getContentIcon(int id) { return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color : 0); } - public Drawable getIcon(int id) { return getDrawable(id, 0); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3724e1172e..958a907842 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -80,7 +80,7 @@ public class MapContextMenu { typeStr = null; streetStr = null; - acquireLeftIconId(); + acquireLeftIcon(); acquireNameAndType(); acquireStreetName(new LatLon(pointDescription.getLat(), pointDescription.getLon())); @@ -123,7 +123,7 @@ public class MapContextMenu { return streetStr; } - private void acquireLeftIconId() { + private void acquireLeftIcon() { leftIconId = 0; if (object != null) { if (object instanceof Amenity) { @@ -131,17 +131,14 @@ public class MapContextMenu { Amenity o = (Amenity) object; PoiType st = o.getType().getPoiTypeByKeyName(o.getSubType()); if (st != null) { - if (RenderingIcons.containsSmallIcon(st.getIconKeyName())) { + if (RenderingIcons.containsBigIcon(st.getIconKeyName())) { id = st.getIconKeyName(); - } else if (RenderingIcons.containsSmallIcon(st.getOsmTag() + "_" + st.getOsmValue())) { + } else if (RenderingIcons.containsBigIcon(st.getOsmTag() + "_" + st.getOsmValue())) { id = st.getOsmTag() + "_" + st.getOsmValue(); } } if (id != null) { - Integer resId = RenderingIcons.getResId(id); - if (resId != null) { - leftIconId = resId; - } + leftIconId = RenderingIcons.getBigIconResourceId(id); } } } @@ -292,5 +289,6 @@ public class MapContextMenu { if (streetStrObj != null) { streetStr = streetStrObj.toString(); } + acquireLeftIcon(); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 68efeec01a..8e0c9279b4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -327,7 +327,7 @@ public class MapContextMenuFragment extends Fragment { iconLayout.setVisibility(View.GONE); } else { iconView.setImageDrawable(iconsCache.getIcon(iconId, - light ? R.color.osmand_orange : R.color.osmand_orange_dark)); + light ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); } setAddressLocation();