From c9f963bb85d4432f44a9b06ce0e507e6c1d8cd06 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 29 Apr 2020 19:53:02 +0300 Subject: [PATCH 01/37] Add support for icons in custom regions --- .../src/net/osmand/plus/AppInitializer.java | 8 +- OsmAnd/src/net/osmand/plus/CustomRegion.java | 5 + .../download/ui/DownloadGroupViewHolder.java | 43 ++-- .../ui/DownloadResourceGroupAdapter.java | 157 +++++++++++++ .../ui/DownloadResourceGroupFragment.java | 211 ------------------ .../net/osmand/plus/helpers/ImportHelper.java | 6 + .../settings/ImportDuplicatesFragment.java | 6 +- 7 files changed, 201 insertions(+), 235 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupAdapter.java diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 6159afb6f5..4a63e3efdf 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -14,6 +14,8 @@ import android.content.res.Resources; import android.os.AsyncTask; import android.os.Build; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import net.osmand.AndroidUtils; @@ -617,7 +619,7 @@ public class AppInitializer implements IProgress { }); } - public static void loadRoutingFiles(final OsmandApplication app, final LoadRoutingFilesCallback callback) { + public static void loadRoutingFiles(@NonNull final OsmandApplication app, @Nullable final LoadRoutingFilesCallback callback) { new AsyncTask>() { @Override @@ -653,7 +655,9 @@ public class AppInitializer implements IProgress { app.getCustomRoutingConfigs().putAll(customConfigs); } app.avoidSpecificRoads.initRouteObjects(false); - callback.onRoutingFilesLoaded(); + if (callback != null) { + callback.onRoutingFilesLoaded(); + } } private Map getDefaultAttributes() { diff --git a/OsmAnd/src/net/osmand/plus/CustomRegion.java b/OsmAnd/src/net/osmand/plus/CustomRegion.java index c2357f1c82..aa37aad322 100644 --- a/OsmAnd/src/net/osmand/plus/CustomRegion.java +++ b/OsmAnd/src/net/osmand/plus/CustomRegion.java @@ -83,6 +83,10 @@ public class CustomRegion extends WorldRegion { return descriptionInfo; } + public String getIconName(Context ctx) { + return JsonUtils.getLocalizedResFromMap(ctx, icons, null); + } + public static CustomRegion fromJson(@NonNull Context ctx, JSONObject object) throws JSONException { String scopeId = object.optString("scope-id", null); String path = object.optString("path", null); @@ -216,6 +220,7 @@ public class CustomRegion extends WorldRegion { if ("json".equalsIgnoreCase(dynamicDownloadItems.format)) { dynamicItemsJson = mapJsonItems(result); } + app.getDownloadThread().runReloadIndexFilesSilent(); } } }; diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java index 2c5547fc83..da4e1b1ce1 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java @@ -5,17 +5,22 @@ import android.view.View; import android.widget.TextView; import net.osmand.AndroidUtils; -import net.osmand.plus.UiUtilities; +import net.osmand.plus.CustomRegion; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadActivityType; import net.osmand.plus.download.DownloadResourceGroup; +import net.osmand.plus.download.DownloadResourceGroup.DownloadResourceGroupType; import net.osmand.plus.download.IndexItem; public class DownloadGroupViewHolder { - TextView textView; + private DownloadActivity ctx; + private TextView textView; + public DownloadGroupViewHolder(DownloadActivity ctx, View v) { this.ctx = ctx; textView = (TextView) v.findViewById(R.id.title); @@ -23,23 +28,30 @@ public class DownloadGroupViewHolder { private boolean isParentWorld(DownloadResourceGroup group) { return group.getParentGroup() == null - || group.getParentGroup().getType() == DownloadResourceGroup.DownloadResourceGroupType.WORLD; + || group.getParentGroup().getType() == DownloadResourceGroupType.WORLD; } private Drawable getIconForGroup(DownloadResourceGroup group) { Drawable iconStart; - if (group.getType() == DownloadResourceGroup.DownloadResourceGroupType.VOICE_REC - || group.getType() == DownloadResourceGroup.DownloadResourceGroupType.VOICE_TTS) { - iconStart = ctx.getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_volume_up); - } else if (group.getType() == DownloadResourceGroup.DownloadResourceGroupType.FONTS) { - iconStart = ctx.getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_map_language); + OsmandApplication app = ctx.getMyApplication(); + UiUtilities cache = app.getUIUtilities(); + if (group.getType() == DownloadResourceGroupType.VOICE_REC + || group.getType() == DownloadResourceGroupType.VOICE_TTS) { + iconStart = cache.getThemedIcon(R.drawable.ic_action_volume_up); + } else if (group.getType() == DownloadResourceGroupType.FONTS) { + iconStart = cache.getThemedIcon(R.drawable.ic_action_map_language); } else { - UiUtilities cache = ctx.getMyApplication().getUIUtilities(); + if (group.getRegion() instanceof CustomRegion) { + String iconName = ((CustomRegion) group.getRegion()).getIconName(ctx); + int iconId = AndroidUtils.getDrawableId(app, iconName); + if (iconId != 0) { + return cache.getThemedIcon(iconId); + } + } if (isParentWorld(group) || isParentWorld(group.getParentGroup())) { iconStart = cache.getThemedIcon(R.drawable.ic_world_globe_dark); } else { - DownloadResourceGroup ggr = group - .getSubGroupById(DownloadResourceGroup.DownloadResourceGroupType.REGION_MAPS.getDefaultId()); + DownloadResourceGroup ggr = group.getSubGroupById(DownloadResourceGroupType.REGION_MAPS.getDefaultId()); iconStart = cache.getThemedIcon(R.drawable.ic_map); if (ggr != null && ggr.getIndividualResources() != null) { IndexItem item = null; @@ -53,11 +65,8 @@ public class DownloadGroupViewHolder { } } if (item != null) { - if (item.isOutdated()) { - iconStart = cache.getIcon(R.drawable.ic_map, R.color.color_distance); - } else { - iconStart = cache.getIcon(R.drawable.ic_map, R.color.color_ok); - } + int color = item.isOutdated() ? R.color.color_distance : R.color.color_ok; + iconStart = cache.getIcon(R.drawable.ic_map, color); } } } @@ -71,4 +80,4 @@ public class DownloadGroupViewHolder { Drawable iconStart = getIconForGroup(group); AndroidUtils.setCompoundDrawablesWithIntrinsicBounds(textView, iconStart, null, null, null); } -} +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupAdapter.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupAdapter.java new file mode 100644 index 0000000000..a212dd5e31 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupAdapter.java @@ -0,0 +1,157 @@ +package net.osmand.plus.download.ui; + +import android.content.res.Resources; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import net.osmand.plus.R; +import net.osmand.plus.activities.OsmandBaseExpandableListAdapter; +import net.osmand.plus.download.CustomIndexItem; +import net.osmand.plus.download.DownloadActivity; +import net.osmand.plus.download.DownloadResourceGroup; +import net.osmand.plus.download.IndexItem; + +import java.util.ArrayList; +import java.util.List; + +public class DownloadResourceGroupAdapter extends OsmandBaseExpandableListAdapter { + + private List data = new ArrayList(); + private DownloadActivity ctx; + private DownloadResourceGroup mainGroup; + + + public DownloadResourceGroupAdapter(DownloadActivity ctx) { + this.ctx = ctx; + } + + public void update(DownloadResourceGroup mainGroup) { + this.mainGroup = mainGroup; + data = mainGroup.getGroups(); + notifyDataSetChanged(); + } + + @Override + public Object getChild(int groupPosition, int childPosition) { + DownloadResourceGroup drg = data.get(groupPosition); + if (drg.getType().containsIndexItem()) { + return drg.getItemByIndex(childPosition); + } + return drg.getGroupByIndex(childPosition); + } + + @Override + public long getChildId(int groupPosition, int childPosition) { + return groupPosition * 10000 + childPosition; + } + + @Override + public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, + View convertView, ViewGroup parent) { + final Object child = getChild(groupPosition, childPosition); + if (child instanceof IndexItem) { + + IndexItem item = (IndexItem) child; + DownloadResourceGroup group = getGroupObj(groupPosition); + ItemViewHolder viewHolder; + if (convertView != null && convertView.getTag() instanceof ItemViewHolder) { + viewHolder = (ItemViewHolder) convertView.getTag(); + } else { + convertView = LayoutInflater.from(parent.getContext()).inflate( + R.layout.two_line_with_images_list_item, parent, false); + viewHolder = new ItemViewHolder(convertView, ctx); + viewHolder.setShowRemoteDate(true); + convertView.setTag(viewHolder); + } + if (mainGroup.getType() == DownloadResourceGroup.DownloadResourceGroupType.REGION && + group != null && group.getType() == DownloadResourceGroup.DownloadResourceGroupType.REGION_MAPS + && !(item instanceof CustomIndexItem)) { + viewHolder.setShowTypeInName(true); + viewHolder.setShowTypeInDesc(false); + } else if (group != null && (group.getType() == DownloadResourceGroup.DownloadResourceGroupType.SRTM_HEADER + || group.getType() == DownloadResourceGroup.DownloadResourceGroupType.HILLSHADE_HEADER)) { + viewHolder.setShowTypeInName(false); + viewHolder.setShowTypeInDesc(false); + } else { + viewHolder.setShowTypeInDesc(true); + } + viewHolder.bindIndexItem(item); + } else { + DownloadResourceGroup group = (DownloadResourceGroup) child; + DownloadGroupViewHolder viewHolder; + if (convertView != null && convertView.getTag() instanceof DownloadGroupViewHolder) { + viewHolder = (DownloadGroupViewHolder) convertView.getTag(); + } else { + convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.simple_list_menu_item, + parent, false); + viewHolder = new DownloadGroupViewHolder(ctx, convertView); + convertView.setTag(viewHolder); + } + viewHolder.bindItem(group); + } + + return convertView; + } + + + @Override + public View getGroupView(int groupPosition, boolean isExpanded, final View convertView, final ViewGroup parent) { + View v = convertView; + String section = getGroup(groupPosition); + if (v == null) { + LayoutInflater inflater = LayoutInflater.from(ctx); + v = inflater.inflate(R.layout.download_item_list_section, parent, false); + } + TextView nameView = ((TextView) v.findViewById(R.id.title)); + nameView.setText(section); + v.setOnClickListener(null); + TypedValue typedValue = new TypedValue(); + Resources.Theme theme = ctx.getTheme(); + theme.resolveAttribute(R.attr.activity_background_color, typedValue, true); + v.setBackgroundColor(typedValue.data); + + return v; + } + + @Override + public int getChildrenCount(int groupPosition) { + return data.get(groupPosition).size(); + } + + public DownloadResourceGroup getGroupObj(int groupPosition) { + return data.get(groupPosition); + } + + @Override + public String getGroup(int groupPosition) { + DownloadResourceGroup drg = data.get(groupPosition); + int rid = drg.getType().getResourceId(); + if (rid != -1) { + return ctx.getString(rid); + } + return ""; + } + + @Override + public int getGroupCount() { + return data.size(); + } + + @Override + public long getGroupId(int groupPosition) { + return groupPosition; + } + + @Override + public boolean hasStableIds() { + return false; + } + + @Override + public boolean isChildSelectable(int groupPosition, int childPosition) { + return true; + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java index adeb95ea28..adc3fb8741 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java @@ -3,11 +3,9 @@ package net.osmand.plus.download.ui; import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.DialogInterface; -import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Bundle; -import android.util.TypedValue; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -32,15 +30,12 @@ import net.osmand.plus.CustomRegion; import net.osmand.plus.LockableViewPager; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.UiUtilities; -import net.osmand.plus.activities.OsmandBaseExpandableListAdapter; import net.osmand.plus.download.CustomIndexItem; import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadActivity.BannerAndDownloadFreeVersion; import net.osmand.plus.download.DownloadActivityType; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.DownloadResourceGroup; -import net.osmand.plus.download.DownloadResourceGroup.DownloadResourceGroupType; import net.osmand.plus.download.DownloadResources; import net.osmand.plus.download.DownloadValidationManager; import net.osmand.plus.download.IndexItem; @@ -53,9 +48,7 @@ import org.json.JSONException; import org.json.JSONObject; import java.text.MessageFormat; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import static net.osmand.plus.download.ui.DownloadItemFragment.updateActionButtons; @@ -565,208 +558,4 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow fragment.setArguments(bundle); return fragment; } - - - - private static class DownloadGroupViewHolder { - TextView textView; - private DownloadActivity ctx; - - public DownloadGroupViewHolder(DownloadActivity ctx, View v) { - this.ctx = ctx; - textView = (TextView) v.findViewById(R.id.title); - } - - private boolean isParentWorld(DownloadResourceGroup group) { - return group.getParentGroup() == null - || group.getParentGroup().getType() == DownloadResourceGroupType.WORLD; - } - - private Drawable getIconForGroup(DownloadResourceGroup group) { - Drawable iconStart; - if (group.getType() == DownloadResourceGroupType.VOICE_REC - || group.getType() == DownloadResourceGroupType.VOICE_TTS) { - iconStart = ctx.getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_volume_up); - } else if (group.getType() == DownloadResourceGroupType.FONTS) { - iconStart = ctx.getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_map_language); - } else { - UiUtilities cache = ctx.getMyApplication().getUIUtilities(); - if (isParentWorld(group) || isParentWorld(group.getParentGroup())) { - iconStart = cache.getThemedIcon(R.drawable.ic_world_globe_dark); - } else { - DownloadResourceGroup ggr = group - .getSubGroupById(DownloadResourceGroupType.REGION_MAPS.getDefaultId()); - iconStart = cache.getThemedIcon(R.drawable.ic_map); - if (ggr != null && ggr.getIndividualResources() != null) { - IndexItem item = null; - for (IndexItem ii : ggr.getIndividualResources()) { - if (ii.getType() == DownloadActivityType.NORMAL_FILE - || ii.getType() == DownloadActivityType.ROADS_FILE) { - if (ii.isDownloaded() || ii.isOutdated()) { - item = ii; - break; - } - } - } - if (item != null) { - if (item.isOutdated()) { - iconStart = cache.getIcon(R.drawable.ic_map, R.color.color_distance); - } else { - iconStart = cache.getIcon(R.drawable.ic_map, R.color.color_ok); - } - } - } - } - } - return iconStart; - } - - public void bindItem(DownloadResourceGroup group) { - String name = group.getName(ctx); - textView.setText(name); - Drawable iconStart = getIconForGroup(group); - AndroidUtils.setCompoundDrawablesWithIntrinsicBounds(textView, iconStart, null, null, null); - } - } - - public static class DownloadResourceGroupAdapter extends OsmandBaseExpandableListAdapter { - - private List data = new ArrayList(); - private DownloadActivity ctx; - private DownloadResourceGroup mainGroup; - - - - public DownloadResourceGroupAdapter(DownloadActivity ctx) { - this.ctx = ctx; - } - - public void update(DownloadResourceGroup mainGroup) { - this.mainGroup = mainGroup; - data = mainGroup.getGroups(); - notifyDataSetChanged(); - } - - @Override - public Object getChild(int groupPosition, int childPosition) { - DownloadResourceGroup drg = data.get(groupPosition); - if (drg.getType().containsIndexItem()) { - return drg.getItemByIndex(childPosition); - } - return drg.getGroupByIndex(childPosition); - } - - @Override - public long getChildId(int groupPosition, int childPosition) { - return groupPosition * 10000 + childPosition; - } - - @Override - public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, - View convertView, ViewGroup parent) { - final Object child = getChild(groupPosition, childPosition); - if (child instanceof IndexItem) { - - IndexItem item = (IndexItem) child; - DownloadResourceGroup group = getGroupObj(groupPosition); - ItemViewHolder viewHolder; - if (convertView != null && convertView.getTag() instanceof ItemViewHolder) { - viewHolder = (ItemViewHolder) convertView.getTag(); - } else { - convertView = LayoutInflater.from(parent.getContext()).inflate( - R.layout.two_line_with_images_list_item, parent, false); - viewHolder = new ItemViewHolder(convertView, ctx); - viewHolder.setShowRemoteDate(true); - convertView.setTag(viewHolder); - } - if (mainGroup.getType() == DownloadResourceGroupType.REGION && - group != null && group.getType() == DownloadResourceGroupType.REGION_MAPS - && !(item instanceof CustomIndexItem)) { - viewHolder.setShowTypeInName(true); - viewHolder.setShowTypeInDesc(false); - } else if (group != null && (group.getType() == DownloadResourceGroupType.SRTM_HEADER - || group.getType() == DownloadResourceGroupType.HILLSHADE_HEADER)) { - viewHolder.setShowTypeInName(false); - viewHolder.setShowTypeInDesc(false); - } else { - viewHolder.setShowTypeInDesc(true); - } - viewHolder.bindIndexItem(item); - } else { - DownloadResourceGroup group = (DownloadResourceGroup) child; - DownloadGroupViewHolder viewHolder; - if (convertView != null && convertView.getTag() instanceof DownloadGroupViewHolder) { - viewHolder = (DownloadGroupViewHolder) convertView.getTag(); - } else { - convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.simple_list_menu_item, - parent, false); - viewHolder = new DownloadGroupViewHolder(ctx, convertView); - convertView.setTag(viewHolder); - } - viewHolder.bindItem(group); - } - - return convertView; - } - - - - @Override - public View getGroupView(int groupPosition, boolean isExpanded, final View convertView, final ViewGroup parent) { - View v = convertView; - String section = getGroup(groupPosition); - if (v == null) { - LayoutInflater inflater = LayoutInflater.from(ctx); - v = inflater.inflate(R.layout.download_item_list_section, parent, false); - } - TextView nameView = ((TextView) v.findViewById(R.id.title)); - nameView.setText(section); - v.setOnClickListener(null); - TypedValue typedValue = new TypedValue(); - Resources.Theme theme = ctx.getTheme(); - theme.resolveAttribute(R.attr.activity_background_color, typedValue, true); - v.setBackgroundColor(typedValue.data); - - return v; - } - - @Override - public int getChildrenCount(int groupPosition) { - return data.get(groupPosition).size(); - } - - public DownloadResourceGroup getGroupObj(int groupPosition) { - return data.get(groupPosition); - } - - @Override - public String getGroup(int groupPosition) { - DownloadResourceGroup drg = data.get(groupPosition); - int rid = drg.getType().getResourceId(); - if (rid != -1) { - return ctx.getString(rid); - } - return ""; - } - - @Override - public int getGroupCount() { - return data.size(); - } - - @Override - public long getGroupId(int groupPosition) { - return groupPosition; - } - - @Override - public boolean hasStableIds() { - return false; - } - - @Override - public boolean isChildSelectable(int groupPosition, int childPosition) { - return true; - } - } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java index 8a29d2ea1f..7651f8413a 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java @@ -854,6 +854,12 @@ public class ImportHelper { if (!Algorithms.isEmpty(plugin.getDownloadMaps())) { app.getDownloadThread().runReloadIndexFilesSilent(); } + if (!Algorithms.isEmpty(plugin.getRendererNames())) { + app.getRendererRegistry().updateExternalRenderers(); + } + if (!Algorithms.isEmpty(plugin.getRouterNames())) { + loadRoutingFiles(app, null); + } if (activity != null) { plugin.onInstall(app, activity); } diff --git a/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java b/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java index 08f9346c21..0820b24052 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java @@ -271,11 +271,7 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment implements View public void onSettingsImportFinished(boolean succeed, @NonNull List items) { if (succeed) { app.getRendererRegistry().updateExternalRenderers(); - AppInitializer.loadRoutingFiles(app, new AppInitializer.LoadRoutingFilesCallback() { - @Override - public void onRoutingFilesLoaded() { - } - }); + AppInitializer.loadRoutingFiles(app, null); FragmentManager fm = getFragmentManager(); if (fm != null && file != null) { ImportCompleteFragment.showInstance(fm, items, file.getName()); From e8bd532cd3fe993b9b99017c50f01963c7413240 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 29 Apr 2020 20:04:53 +0300 Subject: [PATCH 02/37] Fix possible npe --- .../plus/settings/bottomsheets/ChangeDataStorageBottomSheet.java | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeDataStorageBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeDataStorageBottomSheet.java index fd28c3b974..b1b31e5d8e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeDataStorageBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeDataStorageBottomSheet.java @@ -170,6 +170,7 @@ public class ChangeDataStorageBottomSheet extends BasePreferenceBottomSheet { fragment.setNewDirectory(newDirectory); fragment.setTargetFragment(target, 0); fragment.setUsedOnMap(usedOnMap); + fragment.setArguments(args); fragment.show(fm, TAG); return true; } From cc661a567a1b8fa359a298fa1c91f121d17bc653 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 29 Apr 2020 21:10:22 +0300 Subject: [PATCH 03/37] Add support for header color --- OsmAnd/src/net/osmand/plus/CustomRegion.java | 18 ++++++++++++++---- .../plus/download/ui/DownloadItemFragment.java | 9 +++++++++ .../ui/DownloadResourceGroupFragment.java | 8 ++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/CustomRegion.java b/OsmAnd/src/net/osmand/plus/CustomRegion.java index aa37aad322..7cf4a3c9f9 100644 --- a/OsmAnd/src/net/osmand/plus/CustomRegion.java +++ b/OsmAnd/src/net/osmand/plus/CustomRegion.java @@ -32,6 +32,8 @@ import java.util.Map; public class CustomRegion extends WorldRegion { + public static final int INVALID_ID = -1; + private static final Log LOG = PlatformUtil.getLog(CustomRegion.class); private String scopeId; @@ -51,7 +53,7 @@ public class CustomRegion extends WorldRegion { private Map icons = new HashMap<>(); private Map headers = new HashMap<>(); - private int headerColor = -1; + private int headerColor = INVALID_ID; private CustomRegion(String scopeId, String path, String type) { @@ -75,6 +77,11 @@ public class CustomRegion extends WorldRegion { @ColorInt public int getHeaderColor() { + if (headerColor != INVALID_ID) { + return headerColor; + } else if (superregion instanceof CustomRegion) { + return ((CustomRegion) superregion).getHeaderColor(); + } return headerColor; } @@ -121,9 +128,9 @@ public class CustomRegion extends WorldRegion { String headerColor = object.optString("header-color", null); try { - region.headerColor = Algorithms.isEmpty(headerColor) ? 0 : Algorithms.parseColor(headerColor); + region.headerColor = Algorithms.isEmpty(headerColor) ? INVALID_ID : Algorithms.parseColor(headerColor); } catch (IllegalArgumentException e) { - region.headerColor = 0; + region.headerColor = INVALID_ID; } region.descriptionInfo = DownloadDescriptionInfo.fromJson(object.optJSONObject("description")); @@ -142,6 +149,9 @@ public class CustomRegion extends WorldRegion { JsonUtils.writeLocalizedMapToJson("icon", jsonObject, icons); JsonUtils.writeLocalizedMapToJson("header", jsonObject, headers); + if (headerColor != INVALID_ID) { + jsonObject.putOpt("header-color", Algorithms.colorToString(headerColor)); + } if (descriptionInfo != null) { jsonObject.putOpt("description", descriptionInfo.toJson()); } @@ -264,7 +274,7 @@ public class CustomRegion extends WorldRegion { if (value instanceof String) { String key = (String) value; int index = key.indexOf("@"); - if (index != -1) { + if (index != INVALID_ID) { key = key.substring(index + 1); } return json.opt(key); diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadItemFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadItemFragment.java index 7d38a92f73..80260f1215 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadItemFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadItemFragment.java @@ -19,6 +19,8 @@ import androidx.fragment.app.DialogFragment; import androidx.viewpager.widget.ViewPager; import net.osmand.AndroidUtils; +import net.osmand.map.WorldRegion; +import net.osmand.plus.CustomRegion; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; @@ -161,6 +163,13 @@ public class DownloadItemFragment extends DialogFragment implements DownloadEven updateActionButtons(activity, descriptionInfo, indexItem, buttonsContainer, R.layout.bottom_buttons, nightMode); } } + WorldRegion region = group.getParentGroup().getRegion(); + if (region instanceof CustomRegion) { + int headerColor = ((CustomRegion) region).getHeaderColor(); + if (headerColor != CustomRegion.INVALID_ID) { + toolbar.setBackgroundColor(headerColor); + } + } } static void updateActionButtons(final DownloadActivity ctx, DownloadDescriptionInfo descriptionInfo, diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java index adc3fb8741..6f8467bf48 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java @@ -26,6 +26,7 @@ import androidx.fragment.app.DialogFragment; import net.osmand.AndroidNetworkUtils; import net.osmand.AndroidUtils; +import net.osmand.map.WorldRegion; import net.osmand.plus.CustomRegion; import net.osmand.plus.LockableViewPager; import net.osmand.plus.OsmandApplication; @@ -431,6 +432,13 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow if (group != null) { listAdapter.update(group); toolbar.setTitle(group.getName(activity)); + WorldRegion region = group.getRegion(); + if (region instanceof CustomRegion) { + int headerColor = ((CustomRegion) region).getHeaderColor(); + if (headerColor != CustomRegion.INVALID_ID) { + toolbar.setBackgroundColor(headerColor); + } + } } expandAllGroups(); } From 81125cca8de34b3fc507ec8299b0af94a112228f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 29 Apr 2020 22:11:03 +0300 Subject: [PATCH 04/37] Fix custom regions icon color --- .../net/osmand/plus/CustomOsmandPlugin.java | 3 +- .../download/ui/DownloadGroupViewHolder.java | 46 +++++++++++-------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java index 238d80c952..459c2f1942 100644 --- a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java @@ -45,6 +45,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -368,7 +369,7 @@ public class CustomOsmandPlugin extends OsmandPlugin { public static List collectRegionsFromJson(@NonNull Context ctx, JSONArray jsonArray) throws JSONException { List customRegions = new ArrayList<>(); - Map flatRegions = new HashMap<>(); + Map flatRegions = new LinkedHashMap<>(); for (int i = 0; i < jsonArray.length(); i++) { JSONObject regionJson = jsonArray.getJSONObject(i); CustomRegion region = CustomRegion.fromJson(ctx, regionJson); diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java index da4e1b1ce1..0e59743148 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadGroupViewHolder.java @@ -4,6 +4,8 @@ import android.graphics.drawable.Drawable; import android.view.View; import android.widget.TextView; +import androidx.annotation.DrawableRes; + import net.osmand.AndroidUtils; import net.osmand.plus.CustomRegion; import net.osmand.plus.OsmandApplication; @@ -45,35 +47,43 @@ public class DownloadGroupViewHolder { String iconName = ((CustomRegion) group.getRegion()).getIconName(ctx); int iconId = AndroidUtils.getDrawableId(app, iconName); if (iconId != 0) { - return cache.getThemedIcon(iconId); + iconStart = getIconForDownloadedItems(group, iconId); + return iconStart != null ? iconStart : cache.getThemedIcon(iconId); } } if (isParentWorld(group) || isParentWorld(group.getParentGroup())) { iconStart = cache.getThemedIcon(R.drawable.ic_world_globe_dark); } else { - DownloadResourceGroup ggr = group.getSubGroupById(DownloadResourceGroupType.REGION_MAPS.getDefaultId()); - iconStart = cache.getThemedIcon(R.drawable.ic_map); - if (ggr != null && ggr.getIndividualResources() != null) { - IndexItem item = null; - for (IndexItem ii : ggr.getIndividualResources()) { - if (ii.getType() == DownloadActivityType.NORMAL_FILE - || ii.getType() == DownloadActivityType.ROADS_FILE) { - if (ii.isDownloaded() || ii.isOutdated()) { - item = ii; - break; - } - } - } - if (item != null) { - int color = item.isOutdated() ? R.color.color_distance : R.color.color_ok; - iconStart = cache.getIcon(R.drawable.ic_map, color); - } + iconStart = getIconForDownloadedItems(group, R.drawable.ic_map); + if (iconStart == null) { + iconStart = cache.getThemedIcon(R.drawable.ic_map); } } } return iconStart; } + private Drawable getIconForDownloadedItems(DownloadResourceGroup group, @DrawableRes int iconId) { + DownloadResourceGroup ggr = group.getSubGroupById(DownloadResourceGroupType.REGION_MAPS.getDefaultId()); + if (ggr != null && ggr.getIndividualResources() != null) { + IndexItem item = null; + for (IndexItem ii : ggr.getIndividualResources()) { + if (ii.getType() == DownloadActivityType.NORMAL_FILE + || ii.getType() == DownloadActivityType.ROADS_FILE) { + if (ii.isDownloaded() || ii.isOutdated()) { + item = ii; + break; + } + } + } + if (item != null) { + int color = item.isOutdated() ? R.color.color_distance : R.color.color_ok; + return ctx.getMyApplication().getUIUtilities().getIcon(iconId, color); + } + } + return null; + } + public void bindItem(DownloadResourceGroup group) { String name = group.getName(ctx); textView.setText(name); From 2982bebf71204b1aaa6f37c5075533c12e7e15e1 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 30 Apr 2020 12:18:38 +0300 Subject: [PATCH 05/37] Fix #8510 --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 4adf60c2c5..1e09f2889f 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -816,9 +816,11 @@ public class MapControlsLayer extends OsmandMapLayer { compassHud.forceHideCompass = forceHideCompass; compassHud.updateVisibility(!forceHideCompass && shouldShowCompass()); - if (layersHud.setIconResId(settings.getApplicationMode().getMapIconRes())) { + ApplicationMode appMode = settings.getApplicationMode(); + if (layersHud.setIconResId(appMode.getIconRes())) { layersHud.update(app, isNight); } + layersHud.setIconColorId(appMode.getIconColorInfo().getColor(isNight)); layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened && !isInChoosingRoutesMode() && !isInWaypointsChoosingMode()); quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() From ec1533434f573c98d080f7fe79e7adcfa46aa971 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 30 Apr 2020 12:24:34 +0300 Subject: [PATCH 06/37] use map icon resource --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 1e09f2889f..1b0f1fa752 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -817,7 +817,7 @@ public class MapControlsLayer extends OsmandMapLayer { compassHud.updateVisibility(!forceHideCompass && shouldShowCompass()); ApplicationMode appMode = settings.getApplicationMode(); - if (layersHud.setIconResId(appMode.getIconRes())) { + if (layersHud.setIconResId(appMode.getMapIconRes())) { layersHud.update(app, isNight); } layersHud.setIconColorId(appMode.getIconColorInfo().getColor(isNight)); From 04dfc6ffc0c081f43ba95e1c098fe25f17682384 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 30 Apr 2020 12:43:15 +0300 Subject: [PATCH 07/37] setup color before update --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 1b0f1fa752..7893a77f00 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -817,10 +817,10 @@ public class MapControlsLayer extends OsmandMapLayer { compassHud.updateVisibility(!forceHideCompass && shouldShowCompass()); ApplicationMode appMode = settings.getApplicationMode(); + layersHud.setIconColorId(appMode.getIconColorInfo().getColor(isNight)); if (layersHud.setIconResId(appMode.getMapIconRes())) { layersHud.update(app, isNight); } - layersHud.setIconColorId(appMode.getIconColorInfo().getColor(isNight)); layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened && !isInChoosingRoutesMode() && !isInWaypointsChoosingMode()); quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() From e895935a23c1a7cbde7d732d828d834eb2beb987 Mon Sep 17 00:00:00 2001 From: Eugene <44466116+EugeneZmeuk@users.noreply.github.com> Date: Thu, 30 Apr 2020 13:22:47 +0300 Subject: [PATCH 08/37] Update strings.xml --- OsmAnd/res/values/strings.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 15483e1f0b..5f5d158b16 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,17 @@ Thx - Hardy --> + Navigation profiles + OsmAnd purchases + Subscription - OsmAnd Live + Favorites + Map markers + Travel (Wikivoyage and Wikipedia) + Measure distance + Radius ruler + Quick action + OsmAnd + Mapillary + OsmAnd tracker Unsupported action %1$s Extra maps Combine POI types from different categories. Tap switch to select all, tap left side to category selection. From c61c1eecd851d12a5d1b1177b6165dc9eaa5cfe7 Mon Sep 17 00:00:00 2001 From: Eugene <44466116+EugeneZmeuk@users.noreply.github.com> Date: Thu, 30 Apr 2020 13:34:28 +0300 Subject: [PATCH 09/37] Update strings.xml --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 5f5d158b16..91a8f162b2 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -3532,7 +3532,7 @@ FAQ Frequently asked questions Map viewing - Searching the map + Searching on the map Installation and troubleshooting Technical articles Versions From 184a0b751accd73d57ea23c908bc8b4d6d984bc1 Mon Sep 17 00:00:00 2001 From: Eugene <44466116+EugeneZmeuk@users.noreply.github.com> Date: Thu, 30 Apr 2020 13:40:48 +0300 Subject: [PATCH 10/37] Update HelpActivity.java --- .../osmand/plus/activities/HelpActivity.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java index 3a4cb98f91..9fbb7ea535 100644 --- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java @@ -99,6 +99,8 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView R.string.navigation_item_description, "feature_articles/navigation.html")); contextMenuAdapter.addItem(createItem(R.string.faq_item, R.string.faq_item_description, "feature_articles/faq.html")); + contextMenuAdapter.addItem(createItem(R.string.map_legend, + R.string.faq_item_description, "feature_articles/map-legend.html")); } private void createSocialNetworksItems(ContextMenuAdapter contextMenuAdapter) { @@ -127,8 +129,28 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView "feature_articles/find-something-on-map.html")); contextMenuAdapter.addItem(createItem(R.string.planning_trip_item, NULL_ID, "feature_articles/trip-planning.html")); - contextMenuAdapter.addItem(createItem(R.string.map_legend, NULL_ID, - "feature_articles/map-legend.html")); + contextMenuAdapter.addItem(createItem(R.string.navigation_profiles_item, NULL_ID, + "feature_articles/navigation-profiles.html")); + contextMenuAdapter.addItem(createItem(R.string.osmand_purchases_item, NULL_ID, + "feature_articles/osmand_purchases.html")); + contextMenuAdapter.addItem(createItem(R.string.subscription_osmandlive_item, NULL_ID, + "feature_articles/subscription.html")); + contextMenuAdapter.addItem(createItem(R.string.favorites_item, NULL_ID, + "feature_articles/favourites.html")); + contextMenuAdapter.addItem(createItem(R.string.map_markers_item, NULL_ID, + "feature_articles/map-markers.html")); + contextMenuAdapter.addItem(createItem(R.string.travel_item, NULL_ID, + "feature_articles/travel.html")); + contextMenuAdapter.addItem(createItem(R.string.measure_distance_item, NULL_ID, + "feature_articles/measure-distance.html")); + contextMenuAdapter.addItem(createItem(R.string.radius_ruler_item, NULL_ID, + "feature_articles/ruler.html")); + contextMenuAdapter.addItem(createItem(R.string.quick_action_item, NULL_ID, + "feature_articles/quick-action.html")); + contextMenuAdapter.addItem(createItem(R.string.mapillary_item, NULL_ID, + "feature_articles/mapillary.html")); + contextMenuAdapter.addItem(createItem(R.string.tracker_item, NULL_ID, + "feature_articles/tracker.html")); } private void createPluginsItems(ContextMenuAdapter contextMenuAdapter) { From 208727a78fa39320e234fff68c54a491ecff45f3 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 30 Apr 2020 14:04:17 +0300 Subject: [PATCH 11/37] Fix hide icon for disabled quick actions --- .../drawable-hdpi/ic_action_icon_hide_dark.png | Bin 1328 -> 0 bytes .../drawable-hdpi/ic_action_icon_hide_white.png | Bin 1330 -> 0 bytes .../drawable-mdpi/ic_action_icon_hide_dark.png | Bin 1242 -> 0 bytes .../drawable-mdpi/ic_action_icon_hide_white.png | Bin 1242 -> 0 bytes .../drawable-xhdpi/ic_action_icon_hide_dark.png | Bin 1391 -> 0 bytes .../drawable-xhdpi/ic_action_icon_hide_white.png | Bin 1378 -> 0 bytes .../drawable-xxhdpi/ic_action_icon_hide_dark.png | Bin 1559 -> 0 bytes .../ic_action_icon_hide_white.png | Bin 1530 -> 0 bytes OsmAnd/res/drawable/ic_action_icon_hide_dark.xml | 14 ++++++++++++++ .../res/drawable/ic_action_icon_hide_white.xml | 14 ++++++++++++++ 10 files changed, 28 insertions(+) delete mode 100644 OsmAnd/res/drawable-hdpi/ic_action_icon_hide_dark.png delete mode 100644 OsmAnd/res/drawable-hdpi/ic_action_icon_hide_white.png delete mode 100644 OsmAnd/res/drawable-mdpi/ic_action_icon_hide_dark.png delete mode 100644 OsmAnd/res/drawable-mdpi/ic_action_icon_hide_white.png delete mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_icon_hide_dark.png delete mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_icon_hide_white.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_icon_hide_dark.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_icon_hide_white.png create mode 100644 OsmAnd/res/drawable/ic_action_icon_hide_dark.xml create mode 100644 OsmAnd/res/drawable/ic_action_icon_hide_white.xml diff --git a/OsmAnd/res/drawable-hdpi/ic_action_icon_hide_dark.png b/OsmAnd/res/drawable-hdpi/ic_action_icon_hide_dark.png deleted file mode 100644 index 69f417bed61199445306a08e844a2fb2f5ba8247..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1328 zcmaJ>eN5bB7%yyh%w?c14jnGqbg~_Z{k&eUZ8+iX3f`f|4t5KuFr~hEcBE+}A;r<|N+P?4m z^!Ys>zvp?{mu!5obZf;{1VKvUF{v4@&$-VQFMQud1_$A?)2VB9_M2%ZCtCmsYo-Fw zct&mm%|O<=-ugss>W;ocRK z7`me3bcC?gpjs12G-_G^4GDVC%Koc4?GW+`;-!k{-x zON-4?{hBX$3SsSzlNCuam&*}3KVe#J5Gx2I#gGhxLk-;SHXJ#R8}{yk1qs-yrDq-8 zG*H)~te9O+2!oNXrjW@d66=NydyOba8JU-}Bu!9cCgbL{qHR0P;Quf-)V5RISwJ=e z+w8JbSdaAX0vK}la7V5pj7HpN>98nrr(~*K8DKbZDTKi8V{i`8AfPHNNGn>w&W3nD6J;ccibmKlP1kWe&HH(tj|POG#D{}Y0UI}LM>bSY z@U6SPSFq9ghhoL31!TvxQl{Bi=z?Us>6muAnMI>fx9S1Z*P(1X&ED7h@{&(542K21pCw7t`7!0tdABj z;5=Dya2D=tzJ(w~k+>92;nAOt43z3)Pjv(?db*P)`@^Rn=AZm-*X&DgUpv?DB~C1S z)Arh_AL&D7<&RG!xr*4p4WjRpBJM_DJm#6iKTsFX?kv0i>z_Rf{|?TaKW_Ray>+SY zOD=6WBcB`H^sLV}`PLrqQs4ENv55=+^cUCl|9!0Y^z}K9r{>Z{Vm|g>asT!&-aV5% zU%NNn*PvKW+}+dAwDj>V&wUl9dDVdq1ksPK*{Yk?G>8`svM6k!kON@Mo86Mc+Hi_qL~w_1wA_8L8ww6Ul8& zPtQCvdi2Wsl|$RcueOZbESbBXoGl+&M&pMbp^!&A=DevpQ(w9Nuy|dgbUAXc_djZJ B%iI6} diff --git a/OsmAnd/res/drawable-hdpi/ic_action_icon_hide_white.png b/OsmAnd/res/drawable-hdpi/ic_action_icon_hide_white.png deleted file mode 100644 index 4dc04dfee3fe62401678ec0d96af791da626d23b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1330 zcmaJ>eQeZZ7_VD~I5r~WTm~7jc97f>du{J}y|&qHxw~%egq!0w!!X%NKi=Nz)(_f_ z>*h@40)Gf&St1Z1xFB(3Y-E3EAgD27V#cP^_>nL|42ghX3}~W%h$b4}+jf&b7Miy2 z`#ybs&&Th1p1#%A`a)&-=5hoZ_RQmVMfqDcfJ)m`Tx}B*Vylm(dSp()8XM4hkB0_y;EJfH_ZklGMX^P@Jlq$= z1colExIIy9DX7j=8=5d}fQADME>oc(8sP#|m^JtKy7=ok;io>Z84{w@8moE%@ zvlW$33(d>E;3=jJ8PX~sZ6rvdX5>PaSr^AXONeqJr8HUC= zlIC!ZQ-U}HC=iw<8mN*|w6hvMlnB!#%TkFr9iylwhNajL%d&|u7ZKQ4L?~jDhU1Ec z42r%r=zAGUJ{HR-Y#_R(-C>%&#V%;;HeJ){HZ3%fC{#U+`gduDV&LYbDb7J#ko z14^@P>gXcRytYaVq$-AjiX`Hy!m>CG6cOjxNCcN7jLZd9R#rF_TgEGo@VC^bPy+L? zisA5#EHW}3B5{$GNSuNc;*u(daapBV5%LnEDG?)Jh(w`v9%-eb2=-@TyD}K?urgY} zfb(R-!Lj;3c@;sP5RyWy!@F_+de{0qS%K_X@Tz`7W=iX%!DG(I!-;%m_Tg|w-8V%^+OhliA7}le&o-W`o@|JJIoU3J6+iRKnaY`qAFbV= zzcIgX>HCcD(#zP}JYD{ZEs#EU>on^Bd2W1q;&gf0`nsEC7suoKx7Q|pmzksS&qii8 z`m6sgGkilIu50yq^Nm$LuVL(tADsp7`OBZKd-2FW3*Wv!8+qrM>ZwWW(AjLw)zH|@ z;lo`y?duJj>(lz-`qxGxhf41pyj60fd2hb?-OI5=Tefaw-4}yDY>RbGJURO7{Y>6J z@zmIczALxSn|~%sz;I;n*y)zcmgkrY|Dx@gk_u$>^Zd5Er>+hZ{$k0dR$)56C;uO{ CvdOvt diff --git a/OsmAnd/res/drawable-mdpi/ic_action_icon_hide_dark.png b/OsmAnd/res/drawable-mdpi/ic_action_icon_hide_dark.png deleted file mode 100644 index 1bde0ac039e84db144eb1ee9f0b07930e335bcab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1242 zcmaJ>ZD`zN9FMe>t)(z4gI1Bn)bj-{mzPU&N$Bl*P1@^qy<54R?5YlZlIKY;yXK`y z>Rk&$sYRR&oY>7F6H#OZwkVE((BcIC=1E+`v3j^ zzyDh<%#;iLy$|&g1kqod)GK%%jK3rIJ8#F=?U2Ar=7S&4As_8i?5X+=mj*rmv-Rn5E8& zCAQ>isBTX#2k6XlxoR#qOa)T8ljKNC#R?o00kY-HyP?|3QhRz;ypE348d<7M zs#cmIH7`Jw#NpYgW%R-XmSx#bDf#DRIORM-5SaScNu(beMYDJ&ew}p3E zsvbqY$}r7lGu2F|ykHJv6@_7WhUaN4L5E9j1X{Ek4tF%@C^Q4xk8IB+V~xP@7NabM znYLYU{8H&au^a9O3Wtno0iWSgEaNz_UwhJFR6+mKI8-{UF8PS5pwL?kOq>sExC6$q zySJfO5VKKF2R2R$nAbgX(Lruh)Uy=6NkJQ`f(W5uND|FUl0Yl0pwNl}d0Ijo5=}!u zmH|6@4#lT=jn{Qq8x!&zH!jJXoR(!-6P1iE=QDZ-TXe$+xF+h@wqx6EZ04R=RSOV^ zyrAlN^PMV~se6$Z);*upv^eV``Q%yKg9 zLj%wjlx12#5YUR8$I8bPOcWtQ9-P3(-<;RyslT-aC z*hfFTQMWhxzJ2H9KTqroJaT?^bv`d2d;ap9m%)weiRsA&qBks@e|GhD*W0zNwbZC{ z>gwjv%J&10KR0mev$dn|J|-ps^}$Nz)YVrPdJd!wg2IjbG-+nnV;|K#`KOXo(# wzMZ79@!s{`DfDap=ZiPpr&(@ikmw#HYTK_<7vAD-#ebXPcv=5=?1k0;054mV*#H0l diff --git a/OsmAnd/res/drawable-mdpi/ic_action_icon_hide_white.png b/OsmAnd/res/drawable-mdpi/ic_action_icon_hide_white.png deleted file mode 100644 index 5c4d708aa3da4717cc1ea58a23956bc7df40e47f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1242 zcmaJ>U1%It6rQx9H7yZML6V?!oVeOb?#|E7&dv;3<7Q{uuF0lhvyv@EnmcpvBx81d zIx}&11Ex~;Ax04iMMNK3N*=5aLTwRIupp(hNZu6ud1w%&FM?1?ZB4Y^$!238LWh~T z_ntZ5`T5Q{^Y+;2;m$q1dnk(P%pcK;WbKZg$99qTYBhb2EInba9FDtYScN{OGRW02 zowwl>E@Fu4CvV^ZirU$*O69Oz7*P$^j>AYNUb8)drl^6zng@*;9MU?TvYa&Y=hs&l z+Cph&B3a-HUKUSVN9KGyJ~vu2=4K29F@rDB12vTxuyF|Knq6@MwU%Z!?5boRiCKo; zPzh(!Of#r*VT{hYKBkj#2^f4rpi@emPbz{e_R|8#ODrd{yaM=yN^X&(H!p^G^O30* zwL_b}$SKWChoPskY_(dAR}*p9pCVXAVL5>n1VA)EP@GUR2T!)S< zLfxGW(+r8UnS$*V3R{MqV3R098C!!M%f~s^wxhf@w1cpS{|{qZ?VwcmFk8fdJL?;y z9%f$)Ot^crqeziNqaO7wQWRLxTw~V8PMFuy4EYjA7E;9|Lb@(VK#(L6D4eJOML`0P zFpralE@D$hEj!!d6GB$dG%-6QW_Ug)$-JD9WjUKvQktAeX)SEt2}0-?xaHf5d^fR) zM`G2ik74NgCD*OAx?pVD4c%bc_2_Iis(O+>Fkv~!tp*39GBvZ-uy4JA(IMZp=?$J$ zYnvE26D9S z>m1+-g+MorBrr@-hJ=@d$U}xDA+k~HJk&}p5$VrpyEPc(ur*rPA@k&u!MXMRvP6dN zkGz&C)qd93A3PY`3EKAcp4hwa*N%$^eyC9Qsm42tiY0P%^Yiy_=XPJedARc|ef){XuTGq}GQTof7+!tq&fUA;>?*$Z{TJ=A zB@1@Uy?Fks*vOCV7p#tb@s8JzecL#?)cXPVWbx$-v5~7^p6(j{aG`V92at*7&K(!( zw}0E;=!Z=5wZ3Ei?<*gto{mm0RENMx=33YD{&(FvfajN&pS#wz*iTR1=>4?(*2>aP zm!?j&f4=t!O$GeM}o=7(bwH4MIkhu&C%Rhr|)RyIy;3?{0LX+!d%<8G|NNoydK>g$lhZ*JCYY zbDb9PV~*%X;xf!WNEV5XLDXbUo&AHwkY#?&M6+aMGy6vaf(y}Z><`}p#r;8cxx4p$ zpL>4K$M1Qbd%LNzzPRx5LIgpIeGNi0T&>y1yaB#j^Y0A8G+MNf5f^oUcoa}c zErx~_H`eO#Tm4ZUbcP%Hb$m8ur`K%4z*b+CuyZgip42A2XESnu3i}Q zrYj+?S*Tm}1y63Q(=ehONyg)GB5o%%y#r!dmbBVPn+=B=c&tw~#00L!DsmPC5R>(A z)Cg-TnzblOTCd^8V5BQ4M52EGnqf7zN))7wOo&mEBCKR2lFe&bJ7zS4|HD{UI~M4R z0vEKJIX4;Xt-T^7#2nB7Bsmx0#w5%xH0&JP{ImFI}}BdoKD>4 zbkaC$rCFS16&vmZ6mZBA4MLKVv$G!F&O2x;;}ZB<+Cx!ZCqprIhGBRI>k=4`OUPk; zYRnK-8RUG2q3=~J|3ECq>p(O#J)mjbxh`nx)C?`wsYOwq&sN=mZfy;#iWZMmWy`dZ zwE*<+UZB+JS_EC@nG3HIgEb`DZHgq~A%$UZ8Ym*pGA3o)|7hOkw@kHe(2$FZuCwKyhYqQtq;?3tyX2X34m__EeD zK=dbxl=^k@MyTxN{-k_o0u@?Ymd7f1!zgNb ze)i1RtrzuY?@WK5x&H63mFdaMd$*4GF1^`V@aYd_5!{Q6Upg+ge81(d6Aw*FbtmV3o2b~6Jo`;BWGeTLKD<0&HE-g`U&#qc?l9 Ozd)b2Q5dgnfBiok&E(Ml diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_icon_hide_white.png b/OsmAnd/res/drawable-xhdpi/ic_action_icon_hide_white.png deleted file mode 100644 index 744b692459f65853ab9f39060f8529b225aa5b5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1378 zcmaJ>Z%i9y7{BtTDO*@9xMYA!F4xRW!u780U3*vQSZNC@u8grp$Z(_AySH$*y(@PI z{WGV4kVT?%$P%1c;$ot1ak2&HqQNkjd{Cz@d@*JbAv4Y;EW!t4#*(RTf#N=pUGDCE z-{+p+^ZcHF_eN7=eess^EeL`X`}cdB;Ywy7gC4$H@>Wj5rA+g+YKP^BmgE$GxCJ>3 zP=B230L_3C(p}$zY6Qt25QD8+Yv6#Bm*ZwGt7A^Z6A+Cc)itRE$47yNhCzoYxv-^) z>li8uF06$Pkb#5;bc*{k3OJl;4Dy*M&k9)0UbH&pga+b3-wtls4OO-eR+&4%Td;St~lX&S zDMG~A?5$h(1y3%lQ_~Vof=DKl=A_LmD;*HavIJ=*tX3Rq;A&dZxD+m_rkn*YPWxhKOB+c)2VepGt5Ctbi3qm+-x8qj3 zox)j?VsVxgthgOm0L_Of5D5!8JDcHc9-1N<2kWV&+!l+^&R7^5!!RD2b$A)K!<)nU zB~{}j9^`zB(Dyo)c_P;7Q2?jON>G+#xh`nxlr>rHloP1OldU?9?r9MvK~AdAWy`b{ zwHGL24-o1UIgYO8*(q+qfsAlAs}Sb!h`=y71q2Rf8HWSs9d@3zMi^dTBiK4#cr1Tw zeF`Nojzo@*)6R2tp0bfR$An4T0#k^GBRq}s5sKkpUTl*MS z1_K^8Mhi%Ao)kDZzb>Br2tjnPj_zRU_Wj%KLpR8$^ve%FA6-7OHU0D8F|IvxYBHsB zpWgdd7cu+wePiWZQJZhb{%GXDi%o>-;x?n-|TcyRiw?8Q>)ZL;#JhiWP zB(U9>cYerF*yI@~xPaE?_nRohZ9LK&G6beD@0|xPzErWW)0n@o-MDq3*jTzyXsozW zK8>^vhICc#SFY&pqOoHVF+Onl=xh5fJ$(Lz=bOdp9iJ`jp0|$mMtA-F=nuTjc+maJ zwI5F0Ecvr%uJKw(O@9$RSv1k|;POnxvi{AhH99?#w@B^0P%^wN``7dP8ogt+q5l5> D!gbps diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_icon_hide_dark.png b/OsmAnd/res/drawable-xxhdpi/ic_action_icon_hide_dark.png deleted file mode 100644 index 74126c5fc05b5524c4d4914b409d20c09cf6266b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1559 zcmaJ>du$VR94`YZE8B<@gq4Tqtw;x4ua9eccT#G1?Rs6dF-n2X5aoJz-ELcZ*Xxyb zfC-fGOo;6m4;KumlQ1C=m@iZ|k$_nUSwfh|1f9x^JSI_t3o7b$TaiBqm%ID@e&73k zzK_rM`@QYeRqlM1TBT4Z@;#)}E3ahcnWU88%ZEDM@=_$Z{L(T$D8(s}RX7+vzyh8S zRm*x=ifM}Uu!|Im@y(piFZnAgaGDS4sEm#-5fWsyLb1r65GcBVm4Ep!}890KtnaVAfe6+F&vQR!nCwV@4EN2pIJS3#>DEP0$ZQ2wH0I0i?|3=;@g zERfM+K_EjTCg=seHo0ENyVNFlO;)KXj5-<9AzA@Vc)pfkYN9%Y2Ac#!W&46|#7iRc) zv?Noe(X5@U$gN?SGLa7fBRu2WV`9(;DU*>2P*9LTQ3zof3c^sU6{4*c8Z!n_n!$qL z7@m2AztKLGC2}4@HXPhSQx+OA=^+XY=plnlAruJGW{3_VC?)e^LJSlL%OS#<)_J6r zvLd-ZGuwxQAs-%&78{o5Nt6d?^N*1Y3Pnzd$La7T`tMw`Rh`w(P!3$KKQ)f%-9Rqy zp!XiDV3Hm42Ii9!JIHP6iF*z`vtV-Z@ah3&O>(EYqZEzI`ggtk!yE6mEWeq)j{Y&c z#&;#Qr>$$dGqs^G)oc0Z?%8u!vbNTG(bIVu|-V-G$K1 zBh8oZ?OQ@BXS#kN%Z{t}r~mxyVyE-gx@%_&dVX@Ir?m{F7tCybzV_0>)RsB@yWC>r zh(q1e_ra7J&EDaFCcWy_SuMnGk)`BcTH;jboiiKweGbNih#gC*Evk|gxpUO*`^-DEslfC|(w(dxRH<{zi}ZdC8M_3e4^C^@L?r#( z6jg5h)Ny%*H;yVNX?~`jttH=J8*_;MdGibRpgu%X(R4yfew`CLlh(gbunDAgGD_l$ z{WbZ?X4~c4v$vPty1JlnxBp|SrueN5D57;g}iF+b)7oT9|iL#GM7ws*a|_T<##3ic8}JWy_lGxpl|pwnxQwt5GD zES!iiQ0JU68!|w%vA9h#HOt&Nna;W3jGG|_agju0)af)v6K9Ok>^Gh#P=`20^W?xUu`kf5uQ* za$`02a{;D0w>iPozdB7pD% zUEQRKupS|EiVSo2dP7Md^v1PPlVMSWjhrfO3IoOPac&HLu}HGyqV19t3_2XR)#0FV zmZVvnWhE=_02Hu`K^laDQcBOO_%>S!ZFiQE-eTHAQ6&zBVr&e731_VRZs#SGkstYRXR72J4)ClVJCaZ2o7uCp$q(=3{$uf;c z%>hl`45U&`4WnaucFC{sfeZ;Ys}vOQki;-J4I}|)8K)B$oeq(;h8R&|L)ZjgdMSV7 zeF`Noj!4QKmqQdBB5fmafeDg01yhIzL!uoQLo_46yx3?;zzFCfk!+opS}7%h{h8dp z7z}uLF-Qu_!jdj zB&(gvSTx(TpcmyYHvME?mHx1u%Nd+&0w}>>jCYyq5v~2#jKPINZ`Yu6`NXp+wY_#e zG1`&Xc_qFV-NEEsnt%HY58i#=896rTyyyLY5+B&E@kpY@n6sv#d;X7#eRvFY{?6!w tTa{NIubr3oV8&joGQE9y{`JC>$nKkIvrZHY%uN1`eI*rKfARV){{j7?A#4Bu diff --git a/OsmAnd/res/drawable/ic_action_icon_hide_dark.xml b/OsmAnd/res/drawable/ic_action_icon_hide_dark.xml new file mode 100644 index 0000000000..85552e0c0e --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_icon_hide_dark.xml @@ -0,0 +1,14 @@ + + + + diff --git a/OsmAnd/res/drawable/ic_action_icon_hide_white.xml b/OsmAnd/res/drawable/ic_action_icon_hide_white.xml new file mode 100644 index 0000000000..8b6909d2a3 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_icon_hide_white.xml @@ -0,0 +1,14 @@ + + + + From d5366368b70ae552145a926fcd21fb34d9145a02 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 30 Apr 2020 16:31:03 +0300 Subject: [PATCH 12/37] Fix poi layer icons --- .../osmand/plus/render/RenderingIcons.java | 22 ++++++++++++++++++- .../net/osmand/plus/views/POIMapLayer.java | 22 ++++++++++--------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java b/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java index 612ac54b4f..fc6e3f40c1 100644 --- a/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java +++ b/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java @@ -147,7 +147,27 @@ public class RenderingIcons { } return iconsBmp.get(s); } - + + public static Drawable getDrawableIcon(Context ctx, String s, boolean includeShader) { + if (s == null) { + return null; + } + if (includeShader && shaderIcons.containsKey(s)) { + s = "h_" + s; + } + Integer drawableId = s.startsWith("h_") ? shaderIcons.get(s.substring(2)) : smallIcons.get(s); + if (drawableId != null) { + Drawable drawable = ContextCompat.getDrawable(ctx, drawableId); + if (drawable != null) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + drawable = (DrawableCompat.wrap(drawable)).mutate(); + } + } + return drawable; + } + return null; + } + public static Integer getResId(String id) { return id.startsWith("h_") ? shaderIcons.get(id.substring(2)) : smallIcons.get(id); } diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 04eade58e2..86e1b1be86 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -61,11 +61,11 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon public static final org.apache.commons.logging.Log log = PlatformUtil.getLog(POIMapLayer.class); - private Paint paintIcon; - private Paint paintIconBackground; private Bitmap poiBackground; private Bitmap poiBackgroundSmall; + private PorterDuffColorFilter poiColorFilter; + private int poiSize; private OsmandMapTileView view; @@ -176,11 +176,8 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon public void initLayer(OsmandMapTileView view) { this.view = view; - paintIcon = new Paint(); - //paintIcon.setStrokeWidth(1); - //paintIcon.setStyle(Style.STROKE); - //paintIcon.setColor(Color.BLUE); - paintIcon.setColorFilter(new PorterDuffColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN)); + poiSize = dpToPx(view.getContext(), 16f); + poiColorFilter = new PorterDuffColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN); paintIconBackground = new Paint(); poiBackground = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_white_orange_poi_shield); poiBackgroundSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_white_orange_poi_shield_small); @@ -263,9 +260,14 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } } if (id != null) { - Bitmap bmp = RenderingIcons.getIcon(view.getContext(), id, false); - if (bmp != null) { - canvas.drawBitmap(bmp, x - bmp.getWidth() / 2, y - bmp.getHeight() / 2, paintIcon); + Drawable img = RenderingIcons.getDrawableIcon(view.getContext(), id, false); + if (img != null) { + canvas.save(); + canvas.translate(x - poiSize / 2f, y - poiSize / 2f); + img.setBounds(0, 0, poiSize, poiSize); + img.setColorFilter(poiColorFilter); + img.draw(canvas); + canvas.restore(); } } } From 10df688e44db624bc7e2cbb9503c35cac37cbeed Mon Sep 17 00:00:00 2001 From: aceman444 Date: Thu, 30 Apr 2020 16:01:31 +0200 Subject: [PATCH 13/37] Add missing space in strings.xml --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 91a8f162b2..302ff5e50a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -26,7 +26,7 @@ Extra maps Combine POI types from different categories. Tap switch to select all, tap left side to category selection. Search poi types - Payment will be charged to your Google Play account at the confirmation of purchase.\n\nSubscription automatically renews unless it is canceled before the renewal date. Your account will be charged for renewal period(month/three month/year) only on the renewal date.\n\nYou can manage and cancel your subscriptions by going to your Google Play settings. + Payment will be charged to your Google Play account at the confirmation of purchase.\n\nSubscription automatically renews unless it is canceled before the renewal date. Your account will be charged for renewal period (month/three month/year) only on the renewal date.\n\nYou can manage and cancel your subscriptions by going to your Google Play settings. %1$s / %2$s Custom color Lombard From 13be1987316892dfc239907c25f0d3b9b9ac3ea3 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 30 Apr 2020 18:07:19 +0300 Subject: [PATCH 14/37] Added icons drawable cache --- .../osmand/plus/render/RenderingIcons.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java b/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java index fc6e3f40c1..d6156a5704 100644 --- a/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java +++ b/OsmAnd/src/net/osmand/plus/render/RenderingIcons.java @@ -30,6 +30,7 @@ public class RenderingIcons { private static Map smallIcons = new LinkedHashMap(); private static Map bigIcons = new LinkedHashMap(); private static Map iconsBmp = new LinkedHashMap(); + private static Map iconsDrawable = new LinkedHashMap(); // private static DisplayMetrics dm; private static Bitmap cacheBmp = null; @@ -155,17 +156,19 @@ public class RenderingIcons { if (includeShader && shaderIcons.containsKey(s)) { s = "h_" + s; } - Integer drawableId = s.startsWith("h_") ? shaderIcons.get(s.substring(2)) : smallIcons.get(s); - if (drawableId != null) { - Drawable drawable = ContextCompat.getDrawable(ctx, drawableId); - if (drawable != null) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - drawable = (DrawableCompat.wrap(drawable)).mutate(); + Drawable d = iconsDrawable.get(s); + if (d == null) { + Integer drawableId = s.startsWith("h_") ? shaderIcons.get(s.substring(2)) : smallIcons.get(s); + if (drawableId != null) { + d = ContextCompat.getDrawable(ctx, drawableId); + if (d != null) { + d = DrawableCompat.wrap(d); + d.mutate(); + iconsDrawable.put(s, d); } } - return drawable; } - return null; + return d; } public static Integer getResId(String id) { From 19213ff6fd0fb8e46fba7a82323a82e13fe4b60a Mon Sep 17 00:00:00 2001 From: Eugene <44466116+EugeneZmeuk@users.noreply.github.com> Date: Thu, 30 Apr 2020 18:23:34 +0300 Subject: [PATCH 15/37] Update HelpActivity.java --- OsmAnd/src/net/osmand/plus/activities/HelpActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java index 9fbb7ea535..da95de3931 100644 --- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java @@ -100,7 +100,7 @@ public class HelpActivity extends OsmandActionBarActivity implements AdapterView contextMenuAdapter.addItem(createItem(R.string.faq_item, R.string.faq_item_description, "feature_articles/faq.html")); contextMenuAdapter.addItem(createItem(R.string.map_legend, - R.string.faq_item_description, "feature_articles/map-legend.html")); + R.string.legend_item_description, "feature_articles/map-legend.html")); } private void createSocialNetworksItems(ContextMenuAdapter contextMenuAdapter) { From 14f32500fb5719c663266bb909e23a82934afcce Mon Sep 17 00:00:00 2001 From: Eugene <44466116+EugeneZmeuk@users.noreply.github.com> Date: Thu, 30 Apr 2020 18:24:09 +0300 Subject: [PATCH 16/37] Update strings.xml --- OsmAnd/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 91a8f162b2..349c15e9c4 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,6 +12,7 @@ --> Navigation profiles + The guide to a map's symbology OsmAnd purchases Subscription - OsmAnd Live Favorites From 211ccd05eb7e6f4fbc6e1257ec422c0afe659bbe Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 30 Apr 2020 19:21:48 +0300 Subject: [PATCH 17/37] fix string --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 349c15e9c4..0aa796211a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,7 +12,7 @@ --> Navigation profiles - The guide to a map's symbology + The guide to a map\'s symbology OsmAnd purchases Subscription - OsmAnd Live Favorites From 5a53aabe69669b315fe99fb033c326a1592dd1dc Mon Sep 17 00:00:00 2001 From: Hakuchi Date: Fri, 1 May 2020 07:29:07 +0000 Subject: [PATCH 18/37] Translated using Weblate (German) Currently translated at 99.8% (3307 of 3312 strings) --- OsmAnd/res/values-de/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index bce4054b17..ff34ac0fc8 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3669,4 +3669,13 @@ Lon %2$s Sie können auf diese Aktionen zugreifen, indem Sie auf die Schaltfläche „Aktionen“ tippen. Wählen Sie die Sprachen aus, in denen Wikipedia-Artikel auf der Karte erscheinen sollen. Sie können zwischen allen verfügbaren Sprachen wechseln, während Sie den Artikel lesen. Diese Elemente werden aus dem Menü ausgeblendet, aber die dargestellten Optionen oder Plugins funktionieren weiterhin. + Ordnen Sie Elemente aus %1s neu an oder blenden Sie sie aus. + %1$s / %2$s + Die Zahlung wird Ihrem Google Play-Konto bei der Kaufbestätigung belastet. +\n +\nDas Abonnement verlängert sich automatisch, sofern es nicht vor dem Verlängerungsdatum gekündigt wird. Ihr Konto wird für den Verlängerungszeitraum (Monat/drei Monate/Jahr) erst am Verlängerungsdatum belastet. +\n +\nSie können Ihre Abonnements verwalten und kündigen, indem Sie zu Ihren Google Play-Einstellungen gehen. + Poi-Typen suchen + Kombinieren Sie POI-Typen aus verschiedenen Kategorien. Tippen Sie auf den Schalter, um alle auszuwählen, tippen Sie auf die linke Seite, um die Kategorie auszuwählen. \ No newline at end of file From b27c3bc5c08d522fa6a2191ab6a1c73550461242 Mon Sep 17 00:00:00 2001 From: Jeannette L Date: Thu, 30 Apr 2020 16:27:49 +0000 Subject: [PATCH 19/37] Translated using Weblate (French) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index d6c7ce83a4..c2cdfd7b2e 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3412,7 +3412,7 @@ représentant la zone : %1$s x %2$s Importer un profil Navigation, fiabilité d\'enregistrement Taille de l\'image, qualité audio et vidéo - Login, mot de passe, édition hors-ligne + Connexion, mot de passe, édition hors-ligne Choisissez l\'icône, la couleur et le nom Permet le partage de votre position grâce à l\'enregistrement du trajet. Suivi en ligne From 0a2e5b367d8235ecbaf22a6d84ec05961cb4d161 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Fri, 1 May 2020 07:37:42 +0000 Subject: [PATCH 20/37] Translated using Weblate (German) Currently translated at 99.8% (3307 of 3312 strings) --- OsmAnd/res/values-de/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index ff34ac0fc8..8eb3df9459 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3671,11 +3671,11 @@ Lon %2$s Diese Elemente werden aus dem Menü ausgeblendet, aber die dargestellten Optionen oder Plugins funktionieren weiterhin. Ordnen Sie Elemente aus %1s neu an oder blenden Sie sie aus. %1$s / %2$s - Die Zahlung wird Ihrem Google Play-Konto bei der Kaufbestätigung belastet. + Die Bezahlung wird nach der Bestätigung des Kaufs von ihrem Google Play Account abgebucht. \n -\nDas Abonnement verlängert sich automatisch, sofern es nicht vor dem Verlängerungsdatum gekündigt wird. Ihr Konto wird für den Verlängerungszeitraum (Monat/drei Monate/Jahr) erst am Verlängerungsdatum belastet. +\nDas Abonnement verlängert sich automatisch, sofern es nicht vor dem Verlängerungsdatum gekündigt wird. Erst nach dem Verlängerungsdatum wird die Bezahlung für die Verlängerungsperiode (1 Monat/ 3 Monate/ 1 Jahr) von ihrem Account abgebucht. \n -\nSie können Ihre Abonnements verwalten und kündigen, indem Sie zu Ihren Google Play-Einstellungen gehen. +\nSie können ihre Abonnements in ihrem Google Play Einstellungen verwalten oder kündigen. Poi-Typen suchen Kombinieren Sie POI-Typen aus verschiedenen Kategorien. Tippen Sie auf den Schalter, um alle auszuwählen, tippen Sie auf die linke Seite, um die Kategorie auszuwählen. \ No newline at end of file From 27bed4d333d1611ccc9fb3b88007f795347620a6 Mon Sep 17 00:00:00 2001 From: solokot Date: Thu, 30 Apr 2020 07:00:34 +0000 Subject: [PATCH 21/37] Translated using Weblate (Russian) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-ru/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index b60fbeb2f5..e5fc6a2110 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3669,4 +3669,6 @@ \nПодписка продлевается автоматически, если вы не отмените ее до даты продления. С вашего счета будет взиматься плата за период продления (месяц/три месяца/год) разово в день продления. \n \nВы можете управлять подписками и отменять их в настройках Google Play. + Можно объединить типы POI из разных категорий. Нажмите переключатель, чтобы выбрать все; нажмите слева, чтобы выбрать категорию. + Типы POI для поиска \ No newline at end of file From 22cc5ba9760b37d8e1e107752677d2f9b2320052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Thu, 30 Apr 2020 16:48:38 +0000 Subject: [PATCH 22/37] Translated using Weblate (Turkish) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-tr/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 14327635fc..2c4a58788d 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -3632,4 +3632,6 @@ \nYenileme tarihinden önce iptal edilmediği sürece abonelik otomatik olarak yenilenir. Hesabınızdan yenileme süresi (ay/üç ay/yıl) için sadece yenileme tarihinde ücret alınacaktır. \n \nGoogle Play ayarlarınıza giderek aboneliklerinizi yönetebilir ve iptal edebilirsiniz. + POI türleri ara + Farklı kategorilerdeki POI türlerini birleştirin. Tümünü seçmek için düğmeye dokunun, kategori seçimi için sol tarafa dokunun. \ No newline at end of file From c6051bd969682218dd3e7167284646c57f801ed9 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Thu, 30 Apr 2020 07:19:20 +0000 Subject: [PATCH 23/37] Translated using Weblate (Danish) Currently translated at 97.3% (3223 of 3312 strings) --- OsmAnd/res/values-da/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index ecf95a1ad3..65c47fd414 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -3647,4 +3647,7 @@ Repræsenterer område: %1$s x %2$s Nogle Wikipedia-artikler er muligvis ikke tilgængelige på dit sprog. Ekstra kort Ikke understøttet handling %1$s + %1$s / %2$s + Søg efter IP-typer + Kombiner IP-typer fra forskellige kategorier. Tryk på knappen for at vælge alt, tryk på venstre side for valg af kategori. \ No newline at end of file From d26cf8dd63c455d8e04ecbf5f6a8c24a41ccda24 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Thu, 30 Apr 2020 13:54:21 +0000 Subject: [PATCH 24/37] Translated using Weblate (Slovak) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-sk/strings.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index a5a7e7d481..f890b460b3 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3662,4 +3662,12 @@ Zodpovedá oblasti: %1$s x %2$s Baškirsky Aragonsky Lombardsky + %1$s / %2$s + Platba bude stiahnutá z vášho účtu Google Play po potvrdení nákupu. +\n +\nPredplatné sa automaticky obnovuje, ak ho pred jeho termínom obnovenia nezrušíte. Platba za obdobie predplatného (mesiac/štvrťrok/rok) bude stiahnutý z vášho účtu len v deň obnovenia. +\n +\nSpravovať a zrušiť vaše predplatné môžete v nastaveniach Google Play. + Hľadať typy bodov záujmu + Skombinovať typy bodov záujmov z rôznych kategórií. Stlačte prepínač pre zvolenie všetkých, stlačte ľavú stranu pre výber kategórií. \ No newline at end of file From ab2c044885e8ad8c8525545e96499393c9bf8b36 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Thu, 30 Apr 2020 07:29:07 +0000 Subject: [PATCH 25/37] Translated using Weblate (Hebrew) Currently translated at 99.7% (3305 of 3312 strings) --- OsmAnd/res/values-he/strings.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml index c4ccb4508c..1b64eaf1cf 100644 --- a/OsmAnd/res/values-he/strings.xml +++ b/OsmAnd/res/values-he/strings.xml @@ -3666,4 +3666,12 @@ מפות נוספות וראי הפעולה %1$s אינה נתמכת + %1$s / %2$s + התשלום יחוייב דרך חשבון ה־Google Play שלך עם אישור הרכישה. +\n +\nהמינוי מתחדש אוטומטית אלמלא בוטל בטרם מועד החידוש. החשבון שלך יחוייב בתקופת החידוש (חודש/שלושה חודשים/שנה) רק במועד החידוש. +\n +\nניתן לנהל ולבטל את המינויים שלך על ידי מעבר להגדרות ה־Google Play שלך. + חיפוש סוגי נקודות עניין + שילוב סוגי נקודות עניין מקטגוריות שונות. יש לגעת כדי לבחור את כולן, נגיעה בצד השמאלי לבחירת קטגוריה. \ No newline at end of file From 59a2b5a1c8dcdbee72958070bc3a0d3e762b1366 Mon Sep 17 00:00:00 2001 From: Piotr Kubowicz Date: Thu, 30 Apr 2020 05:26:22 +0000 Subject: [PATCH 26/37] Translated using Weblate (Polish) Currently translated at 99.9% (3311 of 3312 strings) --- OsmAnd/res/values-pl/strings.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 81e1a638f2..8b230159ea 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -3408,7 +3408,7 @@ Reprezentuje obszar: %1$s x %2$s Osobiste Pobieranie %s Dla pustyń i innych słabo zaludnionych obszarów. Bardziej szczegółowa. - Pokaż punkty sieci tras rowerowych + Pokaż trasy rowerowe z sieci węzłów Gruby Ikona położenia podczas ruchu Ikona położenia podczas spoczynku @@ -3662,21 +3662,21 @@ Reprezentuje obszar: %1$s x %2$s Sycylijski Czuwaski Birmański - - - + Południowy min + Minangkabau + Malgaski Pendżabski - + Nieobsługiwana czynność %1$s Baszkirski - - + Waray + Scots Aragoński - - + Gudźarati + Joruba Dostosuj liczbę elementów w menu bocznym, wyglądzie mapy i menu kontekstowym. \n \nMożesz wyłączyć nieużywane wtyczki, aby ukryć ich elementy z aplikacji %1$s. %1$s / %2$s - Szukaj typów poi - Łącz typy POI z różnych kategorii. Stuknij przełącznik, aby zaznaczyć wszystko, stuknij lewą stronę, aby wybrać kategorię. + Szukaj typów użytecznych miejsc + Łącz typy użytecznych zmian z różnych kategorii. Stuknij przełącznik, aby zaznaczyć wszystko, stuknij lewą stronę, aby wybrać kategorię. \ No newline at end of file From 4449650536d79cff78242cf6f7875fcf10406dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Thu, 30 Apr 2020 03:29:16 +0000 Subject: [PATCH 27/37] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 5.3% (178 of 3312 strings) --- OsmAnd/res/values-nb/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 13d0fbde8f..822889407a 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -3531,4 +3531,8 @@ Alle profilinnstillinger gjenopprettet til forvalg. Gjennomsiktighet Tegnforklaring + %1$s / %2$s + Tilbakestill programtilleggsinnstillinger til forvalg + Ustøttet handling %1$s + Ekstra kart \ No newline at end of file From fccdde89acbce33607210a2ac8a296c212e0f0a3 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Thu, 30 Apr 2020 14:00:35 +0000 Subject: [PATCH 28/37] Translated using Weblate (Slovak) Currently translated at 93.0% (3533 of 3798 strings) --- OsmAnd/res/values-sk/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-sk/phrases.xml b/OsmAnd/res/values-sk/phrases.xml index 894c0d0c43..85066863e3 100644 --- a/OsmAnd/res/values-sk/phrases.xml +++ b/OsmAnd/res/values-sk/phrases.xml @@ -3554,4 +3554,5 @@ Potápačské centrum Video SMS + Lezecká stena \ No newline at end of file From 28924489b6324b6ae21199f74484c7b5dd422395 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Thu, 30 Apr 2020 02:01:23 +0000 Subject: [PATCH 29/37] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 03dac63f60..18c0af6c14 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3664,4 +3664,6 @@ Pôr do Sol: %2$s \nA assinatura é renovada automaticamente, a menos que seja cancelada antes da data de renovação. Sua conta será cobrada pelo período de renovação (mês/três meses/ano) somente na data de renovação. \n \nVocê pode gerenciar e cancelar suas assinaturas acessando as configurações do Google Play. + Pesquisar tipos de poi + Combine tipos de PIs de diferentes categorias. Toque em para selecionar tudo, toque em lado esquerdo para selecionar a categoria. \ No newline at end of file From d1913b8bd4f241bac73d3790f1eb357cb1321f50 Mon Sep 17 00:00:00 2001 From: Oymate Date: Thu, 30 Apr 2020 08:12:49 +0000 Subject: [PATCH 30/37] Translated using Weblate (Bengali) Currently translated at 3.0% (117 of 3798 strings) --- OsmAnd/res/values-bn/phrases.xml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/OsmAnd/res/values-bn/phrases.xml b/OsmAnd/res/values-bn/phrases.xml index d233579606..37ac51e682 100644 --- a/OsmAnd/res/values-bn/phrases.xml +++ b/OsmAnd/res/values-bn/phrases.xml @@ -85,4 +85,42 @@ ধরণ ভেন্ডিং টাইপ জ্বালানির ধরণ (এভিয়া) + ওয়াশিং মেশিন + তাঁবু + ম্যাসাজ টাইপ + স্বাস্থ্য বিশেষত্ব + ডায়েট + নগ্নতাবাদ + পৃষ্ঠতল + জলের বৈশিষ্ট্য + মৌসুমী + অগ্নিকুণ্ড + ধরণ + গৃহীত বর্জ্য + ধরণ + সেবা + মাইক্রোব্রিয়ারি + ককটেল + টেক আওয়ায় + ড্রাইভ থ্রু + ড্রাইভ ইন + ডেলিভারি + ধূমপান + ফি + বাইরে বসার ব্যবস্থা + জেনরে + স্কি স্থান এর গ্রুমিং + স্কি স্থান এর কাঠিন্য + ধরণ + গ্রাম্য এলাকা + স্কাউট ক্যাম্প + অতিরিক্ত + বিষয়বস্তু + ধরণ + আখ্যা + ধর্ম + ষ্টার রেটিং + ধরণ + বিশিষ্ট + বিশিষ্টতা \ No newline at end of file From dd377355d8626860097019fc1da1f094c5401d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Thu, 30 Apr 2020 14:07:04 +0000 Subject: [PATCH 31/37] Translated using Weblate (Icelandic) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-is/strings.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index 80b0850a41..d93f5af303 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -939,7 +939,7 @@ Ferill %2$s Samfelld myndgerð Nota staðsetningu … Veldu útlit myndgerðar - skrifaðu að sía + skrifaðu til að sía Skjár með háupplausn Leita að almenningssamgöngum Talskilaboð @@ -3655,7 +3655,7 @@ Stendur fyrir svæði: %1$s x %2$s Veldu þau tungumál sem Wikipedia-greinarnar ættu að birtast á á kortinu. Þú munt geta skipt á milli allra tiltækra tungumála á meðan þú lest greinar. Sumar Wikipedia-greinar gætu verið ekki tiltækar á þínu tungumáli. Kantónska - Suður-mín + Suður-Mín Yórúba Waray Úsbekíska @@ -3682,4 +3682,13 @@ Stendur fyrir svæði: %1$s x %2$s Aragónska Lombardíska Sérsniðinn litur + Greiðsla verður gjaldfærð á Google Play reikninginn þinn við staðfestingu á kaupunum. +\n +\nÁskrift endurnýjast sjálfkrafa nema hún sé felld niður fyrir endurnýjunardag. Reikningur þinn verður einungis gjaldfærður fyrir endurnýjunartímabil (mánuður / þrír mánuðir / ár) á endurnýjunardegi. +\n +\nÞú getur stýrt og aflýst áskriftunum þínum með því að fara í Google Play stillingarnar þínar. + %1$s / %2$s + Leita í tegundum merkisstaða + Sameina gerðir merkisstaða úr mismunandi flokkum. Ýttu á hnappinn til að velja allt, ýttu vinstra megin til að fara í val á flokkum. + Óstudd aðgerð %1$s \ No newline at end of file From 0ea09df10a4f0409714d5466d8513c256bfcf755 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Thu, 30 Apr 2020 02:58:12 +0000 Subject: [PATCH 32/37] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3312 of 3312 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 84ff8be48f..5b6d620814 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3668,4 +3668,6 @@ \n除非您在續訂日期前取消,否則將會自動續訂。您的帳號將僅會在續訂日期前收取續訂週期的費用。 \n \n您可以到您的 Google Play 設定管理與取消您的訂閱。 + 搜尋 POI 類型 + 組合來自不同分類的 POI 類型。點擊開關以全選,點擊左側選取分類。 \ No newline at end of file From 7dceb8e670a2b639cc9fed4be74dee26fe3affbe Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 1 May 2020 12:20:58 +0300 Subject: [PATCH 33/37] string format fix --- OsmAnd/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 8eb3df9459..d407e7776e 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3669,7 +3669,7 @@ Lon %2$s Sie können auf diese Aktionen zugreifen, indem Sie auf die Schaltfläche „Aktionen“ tippen. Wählen Sie die Sprachen aus, in denen Wikipedia-Artikel auf der Karte erscheinen sollen. Sie können zwischen allen verfügbaren Sprachen wechseln, während Sie den Artikel lesen. Diese Elemente werden aus dem Menü ausgeblendet, aber die dargestellten Optionen oder Plugins funktionieren weiterhin. - Ordnen Sie Elemente aus %1s neu an oder blenden Sie sie aus. + Ordnen Sie Elemente aus %1$s neu an oder blenden Sie sie aus. %1$s / %2$s Die Bezahlung wird nach der Bestätigung des Kaufs von ihrem Google Play Account abgebucht. \n From b0cf80ade39b03c73e10fc39af11b10bbb1f0cae Mon Sep 17 00:00:00 2001 From: PaulStets Date: Fri, 1 May 2020 15:01:03 +0300 Subject: [PATCH 34/37] Show streets on map if no buildings are found --- OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java index f3554d0c46..3b10b03b49 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java @@ -99,7 +99,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment { showResult(sr); } else { - if (sr.objectType == ObjectType.CITY || sr.objectType == ObjectType.VILLAGE) { + if (sr.objectType == ObjectType.CITY || sr.objectType == ObjectType.VILLAGE || sr.objectType == ObjectType.STREET) { showResult = true; } dialogFragment.completeQueryWithObject(sr); From 9ec38f6341890cfc85d4a10a3f7717c620756a5c Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 1 May 2020 16:19:46 +0300 Subject: [PATCH 35/37] string format fix --- OsmAnd-java/src/main/java/net/osmand/data/MapObject.java | 4 ++++ .../src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java index 7d3efda165..b4d3f1118e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java @@ -211,6 +211,10 @@ public abstract class MapObject implements Comparable { location = new LatLon(latitude, longitude); } + public void setLocation(LatLon loc) { + location = loc; + } + @Override public int compareTo(MapObject o) { return OsmAndCollator.primaryCollator().compare(getName(), o.getName()); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index 750272622d..88b30c09ca 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -467,6 +467,9 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { if (entity != null) { if (!isWay && entity instanceof Node) { // check whether this is node (because id of node could be the same as relation) + if (object instanceof NativeLibrary.RenderedObject && object.getLocation() == null) { + object.setLocation(((NativeLibrary.RenderedObject) object).getLabelLatLon()); + } if (MapUtils.getDistance(entity.getLatLon(), object.getLocation()) < 50) { if (object instanceof Amenity) { return replaceEditOsmTags((Amenity) object, entity); From 27c19e483bccdcdef9cba253e36e921e3698ea20 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 1 May 2020 15:25:02 +0200 Subject: [PATCH 36/37] Update transport route / add new method --- .../java/net/osmand/data/TransportRoute.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java index 02dbf811c3..64839b8649 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/TransportRoute.java @@ -65,8 +65,12 @@ public class TransportRoute extends MapObject { return forwardWays; } - public void mergeForwardWays() { + mergeRouteWays(forwardWays); + resortWaysToStopsOrder(forwardWays, forwardStops); + } + + public static void mergeRouteWays(List forwardWays) { boolean changed = true; // combine as many ways as possible while (changed && forwardWays != null) { @@ -129,10 +133,13 @@ public class TransportRoute extends MapObject { } } } - if (forwardStops.size() > 0) { + } + + public static Map resortWaysToStopsOrder(List forwardWays, List forwardStops) { + final Map orderWays = new HashMap(); + if (forwardWays != null && forwardStops.size() > 0) { // resort ways to stops order - final Map orderWays = new HashMap(); - for (Way w : getForwardWays()) { + for (Way w : forwardWays) { int[] pair = new int[] { 0, 0 }; Node firstNode = w.getFirstNode(); TransportStop st = forwardStops.get(0); @@ -175,6 +182,7 @@ public class TransportRoute extends MapObject { } } + return orderWays; } From 70ad2b36a6d72a2f3b76dd26067abd22ec7422e7 Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Fri, 1 May 2020 17:08:06 +0300 Subject: [PATCH 37/37] fix static fields --- .../osmand/router/TransportRoutePlanner.java | 41 ++++++++----------- .../plus/routing/TransportRoutingHelper.java | 6 +-- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index d55a7e8087..7b0b5b9f67 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -965,13 +965,12 @@ public class TransportRoutePlanner { } } - - //cache for converted TransportRoutes: - private static TLongObjectHashMap convertedRoutesCache; - private static TLongObjectHashMap convertedStopsCache; - public static List convertToTransportRoutingResult(NativeTransportRoutingResult[] res, - TransportRoutingConfiguration cfg) { + TransportRoutingConfiguration cfg) { + //cache for converted TransportRoutes: + TLongObjectHashMap convertedRoutesCache = new TLongObjectHashMap<>(); + TLongObjectHashMap convertedStopsCache = new TLongObjectHashMap<>(); + if (res.length == 0) { return new ArrayList(); } @@ -983,7 +982,7 @@ public class TransportRoutePlanner { for (NativeTransportRouteResultSegment ntrs : ntrr.segments) { TransportRouteResultSegment trs = new TransportRouteResultSegment(); - trs.route = convertTransportRoute(ntrs.route); + trs.route = convertTransportRoute(ntrs.route, convertedRoutesCache, convertedStopsCache); trs.walkTime = ntrs.walkTime; trs.travelDistApproximate = ntrs.travelDistApproximate; trs.travelTime = ntrs.travelTime; @@ -1001,7 +1000,9 @@ public class TransportRoutePlanner { return convertedRes; } - private static TransportRoute convertTransportRoute(NativeTransportRoute nr) { + private static TransportRoute convertTransportRoute(NativeTransportRoute nr, + TLongObjectHashMap convertedRoutesCache, + TLongObjectHashMap convertedStopsCache) { TransportRoute r = new TransportRoute(); r.setId(nr.id); r.setLocation(nr.routeLat, nr.routeLon); @@ -1013,15 +1014,17 @@ public class TransportRoutePlanner { } } r.setFileOffset(nr.fileOffset); - r.setForwardStops(convertTransportStops(nr.forwardStops)); + r.setForwardStops(convertTransportStops(nr.forwardStops, convertedStopsCache)); r.setRef(nr.ref); r.setOperator(nr.routeOperator); r.setType(nr.type); r.setDist(nr.dist); r.setColor(nr.color); - if (nr.intervals != null && nr.intervals.length > 0 && nr.avgStopIntervals !=null && nr.avgStopIntervals.length > 0 && nr.avgWaitIntervals != null && nr.avgWaitIntervals.length > 0) { - r.setSchedule(new TransportSchedule(new TIntArrayList(nr.intervals), new TIntArrayList(nr.avgStopIntervals), new TIntArrayList(nr.avgWaitIntervals))); + if (nr.intervals != null && nr.intervals.length > 0 && nr.avgStopIntervals !=null + && nr.avgStopIntervals.length > 0 && nr.avgWaitIntervals != null && nr.avgWaitIntervals.length > 0) { + r.setSchedule(new TransportSchedule(new TIntArrayList(nr.intervals), + new TIntArrayList(nr.avgStopIntervals), new TIntArrayList(nr.avgWaitIntervals))); } for (int i = 0; i < nr.waysIds.length; i++) { @@ -1032,16 +1035,14 @@ public class TransportRoutePlanner { r.addWay(new Way(nr.waysIds[i], wnodes)); } - if (convertedRoutesCache == null) { - convertedRoutesCache = new TLongObjectHashMap<>(); - } if (convertedRoutesCache.get(r.getId()) == null) { convertedRoutesCache.put(r.getId(), r); } return r; } - private static List convertTransportStops(NativeTransportStop[] nstops) { + private static List convertTransportStops(NativeTransportStop[] nstops, + TLongObjectHashMap convertedStopsCache) { List stops = new ArrayList<>(); for (NativeTransportStop ns : nstops) { if (convertedStopsCache != null && convertedStopsCache.get(ns.id) != null) { @@ -1065,16 +1066,6 @@ public class TransportRoutePlanner { s.distance = ns.distance; s.x31 = ns.x31; s.y31 = ns.y31; -// List routes1 = new ArrayList<>(); - //cache routes to avoid circular conversion and just search them by id -// for (int i = 0; i < ns.routes.length; i++) { -// if (s.getRoutesIds().length == ns.routes.length && convertedRoutesCache != null -// && convertedRoutesCache.get(ns.routesIds[i]) != null) { -// s.addRoute(convertedRoutesCache.get(ns.routesIds[i])); -// } else { -// s.addRoute(convertTransportRoute(ns.routes[i])); -// } -// } if (ns.pTStopExit_refs != null && ns.pTStopExit_refs.length > 0) { for (int i = 0; i < ns.pTStopExit_refs.length; i++) { diff --git a/OsmAnd/src/net/osmand/plus/routing/TransportRoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/TransportRoutingHelper.java index 822f1dac85..47084fb1f6 100644 --- a/OsmAnd/src/net/osmand/plus/routing/TransportRoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/TransportRoutingHelper.java @@ -491,7 +491,7 @@ public class TransportRoutingHelper { } GeneralRouter prouter = config.getRouter(params.mode.getRoutingProfile()); TransportRoutingConfiguration cfg = new TransportRoutingConfiguration(prouter, params.params); - TransportRoutePlanner planner = new TransportRoutePlanner(); + TransportRoutingContext ctx = new TransportRoutingContext(cfg, library, files); ctx.calculationProgress = params.calculationProgress; if (ctx.library != null && !settings.PT_SAFE_MODE.get()) { @@ -501,9 +501,9 @@ public class TransportRoutingHelper { MapUtils.get31TileNumberX(params.end.getLongitude()), MapUtils.get31TileNumberY(params.end.getLatitude()), cfg, ctx.calculationProgress); - List res = TransportRoutePlanner.convertToTransportRoutingResult(nativeRes, cfg); - return res; + return TransportRoutePlanner.convertToTransportRoutingResult(nativeRes, cfg); } else { + TransportRoutePlanner planner = new TransportRoutePlanner(); return planner.buildRoute(ctx, params.start, params.end); } }