From 058c7414f57c5c684a7117082be03adc48815ea7 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 16 Nov 2020 08:25:49 +0200 Subject: [PATCH 01/70] Export UI first screen initial commit --- OsmAnd/res/layout/fragment_import.xml | 66 ++- .../layout/profile_data_list_item_group.xml | 8 +- OsmAnd/res/values/strings.xml | 4 + OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 2 +- .../backend/ExportSettingsCategory.java | 22 + .../settings/backend/ExportSettingsType.java | 77 ++- .../backend/backup/SettingsHelper.java | 260 ++++++---- .../fragments/ConfigureProfileFragment.java | 11 +- .../settings/fragments/ExportDataObject.java | 24 + .../ExportImportSettingsAdapter.java | 488 +++++++----------- .../fragments/ExportProfileBottomSheet.java | 429 --------------- .../fragments/ExportSettingsFragment.java | 405 +++++++++++++++ .../fragments/ImportSettingsFragment.java | 102 ++-- .../fragments/MainSettingsFragment.java | 2 +- .../settings/fragments/ReloadIndexesTack.java | 37 ++ 15 files changed, 996 insertions(+), 941 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsCategory.java create mode 100644 OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java delete mode 100644 OsmAnd/src/net/osmand/plus/settings/fragments/ExportProfileBottomSheet.java create mode 100644 OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java create mode 100644 OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml index 31237e535e..e9852ea58d 100644 --- a/OsmAnd/res/layout/fragment_import.xml +++ b/OsmAnd/res/layout/fragment_import.xml @@ -32,34 +32,46 @@ + android:orientation="horizontal"> - + android:layout_weight="1" + android:orientation="vertical" + android:paddingLeft="@dimen/content_padding" + android:paddingTop="@dimen/bottom_sheet_title_padding_bottom" + android:paddingRight="@dimen/content_padding" + android:paddingBottom="@dimen/bottom_sheet_title_padding_bottom"> + osmand:typeface="@string/font_roboto_regular" + tools:text="567 MB" /> - + + + @@ -79,8 +95,6 @@ android:ellipsize="end" android:gravity="center" android:maxLines="1" - android:paddingLeft="@dimen/content_padding_small" - android:paddingRight="@dimen/content_padding_small" android:text="@string/shared_string_continue" android:textColor="?attr/dlg_btn_primary_text" android:textSize="@dimen/default_desc_text_size" @@ -95,8 +109,8 @@ + osmand:title="@string/shared_string_import" + osmand:titleMarginEnd="0dp" + osmand:titleMarginStart="0dp"> @@ -132,8 +146,8 @@ style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal" android:layout_width="match_parent" android:layout_height="5dp" - android:visibility="gone" android:indeterminate="true" + android:visibility="gone" osmand:mpb_progressStyle="horizontal" osmand:mpb_setBothDrawables="true" osmand:mpb_useIntrinsicPadding="false" diff --git a/OsmAnd/res/layout/profile_data_list_item_group.xml b/OsmAnd/res/layout/profile_data_list_item_group.xml index e10b9eecd0..6cf421ff8a 100644 --- a/OsmAnd/res/layout/profile_data_list_item_group.xml +++ b/OsmAnd/res/layout/profile_data_list_item_group.xml @@ -1,6 +1,6 @@ + android:layout_marginRight="@dimen/text_margin_small"> + Needed for import + Select the data to be exported to the file. + Approximate file size + Resources I already have an account Create new account Photos are provided by open data project OpenPlaceReviews.org. In order to upload your photos you need to sign up on website. diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index de3f073bdc..f319a878be 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -2312,7 +2312,7 @@ public class OsmandAidlApi { File exportDir = app.getSettings().getExternalStorageDirectory(); String fileName = appMode.toHumanString(); SettingsHelper settingsHelper = app.getSettingsHelper(); - settingsItems.addAll(settingsHelper.getFilteredSettingsItems(settingsHelper.getAdditionalData(false), settingsTypes)); + settingsItems.addAll(settingsHelper.getFilteredSettingsItems(settingsTypes, false)); settingsHelper.exportSettings(exportDir, fileName, null, settingsItems, true); return true; } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsCategory.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsCategory.java new file mode 100644 index 0000000000..931068ea31 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsCategory.java @@ -0,0 +1,22 @@ +package net.osmand.plus.settings.backend; + +import androidx.annotation.StringRes; + +import net.osmand.plus.R; + +public enum ExportSettingsCategory { + SETTINGS(R.string.shared_string_settings), + MY_PLACES(R.string.shared_string_my_places), + RESOURCES(R.string.shared_string_resources); + + @StringRes + private final int titleId; + + ExportSettingsCategory(@StringRes int titleId) { + this.titleId = titleId; + } + + public int getTitleId() { + return titleId; + } +} diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java index 3dcb680b06..10e392d0cc 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java @@ -1,22 +1,61 @@ package net.osmand.plus.settings.backend; +import androidx.annotation.DrawableRes; +import androidx.annotation.StringRes; + +import net.osmand.plus.R; + public enum ExportSettingsType { - PROFILE, - QUICK_ACTIONS, - POI_TYPES, - MAP_SOURCES, - CUSTOM_RENDER_STYLE, - CUSTOM_ROUTING, - AVOID_ROADS, - TRACKS, - MULTIMEDIA_NOTES, - GLOBAL, - OSM_NOTES, - OSM_EDITS, - OFFLINE_MAPS, - FAVORITES, - TTS_VOICE, - VOICE, - ACTIVE_MARKERS, - HISTORY_MARKERS -} + PROFILE(R.string.shared_string_profiles, R.drawable.ic_action_manage_profiles), + QUICK_ACTIONS(R.string.configure_screen_quick_action, R.drawable.ic_quick_action), + POI_TYPES(R.string.poi_dialog_poi_type, R.drawable.ic_action_info_dark), + MAP_SOURCES(R.string.quick_action_map_source_title, R.drawable.ic_map), + CUSTOM_RENDER_STYLE(R.string.shared_string_rendering_style, R.drawable.ic_action_map_style), + CUSTOM_ROUTING(R.string.shared_string_routing, R.drawable.ic_action_route_distance), + AVOID_ROADS(R.string.avoid_road, R.drawable.ic_action_alert), + TRACKS(R.string.shared_string_tracks, R.drawable.ic_action_route_distance), + MULTIMEDIA_NOTES(R.string.audionotes_plugin_name, R.drawable.ic_action_photo_dark), + GLOBAL(R.string.general_settings_2, R.drawable.ic_action_settings), + OSM_NOTES(R.string.osm_notes, R.drawable.ic_action_openstreetmap_logo), + OSM_EDITS(R.string.osm_edits, R.drawable.ic_action_openstreetmap_logo), + OFFLINE_MAPS(R.string.shared_string_maps, R.drawable.ic_map), + FAVORITES(R.string.shared_string_favorites, R.drawable.ic_action_favorite), + TTS_VOICE(R.string.local_indexes_cat_tts, R.drawable.ic_action_volume_up), + VOICE(R.string.local_indexes_cat_voice, R.drawable.ic_action_volume_up), + ACTIVE_MARKERS(R.string.map_markers, R.drawable.ic_action_flag), + HISTORY_MARKERS(R.string.markers_history, R.drawable.ic_action_flag); + + @StringRes + private final int titleId; + @DrawableRes + private final int drawableRes; + + ExportSettingsType(@StringRes int titleId, @DrawableRes int drawableRes) { + this.titleId = titleId; + this.drawableRes = drawableRes; + } + + @StringRes + public int getTitleId() { + return titleId; + } + + @DrawableRes + public int getIconRes() { + return drawableRes; + } + + public boolean isSettingsCategory() { + return this == PROFILE || this == GLOBAL || this == QUICK_ACTIONS || this == POI_TYPES; + } + + public boolean isMyPlacesCategory() { + return this == FAVORITES || this == TRACKS || this == OSM_EDITS || this == OSM_NOTES + || this == MULTIMEDIA_NOTES || this == ACTIVE_MARKERS || this == HISTORY_MARKERS; + } + + public boolean isResourcesCategory() { + return this == CUSTOM_RENDER_STYLE || this == CUSTOM_ROUTING || this == MAP_SOURCES + || this == OFFLINE_MAPS || this == VOICE || this == TTS_VOICE; + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index c974e72686..3a0cbe8a61 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -39,7 +39,9 @@ import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.quickaction.QuickActionRegistry; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; +import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; +import net.osmand.plus.settings.fragments.ExportDataObject; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -52,6 +54,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -465,6 +468,17 @@ public class SettingsHelper { exportSettings(fileDir, fileName, listener, new ArrayList<>(Arrays.asList(items)), exportItemsFiles); } + public List getFilteredSettingsItems(List settingsTypes, boolean globalExport) { + Map> dataList = getAdditionalData(globalExport); + Map> typesMap = new HashMap<>(); + for (List objects : dataList.values()) { + for (ExportDataObject exportObject : objects) { + typesMap.put(exportObject.getType(), exportObject.getItems()); + } + } + return getFilteredSettingsItems(typesMap, settingsTypes); + } + public List getFilteredSettingsItems(Map> additionalData, List settingsTypes) { List settingsItems = new ArrayList<>(); @@ -482,20 +496,129 @@ public class SettingsHelper { return settingsItems; } - public Map> getAdditionalData(boolean globalExport) { - Map> dataList = new HashMap<>(); + public Map> getAdditionalData(boolean globalExport) { + Map> dataList = new LinkedHashMap<>(); + + List settingsItems = getSettingsItems(globalExport); + List myPlacesItems = getMyPlacesItems(); + List resourcesItems = getResourcesItems(); + + if (!settingsItems.isEmpty()) { + dataList.put(ExportSettingsCategory.SETTINGS, settingsItems); + } + if (!myPlacesItems.isEmpty()) { + dataList.put(ExportSettingsCategory.MY_PLACES, myPlacesItems); + } + if (!resourcesItems.isEmpty()) { + dataList.put(ExportSettingsCategory.RESOURCES, resourcesItems); + } + + return dataList; + } + + private List getSettingsItems(boolean globalExport) { + List settingsItems = new ArrayList<>(); + + if (globalExport) { + List appModeBeans = new ArrayList<>(); + for (ApplicationMode mode : ApplicationMode.allPossibleValues()) { + appModeBeans.add(mode.toModeBean()); + } + settingsItems.add(new ExportDataObject(ExportSettingsType.PROFILE, appModeBeans)); + } + settingsItems.add(new ExportDataObject(ExportSettingsType.GLOBAL, Collections.singletonList(new GlobalSettingsItem(app.getSettings())))); QuickActionRegistry registry = app.getQuickActionRegistry(); List actionsList = registry.getQuickActions(); if (!actionsList.isEmpty()) { - dataList.put(ExportSettingsType.QUICK_ACTIONS, actionsList); + settingsItems.add(new ExportDataObject(ExportSettingsType.QUICK_ACTIONS, actionsList)); } - List poiList = app.getPoiFilters().getUserDefinedPoiFilters(false); if (!poiList.isEmpty()) { - dataList.put(ExportSettingsType.POI_TYPES, poiList); + settingsItems.add(new ExportDataObject(ExportSettingsType.POI_TYPES, poiList)); } + return settingsItems; + } + + private List getMyPlacesItems() { + List myPlacesItems = new ArrayList<>(); + + List favoriteGroups = app.getFavorites().getFavoriteGroups(); + if (!favoriteGroups.isEmpty()) { + myPlacesItems.add(new ExportDataObject(ExportSettingsType.FAVORITES, favoriteGroups)); + } + File gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); + List gpxInfoList = GpxUiHelper.getSortedGPXFilesInfo(gpxDir, null, true); + if (!gpxInfoList.isEmpty()) { + List files = new ArrayList<>(); + for (GPXInfo gpxInfo : gpxInfoList) { + File file = new File(gpxInfo.getFileName()); + if (file.exists()) { + files.add(file); + } + } + if (!files.isEmpty()) { + myPlacesItems.add(new ExportDataObject(ExportSettingsType.TRACKS, files)); + } + } + OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); + if (osmEditingPlugin != null) { + List notesPointList = osmEditingPlugin.getDBBug().getOsmbugsPoints(); + if (!notesPointList.isEmpty()) { + myPlacesItems.add(new ExportDataObject(ExportSettingsType.OSM_NOTES, notesPointList)); + } + List editsPointList = osmEditingPlugin.getDBPOI().getOpenstreetmapPoints(); + if (!editsPointList.isEmpty()) { + myPlacesItems.add(new ExportDataObject(ExportSettingsType.OSM_EDITS, editsPointList)); + } + } + AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); + if (plugin != null) { + List files = new ArrayList<>(); + for (Recording rec : plugin.getAllRecordings()) { + File file = rec.getFile(); + if (file != null && file.exists()) { + files.add(file); + } + } + if (!files.isEmpty()) { + myPlacesItems.add(new ExportDataObject(ExportSettingsType.MULTIMEDIA_NOTES, files)); + } + } + List mapMarkers = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(false); + if (!mapMarkers.isEmpty()) { + String name = app.getString(R.string.map_markers); + String groupId = ExportSettingsType.ACTIVE_MARKERS.name(); + MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + markersGroup.setMarkers(mapMarkers); + myPlacesItems.add(new ExportDataObject(ExportSettingsType.ACTIVE_MARKERS, Collections.singletonList(markersGroup))); + } + List markersHistory = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(true); + if (!markersHistory.isEmpty()) { + String name = app.getString(R.string.shared_string_history); + String groupId = ExportSettingsType.HISTORY_MARKERS.name(); + MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + markersGroup.setMarkers(markersHistory); + myPlacesItems.add(new ExportDataObject(ExportSettingsType.HISTORY_MARKERS, Collections.singletonList(markersGroup))); + } + return myPlacesItems; + } + + private List getResourcesItems() { + List resourcesItems = new ArrayList<>(); + + Map externalRenderers = app.getRendererRegistry().getExternalRenderers(); + if (!externalRenderers.isEmpty()) { + resourcesItems.add(new ExportDataObject(ExportSettingsType.CUSTOM_RENDER_STYLE, new ArrayList<>(externalRenderers.values()))); + } + File routingProfilesFolder = app.getAppPath(IndexConstants.ROUTING_PROFILES_DIR); + if (routingProfilesFolder.exists() && routingProfilesFolder.isDirectory()) { + File[] fl = routingProfilesFolder.listFiles(); + if (fl != null && fl.length > 0) { + resourcesItems.add(new ExportDataObject(ExportSettingsType.CUSTOM_ROUTING, Arrays.asList(fl))); + } + } List iTileSources = new ArrayList<>(); Set tileSourceNames = app.getSettings().getTileSourceEntries(true).keySet(); for (String name : tileSourceNames) { @@ -513,107 +636,29 @@ public class SettingsHelper { } } if (!iTileSources.isEmpty()) { - dataList.put(ExportSettingsType.MAP_SOURCES, iTileSources); - } - - Map externalRenderers = app.getRendererRegistry().getExternalRenderers(); - if (!externalRenderers.isEmpty()) { - dataList.put(ExportSettingsType.CUSTOM_RENDER_STYLE, new ArrayList<>(externalRenderers.values())); - } - - File routingProfilesFolder = app.getAppPath(IndexConstants.ROUTING_PROFILES_DIR); - if (routingProfilesFolder.exists() && routingProfilesFolder.isDirectory()) { - File[] fl = routingProfilesFolder.listFiles(); - if (fl != null && fl.length > 0) { - dataList.put(ExportSettingsType.CUSTOM_ROUTING, Arrays.asList(fl)); - } - } - - Map impassableRoads = app.getAvoidSpecificRoads().getImpassableRoads(); - if (!impassableRoads.isEmpty()) { - dataList.put(ExportSettingsType.AVOID_ROADS, new ArrayList<>(impassableRoads.values())); - } - AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); - if (plugin != null) { - List files = new ArrayList<>(); - for (Recording rec : plugin.getAllRecordings()) { - File file = rec.getFile(); - if (file != null && file.exists()) { - files.add(file); - } - } - if (!files.isEmpty()) { - dataList.put(ExportSettingsType.MULTIMEDIA_NOTES, files); - } - } - File gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); - List gpxInfoList = GpxUiHelper.getSortedGPXFilesInfo(gpxDir, null, true); - if (!gpxInfoList.isEmpty()) { - List files = new ArrayList<>(); - for (GPXInfo gpxInfo : gpxInfoList) { - File file = new File(gpxInfo.getFileName()); - if (file.exists()) { - files.add(file); - } - } - if (!files.isEmpty()) { - dataList.put(ExportSettingsType.TRACKS, files); - } - } - if (globalExport) { - List appModeBeans = new ArrayList<>(); - for (ApplicationMode mode : ApplicationMode.allPossibleValues()) { - appModeBeans.add(mode.toModeBean()); - } - dataList.put(ExportSettingsType.PROFILE, appModeBeans); - } - OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class); - if (osmEditingPlugin != null) { - List notesPointList = osmEditingPlugin.getDBBug().getOsmbugsPoints(); - if (!notesPointList.isEmpty()) { - dataList.put(ExportSettingsType.OSM_NOTES, notesPointList); - } - List editsPointList = osmEditingPlugin.getDBPOI().getOpenstreetmapPoints(); - if (!editsPointList.isEmpty()) { - dataList.put(ExportSettingsType.OSM_EDITS, editsPointList); - } - } - List favoriteGroups = app.getFavorites().getFavoriteGroups(); - if (!favoriteGroups.isEmpty()) { - dataList.put(ExportSettingsType.FAVORITES, favoriteGroups); + resourcesItems.add(new ExportDataObject(ExportSettingsType.MAP_SOURCES, iTileSources)); } List localIndexInfoList = getLocalIndexData(); List files = getFilesByType(localIndexInfoList, LocalIndexType.MAP_DATA, LocalIndexType.TILES_DATA, LocalIndexType.SRTM_DATA, LocalIndexType.WIKI_DATA); if (!files.isEmpty()) { sortLocalFiles(files); - dataList.put(ExportSettingsType.OFFLINE_MAPS, files); + resourcesItems.add(new ExportDataObject(ExportSettingsType.OFFLINE_MAPS, files)); } files = getFilesByType(localIndexInfoList, LocalIndexType.TTS_VOICE_DATA); if (!files.isEmpty()) { - dataList.put(ExportSettingsType.TTS_VOICE, files); + resourcesItems.add(new ExportDataObject(ExportSettingsType.TTS_VOICE, files)); } files = getFilesByType(localIndexInfoList, LocalIndexType.VOICE_DATA); if (!files.isEmpty()) { - dataList.put(ExportSettingsType.VOICE, files); + resourcesItems.add(new ExportDataObject(ExportSettingsType.VOICE, files)); } - List mapMarkers = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(false); - if (!mapMarkers.isEmpty()) { - String name = app.getString(R.string.map_markers); - String groupId = ExportSettingsType.ACTIVE_MARKERS.name(); - MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); - markersGroup.setMarkers(mapMarkers); - dataList.put(ExportSettingsType.ACTIVE_MARKERS, Collections.singletonList(markersGroup)); + Map impassableRoads = app.getAvoidSpecificRoads().getImpassableRoads(); + if (!impassableRoads.isEmpty()) { + resourcesItems.add(new ExportDataObject(ExportSettingsType.AVOID_ROADS, new ArrayList<>(impassableRoads.values()))); } - List markersHistory = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(true); - if (!markersHistory.isEmpty()) { - String name = app.getString(R.string.shared_string_history); - String groupId = ExportSettingsType.HISTORY_MARKERS.name(); - MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); - markersGroup.setMarkers(markersHistory); - dataList.put(ExportSettingsType.HISTORY_MARKERS, Collections.singletonList(markersGroup)); - } - return dataList; + + return resourcesItems; } private List getLocalIndexData() { @@ -733,6 +778,37 @@ public class SettingsHelper { return settingsItems; } + public static Map> getSettingsToOperateByCategory(List items, boolean importComplete) { + Map> exportMap = new LinkedHashMap<>(); + Map> settingsToOperate = getSettingsToOperate(items, importComplete); + + List settingsItems = new ArrayList<>(); + List myPlacesItems = new ArrayList<>(); + List resourcesItems = new ArrayList<>(); + + for (Map.Entry> entry : settingsToOperate.entrySet()) { + ExportSettingsType type = entry.getKey(); + if (type.isSettingsCategory()) { + settingsItems.add(new ExportDataObject(type, entry.getValue())); + } else if (type.isMyPlacesCategory()) { + myPlacesItems.add(new ExportDataObject(type, entry.getValue())); + } else if (type.isResourcesCategory()) { + resourcesItems.add(new ExportDataObject(type, entry.getValue())); + } + } + if (!settingsItems.isEmpty()) { + exportMap.put(ExportSettingsCategory.SETTINGS, settingsItems); + } + if (!myPlacesItems.isEmpty()) { + exportMap.put(ExportSettingsCategory.MY_PLACES, myPlacesItems); + } + if (!resourcesItems.isEmpty()) { + exportMap.put(ExportSettingsCategory.RESOURCES, resourcesItems); + } + + return exportMap; + } + public static Map> getSettingsToOperate(List settingsItems, boolean importComplete) { Map> settingsToOperate = new HashMap<>(); List profiles = new ArrayList<>(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java index 672229d953..ae1b2eba36 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java @@ -31,12 +31,9 @@ import androidx.recyclerview.widget.RecyclerView; import net.osmand.AndroidUtils; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; -import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; -import net.osmand.plus.settings.backend.backup.SettingsHelper; -import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsCollectListener; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.AndroidUiHelper; @@ -44,6 +41,9 @@ import net.osmand.plus.helpers.FontCache; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet; import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.backup.SettingsHelper; +import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsCollectListener; import net.osmand.plus.settings.backend.backup.SettingsItem; import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet; import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener; @@ -433,10 +433,7 @@ public class ConfigureProfileFragment extends BaseSettingsFragment implements Co } else if (EXPORT_PROFILE.equals(prefId)) { FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null) { - ExportProfileBottomSheet.showInstance( - fragmentManager, - this, - getSelectedAppMode(), false); + ExportSettingsFragment.showInstance(fragmentManager, getSelectedAppMode(), false); } } else if (DELETE_PROFILE.equals(prefId)) { onDeleteProfileClick(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java new file mode 100644 index 0000000000..11cb9a79b6 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java @@ -0,0 +1,24 @@ +package net.osmand.plus.settings.fragments; + +import net.osmand.plus.settings.backend.ExportSettingsType; + +import java.util.List; + +public class ExportDataObject { + + private ExportSettingsType type; + private List items; + + public ExportDataObject(ExportSettingsType type, List items) { + this.type = type; + this.items = items; + } + + public ExportSettingsType getType() { + return type; + } + + public List getItems() { + return items; + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java index 8002a49270..24df2f294f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java @@ -4,8 +4,6 @@ import android.content.res.ColorStateList; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.CheckBox; -import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; @@ -13,32 +11,16 @@ import androidx.core.content.ContextCompat; import androidx.core.widget.CompoundButtonCompat; import net.osmand.AndroidUtils; -import net.osmand.IndexConstants; import net.osmand.PlatformUtil; -import net.osmand.map.ITileSource; -import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; 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.audionotes.AudioVideoNotesPlugin; -import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; -import net.osmand.plus.helpers.FileNameTranslationHelper; -import net.osmand.plus.helpers.GpxUiHelper; -import net.osmand.plus.osmedit.OpenstreetmapPoint; -import net.osmand.plus.osmedit.OsmEditingPlugin; -import net.osmand.plus.osmedit.OsmNotesPoint; -import net.osmand.plus.poi.PoiUIFilter; -import net.osmand.plus.profiles.ProfileIconColors; -import net.osmand.plus.profiles.RoutingProfileDataObject.RoutingProfilesResources; -import net.osmand.plus.quickaction.QuickAction; -import net.osmand.plus.render.RenderingIcons; -import net.osmand.plus.settings.backend.ApplicationMode; -import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; +import net.osmand.plus.helpers.AndroidUiHelper; +import net.osmand.plus.helpers.FontCache; +import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.FileSettingsItem; -import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; -import net.osmand.util.Algorithms; import net.osmand.view.ThreeStateCheckbox; import org.apache.commons.logging.Log; @@ -47,11 +29,10 @@ import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import static net.osmand.plus.settings.backend.ExportSettingsType.OFFLINE_MAPS; -import static net.osmand.plus.settings.backend.backup.FileSettingsItem.FileSubtype; import static net.osmand.view.ThreeStateCheckbox.State.CHECKED; import static net.osmand.view.ThreeStateCheckbox.State.MISC; import static net.osmand.view.ThreeStateCheckbox.State.UNCHECKED; @@ -59,91 +40,94 @@ import static net.osmand.view.ThreeStateCheckbox.State.UNCHECKED; class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { private static final Log LOG = PlatformUtil.getLog(ExportImportSettingsAdapter.class.getName()); - private OsmandApplication app; - private UiUtilities uiUtilities; - private List data; - private Map> itemsMap; - private List itemsTypes; - private boolean nightMode; - private boolean importState; - private int activeColorRes; - private int secondaryColorRes; - ExportImportSettingsAdapter(OsmandApplication app, boolean nightMode, boolean importState) { + private final OsmandApplication app; + private final UiUtilities uiUtilities; + + private List itemsTypes = new ArrayList<>(); + private Map> selectedItemsMap = new HashMap<>(); + private Map> itemsMap = new LinkedHashMap<>(); + + private final OnItemSelectedListener listener; + + private final LayoutInflater themedInflater; + + private final boolean nightMode; + private final int activeColorRes; + private final int secondaryColorRes; + + ExportImportSettingsAdapter(OsmandApplication app, OnItemSelectedListener listener, boolean nightMode) { this.app = app; + this.listener = listener; this.nightMode = nightMode; - this.importState = importState; - this.itemsMap = new HashMap<>(); - this.itemsTypes = new ArrayList<>(); - this.data = new ArrayList<>(); uiUtilities = app.getUIUtilities(); - activeColorRes = nightMode - ? R.color.icon_color_active_dark - : R.color.icon_color_active_light; - secondaryColorRes = nightMode - ? R.color.icon_color_secondary_dark - : R.color.icon_color_secondary_light; + themedInflater = UiUtilities.getInflater(app, nightMode); + activeColorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_active_light; + secondaryColorRes = nightMode ? R.color.icon_color_secondary_dark : R.color.icon_color_secondary_light; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View group = convertView; if (group == null) { - LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); - group = inflater.inflate(R.layout.profile_data_list_item_group, parent, false); + group = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); } + final ExportSettingsCategory category = itemsTypes.get(groupPosition); + final List items = itemsMap.get(category); - boolean isLastGroup = groupPosition == getGroupCount() - 1; - final ExportSettingsType type = itemsTypes.get(groupPosition); - + String title = app.getString(category.getTitleId()); TextView titleTv = group.findViewById(R.id.title_tv); + titleTv.setText(UiUtilities.createCustomFontSpannable(FontCache.getRobotoMedium(app), title, title)); + TextView subTextTv = group.findViewById(R.id.sub_text_tv); - final ThreeStateCheckbox checkBox = group.findViewById(R.id.check_box); - FrameLayout checkBoxContainer = group.findViewById(R.id.check_box_container); - ImageView expandIv = group.findViewById(R.id.explist_indicator); - View lineDivider = group.findViewById(R.id.divider); - View cardTopDivider = group.findViewById(R.id.card_top_divider); - View cardBottomDivider = group.findViewById(R.id.card_bottom_divider); + subTextTv.setText(getCategoryDescr(category)); - titleTv.setText(getGroupTitle(type)); - lineDivider.setVisibility(importState || isExpanded || isLastGroup ? View.GONE : View.VISIBLE); - cardTopDivider.setVisibility(importState ? View.VISIBLE : View.GONE); - cardBottomDivider.setVisibility(importState && !isExpanded ? View.VISIBLE : View.GONE); - - final List listItems = itemsMap.get(type); - subTextTv.setText(getSelectedItemsAmount(listItems, type)); - - if (data.containsAll(listItems)) { - checkBox.setState(CHECKED); - } else { - boolean contains = false; - for (Object object : listItems) { - if (data.contains(object)) { - contains = true; - break; - } + int selectedTypes = 0; + for (int i = 0; i < items.size(); i++) { + ExportDataObject object = items.get(i); + if (selectedItemsMap.containsKey(object.getType())) { + selectedTypes++; } - checkBox.setState(contains ? MISC : UNCHECKED); + } + final ThreeStateCheckbox checkBox = group.findViewById(R.id.check_box); + if (selectedTypes == 0) { + checkBox.setState(UNCHECKED); + } else { + checkBox.setState(selectedTypes == items.size() ? CHECKED : MISC); } int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); - checkBoxContainer.setOnClickListener(new View.OnClickListener() { + + group.findViewById(R.id.check_box_container).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { checkBox.performClick(); - if (checkBox.getState() == CHECKED) { - for (Object object : listItems) { - if (!data.contains(object)) { - data.add(object); + boolean selected = checkBox.getState() == CHECKED; + if (selected) { + for (ExportDataObject object : items) { + if (!selectedItemsMap.containsKey(object.getType())) { + selectedItemsMap.put(object.getType(), (List) object.getItems()); } } + } else { - data.removeAll(listItems); + for (ExportDataObject object : items) { + selectedItemsMap.remove(object.getType()); + } + } + if (listener != null) { + listener.onCategorySelected(category, selected); } notifyDataSetChanged(); } }); + adjustIndicator(app, groupPosition, isExpanded, group, nightMode); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.divider), isExpanded); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_top_divider), true); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.vertical_divider), false); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_bottom_divider), !isExpanded); + return group; } @@ -151,168 +135,57 @@ class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View child = convertView; if (child == null) { - LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); - child = inflater.inflate(R.layout.profile_data_list_item_child, parent, false); + child = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); } - final Object currentItem = itemsMap.get(itemsTypes.get(groupPosition)).get(childPosition); + final ExportDataObject currentItem = itemsMap.get(itemsTypes.get(groupPosition)).get(childPosition); + List selectedItems = selectedItemsMap.get(currentItem.getType()); - boolean isLastGroup = groupPosition == getGroupCount() - 1; - boolean itemSelected = data.contains(currentItem); - final ExportSettingsType type = itemsTypes.get(groupPosition); + TextView titleTv = child.findViewById(R.id.title_tv); + titleTv.setText(currentItem.getType().getTitleId()); - TextView title = child.findViewById(R.id.title_tv); - TextView subText = child.findViewById(R.id.sub_title_tv); - subText.setVisibility(View.GONE); - final CheckBox checkBox = child.findViewById(R.id.check_box); - ImageView icon = child.findViewById(R.id.icon); - View lineDivider = child.findViewById(R.id.divider); - View cardBottomDivider = child.findViewById(R.id.card_bottom_divider); + TextView subTextTv = child.findViewById(R.id.sub_text_tv); + subTextTv.setText(getSelectedTypeDescr(currentItem)); - lineDivider.setVisibility(!importState && isLastChild && !isLastGroup ? View.VISIBLE : View.GONE); - cardBottomDivider.setVisibility(importState && isLastChild ? View.VISIBLE : View.GONE); - int checkBoxColor = itemSelected ? activeColorRes : secondaryColorRes; + ImageView icon = child.findViewById(R.id.explist_indicator); + setupIcon(icon, currentItem.getType().getIconRes(), selectedItems != null); + + final ThreeStateCheckbox checkBox = child.findViewById(R.id.check_box); + if (selectedItems == null) { + checkBox.setState(UNCHECKED); + } else if (selectedItems.containsAll(currentItem.getItems())) { + checkBox.setState(CHECKED); + } else { + boolean contains = false; + for (Object object : currentItem.getItems()) { + if (selectedItems.contains(object)) { + contains = true; + break; + } + } + checkBox.setState(contains ? MISC : UNCHECKED); + } + + int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); - - checkBox.setChecked(itemSelected); - checkBox.setClickable(false); - child.setOnClickListener(new View.OnClickListener() { + child.findViewById(R.id.check_box_container).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (data.contains(currentItem)) { - data.remove(currentItem); + checkBox.performClick(); + boolean selected = checkBox.getState() == CHECKED; + if (selected) { + selectedItemsMap.put(currentItem.getType(), (List) currentItem.getItems()); } else { - data.add(currentItem); + selectedItemsMap.remove(currentItem.getType()); + } + if (listener != null) { + listener.onTypeSelected(currentItem.getType(), selected); } notifyDataSetChanged(); } }); - switch (type) { - case PROFILE: - ApplicationModeBean modeBean = (ApplicationModeBean) currentItem; - String profileName = modeBean.userProfileName; - if (Algorithms.isEmpty(profileName)) { - ApplicationMode appMode = ApplicationMode.valueOfStringKey(modeBean.stringKey, null); - profileName = app.getString(appMode.getNameKeyResource()); - } - title.setText(profileName); - String routingProfile = ""; - String routingProfileValue = modeBean.routingProfile; - if (!routingProfileValue.isEmpty()) { - try { - routingProfile = app.getString(RoutingProfilesResources.valueOf(routingProfileValue.toUpperCase()).getStringRes()); - routingProfile = Algorithms.capitalizeFirstLetterAndLowercase(routingProfile); - } catch (IllegalArgumentException e) { - routingProfile = Algorithms.capitalizeFirstLetterAndLowercase(routingProfileValue); - LOG.error("Error trying to get routing resource for " + routingProfileValue + "\n" + e); - } - } - if (!Algorithms.isEmpty(routingProfile)) { - subText.setText(String.format( - app.getString(R.string.ltr_or_rtl_combine_via_colon), - app.getString(R.string.nav_type_hint), - routingProfile)); - subText.setVisibility(View.VISIBLE); - } - int profileIconRes = AndroidUtils.getDrawableId(app, modeBean.iconName); - ProfileIconColors iconColor = modeBean.iconColor; - icon.setImageDrawable(uiUtilities.getIcon(profileIconRes, iconColor.getColor(nightMode))); - break; - case QUICK_ACTIONS: - title.setText(((QuickAction) currentItem).getName(app.getApplicationContext())); - setupIcon(icon, ((QuickAction) currentItem).getIconRes(), itemSelected); - break; - case POI_TYPES: - title.setText(((PoiUIFilter) currentItem).getName()); - int iconRes = RenderingIcons.getBigIconResourceId(((PoiUIFilter) currentItem).getIconId()); - setupIcon(icon, iconRes != 0 ? iconRes : R.drawable.ic_action_user, itemSelected); - break; - case MAP_SOURCES: - title.setText(((ITileSource) currentItem).getName()); - setupIcon(icon, R.drawable.ic_map, itemSelected); - break; - case CUSTOM_RENDER_STYLE: - String renderName = ((File) currentItem).getName(); - renderName = renderName.replace('_', ' ').replaceAll(IndexConstants.RENDERER_INDEX_EXT, ""); - title.setText(renderName); - setupIcon(icon, R.drawable.ic_action_map_style, itemSelected); - break; - case CUSTOM_ROUTING: - String routingName = ((File) currentItem).getName(); - routingName = routingName.replace('_', ' ').replaceAll(".xml", ""); - title.setText(routingName); - setupIcon(icon, R.drawable.ic_action_route_distance, itemSelected); - break; - case AVOID_ROADS: - AvoidRoadInfo avoidRoadInfo = (AvoidRoadInfo) currentItem; - title.setText(avoidRoadInfo.name); - setupIcon(icon, R.drawable.ic_action_alert, itemSelected); - break; - case MULTIMEDIA_NOTES: - File file = (File) currentItem; - title.setText(file.getName()); - int iconId = AudioVideoNotesPlugin.getIconIdForRecordingFile(file); - if (iconId == -1) { - iconId = R.drawable.ic_action_photo_dark; - } - setupIcon(icon, iconId, itemSelected); - break; - case TRACKS: - String fileName = ((File) currentItem).getName(); - title.setText(GpxUiHelper.getGpxTitle(fileName)); - setupIcon(icon, R.drawable.ic_action_route_distance, itemSelected); - break; - case GLOBAL: - String name = ((GlobalSettingsItem) currentItem).getPublicName(app); - title.setText(name); - setupIcon(icon, R.drawable.ic_action_settings, itemSelected); - break; - case OSM_NOTES: - title.setText(((OsmNotesPoint) currentItem).getText()); - setupIcon(icon, R.drawable.ic_action_osm_note_add, itemSelected); - break; - case OSM_EDITS: - title.setText(OsmEditingPlugin.getTitle((OpenstreetmapPoint) currentItem, app)); - setupIcon(icon, R.drawable.ic_action_info_dark, itemSelected); - break; - case OFFLINE_MAPS: - long size; - if (currentItem instanceof FileSettingsItem) { - FileSettingsItem currentFileItem = (FileSettingsItem) currentItem; - file = currentFileItem.getFile(); - size = currentFileItem.getSize(); - } else { - file = (File) currentItem; - size = file.length(); - } - title.setText(FileNameTranslationHelper.getFileNameWithRegion(app, file.getName())); - FileSubtype subtype = FileSubtype.getSubtypeByPath(app, file.getPath()); - setupIcon(icon, subtype.getIconId(), itemSelected); - subText.setText(AndroidUtils.formatSize(app, size)); - subText.setVisibility(View.VISIBLE); - break; - case FAVORITES: - FavoriteGroup favoriteGroup = (FavoriteGroup) currentItem; - title.setText(favoriteGroup.getDisplayName(app)); - setupIcon(icon, R.drawable.ic_action_favorite, itemSelected); - break; - case TTS_VOICE: - case VOICE: - file = (File) currentItem; - title.setText(FileNameTranslationHelper.getFileNameWithRegion(app, file.getName())); - setupIcon(icon, R.drawable.ic_action_volume_up, itemSelected); - break; - case ACTIVE_MARKERS: - title.setText(R.string.map_markers); - setupIcon(icon, R.drawable.ic_action_flag, itemSelected); - break; - case HISTORY_MARKERS: - title.setText(R.string.markers_history); - setupIcon(icon, R.drawable.ic_action_flag, itemSelected); - break; - default: - return child; - } + AndroidUiHelper.updateVisibility(child.findViewById(R.id.card_bottom_divider), isLastChild); + return child; } @@ -356,78 +229,16 @@ class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { return true; } - private String getSelectedItemsAmount(List listItems, ExportSettingsType type) { - int amount = 0; - long amountSize = 0; - for (Object item : listItems) { - if (data.contains(item)) { - amount++; - if (type == OFFLINE_MAPS) { - if (item instanceof FileSettingsItem) { - amountSize += ((FileSettingsItem) item).getSize(); - } else { - amountSize += ((File) item).length(); - } - } - } - } - String itemsOf = app.getString(R.string.n_items_of_z, String.valueOf(amount), String.valueOf(listItems.size())); - return amountSize == 0 ? itemsOf : app.getString(R.string.ltr_or_rtl_combine_via_bold_point, itemsOf, - AndroidUtils.formatSize(app, amountSize)); - } - - private int getGroupTitle(ExportSettingsType type) { - switch (type) { - case PROFILE: - return R.string.shared_string_profiles; - case QUICK_ACTIONS: - return R.string.configure_screen_quick_action; - case POI_TYPES: - return R.string.poi_dialog_poi_type; - case MAP_SOURCES: - return R.string.quick_action_map_source_title; - case CUSTOM_RENDER_STYLE: - return R.string.shared_string_rendering_style; - case CUSTOM_ROUTING: - return R.string.shared_string_routing; - case AVOID_ROADS: - return R.string.avoid_road; - case TRACKS: - return R.string.shared_string_tracks; - case MULTIMEDIA_NOTES: - return R.string.audionotes_plugin_name; - case GLOBAL: - return R.string.general_settings_2; - case OSM_NOTES: - return R.string.osm_notes; - case OSM_EDITS: - return R.string.osm_edits; - case OFFLINE_MAPS: - return R.string.shared_string_maps; - case FAVORITES: - return R.string.shared_string_favorites; - case TTS_VOICE: - return R.string.local_indexes_cat_tts; - case VOICE: - return R.string.local_indexes_cat_voice; - case ACTIVE_MARKERS: - return R.string.map_markers; - case HISTORY_MARKERS: - return R.string.markers_history; - default: - return R.string.access_empty_list; - } - } - private void setupIcon(ImageView icon, int iconRes, boolean itemSelected) { if (itemSelected) { - icon.setImageDrawable(uiUtilities.getIcon(iconRes, activeColorRes)); + int colorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_osmand_light; + icon.setImageDrawable(uiUtilities.getIcon(iconRes, colorRes)); } else { - icon.setImageDrawable(uiUtilities.getIcon(iconRes, nightMode)); + icon.setImageDrawable(uiUtilities.getIcon(iconRes, secondaryColorRes)); } } - public void updateSettingsList(Map> itemsMap) { + public void updateSettingsList(Map> itemsMap) { this.itemsMap = itemsMap; this.itemsTypes = new ArrayList<>(itemsMap.keySet()); Collections.sort(itemsTypes); @@ -440,17 +251,90 @@ class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { notifyDataSetChanged(); } - public void selectAll(boolean selectAll) { - data.clear(); - if (selectAll) { - for (List values : itemsMap.values()) { - data.addAll(values); - } + public List getData() { + List selectedItems = new ArrayList<>(); + for (List items : selectedItemsMap.values()) { + selectedItems.addAll(items); } - notifyDataSetChanged(); + return selectedItems; } - List getData() { - return this.data; + private String getCategoryDescr(ExportSettingsCategory category) { + long itemsSize = 0; + int selectedTypes = 0; + List items = itemsMap.get(category); + for (int i = 0; i < items.size(); i++) { + ExportDataObject object = items.get(i); + if (selectedItemsMap.containsKey(object.getType())) { + selectedTypes++; + itemsSize += calculateItemsSize(object.getItems()); + } + } + + String description; + if (selectedTypes == 0) { + description = app.getString(R.string.shared_string_none); + } else if (selectedTypes == items.size()) { + description = app.getString(R.string.shared_string_all); + } else { + description = app.getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selectedTypes), String.valueOf(items.size())); + } + String formattedSize = AndroidUtils.formatSize(app, itemsSize); + return itemsSize == 0 ? description : app.getString(R.string.ltr_or_rtl_combine_via_comma, description, formattedSize); + } + + public static long calculateItemsSize(List items) { + long itemsSize = 0; + for (Object item : items) { + if (item instanceof FileSettingsItem) { + itemsSize += ((FileSettingsItem) item).getSize(); + } else if (item instanceof File) { + itemsSize += ((File) item).length(); + } + } + return itemsSize; + } + + private String getSelectedTypeDescr(ExportDataObject dataObject) { + long itemsSize = 0; + int selectedTypes = 0; + + List items = dataObject.getItems(); + List selectedItems = selectedItemsMap.get(dataObject.getType()); + if (selectedItems != null) { + for (int i = 0; i < items.size(); i++) { + Object object = items.get(i); + if (selectedItems.contains(object)) { + selectedTypes++; + if (object instanceof FileSettingsItem) { + itemsSize += ((FileSettingsItem) object).getSize(); + } else if (object instanceof File) { + itemsSize += ((File) object).length(); + } + } + } + } + + String description; + if (selectedTypes == 0) { + description = app.getString(R.string.shared_string_none); + } else if (selectedTypes == items.size()) { + description = app.getString(R.string.shared_string_all); + if (itemsSize == 0) { + description = app.getString(R.string.ltr_or_rtl_combine_via_comma, description, String.valueOf(items.size())); + } + } else { + description = app.getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selectedTypes), String.valueOf(items.size())); + } + String formattedSize = AndroidUtils.formatSize(app, itemsSize); + return itemsSize == 0 ? description : app.getString(R.string.ltr_or_rtl_combine_via_comma, description, formattedSize); + } + + interface OnItemSelectedListener { + + void onCategorySelected(ExportSettingsCategory type, boolean selected); + + void onTypeSelected(ExportSettingsType type, boolean selected); + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportProfileBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportProfileBottomSheet.java deleted file mode 100644 index 8d5b484dfb..0000000000 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportProfileBottomSheet.java +++ /dev/null @@ -1,429 +0,0 @@ -package net.osmand.plus.settings.fragments; - -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.res.ColorStateList; -import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; -import android.graphics.drawable.LayerDrawable; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.ExpandableListView; -import android.widget.Toast; - -import androidx.annotation.NonNull; -import androidx.appcompat.widget.SwitchCompat; -import androidx.core.content.ContextCompat; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentActivity; -import androidx.fragment.app.FragmentManager; - -import net.osmand.AndroidUtils; -import net.osmand.FileUtils; -import net.osmand.IndexConstants; -import net.osmand.PlatformUtil; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.R; -import net.osmand.plus.UiUtilities; -import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; -import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton; -import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; -import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; -import net.osmand.plus.settings.backend.ApplicationMode; -import net.osmand.plus.settings.backend.ExportSettingsType; -import net.osmand.plus.settings.backend.backup.FileSettingsItem; -import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; -import net.osmand.plus.settings.backend.backup.ProfileSettingsItem; -import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsExportListener; -import net.osmand.plus.settings.backend.backup.SettingsItem; -import net.osmand.plus.settings.bottomsheets.BasePreferenceBottomSheet; - -import org.apache.commons.logging.Log; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -public class ExportProfileBottomSheet extends BasePreferenceBottomSheet { - - public static final String TAG = ExportProfileBottomSheet.class.getSimpleName(); - - private static final Log LOG = PlatformUtil.getLog(ExportProfileBottomSheet.class); - - private static final String GLOBAL_EXPORT_KEY = "global_export_key"; - private static final String EXPORT_START_TIME_KEY = "export_start_time_key"; - private static final String EXPORTING_PROFILE_KEY = "exporting_profile_key"; - private static final String INCLUDE_ADDITIONAL_DATA_KEY = "include_additional_data_key"; - private static final String INCLUDE_GLOBAL_SETTINGS_KEY = "include_global_settings_key"; - private static final String PROGRESS_MAX_KEY = "progress_max_key"; - private static final String PROGRESS_VALUE_KEY = "progress_value_key"; - - private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yy", Locale.US); - - private OsmandApplication app; - private Map> dataList = new HashMap<>(); - private ExportImportSettingsAdapter adapter; - - private SettingsExportListener exportListener; - private ProgressDialog progress; - private int progressMax; - private int progressValue; - - private long exportStartTime; - - private boolean globalExport = false; - private boolean exportingProfile = false; - private boolean includeAdditionalData = false; - private boolean includeGlobalSettings = false; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - app = requiredMyApplication(); - if (savedInstanceState != null) { - globalExport = savedInstanceState.getBoolean(GLOBAL_EXPORT_KEY); - exportingProfile = savedInstanceState.getBoolean(EXPORTING_PROFILE_KEY); - includeAdditionalData = savedInstanceState.getBoolean(INCLUDE_ADDITIONAL_DATA_KEY); - includeGlobalSettings = savedInstanceState.getBoolean(INCLUDE_GLOBAL_SETTINGS_KEY); - exportStartTime = savedInstanceState.getLong(EXPORT_START_TIME_KEY); - progressMax = savedInstanceState.getInt(PROGRESS_MAX_KEY); - progressValue = savedInstanceState.getInt(PROGRESS_VALUE_KEY); - } - dataList = app.getSettingsHelper().getAdditionalData(globalExport); - } - - @Override - public void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - outState.putBoolean(GLOBAL_EXPORT_KEY, globalExport); - outState.putBoolean(EXPORTING_PROFILE_KEY, exportingProfile); - outState.putBoolean(INCLUDE_ADDITIONAL_DATA_KEY, includeAdditionalData); - outState.putBoolean(INCLUDE_GLOBAL_SETTINGS_KEY, includeGlobalSettings); - outState.putLong(EXPORT_START_TIME_KEY, exportStartTime); - outState.putInt(PROGRESS_MAX_KEY, progress.getMax()); - outState.putInt(PROGRESS_VALUE_KEY, progress.getProgress()); - } - - @Override - public void createMenuItems(Bundle savedInstanceState) { - final Context context = getContext(); - if (context == null) { - return; - } - if (globalExport) { - items.add(new TitleItem(getString(R.string.shared_string_export))); - - final BottomSheetItemWithCompoundButton[] globalSettingsItem = new BottomSheetItemWithCompoundButton[1]; - globalSettingsItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() - .setChecked(includeGlobalSettings) - .setTitle(getString(R.string.general_settings_2)) - .setLayoutId(R.layout.bottom_sheet_item_with_switch_no_icon) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - boolean checked = !globalSettingsItem[0].isChecked(); - globalSettingsItem[0].setChecked(checked); - includeGlobalSettings = checked; - } - }) - .create(); - items.add(globalSettingsItem[0]); - } else { - items.add(new TitleItem(getString(R.string.export_profile))); - ApplicationMode profile = getAppMode(); - int profileColor = profile.getIconColorInfo().getColor(nightMode); - int colorNoAlpha = ContextCompat.getColor(context, profileColor); - - Drawable backgroundIcon = UiUtilities.getColoredSelectableDrawable(context, colorNoAlpha, 0.3f); - Drawable[] layers = {new ColorDrawable(UiUtilities.getColorWithAlpha(colorNoAlpha, 0.10f)), backgroundIcon}; - - BaseBottomSheetItem profileItem = new BottomSheetItemWithCompoundButton.Builder() - .setChecked(true) - .setCompoundButtonColorId(profileColor) - .setButtonTintList(ColorStateList.valueOf(getResolvedColor(profileColor))) - .setDescription(BaseSettingsFragment.getAppModeDescription(context, profile)) - .setIcon(getIcon(profile.getIconRes(), profileColor)) - .setTitle(profile.toHumanString()) - .setBackground(new LayerDrawable(layers)) - .setLayoutId(R.layout.preference_profile_item_with_radio_btn) - .create(); - items.add(profileItem); - } - setupAdditionalItems(); - } - - private void setupAdditionalItems() { - if (!dataList.isEmpty()) { - LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); - View additionalDataView = inflater.inflate(R.layout.bottom_sheet_item_additional_data, null); - ExpandableListView listView = additionalDataView.findViewById(R.id.list); - adapter = new ExportImportSettingsAdapter(app, nightMode, false); - - View listHeader = inflater.inflate(R.layout.item_header_export_expand_list, null); - final View topSwitchDivider = listHeader.findViewById(R.id.topSwitchDivider); - final View bottomSwitchDivider = listHeader.findViewById(R.id.bottomSwitchDivider); - final SwitchCompat switchItem = listHeader.findViewById(R.id.switchItem); - switchItem.setTextColor(getResources().getColor(nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light)); - switchItem.setChecked(includeAdditionalData); - switchItem.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - includeAdditionalData = !includeAdditionalData; - topSwitchDivider.setVisibility(includeAdditionalData ? View.VISIBLE : View.GONE); - bottomSwitchDivider.setVisibility(includeAdditionalData ? View.VISIBLE : View.GONE); - if (includeAdditionalData) { - adapter.updateSettingsList(app.getSettingsHelper().getAdditionalData(globalExport)); - adapter.selectAll(true); - } else { - adapter.selectAll(false); - adapter.clearSettingsList(); - } - updateSwitch(switchItem); - setupHeightAndBackground(getView()); - } - }); - listView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() { - @Override - public void onGroupExpand(int i) { - setupHeightAndBackground(getView()); - } - }); - - updateSwitch(switchItem); - listView.addHeaderView(listHeader); - listView.setAdapter(adapter); - final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() - .setCustomView(additionalDataView) - .create(); - items.add(titleItem); - } - } - - private void updateSwitch(View view) { - if (includeAdditionalData) { - UiUtilities.setMargins(view, 0, 0, 0, 0); - view.setPadding(AndroidUtils.dpToPx(app, 32), 0, AndroidUtils.dpToPx(app, 32), 0); - } else { - UiUtilities.setMargins(view, AndroidUtils.dpToPx(app, 16), 0, AndroidUtils.dpToPx(app, 16), 0); - view.setPadding(AndroidUtils.dpToPx(app, 16), 0, AndroidUtils.dpToPx(app, 16), 0); - } - } - - @Override - protected int getRightBottomButtonTextId() { - return R.string.shared_string_export; - } - - @Override - protected void onRightBottomButtonClick() { - prepareFile(); - } - - @Override - protected int getDismissButtonTextId() { - return R.string.shared_string_cancel; - } - - @Override - protected boolean useScrollableItemsContainer() { - return false; - } - - @Override - protected boolean useExpandableList() { - return true; - } - - @Override - public void onResume() { - super.onResume(); - checkExportingFile(); - } - - @Override - public void onPause() { - super.onPause(); - if (exportingProfile) { - File file = getExportFile(); - app.getSettingsHelper().updateExportListener(file, null); - } - } - - private void setGlobalExport(boolean globalExport) { - this.globalExport = globalExport; - } - - private List prepareSettingsItemsForExport() { - List settingsItems = new ArrayList<>(); - if (!globalExport) { - settingsItems.add(new ProfileSettingsItem(app, getAppMode())); - } - if (includeGlobalSettings) { - settingsItems.add(new GlobalSettingsItem(app.getSettings())); - } - if (includeAdditionalData) { - settingsItems.addAll(app.getSettingsHelper().prepareAdditionalSettingsItems(adapter.getData())); - } - return settingsItems; - } - - private void prepareFile() { - if (app != null) { - exportingProfile = true; - exportStartTime = System.currentTimeMillis(); - showExportProgressDialog(); - File tempDir = FileUtils.getTempDir(app); - String fileName = getFileName(); - List items = prepareSettingsItemsForExport(); - progress.setMax(getMaxProgress(items)); - app.getSettingsHelper().exportSettings(tempDir, fileName, getSettingsExportListener(), items, true); - } - } - - private int getMaxProgress(List items) { - long maxProgress = 0; - for (SettingsItem item : items) { - if (item instanceof FileSettingsItem) { - maxProgress += ((FileSettingsItem) item).getSize(); - } - } - return (int) maxProgress / (1 << 20); - } - - private String getFileName() { - if (globalExport) { - if (exportStartTime == 0) { - exportStartTime = System.currentTimeMillis(); - } - return "Export_" + DATE_FORMAT.format(new Date(exportStartTime)); - } else { - return getAppMode().toHumanString(); - } - } - - private void showExportProgressDialog() { - Context context = getContext(); - if (context == null) { - return; - } - if (progress != null) { - progress.dismiss(); - } - progress = new ProgressDialog(context); - progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); - progress.setCancelable(true); - progress.setTitle(app.getString(R.string.shared_string_export)); - progress.setMessage(app.getString(R.string.shared_string_preparing)); - progress.setButton(DialogInterface.BUTTON_NEGATIVE, app.getString(R.string.shared_string_cancel), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - cancelExport(); - } - }); - progress.setOnCancelListener(new DialogInterface.OnCancelListener() { - @Override - public void onCancel(DialogInterface dialog) { - cancelExport(); - } - }); - progress.show(); - } - - private void cancelExport() { - app.getSettingsHelper().cancelExportForFile(getExportFile()); - progress.dismiss(); - dismiss(); - } - - private SettingsExportListener getSettingsExportListener() { - if (exportListener == null) { - exportListener = new SettingsExportListener() { - - @Override - public void onSettingsExportFinished(@NonNull File file, boolean succeed) { - dismissExportProgressDialog(); - exportingProfile = false; - if (succeed) { - shareProfile(file); - } else { - app.showToastMessage(R.string.export_profile_failed); - } - } - - @Override - public void onSettingsExportProgressUpdate(int value) { - progress.setProgress(value); - } - }; - } - return exportListener; - } - - private void checkExportingFile() { - if (exportingProfile) { - File file = getExportFile(); - boolean fileExporting = app.getSettingsHelper().isFileExporting(file); - if (fileExporting) { - showExportProgressDialog(); - progress.setMax(progressMax); - progress.setProgress(progressValue); - app.getSettingsHelper().updateExportListener(file, getSettingsExportListener()); - } else if (file.exists()) { - dismissExportProgressDialog(); - shareProfile(file); - } - } - } - - private void dismissExportProgressDialog() { - FragmentActivity activity = getActivity(); - if (progress != null && activity != null && AndroidUtils.isActivityNotDestroyed(activity)) { - progress.dismiss(); - } - } - - private File getExportFile() { - File tempDir = FileUtils.getTempDir(app); - String fileName = getFileName(); - return new File(tempDir, fileName + IndexConstants.OSMAND_SETTINGS_FILE_EXT); - } - - private void shareProfile(@NonNull File file) { - try { - final Intent sendIntent = new Intent(); - sendIntent.setAction(Intent.ACTION_SEND); - sendIntent.putExtra(Intent.EXTRA_SUBJECT, file.getName()); - sendIntent.putExtra(Intent.EXTRA_STREAM, AndroidUtils.getUriForFile(getMyApplication(), file)); - sendIntent.setType("*/*"); - sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - startActivity(sendIntent); - dismiss(); - } catch (Exception e) { - Toast.makeText(requireContext(), R.string.export_profile_failed, Toast.LENGTH_SHORT).show(); - LOG.error("Share profile error", e); - } - } - - public static boolean showInstance(@NonNull FragmentManager fragmentManager, - Fragment target, @NonNull ApplicationMode appMode, - boolean globalExport) { - try { - ExportProfileBottomSheet fragment = new ExportProfileBottomSheet(); - fragment.setAppMode(appMode); - fragment.setGlobalExport(globalExport); - fragment.setTargetFragment(target, 0); - fragment.show(fragmentManager, TAG); - return true; - } catch (RuntimeException e) { - return false; - } - } -} diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java new file mode 100644 index 0000000000..79f7159909 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -0,0 +1,405 @@ +package net.osmand.plus.settings.fragments; + +import android.app.ProgressDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.ViewTreeObserver; +import android.widget.ExpandableListView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.activity.OnBackPressedCallback; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; +import androidx.core.view.ViewCompat; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; + +import com.google.android.material.appbar.CollapsingToolbarLayout; + +import net.osmand.AndroidUtils; +import net.osmand.FileUtils; +import net.osmand.IndexConstants; +import net.osmand.PlatformUtil; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; +import net.osmand.plus.base.BaseOsmAndFragment; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.ExportSettingsCategory; +import net.osmand.plus.settings.backend.ExportSettingsType; +import net.osmand.plus.settings.backend.backup.FileSettingsItem; +import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsExportListener; +import net.osmand.plus.settings.backend.backup.SettingsItem; +import net.osmand.plus.settings.fragments.ExportImportSettingsAdapter.OnItemSelectedListener; +import net.osmand.plus.widgets.TextViewEx; + +import org.apache.commons.logging.Log; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static net.osmand.plus.settings.fragments.BaseSettingsFragment.APP_MODE_KEY; + +public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItemSelectedListener { + + public static final String TAG = ImportSettingsFragment.class.getSimpleName(); + public static final Log LOG = PlatformUtil.getLog(ImportSettingsFragment.class.getSimpleName()); + + private static final String EXPORT_SETTINGS_TAG = "import_settings_tag"; + private static final String GLOBAL_EXPORT_KEY = "global_export_key"; + private static final String EXPORT_START_TIME_KEY = "export_start_time_key"; + private static final String EXPORTING_STARTED_KEY = "exporting_started_key"; + private static final String INCLUDE_ADDITIONAL_DATA_KEY = "include_additional_data_key"; + private static final String INCLUDE_GLOBAL_SETTINGS_KEY = "include_global_settings_key"; + private static final String PROGRESS_MAX_KEY = "progress_max_key"; + private static final String PROGRESS_VALUE_KEY = "progress_value_key"; + + private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd-MM-yy", Locale.US); + + private OsmandApplication app; + private Map> dataList; + + private ProgressDialog progress; + private ApplicationMode appMode; + private SettingsExportListener exportListener; + + private TextViewEx fileSize; + private LinearLayout buttonsContainer; + private ExpandableListView expandableList; + private ExportImportSettingsAdapter adapter; + + private int progressMax; + private int progressValue; + + private long exportStartTime; + + private boolean nightMode; + private boolean globalExport; + private boolean exportingStarted; + + @Override + public int getStatusBarColorId() { + return nightMode ? R.color.status_bar_color_dark : R.color.status_bar_color_light; + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + app = requireMyApplication(); + nightMode = !app.getSettings().isLightContent(); + if (savedInstanceState != null) { + appMode = ApplicationMode.valueOfStringKey(savedInstanceState.getString(APP_MODE_KEY), null); + globalExport = savedInstanceState.getBoolean(GLOBAL_EXPORT_KEY); + exportingStarted = savedInstanceState.getBoolean(EXPORTING_STARTED_KEY); + exportStartTime = savedInstanceState.getLong(EXPORT_START_TIME_KEY); + progressMax = savedInstanceState.getInt(PROGRESS_MAX_KEY); + progressValue = savedInstanceState.getInt(PROGRESS_VALUE_KEY); + } + dataList = app.getSettingsHelper().getAdditionalData(globalExport); + + requireActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { + @Override + public void handleOnBackPressed() { + showExitDialog(); + } + }); + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode); + View root = themedInflater.inflate(R.layout.fragment_import, container, false); + AndroidUtils.addStatusBarPadding21v(app, root); + + fileSize = root.findViewById(R.id.file_size); + expandableList = root.findViewById(R.id.list); + buttonsContainer = root.findViewById(R.id.buttons_container); + + Toolbar toolbar = root.findViewById(R.id.toolbar); + setupToolbar(toolbar); + ViewCompat.setNestedScrollingEnabled(expandableList, true); + View header = themedInflater.inflate(R.layout.list_item_description_header, null); + expandableList.addHeaderView(header); + + TextViewEx continueBtn = root.findViewById(R.id.continue_button); + continueBtn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + prepareFile(); + } + }); + ViewTreeObserver treeObserver = buttonsContainer.getViewTreeObserver(); + treeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + if (buttonsContainer != null) { + ViewTreeObserver vts = buttonsContainer.getViewTreeObserver(); + int height = buttonsContainer.getMeasuredHeight(); + expandableList.setPadding(0, 0, 0, height); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + vts.removeOnGlobalLayoutListener(this); + } else { + vts.removeGlobalOnLayoutListener(this); + } + } + } + }); + + adapter = new ExportImportSettingsAdapter(app, this, nightMode); + adapter.updateSettingsList(dataList); + expandableList.setAdapter(adapter); + + CollapsingToolbarLayout toolbarLayout = root.findViewById(R.id.toolbar_layout); + toolbarLayout.setTitle(getString(R.string.shared_string_export)); + TextView description = header.findViewById(R.id.description); + description.setText(R.string.select_data_to_export); + + return root; + } + + @Override + public void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + outState.putBoolean(GLOBAL_EXPORT_KEY, globalExport); + outState.putBoolean(EXPORTING_STARTED_KEY, exportingStarted); + outState.putLong(EXPORT_START_TIME_KEY, exportStartTime); + outState.putString(APP_MODE_KEY, appMode.getStringKey()); + if (progress != null) { + outState.putInt(PROGRESS_MAX_KEY, progress.getMax()); + outState.putInt(PROGRESS_VALUE_KEY, progress.getProgress()); + } + } + + @Override + public void onResume() { + super.onResume(); + checkExportingFile(); + } + + @Override + public void onPause() { + super.onPause(); + if (exportingStarted) { + File file = getExportFile(); + app.getSettingsHelper().updateExportListener(file, null); + } + } + + private void dismissFragment() { + FragmentManager fm = getFragmentManager(); + if (fm != null && !fm.isStateSaved()) { + getFragmentManager().popBackStack(EXPORT_SETTINGS_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE); + } + } + + public void showExitDialog() { + Context themedContext = UiUtilities.getThemedContext(getActivity(), nightMode); + AlertDialog.Builder dismissDialog = new AlertDialog.Builder(themedContext); + dismissDialog.setTitle(getString(R.string.shared_string_dismiss)); + dismissDialog.setMessage(getString(R.string.exit_without_saving)); + dismissDialog.setNegativeButton(R.string.shared_string_cancel, null); + dismissDialog.setPositiveButton(R.string.shared_string_exit, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dismissFragment(); + } + }); + dismissDialog.show(); + } + + private void setupToolbar(Toolbar toolbar) { + int color = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light); + toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_action_close, color)); + toolbar.setNavigationContentDescription(R.string.shared_string_close); + toolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showExitDialog(); + } + }); + } + + private void updateFileSize() { + long itemsSize = ExportImportSettingsAdapter.calculateItemsSize(adapter.getData()); + String size = itemsSize != 0 ? AndroidUtils.formatSize(app, itemsSize) : ""; + fileSize.setText(size); + } + + @Override + public void onCategorySelected(ExportSettingsCategory type, boolean selected) { + updateFileSize(); + } + + @Override + public void onTypeSelected(ExportSettingsType type, boolean selected) { + updateFileSize(); + } + + private void prepareFile() { + if (app != null) { + exportingStarted = true; + exportStartTime = System.currentTimeMillis(); + showExportProgressDialog(); + File tempDir = FileUtils.getTempDir(app); + String fileName = getFileName(); + List items = app.getSettingsHelper().prepareAdditionalSettingsItems(adapter.getData()); + progress.setMax(getMaxProgress(items)); + app.getSettingsHelper().exportSettings(tempDir, fileName, getSettingsExportListener(), items, true); + } + } + + private int getMaxProgress(List items) { + long maxProgress = 0; + for (SettingsItem item : items) { + if (item instanceof FileSettingsItem) { + maxProgress += ((FileSettingsItem) item).getSize(); + } + } + return (int) maxProgress / (1 << 20); + } + + private String getFileName() { + if (globalExport) { + if (exportStartTime == 0) { + exportStartTime = System.currentTimeMillis(); + } + return "Export_" + DATE_FORMAT.format(new Date(exportStartTime)); + } else { + return appMode.toHumanString(); + } + } + + private void showExportProgressDialog() { + Context context = getContext(); + if (context == null) { + return; + } + if (progress != null) { + progress.dismiss(); + } + progress = new ProgressDialog(context); + progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); + progress.setCancelable(true); + progress.setTitle(app.getString(R.string.shared_string_export)); + progress.setMessage(app.getString(R.string.shared_string_preparing)); + progress.setButton(DialogInterface.BUTTON_NEGATIVE, app.getString(R.string.shared_string_cancel), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + cancelExport(); + } + }); + progress.setOnCancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + cancelExport(); + } + }); + progress.show(); + } + + private void cancelExport() { + app.getSettingsHelper().cancelExportForFile(getExportFile()); + progress.dismiss(); + dismissFragment(); + } + + private SettingsExportListener getSettingsExportListener() { + if (exportListener == null) { + exportListener = new SettingsExportListener() { + + @Override + public void onSettingsExportFinished(@NonNull File file, boolean succeed) { + dismissExportProgressDialog(); + exportingStarted = false; + if (succeed) { + shareProfile(file); + } else { + app.showToastMessage(R.string.export_profile_failed); + } + } + + @Override + public void onSettingsExportProgressUpdate(int value) { + progress.setProgress(value); + } + }; + } + return exportListener; + } + + private void checkExportingFile() { + if (exportingStarted) { + File file = getExportFile(); + boolean fileExporting = app.getSettingsHelper().isFileExporting(file); + if (fileExporting) { + showExportProgressDialog(); + progress.setMax(progressMax); + progress.setProgress(progressValue); + app.getSettingsHelper().updateExportListener(file, getSettingsExportListener()); + } else if (file.exists()) { + dismissExportProgressDialog(); + shareProfile(file); + } + } + } + + private void dismissExportProgressDialog() { + FragmentActivity activity = getActivity(); + if (progress != null && activity != null && AndroidUtils.isActivityNotDestroyed(activity)) { + progress.dismiss(); + } + } + + private File getExportFile() { + File tempDir = FileUtils.getTempDir(app); + String fileName = getFileName(); + return new File(tempDir, fileName + IndexConstants.OSMAND_SETTINGS_FILE_EXT); + } + + private void shareProfile(@NonNull File file) { + try { + final Intent sendIntent = new Intent(); + sendIntent.setAction(Intent.ACTION_SEND); + sendIntent.putExtra(Intent.EXTRA_SUBJECT, file.getName()); + sendIntent.putExtra(Intent.EXTRA_STREAM, AndroidUtils.getUriForFile(getMyApplication(), file)); + sendIntent.setType("*/*"); + sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + startActivity(sendIntent); + dismissFragment(); + } catch (Exception e) { + Toast.makeText(requireContext(), R.string.export_profile_failed, Toast.LENGTH_SHORT).show(); + LOG.error("Share profile error", e); + } + } + + public static boolean showInstance(@NonNull FragmentManager fragmentManager, @NonNull ApplicationMode appMode, boolean globalExport) { + try { + ExportSettingsFragment fragment = new ExportSettingsFragment(); + fragment.appMode = appMode; + fragment.globalExport = globalExport; + fragmentManager.beginTransaction(). + replace(R.id.fragmentContainer, fragment, TAG) + .addToBackStack(EXPORT_SETTINGS_TAG) + .commitAllowingStateLoss(); + return true; + } catch (RuntimeException e) { + return false; + } + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index 443cd583f0..84c1b295a2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -22,13 +22,13 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.core.view.ViewCompat; import androidx.fragment.app.FragmentManager; import com.google.android.material.appbar.CollapsingToolbarLayout; import net.osmand.AndroidUtils; -import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; @@ -48,6 +48,7 @@ import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; +import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.AvoidRoadsSettingsItem; import net.osmand.plus.settings.backend.backup.FavoritesSettingsItem; @@ -66,38 +67,44 @@ import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportAsyncTask; import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportType; import net.osmand.plus.settings.backend.backup.SettingsItem; import net.osmand.plus.settings.backend.backup.SettingsItemType; +import net.osmand.plus.settings.fragments.ExportImportSettingsAdapter.OnItemSelectedListener; import net.osmand.plus.widgets.TextViewEx; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; import java.io.File; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -public class ImportSettingsFragment extends BaseOsmAndFragment { +public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItemSelectedListener { public static final String TAG = ImportSettingsFragment.class.getSimpleName(); public static final Log LOG = PlatformUtil.getLog(ImportSettingsFragment.class.getSimpleName()); + + protected static final String IMPORT_SETTINGS_TAG = "import_settings_tag"; private static final String DUPLICATES_START_TIME_KEY = "duplicates_start_time"; private static final long MIN_DELAY_TIME_MS = 500; - static final String IMPORT_SETTINGS_TAG = "import_settings_tag"; + private OsmandApplication app; + + private File file; + private SettingsHelper settingsHelper; + private List settingsItems; + private Map> dataList; + private ExportImportSettingsAdapter adapter; private ExpandableListView expandableList; - private TextViewEx selectBtn; private TextView description; - private List settingsItems; - private File file; - private boolean allSelected; - private boolean nightMode; private LinearLayout buttonsContainer; private ProgressBar progressBar; + private TextViewEx fileSize; + private TextViewEx fileSizeDescr; private CollapsingToolbarLayout toolbarLayout; - private SettingsHelper settingsHelper; + + private boolean nightMode; private long duplicateStartTime; public static void showInstance(@NonNull FragmentManager fm, @NonNull List settingsItems, @NonNull File file) { @@ -134,11 +141,13 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { View root = inflater.inflate(R.layout.fragment_import, container, false); Toolbar toolbar = root.findViewById(R.id.toolbar); TextViewEx continueBtn = root.findViewById(R.id.continue_button); + fileSize = root.findViewById(R.id.file_size); toolbarLayout = root.findViewById(R.id.toolbar_layout); - selectBtn = root.findViewById(R.id.select_button); expandableList = root.findViewById(R.id.list); buttonsContainer = root.findViewById(R.id.buttons_container); progressBar = root.findViewById(R.id.progress_bar); + fileSizeDescr = root.findViewById(R.id.file_size_descr); + fileSizeDescr.setText(R.string.file_size_needed_for_import); setupToolbar(toolbar); ViewCompat.setNestedScrollingEnabled(expandableList, true); View header = inflater.inflate(R.layout.list_item_description_header, null); @@ -155,14 +164,6 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { } } }); - selectBtn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - allSelected = !allSelected; - selectBtn.setText(allSelected ? R.string.shared_string_deselect_all : R.string.shared_string_select_all); - adapter.selectAll(allSelected); - } - }); if (Build.VERSION.SDK_INT >= 21) { AndroidUtils.addStatusBarPadding21v(app, root); } @@ -207,10 +208,10 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { } } - adapter = new ExportImportSettingsAdapter(app, nightMode, true); - Map> itemsMap = new HashMap<>(); + adapter = new ExportImportSettingsAdapter(app, this, nightMode); + Map> itemsMap = new HashMap<>(); if (settingsItems != null) { - itemsMap = SettingsHelper.getSettingsToOperate(settingsItems, false); + itemsMap = SettingsHelper.getSettingsToOperateByCategory(settingsItems, false); adapter.updateSettingsList(itemsMap); } expandableList.setAdapter(adapter); @@ -224,7 +225,7 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { } else { toolbarLayout.setTitle(getString(R.string.shared_string_import)); } - if (itemsMap.size() == 1 && itemsMap.containsKey(ExportSettingsType.PROFILE)) { + if (itemsMap.size() == 1 && itemsMap.containsKey(ExportSettingsCategory.SETTINGS)) { expandableList.expandGroup(0); } } @@ -235,15 +236,6 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { outState.putLong(DUPLICATES_START_TIME_KEY, duplicateStartTime); } - @Override - public void onResume() { - super.onResume(); - Activity activity = getActivity(); - if (activity instanceof MapActivity) { - ((MapActivity) activity).closeDrawer(); - } - } - private void updateUi(int toolbarTitleRes, int descriptionRes) { if (file != null) { String fileName = file.getName(); @@ -296,31 +288,6 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { } } - private static class ReloadIndexesTack extends AsyncTask { - - private final WeakReference mapActivityRef; - private final OsmandApplication app; - - ReloadIndexesTack(@NonNull MapActivity mapActivity) { - this.mapActivityRef = new WeakReference<>(mapActivity); - this.app = mapActivity.getMyApplication(); - } - - @Override - protected Void doInBackground(Void[] params) { - app.getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, new ArrayList()); - return null; - } - - @Override - protected void onPostExecute(Void aVoid) { - MapActivity mapActivity = mapActivityRef.get(); - if (mapActivity != null) { - mapActivity.refreshMap(); - } - } - } - private SettingsHelper.CheckDuplicatesListener getDuplicatesListener() { return new SettingsHelper.CheckDuplicatesListener() { @Override @@ -544,9 +511,8 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { } private void setupToolbar(Toolbar toolbar) { - toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_action_close, nightMode - ? getResources().getColor(R.color.active_buttons_and_links_text_dark) - : getResources().getColor(R.color.active_buttons_and_links_text_light))); + int color = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light); + toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_action_close, color)); toolbar.setNavigationContentDescription(R.string.shared_string_close); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override @@ -559,4 +525,20 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { public void setFile(File file) { this.file = file; } + + private void updateFileSize() { + long itemsSize = ExportImportSettingsAdapter.calculateItemsSize(adapter.getData()); + String size = itemsSize != 0 ? AndroidUtils.formatSize(app, itemsSize) : ""; + fileSize.setText(size); + } + + @Override + public void onCategorySelected(ExportSettingsCategory type, boolean selected) { + updateFileSize(); + } + + @Override + public void onTypeSelected(ExportSettingsType type, boolean selected) { + updateFileSize(); + } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/MainSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/MainSettingsFragment.java index d7e1f65288..05a2b94d2f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/MainSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/MainSettingsFragment.java @@ -153,7 +153,7 @@ public class MainSettingsFragment extends BaseSettingsFragment { if (mapActivity != null) { ApplicationMode mode = getSelectedAppMode(); FragmentManager fragmentManager = mapActivity.getSupportFragmentManager(); - ExportProfileBottomSheet.showInstance(fragmentManager, this, mode, true); + ExportSettingsFragment.showInstance(fragmentManager, mode, true); } } return super.onPreferenceClick(preference); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java new file mode 100644 index 0000000000..d5776a7f45 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java @@ -0,0 +1,37 @@ +package net.osmand.plus.settings.fragments; + +import android.os.AsyncTask; + +import androidx.annotation.NonNull; + +import net.osmand.IProgress; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.activities.MapActivity; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; + +class ReloadIndexesTack extends AsyncTask { + + private final WeakReference mapActivityRef; + private final OsmandApplication app; + + ReloadIndexesTack(@NonNull MapActivity mapActivity) { + this.mapActivityRef = new WeakReference<>(mapActivity); + this.app = mapActivity.getMyApplication(); + } + + @Override + protected Void doInBackground(Void[] params) { + app.getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, new ArrayList()); + return null; + } + + @Override + protected void onPostExecute(Void aVoid) { + MapActivity mapActivity = mapActivityRef.get(); + if (mapActivity != null) { + mapActivity.refreshMap(); + } + } +} From fac3add4e7f5f9b6b0f37b5801c47df95246afa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Mon, 16 Nov 2020 09:39:28 +0000 Subject: [PATCH 02/70] Login strings reworked --- OsmAnd/res/values/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 07a55e3d92..3a3bb2916c 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -14,10 +14,10 @@ Search history I already have an account Create new account - Photos are provided by open data project OpenPlaceReviews.org. In order to upload your photos you need to sign up on website. + Log in on the open data project website OpenPlaceReviews.org to upload even more photos. Register on\nOpenPlaceReviews.org Add photo - You can log in using the safe OAuth method or use your login and password. + Log in using the safe OAuth method or use your username and password. Comment OSM Note Close OSM Note Trackable means that the trace will not show up in any public listings but trackpoints from it will still be available through the public GPS API with timestamps. Other users will only be able to download processed trackpoints from your trace which can\'t be associated with you directly. @@ -32,15 +32,15 @@ OsmAnd Live subscription has been expired There is a problem with your subscription. Click the button to go to the Google Play subscription settings to fix your payment method. Manage subscription - Login + Username Password Account - Use login and password - You need to login to upload new or modified changes. \n\nYou can log in using the safe OAuth method or use your login and password. + Log in with username and password + Log in to upload new or modified changes,\n\neither with OAuth or using your username and password. You can view all your not yet uploaded edits or OSM bugs in %1$s. Uploaded points don’t show in OsmAnd. - Sign in with OpenStreetMap - Login to OpenStreetMap.org - Login to OpenStreetMap + Log in with OpenStreetMap + Login for OpenStreetMap.org + Login for OpenStreetMap These plugin setting are global, and apply to all profiles You need to add at least two points Travel @@ -59,10 +59,10 @@ Graph Use 2-phase A* routing algorithm File is already imported in OsmAnd - Logout successful + Logged out Clear OpenStreetMap OAuth token Log in via OAuth - Perform an OAuth Login to use osmedit features + Log in with OAuth to use osmedit features Switch to Java (safe) Public Transport routing calculation Native Public Transport development Recalculates only the initial part of the route. Can be used for long trips. From 77a7b03144743b1468803e134d7bc5300604e060 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 16 Nov 2020 16:55:06 +0200 Subject: [PATCH 03/70] Fix crash on taping "Upload" in My places. --- .../SendOsmNoteBottomSheetFragment.java | 15 ++++++++-- .../dialogs/SendPoiBottomSheetFragment.java | 28 ++++++++++++------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index 407e8c0b5f..8cd61909e4 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -1,5 +1,6 @@ package net.osmand.plus.osmedit.dialogs; +import android.app.Activity; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.ContextThemeWrapper; @@ -24,6 +25,7 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; +import net.osmand.plus.dialogs.ProgressDialogFragment; import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.osmedit.oauth.OsmOAuthAuthorizationAdapter; @@ -171,9 +173,16 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen @Override protected void onRightBottomButtonClick() { - ProgressDialogPoiUploader progressDialogPoiUploader; - progressDialogPoiUploader = new SimpleProgressDialogPoiUploader((MapActivity) getActivity()); - progressDialogPoiUploader.showProgressDialog(poi, false, uploadAnonymously.isChecked()); + ProgressDialogPoiUploader progressDialogPoiUploader = null; + Activity activity = getActivity(); + if (activity instanceof MapActivity) { + progressDialogPoiUploader = new SimpleProgressDialogPoiUploader((MapActivity) activity); + } else if (getParentFragment() instanceof ProgressDialogFragment) { + progressDialogPoiUploader = (ProgressDialogPoiUploader) getParentFragment(); + } + if (progressDialogPoiUploader != null) { + progressDialogPoiUploader.showProgressDialog(poi, false, uploadAnonymously.isChecked()); + } dismiss(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index 7755568e43..dd862d0608 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -1,5 +1,6 @@ package net.osmand.plus.osmedit.dialogs; +import android.app.Activity; import android.os.Bundle; import android.view.ContextThemeWrapper; import android.view.View; @@ -20,6 +21,7 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; +import net.osmand.plus.dialogs.ProgressDialogFragment; import net.osmand.plus.osmedit.OpenstreetmapPoint; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.settings.backend.OsmandSettings; @@ -109,19 +111,25 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { @Override protected void onRightBottomButtonClick() { - final ProgressDialogPoiUploader progressDialogPoiUploader; - progressDialogPoiUploader = new SimpleProgressDialogPoiUploader((MapActivity) getActivity()); - - String comment = messageEditText.getText().toString(); - if (comment.length() > 0) { - for (OsmPoint osmPoint : poi) { - if (osmPoint.getGroup() == OsmPoint.Group.POI) { - ((OpenstreetmapPoint) osmPoint).setComment(comment); - break; + ProgressDialogPoiUploader progressDialogPoiUploader = null; + Activity activity = getActivity(); + if (activity instanceof MapActivity) { + progressDialogPoiUploader = new SimpleProgressDialogPoiUploader((MapActivity) activity); + } else if (getParentFragment() instanceof ProgressDialogFragment) { + progressDialogPoiUploader = (ProgressDialogPoiUploader) getParentFragment(); + } + if (progressDialogPoiUploader != null) { + String comment = messageEditText.getText().toString(); + if (comment.length() > 0) { + for (OsmPoint osmPoint : poi) { + if (osmPoint.getGroup() == OsmPoint.Group.POI) { + ((OpenstreetmapPoint) osmPoint).setComment(comment); + break; + } } } + progressDialogPoiUploader.showProgressDialog(poi, closeChangeSet.isChecked(), false); } - progressDialogPoiUploader.showProgressDialog(poi, closeChangeSet.isChecked(), false); dismiss(); } From 02da17f726d93fb3340d2a4a12e6be8333d7fed7 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Mon, 16 Nov 2020 17:25:02 +0200 Subject: [PATCH 04/70] Small refactoring of icon receiving and setup shareIcon to white color in all themes --- .../plus/search/QuickSearchDialogFragment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java index 3c55261668..9badea394e 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java @@ -259,6 +259,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final MapActivity mapActivity = getMapActivity(); + final UiUtilities iconsCache = app.getUIUtilities(); final View view = inflater.inflate(R.layout.search_dialog_fragment, container, false); toolbarController = new QuickSearchToolbarController(); @@ -325,9 +326,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC buttonToolbarView = view.findViewById(R.id.button_toolbar_layout); buttonToolbarImage = (ImageView) view.findViewById(R.id.buttonToolbarImage); - buttonToolbarImage.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_marker_dark)); + buttonToolbarImage.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_marker_dark)); buttonToolbarFilter = (ImageButton) view.findViewById(R.id.filterButton); - buttonToolbarFilter.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_filter)); + buttonToolbarFilter.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_filter)); buttonToolbarFilter.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -474,7 +475,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC if (!app.getSettings().isLightContent()) { toolbar.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.app_bar_color_dark)); } - Drawable icBack = app.getUIUtilities().getThemedIcon(AndroidUtils.getNavigationIconResId(app)); + Drawable icBack = iconsCache.getThemedIcon(AndroidUtils.getNavigationIconResId(app)); toolbar.setNavigationIcon(icBack); toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up); toolbar.setNavigationOnClickListener( @@ -489,7 +490,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC ); toolbarEdit = (Toolbar) view.findViewById(R.id.toolbar_edit); - toolbarEdit.setNavigationIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_remove_dark)); + toolbarEdit.setNavigationIcon(iconsCache.getIcon(R.drawable.ic_action_remove_dark)); toolbarEdit.setNavigationContentDescription(R.string.shared_string_cancel); toolbarEdit.setNavigationOnClickListener( new OnClickListener() { @@ -501,8 +502,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC ); titleEdit = (TextView) view.findViewById(R.id.titleEdit); - Drawable shareIcon = app.getUIUtilities().getIcon(R.drawable.ic_action_gshare_dark, - nightMode ? R.color.text_color_secondary_dark : R.color.text_color_secondary_light); + Drawable shareIcon = iconsCache.getIcon(R.drawable.ic_action_gshare_dark, R.color.color_white); shareIcon = AndroidUtils.getDrawableForDirection(app, shareIcon); ImageView shareButton = (ImageView) view.findViewById(R.id.shareButton); shareButton.setImageDrawable(shareIcon); @@ -644,7 +644,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC progressBar = (ProgressBar) view.findViewById(R.id.searchProgressBar); clearButton = (ImageButton) view.findViewById(R.id.clearButton); - clearButton.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark)); + clearButton.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_remove_dark)); clearButton.setOnClickListener( new OnClickListener() { @Override From 49c0e998bf69134eecfd81ef3f7513bea86f4864 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 16 Nov 2020 23:56:35 +0200 Subject: [PATCH 05/70] Fix crash: landscape tap on "Sign in..." --- .../net/osmand/plus/helpers/IntentHelper.java | 20 +++- .../oauth/OsmOAuthAuthorizationAdapter.java | 109 ++++++++++++++---- .../plus/osmedit/oauth/OsmOAuthHelper.java | 33 +----- 3 files changed, 104 insertions(+), 58 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index 5fa07a91e3..25cc6dcc30 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -297,12 +297,7 @@ public class IntentHelper { Uri uri = intent.getData(); if (uri.toString().startsWith("osmand-oauth")) { String oauthVerifier = uri.getQueryParameter("oauth_verifier"); - app.getOsmOAuthHelper().authorize(oauthVerifier); - for (Fragment fragment : mapActivity.getSupportFragmentManager().getFragments()) { - if (fragment instanceof OsmAuthorizationListener) { - ((OsmAuthorizationListener) fragment).authorizationCompleted(); - } - } + app.getOsmOAuthHelper().authorize(oauthVerifier, getOnAuthorizeListener()); mapActivity.setIntent(null); return true; } @@ -310,6 +305,19 @@ public class IntentHelper { return false; } + private OsmAuthorizationListener getOnAuthorizeListener() { + return new OsmAuthorizationListener() { + @Override + public void authorizationCompleted() { + for (Fragment fragment : mapActivity.getSupportFragmentManager().getFragments()) { + if (fragment instanceof OsmAuthorizationListener) { + ((OsmAuthorizationListener) fragment).authorizationCompleted(); + } + } + } + }; + } + private boolean handleSendText(Intent intent) { String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); if (!Algorithms.isEmpty(sharedText)) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java index 7c2562b580..726a1e1b37 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java @@ -1,10 +1,13 @@ package net.osmand.plus.osmedit.oauth; import android.net.TrafficStats; +import android.os.AsyncTask; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; +import androidx.annotation.NonNull; + import com.github.scribejava.core.model.OAuth1AccessToken; import com.github.scribejava.core.model.OAuth1RequestToken; import com.github.scribejava.core.model.OAuthAsyncRequestCallback; @@ -16,18 +19,22 @@ import net.osmand.osm.oauth.OsmOAuthAuthorizationClient; import net.osmand.plus.BuildConfig; import net.osmand.plus.OsmandApplication; +import org.apache.commons.logging.Log; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.util.concurrent.ExecutionException; +import static net.osmand.plus.osmedit.oauth.OsmOAuthHelper.*; + public class OsmOAuthAuthorizationAdapter { private static final int THREAD_ID = 10101; private static final String OSM_USER = "user"; private static final String DISPLAY_NAME = "display_name"; private static final String OSM_USER_DETAILS_URL = "https://api.openstreetmap.org/api/0.6/user/details"; + public final static Log log = PlatformUtil.getLog(OsmOAuthAuthorizationAdapter.class); private OsmandApplication app; private OsmOAuthAuthorizationClient client = @@ -61,9 +68,8 @@ public class OsmOAuthAuthorizationAdapter { } } - public void startOAuth(ViewGroup rootLayout) { - OAuth1RequestToken requestToken = client.startOAuth(); - loadWebView(rootLayout, client.getService().getAuthorizationUrl(requestToken)); + public void startOAuth(final ViewGroup rootLayout) { + new StartOAuthAsyncTask(rootLayout).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null); } private void saveToken() { @@ -93,30 +99,91 @@ public class OsmOAuthAuthorizationAdapter { return client.performRequestWithoutAuth(url, method, body); } - public void authorize(String oauthVerifier) { - client.authorize(oauthVerifier); - saveToken(); + public void authorize(String oauthVerifier, final OsmOAuthHelper helper, final OsmAuthorizationListener listener) { + new AuthorizeAsyncTask(helper, listener).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, oauthVerifier); } - public String getUserName() throws InterruptedException, ExecutionException, IOException, XmlPullParserException { - Response response = getOsmUserDetails(); - return parseUserName(response); + private class StartOAuthAsyncTask extends AsyncTask { + + private final ViewGroup rootLayout; + + public StartOAuthAsyncTask(ViewGroup rootLayout) { + this.rootLayout = rootLayout; + } + + @Override + protected OAuth1RequestToken doInBackground(Void... params) { + return client.startOAuth(); + } + + @Override + protected void onPostExecute(@NonNull OAuth1RequestToken requestToken) { + loadWebView(rootLayout, client.getService().getAuthorizationUrl(requestToken)); + } + } - public Response getOsmUserDetails() throws InterruptedException, ExecutionException, IOException { - return performRequest(OSM_USER_DETAILS_URL, Verb.GET.name(), null); - } + private class AuthorizeAsyncTask extends AsyncTask { - public String parseUserName(Response response) throws XmlPullParserException, IOException { - String userName = null; - XmlPullParser parser = PlatformUtil.newXMLPullParser(); - parser.setInput(response.getStream(), "UTF-8"); - int tok; - while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) { - if (tok == XmlPullParser.START_TAG && OSM_USER.equals(parser.getName())) { - userName = parser.getAttributeValue("", DISPLAY_NAME); + private final OsmOAuthHelper helper; + private final OsmAuthorizationListener listener; + + public AuthorizeAsyncTask(OsmOAuthHelper helper, OsmAuthorizationListener listener) { + this.helper = helper; + this.listener = listener; + } + + @Override + protected Void doInBackground(String... oauthVerifier) { + client.authorize(oauthVerifier[0]); + saveToken(); + updateUserName(); + return null; + } + + @Override + protected void onPostExecute(Void result) { + if (listener != null) { + listener.authorizationCompleted(); } } - return userName; + + public void updateUserName() { + String userName = ""; + try { + userName = getUserName(); + } catch (InterruptedException e) { + log.error(e); + } catch (ExecutionException e) { + log.error(e); + } catch (IOException e) { + log.error(e); + } catch (XmlPullParserException e) { + log.error(e); + } + app.getSettings().USER_DISPLAY_NAME.set(userName); + } + + public String getUserName() throws InterruptedException, ExecutionException, IOException, XmlPullParserException { + Response response = getOsmUserDetails(); + return parseUserName(response); + } + + public Response getOsmUserDetails() throws InterruptedException, ExecutionException, IOException { + return performRequest(OSM_USER_DETAILS_URL, Verb.GET.name(), null); + } + + public String parseUserName(Response response) throws XmlPullParserException, IOException { + String userName = null; + XmlPullParser parser = PlatformUtil.newXMLPullParser(); + parser.setInput(response.getStream(), "UTF-8"); + int tok; + while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) { + if (tok == XmlPullParser.START_TAG && OSM_USER.equals(parser.getName())) { + userName = parser.getAttributeValue("", DISPLAY_NAME); + } + } + return userName; + } } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java index d13bf624f2..a9ff75c6b5 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java @@ -4,25 +4,13 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; -import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; -import org.apache.commons.logging.Log; -import org.xmlpull.v1.XmlPullParserException; - -import java.io.IOException; -import java.util.concurrent.ExecutionException; - public class OsmOAuthHelper { - private static final Log log = PlatformUtil.getLog(OsmOAuthHelper.class); - - private final OsmandApplication app; - private final OsmOAuthAuthorizationAdapter authorizationAdapter; public OsmOAuthHelper(@NonNull OsmandApplication app) { - this.app = app; authorizationAdapter = new OsmOAuthAuthorizationAdapter(app); } @@ -30,31 +18,14 @@ public class OsmOAuthHelper { authorizationAdapter.startOAuth(view); } - public void authorize(String oauthVerifier) { - authorizationAdapter.authorize(oauthVerifier); - updateUserName(); + public void authorize(String oauthVerifier, OsmAuthorizationListener listener) { + authorizationAdapter.authorize(oauthVerifier, this, listener); } public OsmOAuthAuthorizationAdapter getAuthorizationAdapter() { return authorizationAdapter; } - private void updateUserName() { - String userName = ""; - try { - userName = authorizationAdapter.getUserName(); - } catch (InterruptedException e) { - log.error(e); - } catch (ExecutionException e) { - log.error(e); - } catch (IOException e) { - log.error(e); - } catch (XmlPullParserException e) { - log.error(e); - } - app.getSettings().USER_DISPLAY_NAME.set(userName); - } - public interface OsmAuthorizationListener { void authorizationCompleted(); } From 06edbffb5d4ac5620a8b08b9a6a1acc39eed7da8 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Tue, 17 Nov 2020 01:34:24 +0200 Subject: [PATCH 06/70] UI fix: POI/OSM Note, Send GPX , Login/Password. TextFields Background color make the same for all textfields. Textfield top right and left rounded corners are missing. Account block, check text styles and sizes and size in Figma. If the text filed not empty, put the cursor at the end of the text. --- OsmAnd/res/layout/osm_login_data.xml | 11 +- OsmAnd/res/layout/send_gpx_fragment.xml | 67 ++-- OsmAnd/res/layout/send_osm_note_fragment.xml | 297 +++++++++--------- OsmAnd/res/layout/send_poi_fragment.xml | 202 ++++++------ .../SendOsmNoteBottomSheetFragment.java | 4 +- .../dialogs/SendPoiBottomSheetFragment.java | 1 + .../bottomsheets/OsmLoginDataBottomSheet.java | 7 - 7 files changed, 301 insertions(+), 288 deletions(-) diff --git a/OsmAnd/res/layout/osm_login_data.xml b/OsmAnd/res/layout/osm_login_data.xml index 4679608265..363287fe72 100644 --- a/OsmAnd/res/layout/osm_login_data.xml +++ b/OsmAnd/res/layout/osm_login_data.xml @@ -1,5 +1,6 @@ + android:hint="@string/user_login" + app:boxBackgroundColor="?attr/text_input_background" + app:boxStrokeColor="@color/osmand_orange" + app:hintTextColor="@color/text_color_secondary_light"> + android:hint="@string/user_password" + app:boxBackgroundColor="?attr/text_input_background" + app:boxStrokeColor="@color/osmand_orange" + app:hintTextColor="@color/text_color_secondary_light"> @@ -51,6 +51,7 @@ android:layout_height="wrap_content" android:layout_marginBottom="@dimen/bottom_sheet_content_margin" android:hint="@string/gpx_tags_txt" + app:boxBackgroundColor="?attr/text_input_background" app:boxStrokeColor="@color/osmand_orange" app:helperText="@string/enter_text_separated" app:helperTextEnabled="true" @@ -62,7 +63,6 @@ android:layout_height="wrap_content" android:layout_marginBottom="@dimen/subHeaderPadding" android:imeOptions="actionDone" - android:background = "?attr/text_input_background" android:text="osmand" /> @@ -144,45 +144,41 @@ android:background="?attr/dashboard_divider" /> + android:orientation="horizontal"> + + + android:layout_width="216dp" + android:layout_height="@dimen/bottom_sheet_descr_height" + android:gravity="center_vertical" + android:orientation="vertical"> - \ No newline at end of file diff --git a/OsmAnd/res/layout/send_osm_note_fragment.xml b/OsmAnd/res/layout/send_osm_note_fragment.xml index 6cc897ee89..d98e60b260 100644 --- a/OsmAnd/res/layout/send_osm_note_fragment.xml +++ b/OsmAnd/res/layout/send_osm_note_fragment.xml @@ -1,169 +1,178 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:osmand="http://schemas.android.com/apk/res-auto" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> - + - + - - + + - + - + - + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + diff --git a/OsmAnd/res/layout/send_poi_fragment.xml b/OsmAnd/res/layout/send_poi_fragment.xml index 2f1ee7cf51..d81aa9cdda 100644 --- a/OsmAnd/res/layout/send_poi_fragment.xml +++ b/OsmAnd/res/layout/send_poi_fragment.xml @@ -1,123 +1,127 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:osmand="http://schemas.android.com/apk/res-auto" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> - + - + - + + android:imeOptions="actionDone" + android:lineSpacingExtra="5sp"/> - + - + - + - + - + - + - + - + - + - + + + diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index 407e8c0b5f..79f082badd 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -6,6 +6,7 @@ import android.view.ContextThemeWrapper; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; +import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; @@ -71,8 +72,9 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen final View sendOsmNoteView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_osm_note_fragment, null); - TextView noteText = sendOsmNoteView.findViewById(R.id.note_text); + EditText noteText = sendOsmNoteView.findViewById(R.id.note_text); noteText.setText(((OsmNotesPoint) poi[0]).getText()); + noteText.setSelection(noteText.getText().length()); TextInputLayout noteHint = sendOsmNoteView.findViewById(R.id.note_hint); noteHint.setHint(AndroidUtils.addColon(app, R.string.osn_bug_name)); accountBlockView = sendOsmNoteView.findViewById(R.id.account_container); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index 7755568e43..02c6527948 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -60,6 +60,7 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { messageEditText = sendOsmPoiView.findViewById(R.id.message_field); String defaultChangeSet = createDefaultChangeSet(app); messageEditText.setText(defaultChangeSet); + messageEditText.setSelection(messageEditText.getText().length()); final TextView accountName = sendOsmPoiView.findViewById(R.id.user_name); OsmandSettings settings = app.getSettings(); String userNameOAuth = settings.USER_DISPLAY_NAME.get(); diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java index 169d89b8cd..622fc11977 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java @@ -47,8 +47,6 @@ public class OsmLoginDataBottomSheet extends BasePreferenceBottomSheet { userNameEditText = view.findViewById(R.id.name_edit_text); passwordEditText = view.findViewById(R.id.password_edit_text); - userNameEditText.setBackgroundColor(getResolvedColor(R.color.background_field)); - passwordEditText.setBackgroundColor(getResolvedColor(R.color.background_field)); String name = app.getSettings().USER_NAME.get(); String password = app.getSettings().USER_PASSWORD.get(); @@ -64,11 +62,6 @@ public class OsmLoginDataBottomSheet extends BasePreferenceBottomSheet { TextInputLayout loginBox = view.findViewById(R.id.name_text_box); TextInputLayout passwordBox = view.findViewById(R.id.password_text_box); - loginBox.setBoxStrokeColor(getResolvedColor(R.color.osmand_orange)); - loginBox.setHintTextColor(AppCompatResources.getColorStateList(getContext(),R.color.hint_label)); - passwordBox.setBoxStrokeColor(getResolvedColor(R.color.osmand_orange)); - passwordBox.setHintTextColor(AppCompatResources.getColorStateList(getContext(),R.color.hint_label)); - passwordBox.setStartIconDrawable(R.drawable.ic_action_lock); loginBox.setStartIconDrawable(R.drawable.ic_action_user_account); loginBox.setEndIconMode(TextInputLayout.END_ICON_CLEAR_TEXT); From e5152aa947b4bfc6f2a49961786025a52b02c817 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 17 Nov 2020 13:12:29 +0200 Subject: [PATCH 07/70] Clean up UI and code --- .../res/layout/enough_space_warning_card.xml | 62 +++ OsmAnd/res/layout/fragment_import.xml | 36 +- .../layout/list_item_description_header.xml | 14 +- .../layout/profile_data_list_item_group.xml | 32 +- OsmAnd/res/values/sizes.xml | 2 + OsmAnd/res/values/strings.xml | 41 +- OsmAnd/src/net/osmand/AndroidUtils.java | 8 + .../plus/download/DownloadActivity.java | 41 +- .../plus/download/ReloadIndexesTask.java | 49 ++ .../settings/backend/ExportSettingsType.java | 24 +- .../backend/backup/SettingsHelper.java | 48 +- .../settings/fragments/ExportDataObject.java | 4 +- .../ExportImportSettingsAdapter.java | 499 +++++++++++------- .../fragments/ExportSettingsAdapter.java | 337 ++++++++++++ .../fragments/ExportSettingsFragment.java | 66 ++- .../fragments/ImportSettingsFragment.java | 92 ++-- .../settings/fragments/ReloadIndexesTack.java | 37 -- 17 files changed, 1023 insertions(+), 369 deletions(-) create mode 100644 OsmAnd/res/layout/enough_space_warning_card.xml create mode 100644 OsmAnd/src/net/osmand/plus/download/ReloadIndexesTask.java create mode 100644 OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java delete mode 100644 OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java diff --git a/OsmAnd/res/layout/enough_space_warning_card.xml b/OsmAnd/res/layout/enough_space_warning_card.xml new file mode 100644 index 0000000000..a39076eb99 --- /dev/null +++ b/OsmAnd/res/layout/enough_space_warning_card.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml index e9852ea58d..ef83bba63d 100644 --- a/OsmAnd/res/layout/fragment_import.xml +++ b/OsmAnd/res/layout/fragment_import.xml @@ -21,46 +21,49 @@ + android:paddingBottom="@dimen/bottom_sheet_title_padding_bottom" + android:visibility="invisible" + tools:visibility="visible"> @@ -78,26 +82,32 @@ android:layout_height="match_parent" /> diff --git a/OsmAnd/res/layout/list_item_description_header.xml b/OsmAnd/res/layout/list_item_description_header.xml index f27db51731..9ff915193d 100644 --- a/OsmAnd/res/layout/list_item_description_header.xml +++ b/OsmAnd/res/layout/list_item_description_header.xml @@ -10,15 +10,25 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/bg_color" + android:lineSpacingMultiplier="@dimen/line_spacing_multiplier_description" android:paddingStart="@dimen/content_padding" android:paddingTop="@dimen/list_header_settings_top_margin" android:paddingEnd="@dimen/content_padding" - android:lineSpacingMultiplier="@dimen/line_spacing_multiplier_description" android:paddingBottom="@dimen/list_header_settings_top_margin" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" tools:text="@string/select_data_to_import" /> - + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/profile_data_list_item_group.xml b/OsmAnd/res/layout/profile_data_list_item_group.xml index 6cf421ff8a..99bb29511b 100644 --- a/OsmAnd/res/layout/profile_data_list_item_group.xml +++ b/OsmAnd/res/layout/profile_data_list_item_group.xml @@ -14,12 +14,12 @@ @@ -48,16 +48,20 @@ android:id="@+id/title_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:letterSpacing="@dimen/text_button_letter_spacing" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" + osmand:lineHeight="@dimen/default_title_line_height" tools:text="Quick actions" /> @@ -66,8 +70,8 @@ android:id="@+id/vertical_divider" android:layout_width="1dp" android:layout_height="match_parent" - android:layout_marginTop="@dimen/content_padding" - android:layout_marginBottom="@dimen/content_padding" + android:layout_marginTop="@dimen/setting_profile_item_switch_margin" + android:layout_marginBottom="@dimen/setting_profile_item_switch_margin" android:background="?attr/list_divider" /> 23sp 15sp 15sp + 24sp + 20sp 13sp 13sp diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 9dee5100fe..6b382d13af 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,10 +11,15 @@ Thx - Hardy --> + There is not enough space + OsmAnd is needed %1$s to export a file. Your device only has %2$s free. You can free up space on the device, or skip some items from export. Needed for import Select the data to be exported to the file. Approximate file size Resources + Motorboat + Kayak + Search history I already have an account Create new account Photos are provided by open data project OpenPlaceReviews.org. In order to upload your photos you need to sign up on website. @@ -23,10 +28,10 @@ You can log in using the safe OAuth method or use your login and password. Comment OSM Note Close OSM Note - Trackable means that the trace will not show up in any public listings but trackpoints from it will still be available through the public GPS API with timestamps. Other users will only be able to download processed trackpoints from your trace which can\'t be associated with you directly. - Identifiable means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings, i.e. other users will be able to download the raw trace and associate it with your username. Data served via the trackpoints API will reference your original trace page. Timestamps of the trace points are available through the public GPS API. - Private means that the trace will not show up in any public listings, but trackpoints from it will still be available through the public GPS API without timestamps but will not be chronologically ordered. - Public means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings. Data served via the API does not reference your trace page. Timestamps of the trace points are not available through the public GPS API, and the points are not chronologically ordered. However, other users are still able to download the raw trace from the public trace list and any timestamps contained within. + \"Trackable\" means the trace does not show up in any public listings, but processed trackpoints with timestamps from it (that can\'t be associated with you directly) do through downloads from the public GPS API. + \"Identifiable\" means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings, i.e. other users will be able to download the raw trace and associate it with your username. Public timestamped tracepoint data from the GPS API served via the trackpoints API will reference your original trace page. + \"Private\" means the trace does not show up in any public listings, but trackpoints from it in unchronological order are available through the public GPS API without timestamps. + \"Public\" means the trace is shown publicly in your GPS traces and in public GPS trace listings, and in the public trace list with timestamps in raw form. Data served via the API does not reference your trace page. Tracepoint timestamps are not available through the public GPS API, and tracepoints are not chronologically ordered. Enter tags separated by comma. Send GPX file to OpenStreetMap Markers history @@ -78,13 +83,13 @@ Payment will be charged to your AppGallery 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 AppGallery settings. Subscription charged per selected period. Cancel it on AppGallery at any time. Thank you for purchasing \'Contour lines\' - Start/finish icons + Start and finish icons Name: A – Z Name: Z – A Last modified • Updated "Plan a route" function: allows using different navigation types per segment and the inclusion of tracks\n\n - • New "Appearance" menu for tracks: select color, thickness, display direction arrows, start/finish icons\n\n + • New "Appearance" menu for tracks: select color, thickness, display direction arrows, start and finish icons\n\n • Improved visibility of bicycle nodes.\n\n • Tracks are now tappable, have context menu with basic info.\n\n • Improved "Search" algorithms\n\n @@ -104,11 +109,11 @@ System default Resume trip recording Pause trip recording - Specify the logging interval for the general track recording (enabled via the Trip recording widget on the map). + Specify the logging interval for the general track recording (turned on via the \'Trip recording\' widget on the map). Will pause track logging when the app is killed (via recent apps). (OsmAnd background indication disappears from the Android notification bar.) REC %s track files selected - File name + Filename Only the route line will be saved, the waypoints will be deleted. Simplified track Change route type after @@ -270,11 +275,11 @@ The action button switches between selected profiles. Back to editing Restore default items order - Add / Edit Favorite + Add or edit favorite Parking positions - Create / Edit POI + Create or edit POI Button showing or hiding public transport on the map. - Show/hide public transport + Show or hide public transport Show public transport Hide public transport @@ -376,7 +381,7 @@ A button to show or hide terrain layer on the map. Show terrain Hide terrain - Show / hide terrain + Show or hide terrain Slopes %1$s of %2$s The route will be recalculated if the distance from the route to the current location is more than selected value. @@ -561,7 +566,7 @@ Clear %1$s? Revert Track saved - File name is empty + Empty filename Estimates arrival time for unknown road types, and limits speed for all roads (may affect routing) White Swap %1$s and %2$s @@ -1173,7 +1178,7 @@ Adds initial stop Move destination up, and create it Show closed notes - Show/hide OSM notes on the map. + Show or hide OSM notes on the map. GPX - suitable for export to JOSM or other OSM editors. OSC - suitable for export to OSM. GPX file @@ -1335,7 +1340,7 @@ Save the points either as route points or as a line. Select navigation profile Please add at least one point. - GPX file name: + GPX filename: Show on map after saving Browse the map and add points Measure distance @@ -3826,7 +3831,7 @@ Number of contributors Number of edits Report for - File name contains illegal character + Illegal character in filename Quick action Action %d Screen %d @@ -3948,9 +3953,9 @@ No cobblestone or sett Avoids cobblestone and sett Add at least one item to the list in the \'Quick action\' settings - Alpine/downhill ski + Alpine and downhill skiing Slopes for alpine or downhill skiing and access to ski lifts. - Cross country/nordic ski + Cross country and nordic skiing Trails for nordic or cross-country skiing. Ski touring Routes for ski touring. diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index 40ea9cfb98..af0d934083 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -788,6 +788,14 @@ public class AndroidUtils { return result; } + public static long getAvailableSpace(@Nullable File dir) { + if (dir != null && dir.canRead()) { + StatFs fs = new StatFs(dir.getAbsolutePath()); + return fs.getAvailableBlocksLong() * fs.getBlockSize(); + } + return -1; + } + public static float getFreeSpaceGb(File dir) { if (dir.canRead()) { StatFs fs = new StatFs(dir.getAbsolutePath()); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 3ebd06b4b4..52bb44bf5f 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -22,7 +22,6 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.Space; import android.widget.TextView; -import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -36,7 +35,6 @@ import androidx.fragment.app.FragmentActivity; import androidx.viewpager.widget.ViewPager; import net.osmand.AndroidUtils; -import net.osmand.IProgress; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.access.AccessibilityAssistant; @@ -45,7 +43,6 @@ import net.osmand.data.PointDescription; import net.osmand.map.WorldRegion; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.Version; import net.osmand.plus.activities.LocalIndexInfo; @@ -64,6 +61,8 @@ import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; +import net.osmand.plus.settings.backend.OsmandSettings; +import net.osmand.plus.download.ReloadIndexesTask.ReloadIndexesListener; import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.util.Algorithms; @@ -389,8 +388,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo return !Version.isPaidVersion(application) || application.getSettings().SHOULD_SHOW_FREE_VERSION_BANNER.get(); } - - + public static class FreeVersionBanner { private final View freeVersionBanner; private final View freeVersionBannerTitle; @@ -441,7 +439,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo freeVersionBanner.setVisibility(View.VISIBLE); downloadsLeftProgressBar.setMax(DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS); freeVersionDescriptionTextView.setText(ctx.getString(R.string.free_version_message, - DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS +"" )); + DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS + "")); LinearLayout marksLinearLayout = (LinearLayout) freeVersionBanner.findViewById(R.id.marksLinearLayout); Space spaceView = new Space(ctx); @@ -493,6 +491,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo freeVersionBannerTitle.setVisibility(View.VISIBLE); } } + private void updateAvailableDownloads() { int activeTasks = ctx.getDownloadThread().getCountedDownloads(); OsmandSettings settings = ctx.getMyApplication().getSettings(); @@ -570,36 +569,26 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo } } - @SuppressLint("StaticFieldLeak") public void reloadLocalIndexes() { - AsyncTask> task = new AsyncTask>() { + final OsmandApplication app = (OsmandApplication) getApplication(); + ReloadIndexesTask reloadIndexesTask = new ReloadIndexesTask(app, new ReloadIndexesListener() { @Override - protected void onPreExecute() { - super.onPreExecute(); + public void reloadIndexesStarted() { setSupportProgressBarIndeterminateVisibility(true); } @Override - protected List doInBackground(Void... params) { - return getMyApplication().getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, - new ArrayList() - ); - } - - @Override - protected void onPostExecute(List warnings) { + public void reloadIndexesFinished(List warnings) { setSupportProgressBarIndeterminateVisibility(false); - if (!warnings.isEmpty()) { - Toast.makeText(DownloadActivity.this, AndroidUtils.formatWarnings(warnings).toString(), Toast.LENGTH_LONG).show(); + if (!Algorithms.isEmpty(warnings)) { + app.showToastMessage(AndroidUtils.formatWarnings(warnings).toString()); } newDownloadIndexes(); } - }; - task.executeOnExecutor(singleThreadExecutor); + }); + reloadIndexesTask.executeOnExecutor(singleThreadExecutor); } - - public void setDownloadItem(WorldRegion region, String targetFileName) { if (downloadItem == null) { downloadItem = region; @@ -666,8 +655,8 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo int percent = 0; if (dir.canRead()) { StatFs fs = new StatFs(dir.getAbsolutePath()); - size = AndroidUtils.formatSize(activity, ((long)fs.getAvailableBlocks()) * fs.getBlockSize()); - percent = 100 - (int)((long)fs.getAvailableBlocks() * 100 / fs.getBlockCount()); + size = AndroidUtils.formatSize(activity, ((long) fs.getAvailableBlocks()) * fs.getBlockSize()); + percent = 100 - (int) ((long) fs.getAvailableBlocks() * 100 / fs.getBlockCount()); } sizeProgress.setIndeterminate(false); sizeProgress.setProgress(percent); diff --git a/OsmAnd/src/net/osmand/plus/download/ReloadIndexesTask.java b/OsmAnd/src/net/osmand/plus/download/ReloadIndexesTask.java new file mode 100644 index 0000000000..873d73b671 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/download/ReloadIndexesTask.java @@ -0,0 +1,49 @@ +package net.osmand.plus.download; + +import android.os.AsyncTask; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.IProgress; +import net.osmand.plus.OsmandApplication; + +import java.util.ArrayList; +import java.util.List; + +public class ReloadIndexesTask extends AsyncTask> { + + private final OsmandApplication app; + private final ReloadIndexesListener listener; + + public ReloadIndexesTask(@NonNull OsmandApplication app, @Nullable ReloadIndexesListener listener) { + this.app = app; + this.listener = listener; + } + + @Override + protected void onPreExecute() { + if (listener != null) { + listener.reloadIndexesStarted(); + } + } + + @Override + protected List doInBackground(Void... params) { + return app.getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, new ArrayList()); + } + + @Override + protected void onPostExecute(List warnings) { + if (listener != null) { + listener.reloadIndexesFinished(warnings); + } + } + + public interface ReloadIndexesListener { + + void reloadIndexesStarted(); + + void reloadIndexesFinished(List warnings); + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java index 10e392d0cc..bf86c42ee6 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java @@ -7,23 +7,24 @@ import net.osmand.plus.R; public enum ExportSettingsType { PROFILE(R.string.shared_string_profiles, R.drawable.ic_action_manage_profiles), + GLOBAL(R.string.general_settings_2, R.drawable.ic_action_settings), QUICK_ACTIONS(R.string.configure_screen_quick_action, R.drawable.ic_quick_action), POI_TYPES(R.string.poi_dialog_poi_type, R.drawable.ic_action_info_dark), - MAP_SOURCES(R.string.quick_action_map_source_title, R.drawable.ic_map), - CUSTOM_RENDER_STYLE(R.string.shared_string_rendering_style, R.drawable.ic_action_map_style), - CUSTOM_ROUTING(R.string.shared_string_routing, R.drawable.ic_action_route_distance), + SEARCH_HISTORY(R.string.shared_string_search_history, R.drawable.ic_action_history), AVOID_ROADS(R.string.avoid_road, R.drawable.ic_action_alert), + FAVORITES(R.string.shared_string_favorites, R.drawable.ic_action_favorite), TRACKS(R.string.shared_string_tracks, R.drawable.ic_action_route_distance), - MULTIMEDIA_NOTES(R.string.audionotes_plugin_name, R.drawable.ic_action_photo_dark), - GLOBAL(R.string.general_settings_2, R.drawable.ic_action_settings), OSM_NOTES(R.string.osm_notes, R.drawable.ic_action_openstreetmap_logo), OSM_EDITS(R.string.osm_edits, R.drawable.ic_action_openstreetmap_logo), - OFFLINE_MAPS(R.string.shared_string_maps, R.drawable.ic_map), - FAVORITES(R.string.shared_string_favorites, R.drawable.ic_action_favorite), - TTS_VOICE(R.string.local_indexes_cat_tts, R.drawable.ic_action_volume_up), - VOICE(R.string.local_indexes_cat_voice, R.drawable.ic_action_volume_up), + MULTIMEDIA_NOTES(R.string.audionotes_plugin_name, R.drawable.ic_grouped_by_type), ACTIVE_MARKERS(R.string.map_markers, R.drawable.ic_action_flag), - HISTORY_MARKERS(R.string.markers_history, R.drawable.ic_action_flag); + HISTORY_MARKERS(R.string.markers_history, R.drawable.ic_action_flag), + CUSTOM_RENDER_STYLE(R.string.shared_string_rendering_style, R.drawable.ic_action_map_style), + CUSTOM_ROUTING(R.string.shared_string_routing, R.drawable.ic_action_route_distance), + MAP_SOURCES(R.string.quick_action_map_source_title, R.drawable.ic_map), + OFFLINE_MAPS(R.string.shared_string_maps, R.drawable.ic_map), + TTS_VOICE(R.string.local_indexes_cat_tts, R.drawable.ic_action_volume_up), + VOICE(R.string.local_indexes_cat_voice, R.drawable.ic_action_volume_up); @StringRes private final int titleId; @@ -46,7 +47,8 @@ public enum ExportSettingsType { } public boolean isSettingsCategory() { - return this == PROFILE || this == GLOBAL || this == QUICK_ACTIONS || this == POI_TYPES; + return this == PROFILE || this == GLOBAL || this == QUICK_ACTIONS || this == POI_TYPES + || this == SEARCH_HISTORY || this == AVOID_ROADS; } public boolean isMyPlacesCategory() { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index 3a0cbe8a61..910ac66ab3 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -29,6 +29,8 @@ import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXInfo; +import net.osmand.plus.helpers.SearchHistoryHelper; +import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry; import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.osmedit.OpenstreetmapPoint; @@ -504,12 +506,15 @@ public class SettingsHelper { List resourcesItems = getResourcesItems(); if (!settingsItems.isEmpty()) { + sortExportSettingsObjects(settingsItems); dataList.put(ExportSettingsCategory.SETTINGS, settingsItems); } if (!myPlacesItems.isEmpty()) { + sortExportSettingsObjects(myPlacesItems); dataList.put(ExportSettingsCategory.MY_PLACES, myPlacesItems); } if (!resourcesItems.isEmpty()) { + sortExportSettingsObjects(resourcesItems); dataList.put(ExportSettingsCategory.RESOURCES, resourcesItems); } @@ -537,7 +542,14 @@ public class SettingsHelper { if (!poiList.isEmpty()) { settingsItems.add(new ExportDataObject(ExportSettingsType.POI_TYPES, poiList)); } - + List historyEntries = SearchHistoryHelper.getInstance(app).getHistoryEntries(false); + if (!historyEntries.isEmpty()) { + settingsItems.add(new ExportDataObject(ExportSettingsType.SEARCH_HISTORY, historyEntries)); + } + Map impassableRoads = app.getAvoidSpecificRoads().getImpassableRoads(); + if (!impassableRoads.isEmpty()) { + settingsItems.add(new ExportDataObject(ExportSettingsType.AVOID_ROADS, new ArrayList<>(impassableRoads.values()))); + } return settingsItems; } @@ -653,10 +665,6 @@ public class SettingsHelper { if (!files.isEmpty()) { resourcesItems.add(new ExportDataObject(ExportSettingsType.VOICE, files)); } - Map impassableRoads = app.getAvoidSpecificRoads().getImpassableRoads(); - if (!impassableRoads.isEmpty()) { - resourcesItems.add(new ExportDataObject(ExportSettingsType.AVOID_ROADS, new ArrayList<>(impassableRoads.values()))); - } return resourcesItems; } @@ -699,6 +707,7 @@ public class SettingsHelper { List osmEditsPointList = new ArrayList<>(); List markersGroups = new ArrayList<>(); List markersHistoryGroups = new ArrayList<>(); + List historyEntries = new ArrayList<>(); for (Object object : data) { if (object instanceof QuickAction) { @@ -730,6 +739,8 @@ public class SettingsHelper { } else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) { markersHistoryGroups.add((MapMarkersGroup) object); } + } else if (object instanceof HistoryEntry) { + historyEntries.add((HistoryEntry) object); } } if (!quickActions.isEmpty()) { @@ -775,6 +786,9 @@ public class SettingsHelper { } settingsItems.add(new HistoryMarkersSettingsItem(app, mapMarkers)); } + if (!historyEntries.isEmpty()) { + settingsItems.add(new SearchHistorySettingsItem(app, historyEntries)); + } return settingsItems; } @@ -797,12 +811,15 @@ public class SettingsHelper { } } if (!settingsItems.isEmpty()) { + sortExportSettingsObjects(settingsItems); exportMap.put(ExportSettingsCategory.SETTINGS, settingsItems); } if (!myPlacesItems.isEmpty()) { + sortExportSettingsObjects(myPlacesItems); exportMap.put(ExportSettingsCategory.MY_PLACES, myPlacesItems); } if (!resourcesItems.isEmpty()) { + sortExportSettingsObjects(resourcesItems); exportMap.put(ExportSettingsCategory.RESOURCES, resourcesItems); } @@ -829,6 +846,7 @@ public class SettingsHelper { List favoriteGroups = new ArrayList<>(); List markersGroups = new ArrayList<>(); List markersHistoryGroups = new ArrayList<>(); + List historyEntries = new ArrayList<>(); for (SettingsItem item : settingsItems) { switch (item.getType()) { @@ -916,6 +934,10 @@ public class SettingsHelper { HistoryMarkersSettingsItem historyMarkersSettingsItem = (HistoryMarkersSettingsItem) item; markersHistoryGroups.add(historyMarkersSettingsItem.getMarkersGroup()); break; + case SEARCH_HISTORY: + SearchHistorySettingsItem searchHistorySettingsItem = (SearchHistorySettingsItem) item; + historyEntries.addAll(searchHistorySettingsItem.getItems()); + break; default: break; } @@ -972,9 +994,12 @@ public class SettingsHelper { if (!markersGroups.isEmpty()) { settingsToOperate.put(ExportSettingsType.ACTIVE_MARKERS, markersGroups); } - if (!markersGroups.isEmpty()) { + if (!markersHistoryGroups.isEmpty()) { settingsToOperate.put(ExportSettingsType.HISTORY_MARKERS, markersHistoryGroups); } + if (!historyEntries.isEmpty()) { + settingsToOperate.put(ExportSettingsType.SEARCH_HISTORY, historyEntries); + } return settingsToOperate; } @@ -991,4 +1016,15 @@ public class SettingsHelper { } }); } + + private static void sortExportSettingsObjects(List items) { + Collections.sort(items, new Comparator() { + @Override + public int compare(ExportDataObject lhs, ExportDataObject rhs) { + int order1 = lhs.getType().ordinal(); + int order2 = rhs.getType().ordinal(); + return (order1 < order2) ? -1 : ((order1 == order2) ? 0 : 1); + } + }); + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java index 11cb9a79b6..e8ede12a77 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportDataObject.java @@ -1,5 +1,7 @@ package net.osmand.plus.settings.fragments; +import androidx.annotation.NonNull; + import net.osmand.plus.settings.backend.ExportSettingsType; import java.util.List; @@ -9,7 +11,7 @@ public class ExportDataObject { private ExportSettingsType type; private List items; - public ExportDataObject(ExportSettingsType type, List items) { + public ExportDataObject(@NonNull ExportSettingsType type, @NonNull List items) { this.type = type; this.items = items; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java index 24df2f294f..2643b5230d 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java @@ -4,6 +4,8 @@ import android.content.res.ColorStateList; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.CheckBox; +import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; @@ -11,16 +13,33 @@ import androidx.core.content.ContextCompat; import androidx.core.widget.CompoundButtonCompat; import net.osmand.AndroidUtils; +import net.osmand.IndexConstants; import net.osmand.PlatformUtil; +import net.osmand.map.ITileSource; +import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; 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.helpers.AndroidUiHelper; -import net.osmand.plus.helpers.FontCache; -import net.osmand.plus.settings.backend.ExportSettingsCategory; +import net.osmand.plus.audionotes.AudioVideoNotesPlugin; +import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; +import net.osmand.plus.helpers.FileNameTranslationHelper; +import net.osmand.plus.helpers.GpxUiHelper; +import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry; +import net.osmand.plus.osmedit.OpenstreetmapPoint; +import net.osmand.plus.osmedit.OsmEditingPlugin; +import net.osmand.plus.osmedit.OsmNotesPoint; +import net.osmand.plus.poi.PoiUIFilter; +import net.osmand.plus.profiles.ProfileIconColors; +import net.osmand.plus.profiles.RoutingProfileDataObject.RoutingProfilesResources; +import net.osmand.plus.quickaction.QuickAction; +import net.osmand.plus.render.RenderingIcons; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.FileSettingsItem; +import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; +import net.osmand.util.Algorithms; import net.osmand.view.ThreeStateCheckbox; import org.apache.commons.logging.Log; @@ -29,10 +48,11 @@ import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import static net.osmand.plus.settings.backend.ExportSettingsType.OFFLINE_MAPS; +import static net.osmand.plus.settings.backend.backup.FileSettingsItem.FileSubtype; import static net.osmand.view.ThreeStateCheckbox.State.CHECKED; import static net.osmand.view.ThreeStateCheckbox.State.MISC; import static net.osmand.view.ThreeStateCheckbox.State.UNCHECKED; @@ -40,94 +60,91 @@ import static net.osmand.view.ThreeStateCheckbox.State.UNCHECKED; class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { private static final Log LOG = PlatformUtil.getLog(ExportImportSettingsAdapter.class.getName()); + private OsmandApplication app; + private UiUtilities uiUtilities; + private List data; + private Map> itemsMap; + private List itemsTypes; + private boolean nightMode; + private boolean importState; + private int activeColorRes; + private int secondaryColorRes; - private final OsmandApplication app; - private final UiUtilities uiUtilities; - - private List itemsTypes = new ArrayList<>(); - private Map> selectedItemsMap = new HashMap<>(); - private Map> itemsMap = new LinkedHashMap<>(); - - private final OnItemSelectedListener listener; - - private final LayoutInflater themedInflater; - - private final boolean nightMode; - private final int activeColorRes; - private final int secondaryColorRes; - - ExportImportSettingsAdapter(OsmandApplication app, OnItemSelectedListener listener, boolean nightMode) { + ExportImportSettingsAdapter(OsmandApplication app, boolean nightMode, boolean importState) { this.app = app; - this.listener = listener; this.nightMode = nightMode; + this.importState = importState; + this.itemsMap = new HashMap<>(); + this.itemsTypes = new ArrayList<>(); + this.data = new ArrayList<>(); uiUtilities = app.getUIUtilities(); - themedInflater = UiUtilities.getInflater(app, nightMode); - activeColorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_active_light; - secondaryColorRes = nightMode ? R.color.icon_color_secondary_dark : R.color.icon_color_secondary_light; + activeColorRes = nightMode + ? R.color.icon_color_active_dark + : R.color.icon_color_active_light; + secondaryColorRes = nightMode + ? R.color.icon_color_secondary_dark + : R.color.icon_color_secondary_light; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View group = convertView; if (group == null) { - group = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); + LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); + group = inflater.inflate(R.layout.profile_data_list_item_group, parent, false); } - final ExportSettingsCategory category = itemsTypes.get(groupPosition); - final List items = itemsMap.get(category); - String title = app.getString(category.getTitleId()); + boolean isLastGroup = groupPosition == getGroupCount() - 1; + final ExportSettingsType type = itemsTypes.get(groupPosition); + TextView titleTv = group.findViewById(R.id.title_tv); - titleTv.setText(UiUtilities.createCustomFontSpannable(FontCache.getRobotoMedium(app), title, title)); - TextView subTextTv = group.findViewById(R.id.sub_text_tv); - subTextTv.setText(getCategoryDescr(category)); - - int selectedTypes = 0; - for (int i = 0; i < items.size(); i++) { - ExportDataObject object = items.get(i); - if (selectedItemsMap.containsKey(object.getType())) { - selectedTypes++; - } - } final ThreeStateCheckbox checkBox = group.findViewById(R.id.check_box); - if (selectedTypes == 0) { - checkBox.setState(UNCHECKED); + FrameLayout checkBoxContainer = group.findViewById(R.id.check_box_container); + ImageView expandIv = group.findViewById(R.id.explist_indicator); + View lineDivider = group.findViewById(R.id.divider); + View cardTopDivider = group.findViewById(R.id.card_top_divider); + View cardBottomDivider = group.findViewById(R.id.card_bottom_divider); + + titleTv.setText(getGroupTitle(type)); + lineDivider.setVisibility(importState || isExpanded || isLastGroup ? View.GONE : View.VISIBLE); + cardTopDivider.setVisibility(importState ? View.VISIBLE : View.GONE); + cardBottomDivider.setVisibility(importState && !isExpanded ? View.VISIBLE : View.GONE); + + final List listItems = itemsMap.get(type); + subTextTv.setText(getSelectedItemsAmount(listItems, type)); + + if (data.containsAll(listItems)) { + checkBox.setState(CHECKED); } else { - checkBox.setState(selectedTypes == items.size() ? CHECKED : MISC); + boolean contains = false; + for (Object object : listItems) { + if (data.contains(object)) { + contains = true; + break; + } + } + checkBox.setState(contains ? MISC : UNCHECKED); } int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); - - group.findViewById(R.id.check_box_container).setOnClickListener(new View.OnClickListener() { + checkBoxContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { checkBox.performClick(); - boolean selected = checkBox.getState() == CHECKED; - if (selected) { - for (ExportDataObject object : items) { - if (!selectedItemsMap.containsKey(object.getType())) { - selectedItemsMap.put(object.getType(), (List) object.getItems()); + if (checkBox.getState() == CHECKED) { + for (Object object : listItems) { + if (!data.contains(object)) { + data.add(object); } } - } else { - for (ExportDataObject object : items) { - selectedItemsMap.remove(object.getType()); - } - } - if (listener != null) { - listener.onCategorySelected(category, selected); + data.removeAll(listItems); } notifyDataSetChanged(); } }); - adjustIndicator(app, groupPosition, isExpanded, group, nightMode); - AndroidUiHelper.updateVisibility(group.findViewById(R.id.divider), isExpanded); - AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_top_divider), true); - AndroidUiHelper.updateVisibility(group.findViewById(R.id.vertical_divider), false); - AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_bottom_divider), !isExpanded); - return group; } @@ -135,57 +152,172 @@ class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View child = convertView; if (child == null) { - child = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); + LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); + child = inflater.inflate(R.layout.profile_data_list_item_child, parent, false); } - final ExportDataObject currentItem = itemsMap.get(itemsTypes.get(groupPosition)).get(childPosition); - List selectedItems = selectedItemsMap.get(currentItem.getType()); + final Object currentItem = itemsMap.get(itemsTypes.get(groupPosition)).get(childPosition); - TextView titleTv = child.findViewById(R.id.title_tv); - titleTv.setText(currentItem.getType().getTitleId()); + boolean isLastGroup = groupPosition == getGroupCount() - 1; + boolean itemSelected = data.contains(currentItem); + final ExportSettingsType type = itemsTypes.get(groupPosition); - TextView subTextTv = child.findViewById(R.id.sub_text_tv); - subTextTv.setText(getSelectedTypeDescr(currentItem)); + TextView title = child.findViewById(R.id.title_tv); + TextView subText = child.findViewById(R.id.sub_title_tv); + subText.setVisibility(View.GONE); + final CheckBox checkBox = child.findViewById(R.id.check_box); + ImageView icon = child.findViewById(R.id.icon); + View lineDivider = child.findViewById(R.id.divider); + View cardBottomDivider = child.findViewById(R.id.card_bottom_divider); - ImageView icon = child.findViewById(R.id.explist_indicator); - setupIcon(icon, currentItem.getType().getIconRes(), selectedItems != null); - - final ThreeStateCheckbox checkBox = child.findViewById(R.id.check_box); - if (selectedItems == null) { - checkBox.setState(UNCHECKED); - } else if (selectedItems.containsAll(currentItem.getItems())) { - checkBox.setState(CHECKED); - } else { - boolean contains = false; - for (Object object : currentItem.getItems()) { - if (selectedItems.contains(object)) { - contains = true; - break; - } - } - checkBox.setState(contains ? MISC : UNCHECKED); - } - - int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; + lineDivider.setVisibility(!importState && isLastChild && !isLastGroup ? View.VISIBLE : View.GONE); + cardBottomDivider.setVisibility(importState && isLastChild ? View.VISIBLE : View.GONE); + int checkBoxColor = itemSelected ? activeColorRes : secondaryColorRes; CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); - child.findViewById(R.id.check_box_container).setOnClickListener(new View.OnClickListener() { + + checkBox.setChecked(itemSelected); + checkBox.setClickable(false); + child.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - checkBox.performClick(); - boolean selected = checkBox.getState() == CHECKED; - if (selected) { - selectedItemsMap.put(currentItem.getType(), (List) currentItem.getItems()); + if (data.contains(currentItem)) { + data.remove(currentItem); } else { - selectedItemsMap.remove(currentItem.getType()); - } - if (listener != null) { - listener.onTypeSelected(currentItem.getType(), selected); + data.add(currentItem); } notifyDataSetChanged(); } }); - AndroidUiHelper.updateVisibility(child.findViewById(R.id.card_bottom_divider), isLastChild); - + switch (type) { + case PROFILE: + ApplicationModeBean modeBean = (ApplicationModeBean) currentItem; + String profileName = modeBean.userProfileName; + if (Algorithms.isEmpty(profileName)) { + ApplicationMode appMode = ApplicationMode.valueOfStringKey(modeBean.stringKey, null); + profileName = app.getString(appMode.getNameKeyResource()); + } + title.setText(profileName); + String routingProfile = ""; + String routingProfileValue = modeBean.routingProfile; + if (!routingProfileValue.isEmpty()) { + try { + routingProfile = app.getString(RoutingProfilesResources.valueOf(routingProfileValue.toUpperCase()).getStringRes()); + routingProfile = Algorithms.capitalizeFirstLetterAndLowercase(routingProfile); + } catch (IllegalArgumentException e) { + routingProfile = Algorithms.capitalizeFirstLetterAndLowercase(routingProfileValue); + LOG.error("Error trying to get routing resource for " + routingProfileValue + "\n" + e); + } + } + if (!Algorithms.isEmpty(routingProfile)) { + subText.setText(String.format( + app.getString(R.string.ltr_or_rtl_combine_via_colon), + app.getString(R.string.nav_type_hint), + routingProfile)); + subText.setVisibility(View.VISIBLE); + } + int profileIconRes = AndroidUtils.getDrawableId(app, modeBean.iconName); + ProfileIconColors iconColor = modeBean.iconColor; + icon.setImageDrawable(uiUtilities.getIcon(profileIconRes, iconColor.getColor(nightMode))); + break; + case QUICK_ACTIONS: + title.setText(((QuickAction) currentItem).getName(app.getApplicationContext())); + setupIcon(icon, ((QuickAction) currentItem).getIconRes(), itemSelected); + break; + case POI_TYPES: + title.setText(((PoiUIFilter) currentItem).getName()); + int iconRes = RenderingIcons.getBigIconResourceId(((PoiUIFilter) currentItem).getIconId()); + setupIcon(icon, iconRes != 0 ? iconRes : R.drawable.ic_action_user, itemSelected); + break; + case MAP_SOURCES: + title.setText(((ITileSource) currentItem).getName()); + setupIcon(icon, R.drawable.ic_map, itemSelected); + break; + case CUSTOM_RENDER_STYLE: + String renderName = ((File) currentItem).getName(); + renderName = renderName.replace('_', ' ').replaceAll(IndexConstants.RENDERER_INDEX_EXT, ""); + title.setText(renderName); + setupIcon(icon, R.drawable.ic_action_map_style, itemSelected); + break; + case CUSTOM_ROUTING: + String routingName = ((File) currentItem).getName(); + routingName = routingName.replace('_', ' ').replaceAll(".xml", ""); + title.setText(routingName); + setupIcon(icon, R.drawable.ic_action_route_distance, itemSelected); + break; + case AVOID_ROADS: + AvoidRoadInfo avoidRoadInfo = (AvoidRoadInfo) currentItem; + title.setText(avoidRoadInfo.name); + setupIcon(icon, R.drawable.ic_action_alert, itemSelected); + break; + case MULTIMEDIA_NOTES: + File file = (File) currentItem; + title.setText(file.getName()); + int iconId = AudioVideoNotesPlugin.getIconIdForRecordingFile(file); + if (iconId == -1) { + iconId = R.drawable.ic_action_photo_dark; + } + setupIcon(icon, iconId, itemSelected); + break; + case TRACKS: + String fileName = ((File) currentItem).getName(); + title.setText(GpxUiHelper.getGpxTitle(fileName)); + setupIcon(icon, R.drawable.ic_action_route_distance, itemSelected); + break; + case GLOBAL: + String name = ((GlobalSettingsItem) currentItem).getPublicName(app); + title.setText(name); + setupIcon(icon, R.drawable.ic_action_settings, itemSelected); + break; + case OSM_NOTES: + title.setText(((OsmNotesPoint) currentItem).getText()); + setupIcon(icon, R.drawable.ic_action_osm_note_add, itemSelected); + break; + case OSM_EDITS: + title.setText(OsmEditingPlugin.getTitle((OpenstreetmapPoint) currentItem, app)); + setupIcon(icon, R.drawable.ic_action_info_dark, itemSelected); + break; + case OFFLINE_MAPS: + long size; + if (currentItem instanceof FileSettingsItem) { + FileSettingsItem currentFileItem = (FileSettingsItem) currentItem; + file = currentFileItem.getFile(); + size = currentFileItem.getSize(); + } else { + file = (File) currentItem; + size = file.length(); + } + title.setText(FileNameTranslationHelper.getFileNameWithRegion(app, file.getName())); + FileSubtype subtype = FileSubtype.getSubtypeByPath(app, file.getPath()); + setupIcon(icon, subtype.getIconId(), itemSelected); + subText.setText(AndroidUtils.formatSize(app, size)); + subText.setVisibility(View.VISIBLE); + break; + case FAVORITES: + FavoriteGroup favoriteGroup = (FavoriteGroup) currentItem; + title.setText(favoriteGroup.getDisplayName(app)); + setupIcon(icon, R.drawable.ic_action_favorite, itemSelected); + break; + case TTS_VOICE: + case VOICE: + file = (File) currentItem; + title.setText(FileNameTranslationHelper.getFileNameWithRegion(app, file.getName())); + setupIcon(icon, R.drawable.ic_action_volume_up, itemSelected); + break; + case ACTIVE_MARKERS: + title.setText(R.string.map_markers); + setupIcon(icon, R.drawable.ic_action_flag, itemSelected); + break; + case HISTORY_MARKERS: + title.setText(R.string.markers_history); + setupIcon(icon, R.drawable.ic_action_flag, itemSelected); + break; + case SEARCH_HISTORY: + HistoryEntry historyEntry = (HistoryEntry) currentItem; + title.setText(historyEntry.getName().getName()); + break; + default: + return child; + } return child; } @@ -229,16 +361,80 @@ class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { return true; } - private void setupIcon(ImageView icon, int iconRes, boolean itemSelected) { - if (itemSelected) { - int colorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_osmand_light; - icon.setImageDrawable(uiUtilities.getIcon(iconRes, colorRes)); - } else { - icon.setImageDrawable(uiUtilities.getIcon(iconRes, secondaryColorRes)); + private String getSelectedItemsAmount(List listItems, ExportSettingsType type) { + int amount = 0; + long amountSize = 0; + for (Object item : listItems) { + if (data.contains(item)) { + amount++; + if (type == OFFLINE_MAPS) { + if (item instanceof FileSettingsItem) { + amountSize += ((FileSettingsItem) item).getSize(); + } else { + amountSize += ((File) item).length(); + } + } + } + } + String itemsOf = app.getString(R.string.n_items_of_z, String.valueOf(amount), String.valueOf(listItems.size())); + return amountSize == 0 ? itemsOf : app.getString(R.string.ltr_or_rtl_combine_via_bold_point, itemsOf, + AndroidUtils.formatSize(app, amountSize)); + } + + private int getGroupTitle(ExportSettingsType type) { + switch (type) { + case PROFILE: + return R.string.shared_string_profiles; + case QUICK_ACTIONS: + return R.string.configure_screen_quick_action; + case POI_TYPES: + return R.string.poi_dialog_poi_type; + case MAP_SOURCES: + return R.string.quick_action_map_source_title; + case CUSTOM_RENDER_STYLE: + return R.string.shared_string_rendering_style; + case CUSTOM_ROUTING: + return R.string.shared_string_routing; + case AVOID_ROADS: + return R.string.avoid_road; + case TRACKS: + return R.string.shared_string_tracks; + case MULTIMEDIA_NOTES: + return R.string.audionotes_plugin_name; + case GLOBAL: + return R.string.general_settings_2; + case OSM_NOTES: + return R.string.osm_notes; + case OSM_EDITS: + return R.string.osm_edits; + case OFFLINE_MAPS: + return R.string.shared_string_maps; + case FAVORITES: + return R.string.shared_string_favorites; + case TTS_VOICE: + return R.string.local_indexes_cat_tts; + case VOICE: + return R.string.local_indexes_cat_voice; + case ACTIVE_MARKERS: + return R.string.map_markers; + case HISTORY_MARKERS: + return R.string.markers_history; + case SEARCH_HISTORY: + return R.string.shared_string_search_history; + default: + return R.string.access_empty_list; } } - public void updateSettingsList(Map> itemsMap) { + private void setupIcon(ImageView icon, int iconRes, boolean itemSelected) { + if (itemSelected) { + icon.setImageDrawable(uiUtilities.getIcon(iconRes, activeColorRes)); + } else { + icon.setImageDrawable(uiUtilities.getIcon(iconRes, nightMode)); + } + } + + public void updateSettingsList(Map> itemsMap) { this.itemsMap = itemsMap; this.itemsTypes = new ArrayList<>(itemsMap.keySet()); Collections.sort(itemsTypes); @@ -251,90 +447,17 @@ class ExportImportSettingsAdapter extends OsmandBaseExpandableListAdapter { notifyDataSetChanged(); } - public List getData() { - List selectedItems = new ArrayList<>(); - for (List items : selectedItemsMap.values()) { - selectedItems.addAll(items); - } - return selectedItems; - } - - private String getCategoryDescr(ExportSettingsCategory category) { - long itemsSize = 0; - int selectedTypes = 0; - List items = itemsMap.get(category); - for (int i = 0; i < items.size(); i++) { - ExportDataObject object = items.get(i); - if (selectedItemsMap.containsKey(object.getType())) { - selectedTypes++; - itemsSize += calculateItemsSize(object.getItems()); + public void selectAll(boolean selectAll) { + data.clear(); + if (selectAll) { + for (List values : itemsMap.values()) { + data.addAll(values); } } - - String description; - if (selectedTypes == 0) { - description = app.getString(R.string.shared_string_none); - } else if (selectedTypes == items.size()) { - description = app.getString(R.string.shared_string_all); - } else { - description = app.getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selectedTypes), String.valueOf(items.size())); - } - String formattedSize = AndroidUtils.formatSize(app, itemsSize); - return itemsSize == 0 ? description : app.getString(R.string.ltr_or_rtl_combine_via_comma, description, formattedSize); + notifyDataSetChanged(); } - public static long calculateItemsSize(List items) { - long itemsSize = 0; - for (Object item : items) { - if (item instanceof FileSettingsItem) { - itemsSize += ((FileSettingsItem) item).getSize(); - } else if (item instanceof File) { - itemsSize += ((File) item).length(); - } - } - return itemsSize; - } - - private String getSelectedTypeDescr(ExportDataObject dataObject) { - long itemsSize = 0; - int selectedTypes = 0; - - List items = dataObject.getItems(); - List selectedItems = selectedItemsMap.get(dataObject.getType()); - if (selectedItems != null) { - for (int i = 0; i < items.size(); i++) { - Object object = items.get(i); - if (selectedItems.contains(object)) { - selectedTypes++; - if (object instanceof FileSettingsItem) { - itemsSize += ((FileSettingsItem) object).getSize(); - } else if (object instanceof File) { - itemsSize += ((File) object).length(); - } - } - } - } - - String description; - if (selectedTypes == 0) { - description = app.getString(R.string.shared_string_none); - } else if (selectedTypes == items.size()) { - description = app.getString(R.string.shared_string_all); - if (itemsSize == 0) { - description = app.getString(R.string.ltr_or_rtl_combine_via_comma, description, String.valueOf(items.size())); - } - } else { - description = app.getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selectedTypes), String.valueOf(items.size())); - } - String formattedSize = AndroidUtils.formatSize(app, itemsSize); - return itemsSize == 0 ? description : app.getString(R.string.ltr_or_rtl_combine_via_comma, description, formattedSize); - } - - interface OnItemSelectedListener { - - void onCategorySelected(ExportSettingsCategory type, boolean selected); - - void onTypeSelected(ExportSettingsType type, boolean selected); - + List getData() { + return this.data; } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java new file mode 100644 index 0000000000..82ae93ebc0 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -0,0 +1,337 @@ +package net.osmand.plus.settings.fragments; + +import android.content.res.ColorStateList; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; +import androidx.core.widget.CompoundButtonCompat; + +import net.osmand.AndroidUtils; +import net.osmand.PlatformUtil; +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.helpers.AndroidUiHelper; +import net.osmand.plus.helpers.FontCache; +import net.osmand.plus.settings.backend.ExportSettingsCategory; +import net.osmand.plus.settings.backend.ExportSettingsType; +import net.osmand.plus.settings.backend.backup.FileSettingsItem; +import net.osmand.view.ThreeStateCheckbox; + +import org.apache.commons.logging.Log; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import static net.osmand.view.ThreeStateCheckbox.State.CHECKED; +import static net.osmand.view.ThreeStateCheckbox.State.MISC; +import static net.osmand.view.ThreeStateCheckbox.State.UNCHECKED; + +public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { + + private static final Log LOG = PlatformUtil.getLog(ExportImportSettingsAdapter.class.getName()); + + private final OsmandApplication app; + private final UiUtilities uiUtilities; + + private List itemsTypes = new ArrayList<>(); + private Map> selectedItemsMap = new HashMap<>(); + private Map> itemsMap = new LinkedHashMap<>(); + + private final OnItemSelectedListener listener; + + private final LayoutInflater themedInflater; + + private final boolean nightMode; + private final int activeColorRes; + private final int secondaryColorRes; + + ExportSettingsAdapter(OsmandApplication app, OnItemSelectedListener listener, boolean nightMode) { + this.app = app; + this.listener = listener; + this.nightMode = nightMode; + uiUtilities = app.getUIUtilities(); + themedInflater = UiUtilities.getInflater(app, nightMode); + activeColorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_active_light; + secondaryColorRes = nightMode ? R.color.icon_color_secondary_dark : R.color.icon_color_secondary_light; + } + + @Override + public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { + View group = convertView; + if (group == null) { + group = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); + } + final ExportSettingsCategory category = itemsTypes.get(groupPosition); + final List items = itemsMap.get(category); + + String title = app.getString(category.getTitleId()); + TextView titleTv = group.findViewById(R.id.title_tv); + titleTv.setText(UiUtilities.createCustomFontSpannable(FontCache.getRobotoMedium(app), title, title)); + + TextView subTextTv = group.findViewById(R.id.sub_text_tv); + subTextTv.setText(getCategoryDescr(category)); + + int selectedTypes = 0; + for (int i = 0; i < items.size(); i++) { + ExportDataObject object = items.get(i); + if (selectedItemsMap.containsKey(object.getType())) { + selectedTypes++; + } + } + final ThreeStateCheckbox checkBox = group.findViewById(R.id.check_box); + if (selectedTypes == 0) { + checkBox.setState(UNCHECKED); + } else { + checkBox.setState(selectedTypes == items.size() ? CHECKED : MISC); + } + int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; + CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); + + group.findViewById(R.id.check_box_container).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + checkBox.performClick(); + boolean selected = checkBox.getState() == CHECKED; + if (selected) { + for (ExportDataObject object : items) { + if (!selectedItemsMap.containsKey(object.getType())) { + selectedItemsMap.put(object.getType(), object.getItems()); + } + } + } else { + for (ExportDataObject object : items) { + selectedItemsMap.remove(object.getType()); + } + } + if (listener != null) { + listener.onCategorySelected(category, selected); + } + notifyDataSetChanged(); + } + }); + + adjustIndicator(app, groupPosition, isExpanded, group, nightMode); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.divider), isExpanded); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_top_divider), true); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.vertical_divider), false); + AndroidUiHelper.updateVisibility(group.findViewById(R.id.card_bottom_divider), !isExpanded); + + return group; + } + + @Override + public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { + View child = convertView; + if (child == null) { + child = themedInflater.inflate(R.layout.profile_data_list_item_group, parent, false); + } + final ExportDataObject currentItem = itemsMap.get(itemsTypes.get(groupPosition)).get(childPosition); + List selectedItems = selectedItemsMap.get(currentItem.getType()); + + TextView titleTv = child.findViewById(R.id.title_tv); + titleTv.setText(currentItem.getType().getTitleId()); + + TextView subTextTv = child.findViewById(R.id.sub_text_tv); + subTextTv.setText(getSelectedTypeDescr(currentItem)); + + ImageView icon = child.findViewById(R.id.explist_indicator); + setupIcon(icon, currentItem.getType().getIconRes(), selectedItems != null); + + final ThreeStateCheckbox checkBox = child.findViewById(R.id.check_box); + if (selectedItems == null) { + checkBox.setState(UNCHECKED); + } else if (selectedItems.containsAll(currentItem.getItems())) { + checkBox.setState(CHECKED); + } else { + boolean contains = false; + for (Object object : currentItem.getItems()) { + if (selectedItems.contains(object)) { + contains = true; + break; + } + } + checkBox.setState(contains ? MISC : UNCHECKED); + } + + int checkBoxColor = checkBox.getState() == UNCHECKED ? secondaryColorRes : activeColorRes; + CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(ContextCompat.getColor(app, checkBoxColor))); + child.findViewById(R.id.check_box_container).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + checkBox.performClick(); + boolean selected = checkBox.getState() == CHECKED; + if (selected) { + selectedItemsMap.put(currentItem.getType(), currentItem.getItems()); + } else { + selectedItemsMap.remove(currentItem.getType()); + } + if (listener != null) { + listener.onTypeSelected(currentItem.getType(), selected); + } + notifyDataSetChanged(); + } + }); + + AndroidUiHelper.updateVisibility(child.findViewById(R.id.card_bottom_divider), isLastChild); + + return child; + } + + @Override + public int getGroupCount() { + return itemsTypes.size(); + } + + @Override + public int getChildrenCount(int i) { + return itemsMap.get(itemsTypes.get(i)).size(); + } + + @Override + public Object getGroup(int i) { + return itemsMap.get(itemsTypes.get(i)); + } + + @Override + public Object getChild(int groupPosition, int childPosition) { + return itemsMap.get(itemsTypes.get(groupPosition)).get(childPosition); + } + + @Override + public long getGroupId(int i) { + return i; + } + + @Override + public long getChildId(int groupPosition, int childPosition) { + return groupPosition * 10000 + childPosition; + } + + @Override + public boolean hasStableIds() { + return false; + } + + @Override + public boolean isChildSelectable(int i, int i1) { + return true; + } + + private void setupIcon(ImageView icon, int iconRes, boolean itemSelected) { + if (itemSelected) { + int colorRes = nightMode ? R.color.icon_color_active_dark : R.color.icon_color_osmand_light; + icon.setImageDrawable(uiUtilities.getIcon(iconRes, colorRes)); + } else { + icon.setImageDrawable(uiUtilities.getIcon(iconRes, secondaryColorRes)); + } + } + + public void updateSettingsList(Map> itemsMap) { + this.itemsMap = itemsMap; + this.itemsTypes = new ArrayList<>(itemsMap.keySet()); + Collections.sort(itemsTypes); + notifyDataSetChanged(); + } + + public void clearSettingsList() { + this.itemsMap.clear(); + this.itemsTypes.clear(); + notifyDataSetChanged(); + } + + public List getData() { + List selectedItems = new ArrayList<>(); + for (List items : selectedItemsMap.values()) { + selectedItems.addAll(items); + } + return selectedItems; + } + + private String getCategoryDescr(ExportSettingsCategory category) { + long itemsSize = 0; + int selectedTypes = 0; + List items = itemsMap.get(category); + for (int i = 0; i < items.size(); i++) { + ExportDataObject object = items.get(i); + if (selectedItemsMap.containsKey(object.getType())) { + selectedTypes++; + itemsSize += calculateItemsSize(object.getItems()); + } + } + String description; + if (selectedTypes == 0) { + description = app.getString(R.string.shared_string_none); + } else if (selectedTypes == items.size()) { + description = app.getString(R.string.shared_string_all); + } else { + description = app.getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selectedTypes), String.valueOf(items.size())); + } + String formattedSize = AndroidUtils.formatSize(app, itemsSize); + return itemsSize == 0 ? description : app.getString(R.string.ltr_or_rtl_combine_via_comma, description, formattedSize); + } + + public static long calculateItemsSize(List items) { + long itemsSize = 0; + for (Object item : items) { + if (item instanceof FileSettingsItem) { + itemsSize += ((FileSettingsItem) item).getSize(); + } else if (item instanceof File) { + itemsSize += ((File) item).length(); + } + } + return itemsSize; + } + + private String getSelectedTypeDescr(ExportDataObject dataObject) { + long itemsSize = 0; + int selectedTypes = 0; + + List items = dataObject.getItems(); + List selectedItems = selectedItemsMap.get(dataObject.getType()); + if (selectedItems != null) { + for (int i = 0; i < items.size(); i++) { + Object object = items.get(i); + if (selectedItems.contains(object)) { + selectedTypes++; + if (object instanceof FileSettingsItem) { + itemsSize += ((FileSettingsItem) object).getSize(); + } else if (object instanceof File) { + itemsSize += ((File) object).length(); + } + } + } + } + String description; + if (selectedTypes == 0) { + description = app.getString(R.string.shared_string_none); + } else if (selectedTypes == items.size()) { + description = app.getString(R.string.shared_string_all); + if (itemsSize == 0) { + description = app.getString(R.string.ltr_or_rtl_combine_via_comma, description, String.valueOf(items.size())); + } + } else { + description = app.getString(R.string.ltr_or_rtl_combine_via_slash, String.valueOf(selectedTypes), String.valueOf(items.size())); + } + String formattedSize = AndroidUtils.formatSize(app, itemsSize); + return itemsSize == 0 ? description : app.getString(R.string.ltr_or_rtl_combine_via_comma, description, formattedSize); + } + + interface OnItemSelectedListener { + + void onCategorySelected(ExportSettingsCategory type, boolean selected); + + void onTypeSelected(ExportSettingsType type, boolean selected); + + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java index 79f7159909..f80c225ff2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -35,13 +35,14 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.BaseOsmAndFragment; +import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.FileSettingsItem; import net.osmand.plus.settings.backend.backup.SettingsHelper.SettingsExportListener; import net.osmand.plus.settings.backend.backup.SettingsItem; -import net.osmand.plus.settings.fragments.ExportImportSettingsAdapter.OnItemSelectedListener; +import net.osmand.plus.settings.fragments.ExportSettingsAdapter.OnItemSelectedListener; import net.osmand.plus.widgets.TextViewEx; import org.apache.commons.logging.Log; @@ -78,10 +79,15 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem private ApplicationMode appMode; private SettingsExportListener exportListener; - private TextViewEx fileSize; + private View headerShadow; + private View headerDivider; + private View itemsSizeContainer; + private View availableSpaceContainer; + private TextViewEx selectedItemsSize; + private TextViewEx availableSpaceDescr; private LinearLayout buttonsContainer; private ExpandableListView expandableList; - private ExportImportSettingsAdapter adapter; + private ExportSettingsAdapter adapter; private int progressMax; private int progressValue; @@ -127,16 +133,23 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem View root = themedInflater.inflate(R.layout.fragment_import, container, false); AndroidUtils.addStatusBarPadding21v(app, root); - fileSize = root.findViewById(R.id.file_size); + selectedItemsSize = root.findViewById(R.id.file_size); + itemsSizeContainer = root.findViewById(R.id.file_size_container); expandableList = root.findViewById(R.id.list); buttonsContainer = root.findViewById(R.id.buttons_container); Toolbar toolbar = root.findViewById(R.id.toolbar); setupToolbar(toolbar); ViewCompat.setNestedScrollingEnabled(expandableList, true); + View header = themedInflater.inflate(R.layout.list_item_description_header, null); + headerDivider = header.findViewById(R.id.divider); + headerShadow = header.findViewById(R.id.card_bottom_divider); expandableList.addHeaderView(header); + availableSpaceContainer = inflater.inflate(R.layout.enough_space_warning_card, null); + availableSpaceDescr = availableSpaceContainer.findViewById(R.id.warning_descr); + TextViewEx continueBtn = root.findViewById(R.id.continue_button); continueBtn.setOnClickListener(new View.OnClickListener() { @Override @@ -161,7 +174,7 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem } }); - adapter = new ExportImportSettingsAdapter(app, this, nightMode); + adapter = new ExportSettingsAdapter(app, this, nightMode); adapter.updateSettingsList(dataList); expandableList.setAdapter(adapter); @@ -169,6 +182,7 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem toolbarLayout.setTitle(getString(R.string.shared_string_export)); TextView description = header.findViewById(R.id.description); description.setText(R.string.select_data_to_export); + updateAvailableSpace(); return root; } @@ -235,20 +249,50 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem }); } - private void updateFileSize() { - long itemsSize = ExportImportSettingsAdapter.calculateItemsSize(adapter.getData()); - String size = itemsSize != 0 ? AndroidUtils.formatSize(app, itemsSize) : ""; - fileSize.setText(size); + private void updateAvailableSpace() { + long calculatedSize = ExportSettingsAdapter.calculateItemsSize(adapter.getData()); + if (calculatedSize != 0) { + String itemsSize = AndroidUtils.formatSize(app, calculatedSize); + selectedItemsSize.setText(itemsSize); + + File dir = app.getAppPath("").getParentFile(); + long availableSizeBytes = AndroidUtils.getAvailableSpace(dir); + if (calculatedSize > availableSizeBytes) { + String availableSize = AndroidUtils.formatSize(app, availableSizeBytes); + availableSpaceDescr.setText(getString(R.string.export_not_enough_space_descr, itemsSize, availableSize)); + updateWarningHeaderVisibility(true); + } else { + updateWarningHeaderVisibility(false); + } + itemsSizeContainer.setVisibility(View.VISIBLE); + } else { + updateWarningHeaderVisibility(false); + itemsSizeContainer.setVisibility(View.INVISIBLE); + } + } + + private void updateWarningHeaderVisibility(boolean visible) { + if (visible) { + if (expandableList.getHeaderViewsCount() < 2) { + expandableList.addHeaderView(availableSpaceContainer); + } + AndroidUiHelper.updateVisibility(headerShadow, false); + AndroidUiHelper.updateVisibility(headerDivider, true); + } else { + expandableList.removeHeaderView(availableSpaceContainer); + AndroidUiHelper.updateVisibility(headerShadow, true); + AndroidUiHelper.updateVisibility(headerDivider, false); + } } @Override public void onCategorySelected(ExportSettingsCategory type, boolean selected) { - updateFileSize(); + updateAvailableSpace(); } @Override public void onTypeSelected(ExportSettingsType type, boolean selected) { - updateFileSize(); + updateAvailableSpace(); } private void prepareFile() { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index aaed2edcb5..816d5517dc 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -22,13 +22,13 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.Toolbar; -import androidx.core.content.ContextCompat; import androidx.core.view.ViewCompat; import androidx.fragment.app.FragmentManager; import com.google.android.material.appbar.CollapsingToolbarLayout; import net.osmand.AndroidUtils; +import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; @@ -49,7 +49,6 @@ import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; -import net.osmand.plus.settings.backend.ExportSettingsCategory; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.AvoidRoadsSettingsItem; import net.osmand.plus.settings.backend.backup.FavoritesSettingsItem; @@ -69,44 +68,37 @@ import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportAsyncTask; import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportType; import net.osmand.plus.settings.backend.backup.SettingsItem; import net.osmand.plus.settings.backend.backup.SettingsItemType; -import net.osmand.plus.settings.fragments.ExportImportSettingsAdapter.OnItemSelectedListener; import net.osmand.plus.widgets.TextViewEx; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; import java.io.File; +import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItemSelectedListener { +public class ImportSettingsFragment extends BaseOsmAndFragment { public static final String TAG = ImportSettingsFragment.class.getSimpleName(); public static final Log LOG = PlatformUtil.getLog(ImportSettingsFragment.class.getSimpleName()); - - protected static final String IMPORT_SETTINGS_TAG = "import_settings_tag"; private static final String DUPLICATES_START_TIME_KEY = "duplicates_start_time"; private static final long MIN_DELAY_TIME_MS = 500; - + static final String IMPORT_SETTINGS_TAG = "import_settings_tag"; private OsmandApplication app; - - private File file; - private SettingsHelper settingsHelper; - private List settingsItems; - private Map> dataList; - private ExportImportSettingsAdapter adapter; private ExpandableListView expandableList; private TextView description; + private List settingsItems; + private File file; + private boolean allSelected; + private boolean nightMode; private LinearLayout buttonsContainer; private ProgressBar progressBar; - private TextViewEx fileSize; - private TextViewEx fileSizeDescr; private CollapsingToolbarLayout toolbarLayout; - - private boolean nightMode; + private SettingsHelper settingsHelper; private long duplicateStartTime; public static void showInstance(@NonNull FragmentManager fm, @NonNull List settingsItems, @NonNull File file) { @@ -143,13 +135,10 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem View root = inflater.inflate(R.layout.fragment_import, container, false); Toolbar toolbar = root.findViewById(R.id.toolbar); TextViewEx continueBtn = root.findViewById(R.id.continue_button); - fileSize = root.findViewById(R.id.file_size); toolbarLayout = root.findViewById(R.id.toolbar_layout); expandableList = root.findViewById(R.id.list); buttonsContainer = root.findViewById(R.id.buttons_container); progressBar = root.findViewById(R.id.progress_bar); - fileSizeDescr = root.findViewById(R.id.file_size_descr); - fileSizeDescr.setText(R.string.file_size_needed_for_import); setupToolbar(toolbar); ViewCompat.setNestedScrollingEnabled(expandableList, true); View header = inflater.inflate(R.layout.list_item_description_header, null); @@ -210,10 +199,10 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem } } - adapter = new ExportImportSettingsAdapter(app, this, nightMode); - Map> itemsMap = new HashMap<>(); + adapter = new ExportImportSettingsAdapter(app, nightMode, true); + Map> itemsMap = new HashMap<>(); if (settingsItems != null) { - itemsMap = SettingsHelper.getSettingsToOperateByCategory(settingsItems, false); + itemsMap = SettingsHelper.getSettingsToOperate(settingsItems, false); adapter.updateSettingsList(itemsMap); } expandableList.setAdapter(adapter); @@ -227,7 +216,7 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem } else { toolbarLayout.setTitle(getString(R.string.shared_string_import)); } - if (itemsMap.size() == 1 && itemsMap.containsKey(ExportSettingsCategory.SETTINGS)) { + if (itemsMap.size() == 1 && itemsMap.containsKey(ExportSettingsType.PROFILE)) { expandableList.expandGroup(0); } } @@ -238,6 +227,15 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem outState.putLong(DUPLICATES_START_TIME_KEY, duplicateStartTime); } + @Override + public void onResume() { + super.onResume(); + Activity activity = getActivity(); + if (activity instanceof MapActivity) { + ((MapActivity) activity).closeDrawer(); + } + } + private void updateUi(int toolbarTitleRes, int descriptionRes) { if (file != null) { String fileName = file.getName(); @@ -290,6 +288,31 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem } } + private static class ReloadIndexesTack extends AsyncTask { + + private final WeakReference mapActivityRef; + private final OsmandApplication app; + + ReloadIndexesTack(@NonNull MapActivity mapActivity) { + this.mapActivityRef = new WeakReference<>(mapActivity); + this.app = mapActivity.getMyApplication(); + } + + @Override + protected Void doInBackground(Void[] params) { + app.getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, new ArrayList()); + return null; + } + + @Override + protected void onPostExecute(Void aVoid) { + MapActivity mapActivity = mapActivityRef.get(); + if (mapActivity != null) { + mapActivity.refreshMap(); + } + } + } + private SettingsHelper.CheckDuplicatesListener getDuplicatesListener() { return new SettingsHelper.CheckDuplicatesListener() { @Override @@ -519,8 +542,9 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem } private void setupToolbar(Toolbar toolbar) { - int color = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light); - toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_action_close, color)); + toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_action_close, nightMode + ? getResources().getColor(R.color.active_buttons_and_links_text_dark) + : getResources().getColor(R.color.active_buttons_and_links_text_light))); toolbar.setNavigationContentDescription(R.string.shared_string_close); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override @@ -533,20 +557,4 @@ public class ImportSettingsFragment extends BaseOsmAndFragment implements OnItem public void setFile(File file) { this.file = file; } - - private void updateFileSize() { - long itemsSize = ExportImportSettingsAdapter.calculateItemsSize(adapter.getData()); - String size = itemsSize != 0 ? AndroidUtils.formatSize(app, itemsSize) : ""; - fileSize.setText(size); - } - - @Override - public void onCategorySelected(ExportSettingsCategory type, boolean selected) { - updateFileSize(); - } - - @Override - public void onTypeSelected(ExportSettingsType type, boolean selected) { - updateFileSize(); - } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java deleted file mode 100644 index d5776a7f45..0000000000 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ReloadIndexesTack.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.osmand.plus.settings.fragments; - -import android.os.AsyncTask; - -import androidx.annotation.NonNull; - -import net.osmand.IProgress; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.activities.MapActivity; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; - -class ReloadIndexesTack extends AsyncTask { - - private final WeakReference mapActivityRef; - private final OsmandApplication app; - - ReloadIndexesTack(@NonNull MapActivity mapActivity) { - this.mapActivityRef = new WeakReference<>(mapActivity); - this.app = mapActivity.getMyApplication(); - } - - @Override - protected Void doInBackground(Void[] params) { - app.getResourceManager().reloadIndexes(IProgress.EMPTY_PROGRESS, new ArrayList()); - return null; - } - - @Override - protected void onPostExecute(Void aVoid) { - MapActivity mapActivity = mapActivityRef.get(); - if (mapActivity != null) { - mapActivity.refreshMap(); - } - } -} From bae457acb92380d176fd6e34ff9faa9bf99c7cb2 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 17 Nov 2020 14:09:05 +0200 Subject: [PATCH 08/70] Fix string and update continue button --- OsmAnd/res/layout/fragment_import.xml | 29 ++++--------------- OsmAnd/res/values/strings.xml | 2 +- .../fragments/ExportSettingsAdapter.java | 4 +++ .../fragments/ExportSettingsFragment.java | 14 ++++++--- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml index ef83bba63d..30f518cbfc 100644 --- a/OsmAnd/res/layout/fragment_import.xml +++ b/OsmAnd/res/layout/fragment_import.xml @@ -81,37 +81,20 @@ android:layout_width="@dimen/content_padding" android:layout_height="match_parent" /> - + android:layout_marginBottom="@dimen/content_padding_half"> - + layout="@layout/bottom_sheet_dialog_button" + android:visibility="visible" /> - + diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 6b382d13af..7a5a9b759e 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,7 +12,7 @@ --> There is not enough space - OsmAnd is needed %1$s to export a file. Your device only has %2$s free. You can free up space on the device, or skip some items from export. + Your device only has %1$s free. Please free up some space or unselect some items to export. Needed for import Select the data to be exported to the file. Approximate file size diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java index 82ae93ebc0..65cd471216 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -250,6 +250,10 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter { notifyDataSetChanged(); } + public boolean hasSelectedData() { + return !selectedItemsMap.isEmpty(); + } + public List getData() { List selectedItems = new ArrayList<>(); for (List items : selectedItemsMap.values()) { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java index f80c225ff2..9405714a34 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -34,6 +34,7 @@ import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; +import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.settings.backend.ApplicationMode; @@ -79,6 +80,7 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem private ApplicationMode appMode; private SettingsExportListener exportListener; + private View continueBtn; private View headerShadow; private View headerDivider; private View itemsSizeContainer; @@ -150,13 +152,15 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem availableSpaceContainer = inflater.inflate(R.layout.enough_space_warning_card, null); availableSpaceDescr = availableSpaceContainer.findViewById(R.id.warning_descr); - TextViewEx continueBtn = root.findViewById(R.id.continue_button); + continueBtn = root.findViewById(R.id.continue_button); + UiUtilities.setupDialogButton(nightMode, continueBtn, DialogButtonType.PRIMARY, getString(R.string.shared_string_continue)); continueBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { prepareFile(); } }); + ViewTreeObserver treeObserver = buttonsContainer.getViewTreeObserver(); treeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override @@ -252,22 +256,24 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem private void updateAvailableSpace() { long calculatedSize = ExportSettingsAdapter.calculateItemsSize(adapter.getData()); if (calculatedSize != 0) { - String itemsSize = AndroidUtils.formatSize(app, calculatedSize); - selectedItemsSize.setText(itemsSize); + selectedItemsSize.setText(AndroidUtils.formatSize(app, calculatedSize)); File dir = app.getAppPath("").getParentFile(); long availableSizeBytes = AndroidUtils.getAvailableSpace(dir); if (calculatedSize > availableSizeBytes) { String availableSize = AndroidUtils.formatSize(app, availableSizeBytes); - availableSpaceDescr.setText(getString(R.string.export_not_enough_space_descr, itemsSize, availableSize)); + availableSpaceDescr.setText(getString(R.string.export_not_enough_space_descr, availableSize)); updateWarningHeaderVisibility(true); + continueBtn.setEnabled(false); } else { updateWarningHeaderVisibility(false); + continueBtn.setEnabled(adapter.hasSelectedData()); } itemsSizeContainer.setVisibility(View.VISIBLE); } else { updateWarningHeaderVisibility(false); itemsSizeContainer.setVisibility(View.INVISIBLE); + continueBtn.setEnabled(adapter.hasSelectedData()); } } From 28ea540e4056a7614e9ce59384916071a8e4703e Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 17 Nov 2020 14:20:13 +0200 Subject: [PATCH 09/70] Fix inflater --- .../osmand/plus/settings/fragments/ExportSettingsFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java index 9405714a34..ce9d1f414e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsFragment.java @@ -149,7 +149,7 @@ public class ExportSettingsFragment extends BaseOsmAndFragment implements OnItem headerShadow = header.findViewById(R.id.card_bottom_divider); expandableList.addHeaderView(header); - availableSpaceContainer = inflater.inflate(R.layout.enough_space_warning_card, null); + availableSpaceContainer = themedInflater.inflate(R.layout.enough_space_warning_card, null); availableSpaceDescr = availableSpaceContainer.findViewById(R.id.warning_descr); continueBtn = root.findViewById(R.id.continue_button); From 415bbcf6e34fcbca44232600e3391df4403e8904 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 17 Nov 2020 15:53:01 +0200 Subject: [PATCH 10/70] hide photo button --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 45c4864a2a..1aa35b8589 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -336,6 +336,8 @@ public class MenuBuilder { b.setTypeface(null, Typeface.BOLD); b.setText(context.getResources().getString(R.string.shared_string_add_photo)); b.setBackgroundResource(R.drawable.btn_border_light); + //TODO This feature is under development + b.setVisibility(View.GONE); b.setTextColor(ContextCompat.getColor(context, R.color.preference_category_title)); return b; } From b44f2b7dcd4fb85e5fab12fce58616f13b2611ce Mon Sep 17 00:00:00 2001 From: xmd5a Date: Tue, 17 Nov 2020 18:47:41 +0300 Subject: [PATCH 11/70] Update phrases --- OsmAnd/res/values-ar/phrases.xml | 2 +- OsmAnd/res/values-ast/phrases.xml | 2 +- OsmAnd/res/values-az/phrases.xml | 2 +- OsmAnd/res/values-b+hsb/phrases.xml | 2 +- OsmAnd/res/values-b+kab/phrases.xml | 2 +- OsmAnd/res/values-be/phrases.xml | 2 +- OsmAnd/res/values-bn/phrases.xml | 2 +- OsmAnd/res/values-br/phrases.xml | 2 +- OsmAnd/res/values-ca/phrases.xml | 2 +- OsmAnd/res/values-cs/phrases.xml | 2 +- OsmAnd/res/values-da/phrases.xml | 2 +- OsmAnd/res/values-de/phrases.xml | 2 +- OsmAnd/res/values-el/phrases.xml | 2 +- OsmAnd/res/values-eo/phrases.xml | 2 +- OsmAnd/res/values-es-rAR/phrases.xml | 2 +- OsmAnd/res/values-es-rUS/phrases.xml | 2 +- OsmAnd/res/values-es/phrases.xml | 2 +- OsmAnd/res/values-et/phrases.xml | 2 +- OsmAnd/res/values-eu/phrases.xml | 2 +- OsmAnd/res/values-fa/phrases.xml | 2 +- OsmAnd/res/values-fi/phrases.xml | 2 +- OsmAnd/res/values-fr/phrases.xml | 2 +- OsmAnd/res/values-gl/phrases.xml | 2 +- OsmAnd/res/values-hu/phrases.xml | 2 +- OsmAnd/res/values-is/phrases.xml | 2 +- OsmAnd/res/values-it/phrases.xml | 2 +- OsmAnd/res/values-iw/phrases.xml | 2 +- OsmAnd/res/values-ja/phrases.xml | 2 +- OsmAnd/res/values-lt/phrases.xml | 2 +- OsmAnd/res/values-lv/phrases.xml | 2 +- OsmAnd/res/values-ml/phrases.xml | 2 +- OsmAnd/res/values-nb/phrases.xml | 2 +- OsmAnd/res/values-nl/phrases.xml | 2 +- OsmAnd/res/values-oc/phrases.xml | 2 +- OsmAnd/res/values-pl/phrases.xml | 2 +- OsmAnd/res/values-pt-rBR/phrases.xml | 2 +- OsmAnd/res/values-pt/phrases.xml | 2 +- OsmAnd/res/values-ru/phrases.xml | 2 +- OsmAnd/res/values-sc/phrases.xml | 2 +- OsmAnd/res/values-sk/phrases.xml | 2 +- OsmAnd/res/values-sl/phrases.xml | 2 +- OsmAnd/res/values-sr/phrases.xml | 2 +- OsmAnd/res/values-sv/phrases.xml | 2 +- OsmAnd/res/values-tr/phrases.xml | 2 +- OsmAnd/res/values-uk/phrases.xml | 2 +- OsmAnd/res/values-zh-rCN/phrases.xml | 2 +- OsmAnd/res/values-zh-rTW/phrases.xml | 2 +- OsmAnd/res/values/phrases.xml | 35 +++++++++++++++++++++++++++- 48 files changed, 81 insertions(+), 48 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index d8372de23f..e5bc657997 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -436,7 +436,7 @@ مضخة النوع النوع - النوع + النوع التخصص النوع الدين diff --git a/OsmAnd/res/values-ast/phrases.xml b/OsmAnd/res/values-ast/phrases.xml index 8f54bce23a..b62ba29ac5 100644 --- a/OsmAnd/res/values-ast/phrases.xml +++ b/OsmAnd/res/values-ast/phrases.xml @@ -32,7 +32,7 @@ Categoría Tipu Tipu - Tipu + Tipu Capital Dispensa recetes Especialidá diff --git a/OsmAnd/res/values-az/phrases.xml b/OsmAnd/res/values-az/phrases.xml index b8b54cd907..38ea9555d8 100644 --- a/OsmAnd/res/values-az/phrases.xml +++ b/OsmAnd/res/values-az/phrases.xml @@ -39,7 +39,7 @@ Nasos Növ Növ - Növ + Növ Paytaxt Növ Din diff --git a/OsmAnd/res/values-b+hsb/phrases.xml b/OsmAnd/res/values-b+hsb/phrases.xml index 7d30f647ed..99660df279 100644 --- a/OsmAnd/res/values-b+hsb/phrases.xml +++ b/OsmAnd/res/values-b+hsb/phrases.xml @@ -415,7 +415,7 @@ typ typ typ - typ + typ typ typ typ diff --git a/OsmAnd/res/values-b+kab/phrases.xml b/OsmAnd/res/values-b+kab/phrases.xml index 9171eb6e71..19de90bfa5 100644 --- a/OsmAnd/res/values-b+kab/phrases.xml +++ b/OsmAnd/res/values-b+kab/phrases.xml @@ -509,7 +509,7 @@ Anaw Ih Anaw - Anaw + Anaw Anaw Anaw Isem diff --git a/OsmAnd/res/values-be/phrases.xml b/OsmAnd/res/values-be/phrases.xml index 253f7eb98d..9c24277245 100644 --- a/OsmAnd/res/values-be/phrases.xml +++ b/OsmAnd/res/values-be/phrases.xml @@ -2790,7 +2790,7 @@ Прызначэнне Тып Тып - Тып + Тып Сталіца Продаж лекаў па рэцэптам Спецыялізацыя diff --git a/OsmAnd/res/values-bn/phrases.xml b/OsmAnd/res/values-bn/phrases.xml index 37ac51e682..0a0f54e79d 100644 --- a/OsmAnd/res/values-bn/phrases.xml +++ b/OsmAnd/res/values-bn/phrases.xml @@ -80,7 +80,7 @@ রাজধানী পরিসেবা নগদ উত্তোলন - ধরণ + ধরণ ধরণ ধরণ ভেন্ডিং টাইপ diff --git a/OsmAnd/res/values-br/phrases.xml b/OsmAnd/res/values-br/phrases.xml index 99e82229df..7854237f3d 100644 --- a/OsmAnd/res/values-br/phrases.xml +++ b/OsmAnd/res/values-br/phrases.xml @@ -32,7 +32,7 @@ Anv Seurt Seurt - Seurt + Seurt Kêrbenn Ordrenañs Arbennigiezh diff --git a/OsmAnd/res/values-ca/phrases.xml b/OsmAnd/res/values-ca/phrases.xml index 126959dfec..5a20a8aa4c 100644 --- a/OsmAnd/res/values-ca/phrases.xml +++ b/OsmAnd/res/values-ca/phrases.xml @@ -2118,7 +2118,7 @@ Calefacció Tipus Tipus - Tipus + Tipus Capital Especialitat Característica diff --git a/OsmAnd/res/values-cs/phrases.xml b/OsmAnd/res/values-cs/phrases.xml index fc5bfd5892..b0e0e22791 100644 --- a/OsmAnd/res/values-cs/phrases.xml +++ b/OsmAnd/res/values-cs/phrases.xml @@ -2692,7 +2692,7 @@ Typ Typ Typ - Typ + Typ Typ Typ Typ diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 9f26ab3b43..7f1eb79c21 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -2805,7 +2805,7 @@ Betegnelse Type Type - Type + Type Hovedstad Udlevering Speciale diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 4999a997a0..e9f39131f9 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -2795,7 +2795,7 @@ Bezeichnung Art Art - Art + Art Hauptstadt Signalton U-Bahnstation diff --git a/OsmAnd/res/values-el/phrases.xml b/OsmAnd/res/values-el/phrases.xml index ceec6766ec..affc4dc152 100644 --- a/OsmAnd/res/values-el/phrases.xml +++ b/OsmAnd/res/values-el/phrases.xml @@ -32,7 +32,7 @@ Περιγραφή Τύπος Τύπος - Τύπος + Τύπος Πρωτεύουσα Διανομή Ειδικότητα diff --git a/OsmAnd/res/values-eo/phrases.xml b/OsmAnd/res/values-eo/phrases.xml index d1757bea9d..99dda63d74 100644 --- a/OsmAnd/res/values-eo/phrases.xml +++ b/OsmAnd/res/values-eo/phrases.xml @@ -2786,7 +2786,7 @@ Apliko Speco de teleskopo Dresado de - Speco de diplomata oficejo + Speco de diplomata oficejo Ĉefurbo Medikamentoj je preskribo Kontraŭmedicino diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index 20712137c0..c72ea55517 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -2804,7 +2804,7 @@ Designación Tipo de telescopio Tipo de amaestramiento - Tipo de embajada + Tipo de embajada Ciudad capital Receta médica Especialidad diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index 89b147ca4a..5f62bd195b 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -2805,7 +2805,7 @@ Designación Tipo de telescopio Tipo de amaestramiento - Tipo de embajada + Tipo de embajada Ciudad capital Receta médica Especialidad diff --git a/OsmAnd/res/values-es/phrases.xml b/OsmAnd/res/values-es/phrases.xml index 925fc45bb3..66f9099ee7 100644 --- a/OsmAnd/res/values-es/phrases.xml +++ b/OsmAnd/res/values-es/phrases.xml @@ -2794,7 +2794,7 @@ Designación Tipo Tipo - Tipo + Tipo Capital Especialidad Característica diff --git a/OsmAnd/res/values-et/phrases.xml b/OsmAnd/res/values-et/phrases.xml index 3989f35f69..97af8c5b8c 100644 --- a/OsmAnd/res/values-et/phrases.xml +++ b/OsmAnd/res/values-et/phrases.xml @@ -212,7 +212,7 @@ Määramine Liik Liik - Liik + Liik Pealinn Väljastamine Eriala diff --git a/OsmAnd/res/values-eu/phrases.xml b/OsmAnd/res/values-eu/phrases.xml index 5ed19a222f..0bb27ef42b 100644 --- a/OsmAnd/res/values-eu/phrases.xml +++ b/OsmAnd/res/values-eu/phrases.xml @@ -1208,7 +1208,7 @@ Izendapena Mota Mota - Mota + Mota Hiriburua Farmazia Espezialitatea diff --git a/OsmAnd/res/values-fa/phrases.xml b/OsmAnd/res/values-fa/phrases.xml index 28eb63e08b..e0dc84826b 100644 --- a/OsmAnd/res/values-fa/phrases.xml +++ b/OsmAnd/res/values-fa/phrases.xml @@ -646,7 +646,7 @@ ترمینال باربری نوع تلسکوپ نوع - نوع سفارت + نوع سفارت پایتخت تخصص مشخصات diff --git a/OsmAnd/res/values-fi/phrases.xml b/OsmAnd/res/values-fi/phrases.xml index 002a995140..1c7c0ec44a 100644 --- a/OsmAnd/res/values-fi/phrases.xml +++ b/OsmAnd/res/values-fi/phrases.xml @@ -60,7 +60,7 @@ Pumppu Tyyppi Tyyppi - Tyyppi + Tyyppi Pääkaupunki Erikoisuus Ominainen diff --git a/OsmAnd/res/values-fr/phrases.xml b/OsmAnd/res/values-fr/phrases.xml index 2141c47b39..40f35c26d0 100644 --- a/OsmAnd/res/values-fr/phrases.xml +++ b/OsmAnd/res/values-fr/phrases.xml @@ -1975,7 +1975,7 @@ Cargo Type Type - Type + Type Capitale Spécialité Caractéristiques diff --git a/OsmAnd/res/values-gl/phrases.xml b/OsmAnd/res/values-gl/phrases.xml index fece900054..cfb2bee6f2 100644 --- a/OsmAnd/res/values-gl/phrases.xml +++ b/OsmAnd/res/values-gl/phrases.xml @@ -1029,7 +1029,7 @@ Designación Tipo Tipo - Tipo + Tipo Capital Especialidade Característica diff --git a/OsmAnd/res/values-hu/phrases.xml b/OsmAnd/res/values-hu/phrases.xml index c20dc74cd4..f6fe9f9bfe 100644 --- a/OsmAnd/res/values-hu/phrases.xml +++ b/OsmAnd/res/values-hu/phrases.xml @@ -1849,7 +1849,7 @@ Szivattyú Típus Típus - Típus + Típus Főváros Szakosodás Jellemző diff --git a/OsmAnd/res/values-is/phrases.xml b/OsmAnd/res/values-is/phrases.xml index f90741b80d..9a88f1bc7c 100644 --- a/OsmAnd/res/values-is/phrases.xml +++ b/OsmAnd/res/values-is/phrases.xml @@ -183,7 +183,7 @@ Tilgangur Tegund Tegund - Tegund + Tegund Tegund Stjörnugjöf Trúarbrögð diff --git a/OsmAnd/res/values-it/phrases.xml b/OsmAnd/res/values-it/phrases.xml index 203079b8db..ea5752b771 100644 --- a/OsmAnd/res/values-it/phrases.xml +++ b/OsmAnd/res/values-it/phrases.xml @@ -729,7 +729,7 @@ Designazione Tipo Tipo - Tipo + Tipo Capitale Ricette Specialità diff --git a/OsmAnd/res/values-iw/phrases.xml b/OsmAnd/res/values-iw/phrases.xml index d593ffb9d0..7459854776 100644 --- a/OsmAnd/res/values-iw/phrases.xml +++ b/OsmAnd/res/values-iw/phrases.xml @@ -166,7 +166,7 @@ סוג סוג סוג - סוג + סוג בירה מומחיות מאפיינים diff --git a/OsmAnd/res/values-ja/phrases.xml b/OsmAnd/res/values-ja/phrases.xml index c4199b91d4..73c30df5e8 100644 --- a/OsmAnd/res/values-ja/phrases.xml +++ b/OsmAnd/res/values-ja/phrases.xml @@ -1989,7 +1989,7 @@ 望遠鏡 観測ドーム 動物訓練施設の種類 - 外交関連施設(領事館、大使住居等)の種類 + 外交関連施設(領事館、大使住居等)の種類 部品 販売 修理 diff --git a/OsmAnd/res/values-lt/phrases.xml b/OsmAnd/res/values-lt/phrases.xml index cfb73ccf2b..075634300c 100644 --- a/OsmAnd/res/values-lt/phrases.xml +++ b/OsmAnd/res/values-lt/phrases.xml @@ -133,7 +133,7 @@ Siurblys Tipas Tipas - Tipas + Tipas Sostinė Specializacija Tipas diff --git a/OsmAnd/res/values-lv/phrases.xml b/OsmAnd/res/values-lv/phrases.xml index 777503bce4..d1cd6ac408 100644 --- a/OsmAnd/res/values-lv/phrases.xml +++ b/OsmAnd/res/values-lv/phrases.xml @@ -31,7 +31,7 @@ Nozīmēšana Veids Veids - Veids + Veids Galvaspilsēta Zāles pret receptēm Specializācija diff --git a/OsmAnd/res/values-ml/phrases.xml b/OsmAnd/res/values-ml/phrases.xml index 52b3f27aa2..f19e515bb7 100644 --- a/OsmAnd/res/values-ml/phrases.xml +++ b/OsmAnd/res/values-ml/phrases.xml @@ -875,7 +875,7 @@ പദവി തരം തരം - തരം + തരം തലസ്ഥാനം വിതരണം സ്പെഷ്യാലിറ്റി diff --git a/OsmAnd/res/values-nb/phrases.xml b/OsmAnd/res/values-nb/phrases.xml index b77c5c96e8..984a2fef16 100644 --- a/OsmAnd/res/values-nb/phrases.xml +++ b/OsmAnd/res/values-nb/phrases.xml @@ -630,7 +630,7 @@ Pumpe Type Type - Type + Type Spesialitet Kjennetegn Type diff --git a/OsmAnd/res/values-nl/phrases.xml b/OsmAnd/res/values-nl/phrases.xml index 65a281ce68..b8dd90b484 100644 --- a/OsmAnd/res/values-nl/phrases.xml +++ b/OsmAnd/res/values-nl/phrases.xml @@ -1418,7 +1418,7 @@ Aanduiding Type Type - Type + Type Hoofdstad Apotheek Gespecialiseerd diff --git a/OsmAnd/res/values-oc/phrases.xml b/OsmAnd/res/values-oc/phrases.xml index 92139141e5..d581faf4bd 100644 --- a/OsmAnd/res/values-oc/phrases.xml +++ b/OsmAnd/res/values-oc/phrases.xml @@ -64,7 +64,7 @@ Servici Caufatge Tipe - Tipe + Tipe Tipe Valor en estèlas Tipe diff --git a/OsmAnd/res/values-pl/phrases.xml b/OsmAnd/res/values-pl/phrases.xml index 0d1fa62cc0..c3a1752338 100644 --- a/OsmAnd/res/values-pl/phrases.xml +++ b/OsmAnd/res/values-pl/phrases.xml @@ -2795,7 +2795,7 @@ Zastosowanie Rodzaj Tresura - Rodzaj + Rodzaj Stolica Recepty Specjalizacja diff --git a/OsmAnd/res/values-pt-rBR/phrases.xml b/OsmAnd/res/values-pt-rBR/phrases.xml index f9bb017fe2..cde5e0611b 100644 --- a/OsmAnd/res/values-pt-rBR/phrases.xml +++ b/OsmAnd/res/values-pt-rBR/phrases.xml @@ -2476,7 +2476,7 @@ Designação Tipo Tipo - Tipo + Tipo Capital Dispensa Especialidade diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index 2386f2f08a..eb04e28ff5 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -269,7 +269,7 @@ Designação Tipo Tipo - Tipo + Tipo Especialidade Característica Tipo diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index c75c0ac4ef..ff47fdaea2 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -2793,7 +2793,7 @@ Отсутствуют Исключительно Дорожное зеркало - Вид + Вид Консульство Генеральное консульство Почётное консульство diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index 7e589f3ab7..5dcc8b52d1 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -1782,7 +1782,7 @@ Pompa Casta Casta - Casta + Casta Capitale Ispetzialidade Caraterìstica diff --git a/OsmAnd/res/values-sk/phrases.xml b/OsmAnd/res/values-sk/phrases.xml index 01634dca7f..3a141ef175 100644 --- a/OsmAnd/res/values-sk/phrases.xml +++ b/OsmAnd/res/values-sk/phrases.xml @@ -1933,7 +1933,7 @@ Pumpa Typ Typ - Typ + Typ Hlavné mesto Výdaj na predpis Špecializácia diff --git a/OsmAnd/res/values-sl/phrases.xml b/OsmAnd/res/values-sl/phrases.xml index adf5079f05..53bb97f56f 100644 --- a/OsmAnd/res/values-sl/phrases.xml +++ b/OsmAnd/res/values-sl/phrases.xml @@ -422,7 +422,7 @@ Črpalka Vrsta Vrsta - Vrsta + Vrsta Glavno mesto Specializacija Vrsta diff --git a/OsmAnd/res/values-sr/phrases.xml b/OsmAnd/res/values-sr/phrases.xml index 983b3d4e35..f764fee95c 100644 --- a/OsmAnd/res/values-sr/phrases.xml +++ b/OsmAnd/res/values-sr/phrases.xml @@ -61,7 +61,7 @@ Пумпа Врста Врста - ТипВрста + ТипВрста Главни град Специјализација Особина diff --git a/OsmAnd/res/values-sv/phrases.xml b/OsmAnd/res/values-sv/phrases.xml index aa61340fcb..ab0e9a3e60 100644 --- a/OsmAnd/res/values-sv/phrases.xml +++ b/OsmAnd/res/values-sv/phrases.xml @@ -48,7 +48,7 @@ Beteckning Typ Typ - Typ + Typ Huvudstad Utskrivning Specialitet diff --git a/OsmAnd/res/values-tr/phrases.xml b/OsmAnd/res/values-tr/phrases.xml index a4b87bee1b..45103c30c5 100644 --- a/OsmAnd/res/values-tr/phrases.xml +++ b/OsmAnd/res/values-tr/phrases.xml @@ -1023,7 +1023,7 @@ Tür Tür Tür - Tür + Tür Tür Tür Tür diff --git a/OsmAnd/res/values-uk/phrases.xml b/OsmAnd/res/values-uk/phrases.xml index e3387de728..cc955e79c5 100644 --- a/OsmAnd/res/values-uk/phrases.xml +++ b/OsmAnd/res/values-uk/phrases.xml @@ -548,7 +548,7 @@ Призначення Вид Вид - Вид + Вид Столиця Продаж ліків за рецептами Спеціалізація diff --git a/OsmAnd/res/values-zh-rCN/phrases.xml b/OsmAnd/res/values-zh-rCN/phrases.xml index fb547e6724..189b28d2d2 100644 --- a/OsmAnd/res/values-zh-rCN/phrases.xml +++ b/OsmAnd/res/values-zh-rCN/phrases.xml @@ -21,7 +21,7 @@ 服务 无刷 类型 - 类型 + 类型 额外的 维基百科 用户自定义 diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 8244b4067d..cd4ea85dee 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -2256,7 +2256,7 @@ 指示 類型 類型 - 類型 + 類型 類型 類型 類型 diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 0ca39e1de6..360f1d8718 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -33,7 +33,7 @@ Designation Type Type - Type + Diplomatic institution Capital Dispensing Specialty @@ -138,6 +138,12 @@ Arrow Drinking water refill Departures board + Embassy + Consulate + Liaison + Non-immigrant visas + Immigrant visas + Citizen services Store @@ -4267,4 +4273,31 @@ Radar tower + Embassy + Liaison + + Headed by an ambassador + Branch + Delegation + High commission + Interests section + Mission + Nunciature + Residence + Headed by a consul + Consular agency + Consular office + Consulate general + Honorary consul + Office + Representative office + Subnational + + Yes + No + Yes + No + Yes + No + From fe375c91f1e759f88da49a0cc495d9bcf8298689 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Wed, 18 Nov 2020 12:08:15 +0200 Subject: [PATCH 12/70] Fix progress dialog from my places --- OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java | 5 ++--- .../plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java | 3 +-- .../plus/osmedit/dialogs/SendPoiBottomSheetFragment.java | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index 7aff0a604f..dff223e4d7 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -62,7 +62,6 @@ import net.osmand.plus.osmedit.FileTypeBottomSheetDialogFragment.FileTypeFragmen import net.osmand.plus.osmedit.OsmEditOptionsBottomSheetDialogFragment.OsmEditOptionsFragmentListener; import net.osmand.plus.osmedit.OsmPoint.Group; import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment; -import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.PoiUploaderType; import net.osmand.util.Algorithms; import org.xmlpull.v1.XmlSerializer; @@ -638,12 +637,12 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo && !Algorithms.isEmpty(settings.USER_PASSWORD.get()); if (hasPoiGroup(points)) { if (isLogged) { - SendPoiBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), points); + SendPoiBottomSheetFragment.showInstance(getChildFragmentManager(), points); } else { LoginBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), this); } } else { - SendOsmNoteBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), points); + SendOsmNoteBottomSheetFragment.showInstance(getChildFragmentManager(), points); } } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index 8cd61909e4..c488ad9149 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -25,7 +25,6 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; -import net.osmand.plus.dialogs.ProgressDialogFragment; import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.osmedit.oauth.OsmOAuthAuthorizationAdapter; @@ -177,7 +176,7 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen Activity activity = getActivity(); if (activity instanceof MapActivity) { progressDialogPoiUploader = new SimpleProgressDialogPoiUploader((MapActivity) activity); - } else if (getParentFragment() instanceof ProgressDialogFragment) { + } else if (getParentFragment() instanceof ProgressDialogPoiUploader) { progressDialogPoiUploader = (ProgressDialogPoiUploader) getParentFragment(); } if (progressDialogPoiUploader != null) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index dd862d0608..676a1063ff 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -21,7 +21,6 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; -import net.osmand.plus.dialogs.ProgressDialogFragment; import net.osmand.plus.osmedit.OpenstreetmapPoint; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.settings.backend.OsmandSettings; @@ -115,7 +114,7 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { Activity activity = getActivity(); if (activity instanceof MapActivity) { progressDialogPoiUploader = new SimpleProgressDialogPoiUploader((MapActivity) activity); - } else if (getParentFragment() instanceof ProgressDialogFragment) { + } else if (getParentFragment() instanceof ProgressDialogPoiUploader) { progressDialogPoiUploader = (ProgressDialogPoiUploader) getParentFragment(); } if (progressDialogPoiUploader != null) { From 8709798f6ddc81a82314ded5df79613192b07de4 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 18 Nov 2020 14:30:57 +0300 Subject: [PATCH 13/70] Fix HW signing --- OsmAnd/build.gradle | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index c52dac72ad..c837c89867 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -40,15 +40,6 @@ android { keyAlias "osmand" keyPassword System.getenv("OSMAND_APK_PASSWORD") } - - publishingHuawei { - storeFile file("/var/lib/jenkins/osmand_hw_key") - storePassword System.getenv("OSMAND_HW_APK_PASSWORD") - keyAlias "osmand" - keyPassword System.getenv("OSMAND_HW_APK_PASSWORD") - v1SigningEnabled true - v2SigningEnabled true - } } defaultConfig { @@ -215,11 +206,7 @@ android { buildConfigField "String", "OPR_BASE_URL", "\"https://test.openplacereviews.org/\"" buildConfigField "String", "OSM_OAUTH_CONSUMER_KEY", "\"Ti2qq3fo4i4Wmuox3SiWRIGq3obZisBHnxmcM05y\"" buildConfigField "String", "OSM_OAUTH_CONSUMER_SECRET", "\"lxulb3HYoMmd2cC4xxNe1dyfRMAY8dS0eNihJ0DM\"" - if (gradle.startParameter.taskNames.toString().contains("huawei")) { - signingConfig signingConfigs.publishingHuawei - } else { - signingConfig signingConfigs.publishing - } + signingConfig signingConfigs.publishing } } From d2b030d5d9645475c3a999d98e22685697ed8286 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 18 Nov 2020 14:12:39 +0200 Subject: [PATCH 14/70] Separate account details, osm create/modify textfield style --- OsmAnd/res/layout/account_details.xml | 59 +++++++ OsmAnd/res/layout/open_osm_note_text.xml | 36 +++++ OsmAnd/res/layout/send_gpx_fragment.xml | 60 +------ OsmAnd/res/layout/send_osm_note_fragment.xml | 151 ++++++------------ OsmAnd/res/layout/send_poi_fragment.xml | 60 +------ .../osmedit/dialogs/BugBottomSheetDialog.java | 2 +- 6 files changed, 151 insertions(+), 217 deletions(-) create mode 100644 OsmAnd/res/layout/account_details.xml create mode 100644 OsmAnd/res/layout/open_osm_note_text.xml diff --git a/OsmAnd/res/layout/account_details.xml b/OsmAnd/res/layout/account_details.xml new file mode 100644 index 0000000000..9e6e4497d7 --- /dev/null +++ b/OsmAnd/res/layout/account_details.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/open_osm_note_text.xml b/OsmAnd/res/layout/open_osm_note_text.xml new file mode 100644 index 0000000000..a6bdcc5178 --- /dev/null +++ b/OsmAnd/res/layout/open_osm_note_text.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/send_gpx_fragment.xml b/OsmAnd/res/layout/send_gpx_fragment.xml index 18c871e671..795b169300 100644 --- a/OsmAnd/res/layout/send_gpx_fragment.xml +++ b/OsmAnd/res/layout/send_gpx_fragment.xml @@ -141,63 +141,13 @@ - + - - - - - - - - - - - - + \ No newline at end of file diff --git a/OsmAnd/res/layout/send_osm_note_fragment.xml b/OsmAnd/res/layout/send_osm_note_fragment.xml index d98e60b260..12205d77bb 100644 --- a/OsmAnd/res/layout/send_osm_note_fragment.xml +++ b/OsmAnd/res/layout/send_osm_note_fragment.xml @@ -30,7 +30,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:imeOptions="actionDone" - android:lineSpacingExtra="5sp"/> + android:lineSpacingExtra="5sp" /> + + + + + + - - - - - - - - - - - - - - - - - - + android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier" + android:paddingStart="@dimen/content_padding" + android:paddingLeft="@dimen/content_padding" + android:paddingTop="@dimen/content_padding_small" + android:paddingEnd="@dimen/content_padding" + android:paddingRight="@dimen/content_padding" + android:paddingBottom="@dimen/content_padding_small" + android:text="@string/osm_login_descr" + android:textColor="?android:textColorPrimary" + android:textSize="@dimen/default_list_text_size" + osmand:typeface="@string/font_roboto_regular" /> - + - - - - - - - + + diff --git a/OsmAnd/res/layout/send_poi_fragment.xml b/OsmAnd/res/layout/send_poi_fragment.xml index d81aa9cdda..751c0b1fe8 100644 --- a/OsmAnd/res/layout/send_poi_fragment.xml +++ b/OsmAnd/res/layout/send_poi_fragment.xml @@ -64,64 +64,14 @@ - + - + - - - - - - - - - - - diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java index a865d0962c..3793196ce0 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/BugBottomSheetDialog.java @@ -55,7 +55,7 @@ public class BugBottomSheetDialog extends MenuBottomSheetDialogFragment { items.add(new TitleItem(getString(titleTextId))); View osmNoteView = View.inflate(UiUtilities.getThemedContext(app, nightMode), - R.layout.track_name_edit_text, null); + R.layout.open_osm_note_text, null); TextInputLayout textBox = osmNoteView.findViewById(R.id.name_text_box); int highlightColorId = nightMode ? R.color.list_background_color_dark : R.color.activity_background_color_light; textBox.setBoxBackgroundColorResource(highlightColorId); From 99f2cf270ee90b81d050402cf6c44adf813a6bec Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 18 Nov 2020 16:29:48 +0200 Subject: [PATCH 15/70] Remove unnecessary view --- OsmAnd/res/layout/open_osm_note_text.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/OsmAnd/res/layout/open_osm_note_text.xml b/OsmAnd/res/layout/open_osm_note_text.xml index a6bdcc5178..c3bb2dccd8 100644 --- a/OsmAnd/res/layout/open_osm_note_text.xml +++ b/OsmAnd/res/layout/open_osm_note_text.xml @@ -5,12 +5,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical"> - - Date: Wed, 18 Nov 2020 17:14:42 +0200 Subject: [PATCH 16/70] Fix my places send gpx OAuth --- .../net/osmand/plus/helpers/IntentHelper.java | 3 +- .../LoginBottomSheetFragment.java | 6 +++- .../plus/myplaces/AvailableGPXFragment.java | 17 ++++++++-- .../osmand/plus/osmedit/OsmEditingPlugin.java | 4 +-- .../osmand/plus/osmedit/OsmEditsFragment.java | 32 ++++++++++++++----- .../SendOsmNoteBottomSheetFragment.java | 12 +++++-- .../oauth/OsmOAuthAuthorizationAdapter.java | 15 +++------ .../plus/osmedit/oauth/OsmOAuthHelper.java | 29 ++++++++++++++--- 8 files changed, 86 insertions(+), 32 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index 25cc6dcc30..a7d6dd7f79 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -297,7 +297,8 @@ public class IntentHelper { Uri uri = intent.getData(); if (uri.toString().startsWith("osmand-oauth")) { String oauthVerifier = uri.getQueryParameter("oauth_verifier"); - app.getOsmOAuthHelper().authorize(oauthVerifier, getOnAuthorizeListener()); + app.getOsmOAuthHelper().addListener(getOnAuthorizeListener()); + app.getOsmOAuthHelper().authorize(oauthVerifier); mapActivity.setIntent(null); return true; } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java index 3276bb2aa8..2b50ea6b2f 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java @@ -24,7 +24,7 @@ import net.osmand.plus.settings.bottomsheets.OsmLoginDataBottomSheet; import org.apache.commons.logging.Log; import static net.osmand.plus.osmedit.OsmEditingFragment.OSM_LOGIN_DATA; -import static net.osmand.plus.osmedit.oauth.OsmOAuthHelper.*; +import static net.osmand.plus.osmedit.oauth.OsmOAuthHelper.OsmAuthorizationListener; public class LoginBottomSheetFragment extends MenuBottomSheetDialogFragment implements OsmAuthorizationListener { @@ -89,6 +89,10 @@ public class LoginBottomSheetFragment extends MenuBottomSheetDialogFragment impl protected void onThirdBottomButtonClick() { View view = getView(); if (view != null) { + Fragment fragment = getTargetFragment(); + if (fragment instanceof OsmAuthorizationListener) { + osmOAuthHelper.addListener((OsmAuthorizationListener) fragment); + } osmOAuthHelper.startOAuth((ViewGroup) view); } } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 31cb5375fe..6bac2a31ea 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -80,11 +80,12 @@ import net.osmand.plus.activities.TrackActivity; import net.osmand.plus.base.OsmandExpandableListFragment; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetType; +import net.osmand.plus.helpers.enums.TracksSortByMode; import net.osmand.plus.mapmarkers.CoordinateInputDialogFragment; import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin; +import net.osmand.plus.osmedit.oauth.OsmOAuthHelper.OsmAuthorizationListener; import net.osmand.plus.settings.backend.OsmandSettings; -import net.osmand.plus.helpers.enums.TracksSortByMode; import java.io.File; import java.text.DateFormat; @@ -112,7 +113,7 @@ import static net.osmand.util.Algorithms.objectEquals; import static net.osmand.util.Algorithms.removeAllFiles; public class AvailableGPXFragment extends OsmandExpandableListFragment implements - FavoritesFragmentStateHolder { + FavoritesFragmentStateHolder, OsmAuthorizationListener { public static final Pattern ILLEGAL_PATH_NAME_CHARACTERS = Pattern.compile("[?:\"*|<>]"); public static final int SEARCH_ID = -1; @@ -922,6 +923,18 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement public void restoreState(Bundle bundle) { } + @Override + public void authorizationCompleted() { + Bundle bundle = new Bundle(); + bundle.putInt(TAB_ID, GPX_TAB); + + Intent intent = new Intent(app, app.getAppCustomization().getFavoritesActivity()); + intent.putExtra(MapActivity.INTENT_PARAMS, bundle); + intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); + + app.startActivity(intent); + } + public class LoadGpxTask extends AsyncTask> { private List result; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index a2ca2f0a61..6382acb107 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -461,10 +461,10 @@ public class OsmEditingPlugin extends OsmandPlugin { String pwd = settings.USER_PASSWORD.get(); String authToken = settings.USER_ACCESS_TOKEN.get(); if ((Algorithms.isEmpty(name) || Algorithms.isEmpty(pwd)) && Algorithms.isEmpty(authToken)) { - LoginBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment()); + LoginBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment); return false; } else { - SendGpxBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment(), info); + SendGpxBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment, info); return true; } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index dff223e4d7..3c1733f7ac 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -42,11 +42,6 @@ import net.osmand.osm.edit.Entity; import net.osmand.osm.edit.Node; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.measurementtool.LoginBottomSheetFragment; -import net.osmand.plus.osmedit.dialogs.SendOsmNoteBottomSheetFragment; -import net.osmand.plus.osmedit.dialogs.SendPoiBottomSheetFragment; -import net.osmand.plus.osmedit.oauth.OsmOAuthAuthorizationAdapter; -import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.Version; import net.osmand.plus.activities.ActionBarProgressActivity; @@ -55,13 +50,20 @@ import net.osmand.plus.activities.OsmandActionBarActivity; import net.osmand.plus.base.OsmAndListFragment; import net.osmand.plus.dialogs.ProgressDialogFragment; import net.osmand.plus.helpers.AndroidUiHelper; +import net.osmand.plus.measurementtool.LoginBottomSheetFragment; import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.myplaces.FavoritesFragmentStateHolder; import net.osmand.plus.osmedit.ExportOptionsBottomSheetDialogFragment.ExportOptionsFragmentListener; import net.osmand.plus.osmedit.FileTypeBottomSheetDialogFragment.FileTypeFragmentListener; +import net.osmand.plus.osmedit.OpenstreetmapLocalUtil.OnNodeCommittedListener; import net.osmand.plus.osmedit.OsmEditOptionsBottomSheetDialogFragment.OsmEditOptionsFragmentListener; import net.osmand.plus.osmedit.OsmPoint.Group; -import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment; +import net.osmand.plus.osmedit.dialogs.SendOsmNoteBottomSheetFragment; +import net.osmand.plus.osmedit.dialogs.SendPoiBottomSheetFragment; +import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.ProgressDialogPoiUploader; +import net.osmand.plus.osmedit.oauth.OsmOAuthAuthorizationAdapter; +import net.osmand.plus.osmedit.oauth.OsmOAuthHelper.OsmAuthorizationListener; +import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.util.Algorithms; import org.xmlpull.v1.XmlSerializer; @@ -79,8 +81,8 @@ import java.util.Map; import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID; import static net.osmand.plus.osmedit.OsmEditingPlugin.OSM_EDIT_TAB; -public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialogFragment.ProgressDialogPoiUploader, OpenstreetmapLocalUtil.OnNodeCommittedListener, - FavoritesFragmentStateHolder { +public class OsmEditsFragment extends OsmAndListFragment implements ProgressDialogPoiUploader, + OnNodeCommittedListener, FavoritesFragmentStateHolder, OsmAuthorizationListener { public static final int EXPORT_TYPE_ALL = 0; public static final int EXPORT_TYPE_POI = 1; @@ -104,6 +106,7 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo private final static int MODE_DELETE = 100; private final static int MODE_UPLOAD = 101; + private OsmandApplication app; private OsmEditingPlugin plugin; private View footerView; @@ -144,6 +147,7 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + app = getMyApplication(); if (savedInstanceState != null) { exportType = savedInstanceState.getInt(EXPORT_TYPE_KEY); } @@ -647,6 +651,18 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo } } + @Override + public void authorizationCompleted() { + Bundle bundle = new Bundle(); + bundle.putInt(TAB_ID, OSM_EDIT_TAB); + + Intent intent = new Intent(app, app.getAppCustomization().getFavoritesActivity()); + intent.putExtra(MapActivity.INTENT_PARAMS, bundle); + intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); + + app.startActivity(intent); + } + boolean hasPoiGroup(OsmPoint[] points) { boolean hasPoiGroup = false; for (OsmPoint p : points) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index 628d693578..5046165ba7 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -13,6 +13,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.SwitchCompat; +import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import com.google.android.material.textfield.TextInputLayout; @@ -38,8 +39,10 @@ import org.apache.commons.logging.Log; import static net.osmand.plus.UiUtilities.setupDialogButton; import static net.osmand.plus.osmedit.OsmEditingFragment.OSM_LOGIN_DATA; -import static net.osmand.plus.osmedit.ValidateOsmLoginDetailsTask.*; -import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.*; +import static net.osmand.plus.osmedit.ValidateOsmLoginDetailsTask.ValidateOsmLoginListener; +import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.OPENSTREETMAP_POINT; +import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.ProgressDialogPoiUploader; +import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.SimpleProgressDialogPoiUploader; public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragment implements ValidateOsmLoginListener, OsmAuthorizationListener { @@ -89,7 +92,10 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen signInButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - OsmandApplication app = requiredMyApplication(); + Fragment fragment = getParentFragment(); + if (fragment instanceof OsmAuthorizationListener) { + app.getOsmOAuthHelper().addListener((OsmAuthorizationListener) fragment); + } app.getOsmOAuthHelper().startOAuth((ViewGroup) v); } }); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java index 726a1e1b37..a224d93fa0 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthAuthorizationAdapter.java @@ -26,8 +26,6 @@ import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.util.concurrent.ExecutionException; -import static net.osmand.plus.osmedit.oauth.OsmOAuthHelper.*; - public class OsmOAuthAuthorizationAdapter { private static final int THREAD_ID = 10101; @@ -99,8 +97,8 @@ public class OsmOAuthAuthorizationAdapter { return client.performRequestWithoutAuth(url, method, body); } - public void authorize(String oauthVerifier, final OsmOAuthHelper helper, final OsmAuthorizationListener listener) { - new AuthorizeAsyncTask(helper, listener).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, oauthVerifier); + public void authorize(String oauthVerifier, OsmOAuthHelper helper) { + new AuthorizeAsyncTask(helper).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, oauthVerifier); } private class StartOAuthAsyncTask extends AsyncTask { @@ -120,17 +118,14 @@ public class OsmOAuthAuthorizationAdapter { protected void onPostExecute(@NonNull OAuth1RequestToken requestToken) { loadWebView(rootLayout, client.getService().getAuthorizationUrl(requestToken)); } - } private class AuthorizeAsyncTask extends AsyncTask { private final OsmOAuthHelper helper; - private final OsmAuthorizationListener listener; - public AuthorizeAsyncTask(OsmOAuthHelper helper, OsmAuthorizationListener listener) { + public AuthorizeAsyncTask(OsmOAuthHelper helper) { this.helper = helper; - this.listener = listener; } @Override @@ -143,9 +138,7 @@ public class OsmOAuthAuthorizationAdapter { @Override protected void onPostExecute(Void result) { - if (listener != null) { - listener.authorizationCompleted(); - } + helper.notifyAndRemoveListeners(); } public void updateUserName() { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java index a9ff75c6b5..f444c03030 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/oauth/OsmOAuthHelper.java @@ -6,26 +6,47 @@ import androidx.annotation.NonNull; import net.osmand.plus.OsmandApplication; +import java.util.HashSet; +import java.util.Set; + public class OsmOAuthHelper { + private final OsmandApplication app; private final OsmOAuthAuthorizationAdapter authorizationAdapter; + private final Set listeners = new HashSet<>(); public OsmOAuthHelper(@NonNull OsmandApplication app) { + this.app = app; authorizationAdapter = new OsmOAuthAuthorizationAdapter(app); } - public void startOAuth(ViewGroup view) { - authorizationAdapter.startOAuth(view); + public void addListener(OsmAuthorizationListener listener) { + listeners.add(listener); } - public void authorize(String oauthVerifier, OsmAuthorizationListener listener) { - authorizationAdapter.authorize(oauthVerifier, this, listener); + public void removeListener(OsmAuthorizationListener listener) { + listeners.remove(listener); } public OsmOAuthAuthorizationAdapter getAuthorizationAdapter() { return authorizationAdapter; } + public void startOAuth(@NonNull ViewGroup view) { + authorizationAdapter.startOAuth(view); + } + + public void authorize(@NonNull String oauthVerifier) { + authorizationAdapter.authorize(oauthVerifier, this); + } + + public void notifyAndRemoveListeners() { + for (OsmAuthorizationListener listener : listeners) { + listener.authorizationCompleted(); + } + listeners.clear(); + } + public interface OsmAuthorizationListener { void authorizationCompleted(); } From b7980ff511eaba4844add3cca33cfc188a6d8225 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 17 Nov 2020 07:34:26 +0000 Subject: [PATCH 17/70] Translated using Weblate (German) Currently translated at 99.9% (3554 of 3555 strings) --- OsmAnd/res/values-de/strings.xml | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index a17e9b39de..00fc2b7047 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1928,7 +1928,7 @@ Die App darf nun auf den externen Speicher schreiben, dazu ist aber ein manueller Neustart nötig. Verschieben ↑ Verschieben ↓ - Dateiname beinhaltet nicht erlaubte Zeichen + Nicht erlaubte Zeichen im Dateinamen Keine Wegpunkte gefunden Bitte Kartenmarkierungen über die Karte hinzufügen Fein @@ -2646,7 +2646,7 @@ Ort/POI-Name kopieren Unbenannter Ort Geschlossene Notizen anzeigen - OSM-Notizen auf der Karte ein-/ausblenden. + OSM-Notizen auf der Karte ein- oder ausblenden. GPX - geeignet für den Export in JOSM oder andere OSM-Editoren. OSC - geeignet für den Export nach OSM. GPX-Datei @@ -3104,13 +3104,13 @@ Extrem schwere Routen, mit gefährlichen Hindernissen und schwieriger Umgebung. Nur klassische Routen zulassen Bevorzugter Schwierigkeitsgrad - Ski Alpin/Abfahrtslauf + Ski Alpin und Abfahrtslauf Pisten für Ski Alpin oder Abfahrtslauf und Zugang zu den Skiliften. OsmAnd Download-Dienst Magenta Symbol Erfasste Daten - Skilanglauf/Nordischer Skisport + Skilanglauf und Nordischer Skisport Loipen für Skilangläufer und Nordische Skiläufer. Routen dieser Schwierigkeit bevorzugen, obwohl bei kürzerer Routenführung schwierigere oder einfachere Pisten immer noch möglich sind. Abseits der Piste @@ -3373,7 +3373,7 @@ Startpunkt Schätzt die Ankunftszeit für unbekannte Straßentypen und begrenzt die Geschwindigkeit für alle Straßen (kann die Navigation beeinflussen) Track gespeichert - Dateiname ist leer + Leerer Dateiname Zurücksetzen %1$s löschen\? Vorgeschlagene Karten @@ -3579,7 +3579,7 @@ Eine Schaltfläche zum Ein- und Ausblenden der Geländeebene auf der Karte. Gelände einblenden Gelände ausblenden - Gelände ein- / ausblenden + Gelände ein- oder ausblenden Relief Zoomstufen Transparenz @@ -3697,11 +3697,11 @@ Sie können auf diese Aktionen zugreifen, indem Sie auf die Schaltfläche \"%1$s\" tippen. Öffentliche Verkehrsmittel ausblenden Öffentliche Verkehrsmittel anzeigen - Öffentliche Verkehrsmittel anzeigen/ausblenden + Öffentliche Verkehrsmittel anzeigen oder ausblenden Schaltfläche zum Ein- oder Ausblenden der öffentlichen Verkehrsmittel auf der Karte. - POI erstellen / bearbeiten + POI erstellen oder bearbeiten Parkpositionen - Favorit hinzufügen / bearbeiten + Favorit hinzufügen oder bearbeiten Standard-Reihenfolge der Elemente wiederherstellen Zurück zur Bearbeitung Die Aktionsschaltfläche schaltet zwischen den ausgewählten Profilen um. @@ -3878,7 +3878,7 @@ Track Route Track Datei zum Folgen auswählen, oder vom Gerät importieren. Die GPX-Aufzeichnung wird angehalten, wenn OsmAnd beendet wird (über „zuletzt verwendete Apps“). (Die Hintergrunddienst-Anzeige verschwindet aus der Android-Benachrichtigungsleiste.) - Aufzeichnungsintervall für die generelle Track-Aufzeichnung festlegen (via Schaltfläche \'GPX\' auf dem Kartenbildschirm). + Aufzeichnungsintervall für die generelle Track-Aufzeichnung festlegen (wird über die Schaltfläche \'Routenaufzeichung\' auf dem Kartenbildschirm angeschaltet). Als nächstes können Sie Ihren Track mit einem Ihrer Navigationsprofile auf die nächstgelegene erlaubte Straße einrasten lassen, um diese Option zu nutzen. Track-Wegpunkt hinzufügen %s Track Dateien ausgewählt @@ -3895,7 +3895,7 @@ Wiederholen • Aktualisierte Funktion zum Planen einer Route: erlaubt die Verwendung verschiedener Navigationstypen pro Segment und die Einbeziehung von Tracks \n -\n • Neues Menü zum Erscheinungsbild von Tracks: Wählen Sie Farbe, Dicke, Richtungspfeile, Start-/Ziel-Symbole +\n • Neues Menü zum Erscheinungsbild von Tracks: Wählen Sie Farbe, Dicke, Richtungspfeile, Start- und Zielsymbole \n \n • Verbesserte Darstellung von Fahrradknotenpunkten. \n @@ -3911,7 +3911,7 @@ Zuletzt geändert Name: Z – A Name: A – Z - Start-/Ziel-Symbole + Start- und Zielsymbole Vielen Dank für den Kauf von \'Höhenlinien\' Das Abonnement wird pro ausgewähltem Zeitraum berechnet. Sie können das Abonnement jederzeit über die AppGallery kündigen. Die Bezahlung wird Ihrem AppGallery-Konto bei der Bestätigung des Kaufs belastet. @@ -3969,10 +3969,10 @@ Historie der Marker GPX-Datei an OpenStreetMap senden Geben Sie durch Komma getrennte Tags ein. - Öffentlich bedeutet, dass der Track in Ihren GPS-Tracks und in GPS-Track Verzeichnissen öffentlich angezeigt wird. Die über die API bereitgestellten Daten verweisen nicht auf Ihre Track-Seite. Die Zeitstempel der Trackpunkte sind nicht über die öffentliche GPS-API verfügbar, und die Punkte sind nicht chronologisch geordnet. Andere Benutzer können jedoch nach wie vor den Rohtrack aus der öffentlichen Trackliste und alle darin enthaltenen Zeitstempel herunterladen. - Identifizierbar bedeutet, dass der Track in Ihren GPS-Tracks und in öffentlichen GPS-Track Verzeichnissen angezeigt wird. Andere Benutzer können den Rohtrack herunterladen und mit Ihrem Benutzernamen verknüpfen. Daten, die über die Trackpunkte-API geliefert werden, verweisen auf Ihre ursprüngliche Track-Seite. Die Zeitstempel der Trackpunkte sind über die öffentliche GPS-API verfügbar. - Privat bedeutet, dass der Track nicht in öffentlichen Verzeichnissen auftaucht. Punkte des Tracks werden weiterhin über die öffentliche GPS-API ohne Zeitstempel verfügbar sein, aber nicht chronologisch geordnet. - Verfolgbar bedeutet, dass der Track in keiner öffentlichen Auflistung auftaucht, aber Trackpunkte weiterhin über die öffentliche GPS API mit Zeitstempel verfügbar sein werden. Andere Benutzer werden nur verarbeitete Trackpunkte Ihres Tracks herunterladen können, die nicht direkt mit Ihnen in Verbindung gebracht werden können. + \"Öffentlich\" bedeutet, dass der Track öffentlich in Ihren GPS-Tracks und in öffentlichen GPS-Track Verzeichnissen mit Zeitstempeln in Rohform angezeigt wird. Die über die API bereitgestellten Daten verweisen nicht auf Ihre Track-Seite. Die Zeitstempel der Trackpunkte sind nicht über die öffentliche GPS API verfügbar, und die Trackpunkte sind nicht chronologisch geordnet. + \"Identifizierbar\" bedeutet, dass der Track in Ihren GPS-Tracks und in öffentlichen GPS-Track Verzeichnissen angezeigt wird, d.h. andere Benutzer können den Track herunterladen und mit Ihrem Benutzernamen verknüpfen. Öffentliche, mit Zeitstempel versehene Trackpunkt-Daten von der GPS API, die über die Trackpunkt API bereitgestellt werden, verweisen auf Ihre ursprüngliche Trackseite. + \"Privat\" bedeutet, dass der Track nicht in öffentlichen Verzeichnissen auftaucht, aber seine Trackpunkte in nicht chronologischer Reihenfolge über die öffentliche GPS API ohne Zeitstempel verfügbar sind. + \"Verfolgbar\" bedeutet, dass die Spur nicht in öffentlichen Auflistungen auftaucht, aber verarbeitete Trackpunkte mit Zeitstempeln davon (die nicht direkt mit Ihnen in Verbindung gebracht werden können) durch Downloads von der öffentlichen GPS API. OSM Notiz schließen OSM Notiz kommentieren Sie können sich mit der sicheren OAuth-Methode anmelden oder Ihren Benutzernamen und Passwort verwenden. @@ -3982,4 +3982,7 @@ Fotos werden vom offenen Datenprojekt OpenPlaceReviews.org zur Verfügung gestellt. Um Ihre Fotos hochladen zu können, müssen Sie sich auf der Website anmelden. Neues Konto erstellen Ich habe bereits ein Konto + Suchverlauf + Kajak + Motorboot \ No newline at end of file From 52875d89f25fa6a8922207e8ce0d20474d5b73ea Mon Sep 17 00:00:00 2001 From: solokot Date: Wed, 18 Nov 2020 19:17:26 +0000 Subject: [PATCH 18/70] Translated using Weblate (Russian) Currently translated at 99.6% (3543 of 3555 strings) --- OsmAnd/res/values-ru/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 66894bb368..90979d5476 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -398,7 +398,7 @@ Флуоресцентные цвета Использовать флуоресцентные цвета для отображения треков и маршрутов. Локальное редактирование - Всегда использовать редактирование на устройстве. + Если используется редактирование на устройстве, то изменения будут сохранены локально и загружены на сервер только по запросу, иначе они будут загружаться немедленно. Изменение POI в приложении не меняет POI загруженные из интернета, однако все изменения сохраняются в локальный файл на устройстве. Отправка… {0} POI/заметок отправлено From 3e44bed0b0955cc272a9a3e50f77472854dfdbc6 Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 17 Nov 2020 20:16:08 +0000 Subject: [PATCH 19/70] Translated using Weblate (Russian) Currently translated at 99.6% (3543 of 3555 strings) --- OsmAnd/res/values-ru/strings.xml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 90979d5476..6f13c99ab5 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3107,7 +3107,7 @@ Режим пользователя, полученный из: %s Повторяющееся имя BRouter (локально) - Горнолыжные спуски + Альпийские и горные лыжи Склоны для катания и спуска на горных лыжах и доступ к подъёмникам. Лыжные туры Сани @@ -3334,7 +3334,7 @@ Правки OSM Поменять местами %1$s и %2$s Трек сохранён - Не указано имя файла + Пустое имя файла Очистить %1$s\? Узловые сети Предлагаемые карты @@ -3561,7 +3561,7 @@ Пересчитывать маршрут в случае отклонения %1$s из %2$s Настройка минимального и максимального уровней масштабирования, при которых слой будет отображаться. - Показать/скрыть рельеф + Показать или скрыть рельеф Переключатель, чтобы показать или скрыть слой рельефа местности на карте. Показать рельеф Скрыть рельеф @@ -3691,8 +3691,8 @@ Скрыть общественный транспорт Показать общественный транспорт Показать/скрыть общественный транспорт - Добавить/изменить место - Создать/изменить POI + Добавить или изменить избранное + Создать или изменить POI Возврат к редактированию Парковки Переключатель, чтобы показать или скрыть общественный транспорт на карте. @@ -3961,4 +3961,12 @@ Подписка OsmAnd Live приостановлена История маркеров Отправить GPX-файл в OpenStreetMap + Закрыть заметку OSM + Добавить фото + Зарегистрироваться на +\nOpenPlaceReviews.org + Создать новый аккаунт + У меня уже есть аккаунт + История поиска + Моторная лодка \ No newline at end of file From c99ef9d4b27946c33bcc9a4b02d531577283d5ac Mon Sep 17 00:00:00 2001 From: Moo Date: Wed, 18 Nov 2020 00:00:57 +0000 Subject: [PATCH 20/70] Translated using Weblate (Lithuanian) Currently translated at 60.2% (2141 of 3555 strings) --- OsmAnd/res/values-lt/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 36989898e7..049ac26e8c 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -2777,4 +2777,7 @@ Tai yra puikus būdas paremti OsmAnd ir OSM, jei jie jums patinka. Pridėtas taškas nebus matomas žemėlapyje, nes pasirinkta grupė yra paslėpta, ją galite rasti \"%s\". Pasirinkite intervalą nuo kurio taškas su atstumu ar laiku bus pavaizduojamas ekrane ant trasos. Pasirinkite norima dalinimo variantą: pagal laiką arba pagal atstumą. + Pridėti nuotrauką + Sukurti naują paskyrą + Aš jau turiu paskyrą \ No newline at end of file From bf68391ff2e11a38d4eb4f619e06633feb3d804b Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Tue, 17 Nov 2020 00:35:00 +0000 Subject: [PATCH 21/70] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3555 of 3555 strings) --- OsmAnd/res/values-uk/strings.xml | 47 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 4abd682cde..61ff054492 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -59,7 +59,7 @@ Видимість Теги Опис - Для вивантаження GPX-файлів, будь ласка, вкажіть Ваше ім\'я користувача і пароль в OSM. + Для вивантаження GPX-файлів вкажіть ваше ім\'я користувача і пароль в OSM. Підтримка Підтримати розробку нових функцій Відображати масштаб @@ -1946,7 +1946,7 @@ Це потрібно, щоб надавати Вам відомості про зміни на мапі. Прилюдне імʼя Територія - Будь ласка, введіть прилюдне ім\'я + Введіть загальнодоступне ім\'я Дякуємо за підтримку OsmAnd! \nЩоб задіяти усі нові можливості Вам потрібно перезапустити застосунок. Частина коштів буде спрямована землеписцям OSM, що внесли зміни до мапи в цьому місці. @@ -1956,7 +1956,7 @@ \nЯкщо Вам подобається OsmAnd та OSM, і хочете підтримати і бути підтриманими ними, це ідеальний спосіб зробити це. Надішліть Вашу OSM-нотатку таємно, або скориставшись обліковим записом на OSM.org. Надіслати нотатку в OSM - Ім\'я файлу містить неприпустимі знаки + Неприпустимі знаки в назві файлу Слідкуйте за нами Звукові напрямки Індикація звуком напряму на цільову точку. @@ -2243,7 +2243,7 @@ Рівень масштабування: %1$s Назва групи Зміна кольору - Редагувати ім\'я + Змінити ім\'я Огляд Виберіть вулицю у %1$s @@ -2433,7 +2433,7 @@ Перезавантажити Перезавантажити тайли, щоб переглянути актуальні дані. Тайловий кеш - Невірне ім\'я користувача + Неправильне ім\'я користувача до від Показувати лише додані зображення @@ -2464,7 +2464,7 @@ Перегляньте мапу і додайте точки Вимірювання відстані Необхідно додати хоча б одну точку. - Ім’я GPX файлу: + Назва GPX файлу: Показати на мапі після збереження Додати шляхову точку Зберегти GPX-точку шляху @@ -2633,7 +2633,7 @@ Додає першу зупинку Пересунути призначення далі і створити його Показати закриті нотатки - Показати/приховати OSM-нотатки на мапі. + Показати чи приховати примітки OSM на мапі. GPX — підходить для експорту в JOSM та інші OSM-редактори. OSC — підходить для експорту в OSM. GPX-файл @@ -2663,7 +2663,7 @@ Зх Пд Пн - Необов\'язкове ім\'я точки + Необов\'язкова назва точки Близькі маршрути в межах В межах Відстань: спочатку найдальше @@ -3122,7 +3122,7 @@ Змінюйте масштабування мапи прокручуванням колеса вгору і вниз. Клавіша Escape поверне вас до додатку WunderLINQ. Використовувати WunderLINQ для контролю Потрібно додати принаймні одну річ до списку у налаштуваннях \'Швидкої дії\' - Високогір\'я / гірські лижі + Альпійські та гірські лижі Траси для високогірних і гірських лиж та доступ до лижних підіймачів. Бездоріжжя Налаштувати профіль @@ -3132,7 +3132,7 @@ Оберіть налаштування навігації для профілю Вкажіть верхню межу змін Кількість змін - Бігові лижі / скандинавська ходьба + Бігові лижі та скандинавські лижі Траси для скандинавської ходьби або бігу на лижах. Лижні тури Маршрути для лижних турів. @@ -3364,7 +3364,7 @@ Змінити місцями %1$s та %2$s Початкова точка Трек збережено - Ім\'я файлу порожнє + Порожня назва файлу Повернутися Показати мережеві маршрути циклу вузлів Очистити %1$s\? @@ -3574,7 +3574,7 @@ Пагорб %1$s з %2$s Схили - Показати / приховати місцевість + Показати чи приховати рельєф Сховати місцевість Показати місцевість Кнопка для відображення або приховування шару місцевості на мапі. @@ -3691,10 +3691,10 @@ Розташування припаркованого авто Приховати громадський транспорт Показати громадський транспорт - Показати/приховати громадський транспорт + Показати чи приховати громадський транспорт Кнопка показу або приховування громадського транспорту на мапі. - Створити / змінити POI - Додати / правити вибране + Створити чи змінити POI + Додати чи змінити вибране Відновити усталене впорядкування Повернутися до редагування Ви можете отримати доступ до цих дій, торкнувшись кнопки “%1$s”. @@ -3863,7 +3863,7 @@ Обрізати після Змінити вид маршруту раніше Змінити вид маршруту після - Вкажіть інтервал для загального запису поїздки (включається через віджет запису подорожі на мапі). + Вкажіть інтервал для загального запису поїздки (увімкнено через віджет «Запис подорожі» на мапі). Усталена системна Всі наступні сегменти Попередній сегмент @@ -3884,7 +3884,7 @@ Повторити • Оновлено функції планування маршруту: дозволено застосувати різні типи переходів для кожного сегмента і прив\'язати будь-який трек до доріг \n -\n• Нове меню вигляду треків: вибір кольору, товщина, вигляд стрілки напрямку, значки початку/завершення +\n• Нове меню вигляду треків: вибір кольору, товщина, вигляд стрілки напрямку, піктограми початку та завершення \n \n• Покращено оглядовість велосипедних вузлів \n @@ -3900,7 +3900,7 @@ Востаннє змінено За назвою: Я — А За назвою: А — Я - Значки початку/завершення + Піктограми початку та завершення Дякуємо за придбання «Горизонталей» Що нового Передплата стягується за вибраний період. Скасуйте її в AppGallery у будь-який час. @@ -3961,10 +3961,10 @@ Історія маркерів Надіслати файл GPX на OpenStreetMap Введіть мітки через коми. - Загальнодоступне означає, що трасування буде показано загальнодоступно у ваших GPS-трасуваннях та у загальнодоступних списках GPS-трасування. Дані, що подаються через API, не посилаються на вашу сторінку трасування. Мітки часу точок трасування недоступні через загальнодоступний API GPS і не впорядковані хронологічно. Однак інші користувачі все ще можуть завантажувати необроблену трасування із загальнодоступного списку трасування та будь-які часові позначки, що містяться всередині. - Приватне означає, що трасування не з\'являтиметься в жодному загальнодоступному списку, але контрольні точки з нього все одно будуть доступні через загальнодоступний API GPS без позначок часу та не впорядковані за хронологією. - Ідентифікований означає, що трасування буде показано публічно у вашому трасуванні GPS і в загальнодоступних списках трасування GPS, тобто інші користувачі зможуть завантажити необроблене трасування та пов\'язати його з вашим ім\'ям користувача. Дані, подані за допомогою API точок відстеження, посилаються на вихідну сторінку трасування. Позначки часу точок трасування доступні через загальнодоступний GPS API. - Відстежуваний означає, що трасування не з\'явиться в жодному загальнодоступному списку, але точки від нього все одно будуть доступні через загальнодоступний API GPS із позначками часу. Інші користувачі зможуть завантажувати лише оброблені контрольні точки з вашого трасування, які не можуть бути безпосередньо пов’язані з вами. + «Загальнодоступне» означає, що трасування показано загальнодоступно у ваших GPS-трасуваннях та у загальнодоступних списках GPS-трасування, а також у загальнодоступному списку трасування з позначками часу в необробленому вигляді.. Дані, що подаються через API, не посилаються на вашу сторінку трасування. Мітки часу точок трасування недоступні через загальнодоступний API GPS і не впорядковані хронологічно. + «Приватне» означає, що трасування не з\'являється в жодному загальнодоступному списку, але контрольні точки з нього в нехронологічному порядку доступні через загальнодоступний API GPS без позначок часу. + «Ідентифікований» означає, що трасування буде показано публічно у вашому трасуванні GPS і в загальнодоступних списках трасування GPS, тобто інші користувачі зможуть завантажити необроблене трасування та пов\'язати його з вашим ім\'ям користувача. Загальнодоступні дані трасування з GPS API, що обслуговуються за допомогою API точок відстеження, посилаються на початкову сторінку трасування. + «Відстежуваний» означає, що трек не з\'явиться в жодному загальнодоступному списку, але обробка точок з позначками часу від нього (які не можуть бути безпосередньо пов’язані з вами) виконується за допомогою завантажень із загальнодоступного API GPS. Закрити примітку OSM Коментувати примітку OSM Ви можете увійти за допомогою безпечного методу OAuth або застосувавши свої ім\'я користувача й пароль. @@ -3974,4 +3974,7 @@ Світлини надаються проєктом відкритих даних OpenPlaceReviews.org. Щоб завантажити світлини зареєструйтеся на сайті. Створити обліковий запис У мене вже є обліковий запис + Журнал пошуку + Каяк + Моторний човен \ No newline at end of file From b29bbffd1b2b0c0a769e4f6c5c4b67f43147b38f Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Wed, 18 Nov 2020 20:10:19 +0000 Subject: [PATCH 22/70] Translated using Weblate (Italian) Currently translated at 89.1% (3171 of 3555 strings) --- OsmAnd/res/values-it/strings.xml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index d46ef2e3c1..f7bb74d54c 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3417,7 +3417,7 @@ Note fotografiche Ricalcolo del percorso Nome utente e password - Queste impostazioni del plugin sono globali e si applicano a tutti i profili. + Queste impostazioni del plugin sono globali e si applicano a tutti i profili Modifica di OpenStreetMap È possibile visualizzare tutte le modifiche non caricate o le note OSM in %1$s. I punti caricati non vengono visualizzati in OsmAnd. OSM @@ -3945,7 +3945,7 @@ Sport Emergenza Viaggio - Devi aggiungere almeno due punti. + Devi aggiungere almeno due punti Chiudi la nota OSM Commenta la nota OSM Puoi autenticarti con il metodo sicuro OAuth o utilizzare le tue credenziali. @@ -3955,4 +3955,28 @@ Le foto sono fornite dal progetto a sorgente aperto OpenPlaceReviews.org. Per contribuire delle tue foto devi registrarti nel sito. Crea un nuovo account Ho già un account + Cronologia di ricerca + Kayak + Motoscafo + Connettiti a OpenStreetMap + Connettiti a OpenStreetMap.org + Registrati con OpenStreetMap + Devi fare il login per inviare nuove modifiche o dei cambiamenti. +\n +\nPuoi fare login utilizzando il metodo sicuro OAuth o il nomeutente e password. + Usa login e password + Account + Entra + Gestisci la sottoscrizione + C\'è un problema con la tua sottoscrizione. Clicca sul pulsante per andare alle impostazioni di sottoscrizione di Google Play per correggere il tuo metodo di pagamento. + La sottoscrizione di OsmAnd Live è terminata + La sottoscrizione di OsmAnd Live è stata messa in pausa + La sottoscrizione di OsmAnd Live è in sospeso + Cronologia dei marcatori + Invia il file GPX a OpenStreetMap + Immetti le etichette separate dalla virgola. + \"Pubblico\" significa che la traccia è visualizzata pubblicamente nelle tue tracce GPS, nelle liste pubbliche di tracce GPS con le informazioni temporali in forma grezza. I dati forniti attraverso le API non conducono alla tua pagina delle tracce. Le informazioni temporali dei punti traccia non sono disponibili attraverso le API GPS pubbliche, e i punti della traccia non sono ordinati cronologicamente. + \"Privato\" significa che la traccia non è visualizzabile in alcuna lista pubblica ma i suoi punti, in ordine non cronologico, sono disponibili attraverso le API GPS senza le informazioni temporali. + \"Identificabile\" significa che la traccia è visualizzabile nelle Mie tracce GPS e nelle liste pubbliche, es. gli altri utenti potranno scaricare la traccia grezza e associarla con il tuo nome utente. I punti della traccia, con le loro informazioni temporali, saranno riconducibili, attraverso le API GPS, alla tua traccia originale. + \"Tracciabile\" significa che la traccia non è visualizzabile in alcuna lista pubblica, ma solo i suoi punti, processati, con le informazioni temporali (che non possono essere direttamente associati a te) attraverso le API GPS pubbliche. \ No newline at end of file From b7af5a2e16973d9e5d626de6c96843925f849b5c Mon Sep 17 00:00:00 2001 From: ace shadow Date: Tue, 17 Nov 2020 23:17:56 +0000 Subject: [PATCH 23/70] Translated using Weblate (Slovak) Currently translated at 99.8% (3551 of 3555 strings) --- OsmAnd/res/values-sk/strings.xml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 2f0404d1dc..2b246edb29 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1919,7 +1919,7 @@ Aplikácia teraz má povolenie zapisovať do externého úložiska, ale je potrebný reštart aplikácie. Podrobný prehľad Meno a heslo pre OSM - Názov súboru obsahuje nepovolený znak + Nepovolený znak v názve súboru Tenké Stredné Tučné @@ -2636,7 +2636,7 @@ Kopírovať názov bodu/umiestnenia Nepomenované miesto Zobraziť uzavreté poznámky - Zobraziť/skryť OSM poznámky na mape. + Zobraziť alebo skryť OSM poznámky na mape. GPX - vhodné na export do JOSM a iných editorov OSM. OSC - vhodné na export do OSM. Súbor GPX @@ -3080,7 +3080,7 @@ Zmeňte priblíženie mapy pomocou posúvania kolieskom nahor a nadol. Esc vás vráti do aplikácie WunderLINQ. Použiť WunderLINQ na približovanie Pridajte aspoň jednu položku do zoznamu v nastaveniach \'Rýchlej akcie\' - Alpské/zjazdové lyžovanie + Alpské alebo zjazdové lyžovanie Svahy pre alpské a zjazdové lyžovanie a prístup k vlekom. Bežkovanie Trasy pre beh na lyžiach. @@ -3346,7 +3346,7 @@ Zameniť %1$s a %2$s Východzí bod Stopa uložená - Názov súboru je prázdny + Prázdny názov súboru Vrátiť späť Zobraziť sieť cyklotrás Vymazať %1$s\? @@ -3574,7 +3574,7 @@ Trasa bude prepočítaná ak vzdialenosť od trasy k aktuálnej polohe je väčšia ako zvolená hodnota. %1$s z %2$s Sklony svahov - Zobraziť / skryť terén + Zobraziť alebo skryť terén Skryť terén Zobraziť terén Tlačidlo pre zobrazenie alebo skrytie vrstvy terénu na mape. @@ -3693,11 +3693,11 @@ \n Skryť verejnú dopravu Zobraziť verejnú dopravu - Zobraziť/skryť verejnú dopravu + Zobraziť alebo skryť verejnú dopravu Tlačidlo na zobrazenie alebo skrytie verejnej dopravy na mape. - Vytvoriť / Upraviť bod záujmu + Vytvoriť alebo upraviť bod záujmu Parkovacie miesta - Pridať / Upraviť obľúbený bod + Pridať alebo upraviť obľúbený bod Obnoviť predvolené poradie položiek Naspäť k úpravám K týmto akciám sa dostanete stlačením tlačidla “%1$s”. @@ -3904,7 +3904,7 @@ Naposledy zmenené Názov: Z – A Názov: A – Z - Ikony štartu/cieľa + Ikony štartu a cieľa Ďakujeme za zakúpenie modulu \'Vrstevnice\' Predplatné bude spoplatnené v zvolenom intervale. Predplatné zrušte kedykoľvek na AppGallery. Platba bude stiahnutá z vášho účtu AppGallery po potvrdení nákupu. @@ -3974,4 +3974,7 @@ Fotografie sú poskytované projektom OpenPlaceReviews.org s otvorenými dátami. Na odoslanie vašich fotiek sa musíte zaregistrovať na webovej stránke. Vytvoriť nový účet Už mám účet + História hľadania + Kajak + Motorový čln \ No newline at end of file From c71d71e5359c22c0a0fbb61a2237af03f6200437 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Tue, 17 Nov 2020 09:12:31 +0000 Subject: [PATCH 24/70] Translated using Weblate (Hebrew) Currently translated at 99.9% (3552 of 3555 strings) --- OsmAnd/res/values-iw/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 81122d590f..5e3f1a1567 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -3982,4 +3982,5 @@ היסטוריית חיפוש קיאק סירת מנוע + מגדהי \ No newline at end of file From bc8980520ac863700bbfa19745b575fd6de4c550 Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Tue, 17 Nov 2020 10:00:42 +0000 Subject: [PATCH 25/70] Translated using Weblate (Arabic) Currently translated at 100.0% (3555 of 3555 strings) --- OsmAnd/res/values-ar/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 26b1bd66e3..07aaf2352e 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -2454,7 +2454,7 @@ تصفح الخريطة وإضافة نقاط قياس المسافة الرجاء إضافة نقطة واحدة على الأقل. - اسم مسار الـGPX : + اسم مسار GPX : عرض على الخريطة بعد الحفظ إضافة نقطة حفظ نقطة GPX From ded33a229aa4444db16645648a004b087dc58b1c Mon Sep 17 00:00:00 2001 From: iman Date: Wed, 18 Nov 2020 16:24:10 +0000 Subject: [PATCH 26/70] Translated using Weblate (Persian) Currently translated at 98.8% (3513 of 3555 strings) --- OsmAnd/res/values-fa/strings.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index f08461e509..e657b192aa 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -3980,4 +3980,11 @@ خصوصی یا Private به این معنی است که رد در هیچ‌یک از لیست‌های عمومی نشان داده نمی‌شود اما نقاط رد از طریق API جی‌پی‌اس‌های عمومی بدون مهر زمان و بدون ترتیب زمانی دست‌یافتنی است. قابل‌شناسایی یا Identifiable به این معنی است که رد به‌صورت عمومی در لیست ردهای جی‌پی‌اس شما و لیست عمومی ردهای جی‌پی‌اس نمایش داده می‌شود، یعنی سایر کاربران می‌توانند رد خام را دانلود کنند و بدانند که مربوط به نام کاربری شماست. دادهٔ نقاط رد که از طریق API در دسترس قرار می‌گیرد، به صفحهٔ ردهای شما ارجاع می‌دهد. مهر زمان نقاط رد از طریق API جی‌پی‌اس‌های عمومی دست‌یافتنی است. قابل‌ردیابی یا Trackable به این معنی است که رد در هیچ‌یک از لیست‌های عمومی نشان داده نمی‌شود اما نقاط رد + مهر زمان نقاط از طریق API جی‌پی‌اس‌های عمومی دست‌یافتنی است. سایر کاربران فقط می‌توانند نقاط پردازش‌شدهٔ رد شما را دانلود کنند که مستقیماً امکان ارجاع به نام کاربری شما را ندارد. + افزودن عکس + عکس‌ها از طریق پروژهٔ داده‌باز OpenPlaceReviews.org ارائه می‌شود. برای آپلود عکس‌های خود لازم است در این وبگاه ثبت نام کنید. + ثبت نام در +\nOpenPlaceReviews.org + ساخت حساب جدید + حساب کاربری دارم + تاریخچهٔ جست‌وجو \ No newline at end of file From 8a880d72dfa221c62e82359c69a3dc240d009822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Kotr=C4=8D?= Date: Tue, 17 Nov 2020 15:29:57 +0000 Subject: [PATCH 27/70] Translated using Weblate (Czech) Currently translated at 88.1% (3132 of 3555 strings) --- OsmAnd/res/values-cs/strings.xml | 110 ++++++++++++++++--------------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 374d0b113a..c23e4be8e6 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1521,7 +1521,7 @@ Délka %2$s Výškové omezení Zadejte výšku vozidla, která musí být povolena na cestách. Inteligentní přepočítávání trasy - Pro dlouhé cesty přepočítat pouze počáteční úsek trasy. + Přepočítá pouze počáteční úsek trasy. Může se hodit pro dlouhé trasy. Odhlásit Importovat do OsmAnd Přečíst celý článek (on-line) @@ -3090,15 +3090,15 @@ Zobrazená oblast: %1$s x %2$s Terénní Nastavit profil Profil si udrží své vlastní nastavení - Vybrat výchozí nastavení mapy u profilu - Vybrat výchozí nastavení obrazovky u profilu - Vybrat výchozí nastavení navigace u profilu + Zvolte nastavení mapy pro profil + Zvolte nastavení obrazovky pro profil + Zvolte nastavení navigace pro profil Určete maximální počet přestupů Počet přestupů Probudit na odbočce - Nastavte čas, po který bude obrazovka zapnutá. + Nastavte, jak dlouho bude obrazovka zapnutá. Použít senzor přiblížení - Zamávejte rukou přes horní část obrazovky pro zapnutí obrazovky při navigování. + Zamávání rukou nad obrazovkou ji zapne. 1. třída 2. třída 3. třída @@ -3110,7 +3110,7 @@ Zobrazená oblast: %1$s x %2$s Obecná klávesnice WunderLINQ Parrot - Prosíme, zapněte alespoň jeden profil aplikace, pro použití tohoto nastavení. + Pro použití tohoto nastavení zapněte prosím alespoň jeden profil aplikace. Zimní cesta Ledová cesta Zimní a ledové cesty @@ -3159,7 +3159,7 @@ Zobrazená oblast: %1$s x %2$s Nainstalované moduly Nastavení navigace Vzhled aplikace, jednotky, oblast - Upozornění jsou zobrazena vlevo dole během navigace. + Upozornění zobrazená vlevo dole během navigace. Jazyk a výstup Obnovit do základního nastavení Spravovat profily aplikace… @@ -3170,14 +3170,14 @@ Zobrazená oblast: %1$s x %2$s Mapa během navigace Mapa během navigace Další - Hmotnost, výška, rychlost + Hmotnost, výška, délka, rychlost Parametry vozidla Hlasová oznámení se přehrávají pouze během navigace. Navigační pokyny a oznámení Hlasová oznámení Konfigurace parametrů trasy Parametry trasy - Použito pro odhadnutí času příjezdu u cest s neznámým povrchem a pro omezení rychlosti u všech cest (může ovlivnit trasu) + Odhaduje času příjezdu u cest s neznámým povrchem a omezuje rychlost na všech cestách (může ovlivnit trasu) Nastavení profilu: OsmAnd používá UTM Standard, který je podobný, ale nikoliv identický s UTM NATO formátem. Příklad @@ -3210,8 +3210,8 @@ Zobrazená oblast: %1$s x %2$s Zadejte cestu k adresáři s OsmAnd daty Změnit adresář pro OsmAnd data\? Přesunout do nového umístění - Vnitřní úložiště, skryté před uživateli a aplikacemi, přístupné výhradně pro OsmAnd - Změnit adresář úložiště dat + Vnitřní úložiště pro OsmAnd (skryté před uživateli a jinými aplikacemi). + Změnit složku pro ukládání dat Typ sjezdovky Nováček Začátečník @@ -3240,44 +3240,44 @@ Zobrazená oblast: %1$s x %2$s Opravdu chcete aktualizovat všechny mapy (%1$d)\? Sdíleno Upřednostňovat nezpevněné cesty - Upřednostňovat nezpevněné cesty. + Pro navigaci upřednostňovat nezpevněné cesty před zpevněnými. OSM úpravy Exportovat profil OsmAnd profil: %1$s - Profil „%1$s“ již existuje. Přepsat\? + \'%1$s\' již existuje. Přepsat\? Profil nelze exportovat. - Import profilu: + Importovat profil Přidejte profil otevřením jeho souboru pomocí OsmAnd. %1$s chyba importu: %2$s - Úspěšně importováno: %1$s + %1$s importován. Prohodit %1$s a %2$s Počáteční bod Trasa uložena - Název souboru je prázdný + Prázdný název souboru Vrátit zpět Vyčistit %1$s\? Dialog stahování map Dialogy a oznámení - Správa vyskakovacích upozornění, oznámení a dialogů zobrazovaných aplikací OsmAnd. + Správa vyskakovacích upozornění, dialogů a oznámení. Navrhované mapy - Tyto mapy je třeba používat s modulem + Tyto mapy jsou potřebné pro modul. Přidané profily - Nový profil přidaný do OsmAnd modulem + Profily přidané modulem Vypnout Přidán nový modul - Přidat nový profil „%1$s“\? + Přidat nový profil \'%1$s\'\? Trasy upravené pro klasické lyžování bez bruslení. Zahrnuje trasy upravené menšími sněžnými vozidly a stopy vytvořené samotnými lyžaři. Povolit pouze trasy pro bruslení na lyžích Sněžný skútr Vlastní modul pro OsmAnd - Změny aplikovány na profil %1$s. - Nelze přečíst %1$s. - Nelze zapsat %1$s. - Nelze importovat %1$s. + Změny aplikovány na profil \'%1$s\'. + Nepodařilo se přečíst z \'%1$s\'. + Nelze zapsat do \'%1$s\'. + Nelze importovat z \'%1$s\'. Stínování svahů Terén Stínované svahy používají tmavé odstíny pro vyjádření svahů, vrcholů a nížin. - Svahy jsou barevné vizualizace terénu. + Svahy využívají barvy k vizualizaci strmosti terénu. Nastavte minimální a maximální úroveň přiblížení, při které bude vrstva zobrazená. Pro zobrazení stínování kopců jsou potřeba další mapy. Pro zobrazení svahů jsou potřeba další mapy. @@ -3285,7 +3285,7 @@ Zobrazená oblast: %1$s x %2$s Průhlednost Úrovně přiblížení Legenda - Zapněte pro zobrazení stínovaných svahů. O tomto typu map se dozvíte více na našich stránkách + Zapněte pro zobrazení stínovaných svahů nebo sklonu svahů. O těchto typech map se dozvíte více na našich stránkách. Všechna data z %1$s jsou naimportovaná, můžete použít tlačítka níže k otevření části aplikace pro jejich správu. Import dokončen Položky přidány @@ -3304,7 +3304,7 @@ Zobrazená oblast: %1$s x %2$s Trasa bude přepočítaná pokud vzdálenost od trasy k aktuální poloze je větší než zvolená hodnota. %1$s z %2$s Svahy - Zobrazit/skrýt terén + Zobrazit nebo skrýt terén Skrýt terén Zobrazit terén Tlačítko pro zobrazení nebo skrytí vrstvy terénu na mapě. @@ -3316,7 +3316,7 @@ Zobrazená oblast: %1$s x %2$s Osmiúhelník Čtverec Min - Nahradit jiný bod tímto + Nahradit jiný bod tímto. Lyžařské okruhy Úhel Úhel: %s° @@ -3333,7 +3333,7 @@ Zobrazená oblast: %1$s x %2$s \nModul zůstane v zařízení i po odstranění aplikace OsmAnd. Modul vypnutý Otevřít nastavení - Vypnout přepočítávání + Žádné přepočítávání Zadejte prosím název profilu Vyberte data k importu. Některé položky již existují @@ -3359,12 +3359,12 @@ Zobrazená oblast: %1$s x %2$s Některé články Wikipedie nemusí být dostupné ve vašem jazyce. Zvolte jazyky, v nichž se články Wikipedie objeví na mapě. \nBěhem čtení článku budete moci přepínat mezi všemi dostupnými jazyky. Pro zobrazení bodů zájmu Wikipedie jsou potřeba další mapy. - Hlavní akce mohou obsahovat pouze 4 tlačítka. + Obsahuje pouze 4 tlačítka. Hlavní akce Položky můžete přesouvat pouze v rámci této kategorie. Modul pro vývojáře Položky - Zvolte jazyky, v nichž se články Wikipedie zobrazí na mapě. Při čtení článku můžete přepínat mezi všemi dostupnými jazyky. + Zvolte jazyky článků Wikipedie na mapě. Při čtení článku můžete přepínat mezi všemi dostupnými jazyky. Některé články Wikipedie nemusí být dostupné ve vašem jazyce. Kantonština Jižní min @@ -3397,9 +3397,9 @@ Zobrazená oblast: %1$s x %2$s %1$s / %2$s Platba bude stržena z vašeho účtu Google Play po potvrzení nákupu. \n -\nPředplatné se automaticky prodlužuje, pokud ho před termínem obnovení nezrušíte. Platba za předplatné (měsíc/tři měsíce/rok) bude stržena vždy jen v den obnovení. +\n Předplatné se automaticky prodlužuje, pokud ho před termínem obnovení nezrušíte. Platba za předplatné (měsíc/tři měsíce/rok) bude stržena vždy jen v den obnovení. \n -\nSvé předplatné můžete spravovat nebo zrušit v nastavení Google Play. +\n Své předplatné můžete spravovat nebo zrušit v nastavení Google Play. Hledat typy bodů zájmu Zkombinujte body zájmu různých kategorií. Klepnutím na přepínač vyberete všechny, klepnutím na levou stranu vyberete kategorie. Další mapy @@ -3447,12 +3447,12 @@ Zobrazená oblast: %1$s x %2$s Mercatorovo zobrazení Formát uložení Nastavte minimální a maximální úroveň přiblížení, při níž se zobrazí nebo načte online mapa. - Tyto parametry ovlivňují zobrazení při použití jako mapy nebo překryvu/podkladu. + Ovlivňuje zobrazení při použití jako mapy nebo překryvu/podkladu. \n -\n%1$s: Zobrazení mapy bude omezeno na vybrané úrovně přiblížení. +\n%1$s: Mapa bude omezena na vybrané úrovně přiblížení. \n -\n%2$s: Úrovně přiblížení, při nichž budou zobrazeny původní dlaždice. Mimo tyto hodnoty se dlaždice přeškálují. - Čas obnovení v minutách. Dlaždice v mezipaměti budou znovu načteny po uplynutí zadaného času. Necháte-li toto pole prázdné, dlaždice z tohoto zdroje se nebudou obnovovat nikdy. +\n%2$s jsou úrovně přiblížení, při nichž budou zobrazeny původní dlaždice. Mimo tyto hodnoty se dlaždice přeškálují. + Dlaždice v mezipaměti budou znovu načteny po uplynutí zadaného počtu minut. Necháte-li toto pole prázdné, dlaždice z tohoto zdroje se nebudou obnovovat nikdy. \n \nJeden den má 1440 minut. \nJeden týden má 10 080 minut. @@ -3465,7 +3465,7 @@ Zobrazená oblast: %1$s x %2$s Pro pokračování je potřeba nastavit pracovní dny Trasa mezi body Naplánovat trasu - Přidat k trase + Přidat ke stopě Zobrazit ikony startu a cíle Zvolte šířku Vyberte interval pro zobrazování značek na trase se vzdáleností nebo časem. @@ -3476,12 +3476,12 @@ Zobrazená oblast: %1$s x %2$s Importovat trasu Otevřít existující trasu Vytvořit novou trasu - Vyberte trasu k otevření. + Vyberte stopu k otevření. Hotovo Zadejte prosím název bodu Současný cílový bod na trase bude smazán. Jestliže to je poslední cíl, navigace se zastaví. Stáhnout Wikipedia mapy - Získejte informace o zájmových bodech z Wikipedie. Je to váš offline kapesní průvodce - zapněte Wikipedia plugin a užívejte si články o objektech okolo Vás. + Získejte informace o zájmových bodech z Wikipedie. Je to váš offline kapesní průvodce - zapněte modul Wikipedia a užívejte si články o objektech okolo vás. Přidaný bod nebude na mapě vidět, protože vybraná skupina je skrytá. Můžete jej najít v \"%s\". Enduro motorka Motorový skútr @@ -3493,7 +3493,7 @@ Zobrazená oblast: %1$s x %2$s Uložit jako soubor trasy Sledovat trasu Zvolte soubor trasy, kterou chcete sledovat - Zvolte soubor trasy, kterou chcete sledovat, nebo jej importujte ze zařízení. + Zvolte soubor stopy, kterou chcete sledovat, nebo jej importujte ze svého zařízení. Zvolit jinou trasu Navigovat z mé polohy k trase Bod trasy pro navigování @@ -3518,12 +3518,12 @@ Zobrazená oblast: %1$s x %2$s Omezení délky Azimut %1$s smazáno - Ke kompletnímu smazání dat o rychlostních radarech je nutný restart. + Restartovat aplikaci pro kompletní smazání dat o rychlostních radarech. Odinstalovat a restartovat Toto zařízení nemá rychlostní kamery. Inline brusle - Smazat následující cílový bod - Umožní ovládat úroveň přiblížení mapy pomocí tlačítek hlasitosti zařízení. + Smazat nejbližší cílový bod + Ovládat úroveň přiblížení mapy pomocí tlačítek hlasitosti zařízení. Tlačítka hlasitosti pro přibližování Mezní vzdálenost Navigační profil @@ -3576,7 +3576,7 @@ Zobrazená oblast: %1$s x %2$s Naposledy změněno Název: Z – A Název: A – Z - Ikony startu/cíle + Ikony startu a cíle Děkujeme za zakoupení modulu \'Vrstevnice\' Přihlásit se pomocí OAuth pro použití funkcí editace OSM Přihlásit pomocí OAuth @@ -3692,11 +3692,11 @@ Zobrazená oblast: %1$s x %2$s Úvodní panel Skrýt veřejnou dopravu Zobrazit veřejnou dopravu - Zobrazit/skrýt veřejnou dopravu + Zobrazit nebo skrýt veřejnou dopravu Tlačítko pro zobrazení nebo skrytí veřejné dopravy na mapě. - Vytvořit / upravit bod zájmu + Vytvořit nebo upravit bod zájmu Parkovací místa - Přidat / upravit oblíbený bod + Přidat nebo upravit oblíbený bod Obnovit výchozí pořadí položek Zpět k úpravám Tlačítko akce přepne mezi zvolenými profily. @@ -3722,7 +3722,7 @@ Zobrazená oblast: %1$s x %2$s Tlačítko napájení Senzor přiblížení Zvolte časový limit vypnutí obrazovky po probuzení (\"%1$s\" znamená bez časového limitu.) - Musíte přidat aspoň dva body. + Musíte přidat aspoň dva body Spravovat předplatné S vaším předplatným je problém. Klikněte na tlačítko pro přechod do nastavení předplatného v Google Play a opravte způsob platby. Předplatné OsmAnd Live skončilo @@ -3902,8 +3902,8 @@ Zobrazená oblast: %1$s x %2$s Účet Přihlašovací jméno Historie značek - Veřejná znamená, že trasa bude veřejně dostupná ve vašich GPS trasách a veřejných seznamech GPS tras. Data poskytnutá prostřednictvím API nebudou odkazovat na vaši stránku s trasou. Časová razítka bodů trasy nebudou dostupná prostřednictvím veřejného GPS API a body nebudou chronologicky seřazeny. Ostatní uživatelé si ale stále budou moci stáhnout nezpracovanou trasu z veřejného seznamu spolu se všemi časovými razítky, které obsahuje. - Soukromá znamená, že trasa se neobjeví v žádném veřejném seznamu a body trasy budou dostupném prostřednictvím veřejného GPS API bez časových razítek, ale nebudou chronologicky seřazeny. + \"Veřejná\" znamená, že trasa je veřejně dostupná ve vašich GPS trasách, ve veřejných seznamech GPS tras a také ve veřejném seznamu stop s nezpracovanými časovými razítky. Data poskytnutá prostřednictvím API nebudou odkazovat na vaši stránku s trasou. Časová razítka bodů trasy nebudou dostupná prostřednictvím veřejného GPS API a body nebudou chronologicky seřazeny. + \"Soukromá\" znamená, že trasa se neobjeví v žádném veřejném seznamu a body trasy budou dostupné prostřednictvím veřejného GPS API bez časových razítek a nebudou chronologicky seřazeny. Odeslat soubor GPX do OpenStreetMap Zadejte značky oddělené čárkou. Sledovatelná znamená, že trasa se neobjeví v žádném veřejném seznamu, ale body trasy budou dostupné prostřednictvím veřejného GPS API s časovými razítky. Ostatní uživatelé si budou moci stáhnout zpracované body z vaší trasy, které ale nebude možné přímo spojit s vámi. @@ -3942,4 +3942,10 @@ Zobrazená oblast: %1$s x %2$s Ve výchozím stavu vypnuto: běží-li OsmAnd na popředí, obrazovka se nevypne. \n \nJe-li zapnuto, OsmAnd vypne obrazovku podle systémového limitu. + Tyto akce jsou dostupné po stisknutí tlačítka “%1$s”. + Importovat nebo nahrát soubory stop + Zadejte interval ukládání pro obecný záznam trasy (aktivovaný přes widget Záznam trasy na mapové obrazovce). + Historie vyhledávání + Kajak + Motorový člun \ No newline at end of file From aefc4df036161418ff9f3438248242bcdf09b4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Tue, 17 Nov 2020 11:38:07 +0000 Subject: [PATCH 28/70] =?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 50.9% (1811 of 3555 strings) --- OsmAnd/res/values-nb/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 8ccc84ede3..5863aba29d 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -1692,7 +1692,7 @@ \n \n OsmAnd utvikles aktivt, og prosjektet vårt og dets videre framdrift avhenger av finansielle bidrag for å drive utviklingen og testingen av nye funksjoner. Overvei å kjøpe OsmAnd+ eller støtte spesifikke nye funksjoner eller bidra med en generell donasjon på https://osmand.net. Last opp ditt OSM-notat anonymt eller ved å bruke din profil hos OpenStreetMap.org. - Du har ingen sporfiler ennå + Du har ingen sporfiler enda Du kan også legge til sporfiler i mappen Legg til flere… Skru på hurtigopptak @@ -1792,7 +1792,7 @@ Start nettbasert sporing Stopp nettbasert sporing Fant ikke noe. Hvis du ikke finner din region, kan du lage den selv (se https://osmand.net). - Spesifiser først en GPX-fil med et langt trykk. + Spesifiser en GPX-fil med et langt trykk først. Oppdelingsintervall Nedstigning/stigning: %1$s Tidsrom: %1$s @@ -3887,7 +3887,7 @@ Nødsfall Reise Du må legge til minst to punkter. - Sporbar betyr at sporet ikke vil vises i offentlige lister, men punkter fra det vil fremdeles ikke være tilgjengelige gjennom det offentlige GPS-API-et med tidsstempel. Andre brukere vil kun ha mulighet til å laste ned behandlede punkter fra ditt spor, noe som ikke kan tilknyttes deg direkte. + \"Sporbar\" betyr at sporet ikke vil vises i offentlige lister, men bearbeidede sporpunkter med tidsstempel (som ikke direkte kan knyttes til deg) vil være tilgjengelig gjennom nedlastinger fra det offentlige GPS-API-et. Logg inn med OpenStreetMap Bruk innlogging og passord Konto From b2c2b438c48badf8c25fcdc528cee1fefaf1d86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Thu, 19 Nov 2020 00:21:42 +0000 Subject: [PATCH 29/70] Translated using Weblate (Galician) Currently translated at 100.0% (3555 of 3555 strings) --- OsmAnd/res/values-gl/strings.xml | 48 ++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index f0d735e36c..8b24fe075a 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -753,7 +753,7 @@ Sobreposicións fluorescentes Empregar cores fluorescentes para amosar as pistas e rutas. Edición sen conexión - Empregar sempre a edición sen conexión. + Se se activa a edición sen conexión, as modificacións serán gardadas de xeito local primeiro e serán cargadas por solicitude, do contrario as modificacións serán cargadas de xeito inmediato. As modificacións nos puntos de interese (PDI) dentro da aplicación non afectan ós ficheiros dos mapas baixados, pois esas modificacións gárdanse coma un ficheiro no teu dispositivo. Estase a subir… {0} PDI/notas subidos @@ -2063,7 +2063,7 @@ Lon %2$s Número de colaboradores Número de edicións Informe para - O nome do ficheiro contén un carácter incorrecto + Caráter ilegal no nome do ficheiro Acción rápida Acción %d Pantalla %d @@ -2365,7 +2365,7 @@ Lon %2$s Engade unha parada intermedia Engade a primeira parada do percorrido Move o destino cara enriba e crea un novo - Amosar/agochar as notas do OSM no mapa. + Amosar ou agochar as notas do OSM no mapa. GPX - axeitado para exportar a JOSM ou outros editores do OSM. OSC - axeitado para exportar ó OSM. Ficheiro GPX @@ -3115,9 +3115,9 @@ Lon %2$s Muda o achegamento do mapa desprazando a roda cara arriba e abaixo. A tecla «Esc» volta á aplicación WunderLINQ. Controlar co WunderLINQ Engadir polo menos un elemento á listaxe nos axustes de \'Acción rápida\' - Esquí alpino/de descendemento + Esquí alpino e de descendemento Pistas de esquí alpino ou de descendemento e acceso a remontes mecánicos. - Esquí de travesía/nórdico + Esquí de travesía e nórdico Pistas para esquí nórdico ou de travesía. Esquí de travesía Roteiros para esquí de travesía. @@ -3385,7 +3385,7 @@ Lon %2$s Trocar %1$s e %2$s Punto de comezo Pista gardada - O nome do ficheiro está baleiro + Nome do ficheiro baleiro Reverter Un botón para facer que a pantalla se centre no punto de partida. Despois define o destino ou activa o cálculo da ruta. Amosar os nós da rede de sendas ciclistas @@ -3450,7 +3450,7 @@ Lon %2$s Nome de usuario e contrasinal Os axustes deste complemento son globais e aplícanse a todos os perfís Edición do OSM - Podes ollar todas as túas edición non subidas ou erros do OSM en %1$s. Os puntos subidos non se amosan no OsmAnd. + Podes ollar todas as túas edicións aínda non subidas ou erros do OSM en %1$s. Os puntos subidos non se amosan no OsmAnd. OSM A icona amósase mentres se navega ou se move pola pantalla. A icona amósase en asueto. @@ -3647,7 +3647,7 @@ Lon %2$s A ruta será recalculada se a distancia á localización actual é maior que o valor escollido. %1$s de %2$s Pendentes - Amosar / agochar terreo + Amosar ou agochar terreo Agochar terreo Amosar terreo Un botón que amosa ou agocha a capa do terreo no mapa. @@ -3716,11 +3716,11 @@ Lon %2$s Podes acceder a estas accións premendo no botón “%1$s”. Agochar transporte público Amosar transporte público - Amosar/agochar transporte público + Amosar ou agochar transporte público Botón que amosa ou agocha o transporte público no mapa. - Crear / Editar PDI + Crear ou editar PDI Posicións de aparcamento - Engadir / Editar favorito + Engadir ou editar favorito Restabelecer a orde dos elementos predefinidos Voltar á edición O botón de acción troca entre os perfís escollidos. @@ -3854,7 +3854,7 @@ Lon %2$s Refacer • Actualizouse a función \"Planificar ruta\": permite empregar diferentes tipos de navegación por segmento e o engadido de pistas \n -\n • Novo menú coa aparencia das pistas: escoller a cor, o grosor, amosar as frechas de dirección e as iconas de comezo/final. +\n • Novo menú coa aparencia das pistas: escoller a cor, o grosor, amosar as frechas de dirección e as iconas de inicio e final. \n \n • Melloras na visibilidade dos nós de bicicleta. \n @@ -3924,11 +3924,11 @@ Lon %2$s %s ficheiros de pista seleccionados Gravar A gravación da pista deterase ó pechar a aplicación (mediante aplicacións recentes). (A indicación de fondo do OsmAnd, desaparecerá da barra de notificacións do Android.) - Especifica o intre de gravación xeral para pistas (habilitado a través do trebello de gravación no mapa). + Especifica o intre de gravación xeral para pistas (habilitado a través do trebello de \'Gravación no mapa\'). Última modificación Nome: Z – A Nome: A – Z - Iconas de comezo/final + Iconas de inicio e fin Grazas por mercar \'Curvas de nivel\' Subscrición cobrada por período escollido. Cancélaa na AppGallery en calquera intre. O pagamento será cargado na túa conta da AppGallery no mesmo intre da confirmación da compra. @@ -3977,7 +3977,7 @@ Lon %2$s A subscrición do OsmAnd Live expirou A subscrición do OsmAnd Live foi detida A subscrición do OsmAnd Live está en espera - Público significa que a pista amosarase de xeito público na túa listaxe de pistas e nas listaxes de pistas GPS públicas. Os datos servidos a través da API non farán referencia á túa páxina de pistas. As marcaxes de tempo dos puntos da pista non estarán dispoñíbeis a través da API pública de GPS, aínda que os puntos ordénanse de xeito cronolóxico. Porén, outros usuarios poderán baixar a pista en bruto da listaxe de pistas públicas e as marcaxes de tempo que contén. + \"Público\" significa que a pista amosarase de xeito público na túa listaxe de pistas e nas listaxes de pistas GPS públicas con marcas de tempo en bruto. Os datos servidos a través da API no farán referencia á túa pácina de pistas. As marcaxes de tempo dos puntos da pista non estarán dispoñíbeis a través da API pública de GPS, aínda que os puntos son ordenados de xeito cronolóxico. Iniciar sesión no OpenStreetMap Entrar ó OpenStreetMap.org Entrar co OpenStreetMap @@ -3990,7 +3990,19 @@ Lon %2$s Historial de marcaxes Enviar ficheiro GPX ó OpenStreetMap Insire etiquetas separadas por comas. - Privado significa que a pista non aparecerá en ningunha listaxe pública, mais o conxunto de puntos seguirá estando dispoñíbel en orde cronolóxica a través da API pública de GPS e sen marcaxes de tempo. - Rastrexábel (ou trazábel) significa que a pista non aparecerá en ningunha listaxe pública pero o conxunto de puntos estarán dispoñíbeis a través da API pública de GPS e con marcaxes de tempo. Outros usuarios só poderán baixar o conxunto de puntos procesados da túa pista que non se poden asociar directamente contigo. - Identificábel significa que a pista amosarase de xeito público na túa listaxe de pistas e na listaxe de pistas GPS públicas, é dicir que outros usuarios poderán baixar a pista en bruto e asociala co teu nome de usuario. Os datos servidos a través da API de conxunto de puntos fará referencia á páxina orixinal da pista. As marcaxes de tempo dos puntos da traza estarán dispoñíbeis a través da API pública de GPS. + \"Privado\" significa que a pista non aparecerá en ningunha listaxe pública, pero o conxunto de puntos seguirá estando dispoñíbel en orde cronolóxica a través da API pública de GPS e sen marcas de tempo. + \"Rastrexábel\" (ou \"trazábel\") significa que a pista non aparece en ningunha listaxe pública, pero o conxunto de puntos procesados con marcas de tempo (non se poden asociar directamente contigo) estarán dispoñíbeis a través da API pública de GPS. + \"Identificábel\" significa que a pista amosarase de xeito público na túa listaxe de pistas e na listaxe de pistas GPS públicas, é dicir que outros usuarios poderán baixar a pista en bruto e asociala co seu nome de usuario. Os datos servidos a través da API de conxunto de puntos fará referencia á páxina orixinal da pista. + Pechar nota do OSM + Comentar nota do OSM + Podes iniciar a sesión co método seguro do OAuth ou empregar o nome de usuario e contrasinal. + Engadir imaxe + Rexistrarse no +\nOpenPlaceReviews.org + As imaxes son fornecidas polo proxecto de datos abertos OpenPlaceReviews.org. Para subir imaxes tes que rexistrarte no sitio web. + Crear nova conta + Xa teño unha conta + Historial de procura + Caiac + Lancha a motor \ No newline at end of file From 1bbaf4fed819686fa29f51d99f68378ee0e25105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Wed, 18 Nov 2020 23:55:29 +0000 Subject: [PATCH 30/70] Translated using Weblate (Galician) Currently translated at 100.0% (3830 of 3830 strings) --- OsmAnd/res/values-gl/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-gl/phrases.xml b/OsmAnd/res/values-gl/phrases.xml index fece900054..bc344c6287 100644 --- a/OsmAnd/res/values-gl/phrases.xml +++ b/OsmAnd/res/values-gl/phrases.xml @@ -796,7 +796,7 @@ Lámpadas eléctricas Poliéster Escola - Universidade + Educación superior Pediatría Tiro con arco Salón de tiro From da2db5ebe2d7afd5a14457a6a92fc346c1c880c0 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Tue, 17 Nov 2020 00:03:05 +0000 Subject: [PATCH 31/70] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3555 of 3555 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 35 +++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 802205f9e0..75fe84842c 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -2389,7 +2389,7 @@ \n O plugin de mapas de ski Skiing OsmAnd permite que você veja pistas de ski com nível de complexidade e algumas informações adicionais, como localização de elevadores e outras facilidades. Buffer de tempo para rastreamento on-line O nome contém muitas letras maiúsculas. Continuar\? - O nome do arquivo contém caracteres ilegais + Caráter ilegal no nome do arquivo Ação rápida Ação %d Tela %d @@ -2551,7 +2551,7 @@ \n Laociano Mostrar notas encerradas - Mostrar/ocultar notas OSM no mapa. + Mostrar ou ocultar notas OSM no mapa. Arquivo GPX Arquivo OSC Selecione o tipo de arquivo @@ -3078,9 +3078,9 @@ Altere o zoom do mapa rolando a roda para cima e para baixo. Escape retorna para o aplicativo WunderLINQ. Use o WunderLINQ para controle Adicionar ao menos um item à lista nas configurações de \'Ação rápida\' - Esqui alpino/de declínio + Esqui alpino e downhill Pistas de esqui alpino ou de declínio e acesso a teleféricos. - Cross country/esqui nórdico + Cross country e esqui nórdico Trilhas para esqui nórdico ou cross-country. Turismo de esqui Rotas para passeios de esqui. @@ -3359,7 +3359,7 @@ Ponto de partida Estima a hora de chegada de tipos de estradas desconhecidas e limita a velocidade de todas as estradas (pode afetar o roteamento) Trilha salva - O nome do arquivo está vazio + Nome de arquivo vazio Reverter Um botão para fazer com que a tela centralize o ponto de partida. Em seguida, solicitará para definir o destino ou acionar o cálculo da rota. Mostrar os nós da rede de ciclovias @@ -3569,7 +3569,7 @@ Sombras de relevo %1$s de %2$s Encostas - Mostrar / ocultar terreno + Mostrar ou ocultar terreno Ocultar terreno Mostrar terreno Um botão para mostrar ou ocultar a camada do terreno no mapa. @@ -3686,11 +3686,11 @@ Você pode acessar essas ações tocando no botão “%1$s”. Ocultar transporte público Mostrar transporte público - Mostrar/ocultar transporte público + Mostrar ou ocultar transporte público Botão que mostra ou oculta o transporte público no mapa. - Criar / Editar POI + Criar ou editar POI Posições de estacionamento - Adicionar / Editar favorito + Adicionar ou editar favoritos Restaurar ordem de itens padrão Voltar à edição Retomar @@ -3867,7 +3867,7 @@ Nome do arquivo %s arquivos de trilha selecionados Pausará o registro de rastreamento quando o aplicativo for encerrado (por meio de aplicativos recentes). (A indicação de uso em segundo plano do OsmAnd desaparece da barra de notificação do Android.) - Especifique o intervalo de registro para a gravação geral da trilha (habilitado por meio do widget Gravação de viagem no mapa). + Especifique o intervalo de registro para a gravação geral da trilha (ligado por meio do widget de \'gravação de viagem\' no mapa). Pausar gravação de viagem Retomar a gravação da viagem Padrão do sistema @@ -3883,7 +3883,7 @@ Refazer "• Função de planejamento de rota atualizada: permite o uso de diferentes tipos de navegação por segmento e a inclusão de trilhas \n -\n • Novo menu de aparência para trilhas: selecione cor, espessura, setas de direção de exibição, ícones de início / término +\n • Novo menu de aparência para trilhas: selecione cor, espessura, setas de direção de exibição, ícones de início e término \n \n • Melhor visibilidade dos nós da bicicleta. \n @@ -3899,7 +3899,7 @@ Última modificação Nome: Z – A Nome: A – Z - Ícones de início/término + Ícones de início e término Obrigado por adquirir \'curvas de nível\' Assinatura cobrada por período selecionado. Cancele no AppGallery a qualquer momento. O pagamento será cobrado em sua conta AppGallery na confirmação da compra. @@ -3960,10 +3960,10 @@ Histórico de marcadores Enviar arquivo GPX para OpenStreetMap Insira as etiquetas separadas por vírgula. - Público significa que o traçado será mostrado publicamente em Seus traços de GPS e em listas públicas de traços de GPS. Os dados fornecidos por meio da API não fazem referência à sua página de rastreamento. Os carimbos de data/hora dos pontos de rastreamento não estão disponíveis por meio da API GPS pública e os pontos não são ordenados cronologicamente. No entanto, outros usuários ainda podem fazer o download do rastreamento bruto da lista pública de rastreamento e de quaisquer carimbos de data/hora contidos nela. - Privado significa que o rastreamento não aparecerá em nenhuma lista pública, mas os pontos de trilha dele ainda estarão disponíveis por meio da API GPS pública sem carimbos de data/hora, mas não serão ordenados cronologicamente. - Identificável significa que o traço será mostrado publicamente em Seus traços de GPS e em listas públicas de traços de GPS, ou seja, outros usuários poderão fazer download do traço bruto e associá-lo ao seu nome de usuário. Os dados fornecidos por meio da API de pontos de trilha farão referência à sua página de rastreamento original. Os carimbos de data/hora dos pontos de rastreamento estão disponíveis por meio da API GPS pública. - Rastreável significa que o rastreamento não aparecerá em nenhuma lista pública, mas os pontos de trilha dele ainda estarão disponíveis por meio da API GPS pública com carimbos de data/hora. Outros usuários só poderão baixar pontos de trilha processados de seu trace, que não podem ser associados a você diretamente. + \"Público\" significa que o traçado é mostrado publicamente em seus traços GPS e em listagens públicas de traços GPS e na lista pública de traços com carimbos de data/hora em formato bruto. Os dados fornecidos por meio da API não fazem referência à sua página de rastreamento. Os carimbos de data/hora do ponto de rastreamento não estão disponíveis por meio da API GPS pública e os pontos de rastreamento não são ordenados cronologicamente. + \"Privado\" significa que o rastreamento não aparece em nenhuma listagem pública, mas os pontos de trilha dele em ordem não sincronizada estão disponíveis por meio da API GPS pública sem carimbos de data/hora. + \"Identificável\" significa que o traço será mostrado publicamente em Seus traços de GPS e em listas públicas de traços de GPS, ou seja, outros usuários poderão fazer download do traço bruto e associá-lo ao seu nome de usuário. Os dados de pontos de rastreamento com carimbo de data/hora públicos da API GPS servidos por meio da API de pontos de rastreamento farão referência à sua página de rastreamento original. + \"Rastreável\" significa que o rastreamento não aparece em nenhuma listagem pública, mas os pontos de trilha processados com carimbos de data/hora (que não podem ser associados a você diretamente) são feitos por meio de downloads da API GPS pública. Fechar nota do OSM Comentário de nota do OSM Você pode entrar usando o método OAuth seguro ou usar sua entrada e senha. @@ -3973,4 +3973,7 @@ As fotos são fornecidas pelo projeto de dados abertos do OpenPlaceReviews.org. Para carregar suas fotos você precisa se inscrever no site. Criar nova conta Eu já tenho uma conta + Histórico de busca + Caiaque + Lancha \ No newline at end of file From 441afb44bda9de116826fd65a7872edce1323ac9 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Wed, 18 Nov 2020 12:17:05 +0000 Subject: [PATCH 32/70] Translated using Weblate (Esperanto) Currently translated at 99.5% (3539 of 3555 strings) --- OsmAnd/res/values-eo/strings.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index ea11a3cdb0..2246163a37 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3966,15 +3966,18 @@ Enigu etikedojn disigitajn per komo (,). “Publika” signifas, ke la GPX‑spuro estos publika videbla en “miaj spuroj” kaj en la publika listo de spuro (GPS‑spuroj). Datumoj liverataj per la API ne ligos al paĝo de via spuro. Tempindikoj de punktoj ne estos akireblaj per la publika API GPS, kaj la punktoj ne estos ordigitaj laŭtempe. Tamen aliaj uzantoj plue povos elŝuti la nepritraktitan spuron el la publika listo de spuroj kune kun ĉiuj ampleksitaj tempindikoj. “Privata” signifas, ke la GPX‑spuro montriĝos en neniu publika listo, sed ĝiaj punktoj plue estos akireblaj per la publika API GPS sen tempindikoj, sed tiuj punktoj estos ordigitaj laŭtempe. - “Identigebla” signifas, ke la GPX‑spuro estos publike videbla en “miaj spuroj” kaj en la publika listo de spuroj (GPS‑spuroj), aliaj uzantoj povos elŝuti vian nepritraktitan spuron kaj ligi ĝin al via uzantnomo. Datumoj liveritaj per la API de spuroj ligos al originala paĝo de via spuro. Tempindikoj de la spuro estos akireblaj per la publika API GPS. - “Spurebla” signifas, ke la GPX‑spuro ne estos montrata en publikaj listoj, sed punktoj el ĝi plue estos akireblaj per la publika API GPS kune kun tempindikoj. Aliaj uzantoj povos elŝuti nur pritraktitajn punktojn el via spuro, kiuj ne povos esti senpere ligitaj al vi. + “Identigebla” signifas, ke la GPX‑spuro estos publike videbla en “miaj spuroj” kaj en la publika listo de spuroj (GPS‑spuroj), aliaj uzantoj povos elŝuti vian nepritraktitan spuron kaj ligi ĝin al via uzantnomo. Publikaj datumoj kun tempindikoj el la API GPS akireblaj per la API de spur‑punktoj indikos al originala paĝo de via spuro. + “Spurebla” signifas, ke la GPX‑spuro ne montriĝos en publikaj listoj, sed pritraktitaj punktoj kun tempindikoj el ĝi (kiuj ne povos esti senpere ligitaj al vi) estos elŝuteblaj per la publika API GPS. Fermi OSM-rimarkon Komenti OSM-rimarkon - Vi povas ensaluti per l sekura metodo OAuth aŭ per uzi uzantnomon kaj pasvorton. + Vi povas ensaluti per la sekura metodo OAuth aŭ per uzi uzantnomon kaj pasvorton. Aldoni foton Registri ĉe \nOpenPlaceReviews.org Fotoj estas liverataj de la malferm‑datuma projekto OpenPlaceReviews.org. Por alŝuti viajn fotojn, vi devas registri ĉe la retejo. Krei novan konton Mi jam havas konton + Serĉi en historio + Kajako + Motorboato \ No newline at end of file From e7ef5e9ba2dd8b8b47d069a3aad8a0228d0324ec Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Wed, 18 Nov 2020 19:32:48 +0000 Subject: [PATCH 33/70] Translated using Weblate (Arabic) Currently translated at 93.5% (3582 of 3830 strings) --- OsmAnd/res/values-ar/phrases.xml | 668 ++++++++++++++++++++++++++++++- 1 file changed, 646 insertions(+), 22 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index d8372de23f..8581321bd9 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -382,7 +382,7 @@ الوصول إلى المراحيض بالكراسي المتحركة: نعم الوصول إلى المراحيض بالكراسي المتحركة: لا الوصول إلى دورة المياة: العملاء فقط - طاولة تغيير الحفائض + طاولة تغيير حفائض الأطفال لا توجد طاولة تغيير الحفاض غرفة تغيير الحفاضات الوقت المحدد لوقوف السيارات @@ -563,7 +563,7 @@ مساحة تجارية حقل عنب مزرعة - مرعى أو مرج + مرعى/مرج/روضة قناة مراقبة مرصد @@ -1396,7 +1396,7 @@ كافتيريا الخدمات نوع الدراجة النارية - موحد + قياسية النوع محطة Aerialway رافعة بالكرسي @@ -1437,7 +1437,7 @@ مسار الزحلقة الحيوانات المسموح بها الغرض - الوجهة: مدخل + الاتجاه: المدخل قوارب مأجرة بئر نفط شبكات الكريكيت @@ -1569,32 +1569,32 @@ دولفين مكان لتغذية الحيوان قدرة تحمل المكان للماء: متين - بروز - تماس - التماس غير مقبول + بروز طبقات الأرض (تفجر أرضي) + تلامس + لا يتم قبول التلامس خطر خطر مواد نووية - خطر التآكل - خطر الانهيار - طريق زلقة + خطر الهيار/التعرية الأرضية + خطر الانهيار الجليدي + طريق زلق خطر فيضانات حقل الغام - أطلال + أطلال/أنقاض/خرائب فئات الترخيص تل تصليح أحذية نعم فقط - خط أنابيب فرعية - الإرسال + محطة فرعية لخطوط الأنابيب + ‌الإرسال/الدفع التوزيع توزيع ثانوي صناعية - مرحلة انتقالية - جر + ناقل + تغذية النقل (المترو/القطار ..) محول التعويض - ضغط + الضغط قياس صمام مجموعة صمامات @@ -1602,14 +1602,14 @@ ميدان تجمع إنتاج حلويات متجر جملة - مختبرات طبية + مختبر طبي التبرع بالدم قصص مصورة أثري ديني أكاديمي أطفال - جزر مرجانية + جزيرة مرجانية جهاز ارسال رسوم الكترونية رعاية أطفال معلم طبيعي @@ -1618,7 +1618,7 @@ قطار باص مترو انفاق - HOV + مركبات فيها أكثر من شخص ترام عبّارة مصدر الطاقة: الكتلة الحيوية @@ -2170,7 +2170,7 @@ رطب صعب المشي فيه،قصب اهوار مستنقع - مرعى أو مرج رطب طوال العام + مرعى/مرج رطب طوال العام الطفة البركانية القصدير حجر @@ -2179,7 +2179,7 @@ النوع: ساحة الطوب النوع: زراعة النوع: متلف/محطم السيارات - النوع: مستودع + النوع: مخزن النوع: مصفاة النوع: خشب النوع: صناعة الغاز @@ -2620,7 +2620,7 @@ النوع: قطع الصخور النوع: رمل النوع: قبر حرب - رِجّم (صخور مركومة) علامة + رِجْم، رجوم (صخور مركومة) عتبات مختلفة أو مائلة عتبات غير متساوية عتبات متساوية @@ -2961,4 +2961,628 @@ تركي عالمي تايلندي + برج رادار + (منطقة وقوف جانب الطريق) + سقيفة + على السطح + بنك ميغروس + بطاقة ما بعد التمويل + السحب النقدي: البطاقات الأجنبية + السحب النقدي: الحد الأدنى للشراء + رسوم السحب النقدي: لا + رسوم السحب النقدي: نعم + السحب النقدي: لا يتطلب الشراء + السحب النقدي: لابد من الشراء + عملة السحب النقدي + حد السحب النقدي + نوع السحب النقدي: الدفع الذاتي + نوع السحب النقدي: الدفع + مشغل السحب النقدي + سحب نقدي + السحب النقدي: نعم + العناية بالحيوانات الأليفة + شحن + نجار/صانع أثاث + مخبز + مبلط/تبليط/أرضيات + نجار + مقاولات/بناء + الغذاء الصحي + مدخل القبو + المعينه/المحدد + نعم + المعينه/المحدد + نعم + للتسليم والتوصيل فقط + المعينه/المحدد + للوصول للوجهة فقط + نعم + المعينه/المحدد + نعم + المعينه/المحدد + نعم + المعينه/المحدد + للوصول للوجهة فقط + نعم + المعينه/المحدد + نعم + المعينه/المحدد + نعم + المعينه/المحدد + نعم + المعينه/المحدد + نعم + خاص مسموح بدخوله + المعينه/المحدد + نعم + السماح بدخول المعاقين: لا + الخيول غير مسموح بها + مسموح بالخيول + السماح بدخول مركبات الأجرة: لا + السماح بدخول مركبات الأجرة: محدد + السماح بدخول مركبات الأجرة: نعم + السماح بدخول المركبات الزراعية: لا + السماح بدخول المركبات الزراعية: نعم + السماح بدخول الزلاجات الآلية: لا + السماح بدخول الزلاجات الآلية: خاص + السماح بدخول الزلاجات: لا + السماح بدخول الزلاجات: نعم + السماح بدخول مدربي القيادة: لا + السماح بدخول مدربي القيادة: نعم + السماح بدخول حافلات السياح: نعم + السماح بدخول حافلات السياح: لا + السماح بدخول حافلات السياح: محدد + السماح بدخول الحافلات: لا + السماح بدخول مركبات الخدمات العامة: لا + السماح بدخول مركبات الخدمات العامة: محدد + السماح بدخول مركبات الخدمات العامة: لا + السماح بدخول المقطورات: لا + السماح بدخول البيوت المتنقلة: لا + السماح بدخول الكرفانات: لا + السماح بدخول المشاة: للعملاء فقط + السماح بدخول المشاة: للعبور إلى الوجهة فقط + السماح بدخول المشاة: لا + السماح بدخول المشاة: خاص + السماح بدخول المشاة: نعم + السماح بدخول الخيول: الخاصة بالغابات + السماح بدخول الخيول: للعبور إلى الوجهة + السماح بدخول الخيول: خاص + السماح بدخول الدراجات: للعملاء فقط + السماح بدخول الدراجات: للعبور إلى الوجهة + السماح بدخول الدراجات: بدون قيادتها (سحبها مشياً) + السماح بدخول الدراجات:خاص + السماح بدخول الدراجات الآلية:لا + السماح بدخول الدبابات الصغيرة:لا + السماح بدخول الدراجات النارية:لا + السماح بدخول الدراجات النارية:خاص + السماح بدخول المركبات الصغيرة:لا + السماح بدخول المركبات الكبيرة:غير ملائم + السماح بدخول المركبات الكبيرة:غير مناسب + السماح بدخول المركبات الكبيرة:الزراعية + السماح بدخول المركبات الكبيرة:لا + السماح بدخول المركبات الكبيرة:خاص + السماح بدخول المركبات الآلية:الزراعية + السماح بدخول المركبات الآلية:الخاصة بالغابات + السماح بدخول المركبات الآلية: للتسليم فقط + السماح بدخول المركبات الآلية:العسكرية + السماح بدخول المركبات الآلية:العملاء فقط + السماح بدخول المركبات الآلية:للوصول إلى الوجهة فقط + السماح بدخول المركبات الآلية:لا + السماح بدخول المركبات الآلية:خاص + السماح بدخول المركبات الآلية:نعم + السماح بدخول السيارات: الخاصة بالغابة + السماح بدخول السيارات: العملاء + ‏‏ خاص مسموح بدخوله + خاص مسموح بدخوله + السماح بدخول المشاة: خاص مسموح بدخوله + السماح بدخول الخيول: خاص مسموح بدخوله + السماح بدخول الدرجات: خاص مسموح بدخوله + السماح بدخول المركبات الآلية: خاص مسموح بدخوله + السماح بدخول السيارات: خاص مسموح بدخوله + السماح بدخول السيارات: للعبور للوجهة + السماح بدخول السيارات: لا + السماح بدخول السيارات:خاص + السماح بدخول السيارات: + السماح بدخول المركبات: الخاصة بالغابات + السماح بدخول المركبات: لتسليم الطلبات + السماح بدخول المركبات: العسكرية + السماح بدخول المركبات: العملاء فقط + السماح بدخول المركبات: خاص مسموح بدخوله + السماح بدخول المركبات: للعبور للوجهة + السماح بدخول المركبات: لا + السماح بدخول المركبات: خاص + السماح بدخول المركبات: نعم + مكتب سيارات الأجرة + رسوم على طاولة تغيير الأطفال: لا + رسوم على طاولة تغيير الأطفال: نعم + عدد طاولات تغيير الأطفال + موقع طاولة تغيير للأطفال: دورة مياة للجنسين + موقع طاولة تغيير للأطفال: دورة مياة النساء + موقع طاولة تغيير للأطفال: دورة مياة الرجال + موقع طاولة تغيير للأطفال: غرفة + طاولة تغيير للأطفال: محدودة (غير رسمية) + طاولة تغيير للأطفال: لا + طاولة تغيير للأطفال: نعم + الموقع (وصف المكان) + الخطر: التلوث + الخطر: حقل ألغام + الخطر: انهيار جليدي + الخطر: فيضان + الخطر: نووي + الخطر: سقوط الصخور + خطر: تآكل/تعرية + صندوق الطوارئ + كائن محذوف + شعلة الغاز ؛ مداخن مضيئة + 3B* + 3B + 3A* + 3A + 2B* + 2B + 2A* + 2A + 1B* + 1B + 1A* + 1A + n/c* + n/c + شوكو + نيما 14-50 + نيما 14-30 + نيما 5-20 + نيما 5-15R + تسلا رودستر + شاحن تسلا + معيار تسلا + شاديمو + النوع 3 + النوع 2 كومبو + النوع 2 + النوع 1 كومبو + النوع 1 + CEE الأحمر 125A + CEE الأحمر 64 أ + CEE الأحمر 32A + CEE الأحمر 16A + CEE الأزرق + متجر قوارب + متجر موقد/مشب + متجر زراعي + أغذية مجمدة + النوع: مرعى + النوع: انتقالي + النوع: دائم + النوع: زراعي + قطر القمة + محيط + طرق التسلق + تسلق قمة الجذوع: لا + تسلق قمة الجذوع: نعم + اتجاه الجدار: شمال غرب + اتجاه الجدار: غرب + اتجاه الجدار: جنوب غرب + اتجاه الجدار: جنوب + اتجاه الجدار: جنوب شرق + اتجاه الجدار: شرق + اتجاه الجدار: شمال شرق + اتجاه الجدار: شمال + المراسي الثابتة: لا + المراسي الثابتة: نعم + جودة التسلق: هشة + جودة التسلق: ثابت + تسلق الصخور: الرخام السماقي + تسلق الصخور: النيس + تسلق الصخور: الكوارتز + تسلق الصخور: الحجر الرملي + تسلق الصخور: الجرانيت + تسلق الصخور: الحجر الجيري + طول الحد الأقصى للتسلق + طول الحد الأدنى للتسلق + طول مساحة التسلق + التسلق الفردي في المياه العميقة: لا + التسلق الفردي في المياه العميقة: نعم + مختلط: لا + مختلط: نعم + الجليد: لا + الجليد: نعم + طرق متعددة : لا + طرق متعددة: نعم + تقليدي: لا + تقليدي: نعم + حبل علوي: لا + حبل علوي: نعم + بولدرينغ: لا + بولدرينغ: نعم + الرياضة: لا + الرياضة: نعم + الرمز البريدي + صندوق الرسائل + مستودع + حجم الخريطة: المنطقة + حجم الخريطة: المدينة + حجم الخريطة: الموقع + نوع الخريطة: الطبوغرافية التي توضح معالم الاتجاهات + نوع الخريطة: مخطط + نوع الخريطة: طبوغرافية + مخرج محطة الشحن + التيار/أمبير + رسوم وقوف السيارات: لا + رسوم وقوف السيارات: نعم + شاحنة: لا + شاحنة: نعم + المقبس: CEE الأحمر 32A: التيار + المقبس: CEE الأحمر 64A: التيار + ‍المقبس: CEE الأحمر 125A: التيار + مأخذ التوصيل: النوع 1: التيار + مأخذ التوصيل: نوع 1 التحرير والسرد: التيار + مأخذ التوصيل: النوع 2: التيار + المقبس: نوع 2 التحرير والسرد: التيار + مأخذ التوصيل: النوع 3: التيار + المقبس: CHAdeMO: التيار + المقبس: تيسلا رودستر: التيار + المقبس: نيما 14-50: التيار + المقبس: CEE الأحمر 16A: التيار + المقبس: CEE الأزرق: التيار + سكوتر: لا + سكوتر: نعم + الدراجة: لا + الدراجة: نعم + السيارة: لا + السيارة: نعم + المقبس: AS / NZS 3112: الإخراج + المقبس: AS / NZS 3112: التيار + المقبس: AS / NZS 3112 + المقبس: BS 1363: الإخراج + مأخذ التوصيل: BS 1363: التيار + المقبس: BS 1363 + المقبس: شوكو: الإخراج + المقبس: Schuko: التيار + المقبس: شوكو + المقبس: نيما 14-50: الإخراج + المقبس: نيما 14-30 + المقبس: نيما 14-30: الإخراج + المقبس: نيما 14-30: التيار + المقبس: نيما 14-30 + المقبس: نيما 5-20: الإخراج + المقبس: نيما 5-20: التيار + المقبس: نيما 5-20 + المقبس: نيما 5-15R: الإخراج + المقبس: نيما 5-15R: التيار + المقبس: نيما 5-15R + المقبس: تسلا رودستر: الإخراج + المقبس: تسلا رودستر + المقبس: تسلا شاحن: الإخراج + المقبس: تسلا شاحن: التيار + المقبس: تسلا سوبر تشارج + المقبس: معيار تسلا: الإخراج + المقبس: معيار تسلا: التيار + المقبس: معيار تسلا + مأخذ التوصيل: CHAdeMO: الإخراج + المقبس: شاديمو + مأخذ التوصيل: النوع 3: الإخراج + المقبس: النوع 3 + المقبس: النوع 2 التحرير والسرد: الإخراج + المقبس: نوع 2 كومبو + مأخذ التوصيل: نوع 2: الإخراج + المقبس: النوع 2 + المقبس: نوع 1 التحرير والسرد: الإخراج + المقبس: نوع 1 كومبو + مأخذ التوصيل: النوع 1: الإخراج + المقبس: النوع 1 + المقبس: CEE الأحمر 125A: الإخراج + المقبس: CEE الأحمر 125A + المقبس: CEE الأحمر 64A: الإخراج + المقبس: CEE الأحمر 64A + المقبس: CEE الأحمر 32A: الإخراج + المقبس: CEE الأحمر 16A + المقبس: CEE الأحمر 16A: الإخراج + المقبس: CEE الأحمر 16A + المقبس: CEE الأزرق: الإخراج + المقبس: CEE الأزرق + عائلات متعددة + العائلة + المجتمع + مياه معبأة + خزان ماء + نقل المياه بالشاحنات + الثقب + مضخة + المياه الجارية + خط انابيب + بئر ماء + أكواتابس + التناضح العكسي + الكلور + بدون + نقطة GPX + الغاز الطبيعي المسال + متجر البندق + خلية نحل + الجدول الزمني + في الوقت الحقيقي + تأخير + نعم + لوحة المغادرين: لا + مصعد + كتلة المدينة + محافظة + صندوق العطايا + أسهم: لا + نعم + نعم + الاهتزاز: لا + حالة المضخة: شعاع مفقود + شفط + مضغوط + مياه جوفية + أنابيب + شبكة تعبئة مياه الشرب + إعادة تعبئة مياه الشرب:لا + نعم + عائق + مستوى الماء: أقل من مستوى الماء + مستوى الماء: فوق متوسط مستوى الماء + مستوى الماء: عائم + مستوى الماء: فيضانات + منسوب الماء: متقاذف/متلاطم + مستوى الماء: يغطي + مستوى الماء: جاف + مستوى الماء: مغمور + مستوى الماء: جزء مغمور + غير صحيح + بدائي + متباين اللون + فقط عندما يسمح بالمشي + لا + نعم + نوع الكشك + كشك + لا + نعم + قاعدة الصيد + رقم مرجع الزحلقة + مركز البولينج + متجر الأمن + إنقاذ الجبال + بينتبول (كرة الطلاء) + دراجة الشبح + عدد الانفجارات + خامل + نشط + في سبات + منطفئ/خامد + آخر ثوران بركاني + طينيه + قبة الحمم البركانية + فوه بركانيه كبيرة + لكن + درع + ستراتوفوكانو + سكوريا + الرابط + أماكن لوقوف السيارات + قبر + جنس المجتمع: ذكر + جنس المجتمع: أنثى + لا + نعم + حمام القدم + بحيرة + نهر + حراري + حمام + أونسن + ينبوع ساخن + بوستبنك + جيروكارد + قدرة تحمل المكان للماء: للطوارئ + معطل + يحتاج إلى صيانة + مقيد + مغلق + مفتوح + الرؤية: المنطقة (أعلى من 50 متر) + الرؤية: الشارع (10-50 متر) + الرؤية: منزل (10 متر) + الموقع: المدخل + الموقع: الجدار + الموقع: الجسر + الموقع: كشك + الموقع: منصة + الموقع: داخلي + الموقع: في الهواء الطلق + الموقع: السطح + الموقع: السقف + الموقع: في الهواء + الموقع: فوق الأرض + الموقع: تحت الماء + الموقع: تحت الارض + شبكة معدنية + DecoTurf + العشب الصناعي + طرطان + طين + منطقة جبلية + أخدود/تلعة + الخدمات الاجتماعية + الضمان الاجتماعي + أرشيف + الشبكة + كانوي: لا + كانوي: نعم + زوارق الكاياك: لا + زوارق الكاياك: نعم + زورق: لا + زورق: نعم + المراكب الشراعية: لا + المراكب الشراعية: نعم + جيتسكي: لا + جيتسكي: نعم + الدواسات: لا + الدواسات: نعم + المراكب: لا + المراكب: نعم + القوارب: لا + القوارب: نعم + تأجير قوارب + أسرة/سرير + الحجز: للأعضاء فقط + الحجز: لا + الحجز: نعم + الحجز المسبق: موصى به + الحجز المسبق: مطلوب + غرفة الشتاء: لا + غرفة الشتاء: نعم + الاتجاه: لأسفل + اتجاه: لأعلى + الاتجاه: عكس اتجاه عقارب الساعة + الاتجاه: اتجاه عقارب الساعة + الاتجاه: للخلف + الاتجاه: إلى الأمام + الاتجاه: الشمال والشمال الغربي + الاتجاه: شمال غربي + الاتجاه: الغرب والشمال الغربي + الاتجاه: الغرب + الاتجاه: الغرب والجنوب الغربي + الاتجاه: جنوب غربي + الاتجاه: الجنوب والجنوب الغربي + الاتجاه: الجنوب + الاتجاه: جنوب-جنوب شرق + الاتجاه: جنوب شرق + الاتجاه: شرق وجنوب شرق + الاتجاه: شرق + الاتجاه: شرق - شمال شرق + الاتجاه: شمال شرقي + الاتجاه: الشمال والشمال الشرقي + الاتجاه: شمال + ميناء فضائي + إطلاق السراح: لا + إطلاق السراح: نعم + التبني: لا + التبني: نعم + مالك + مزدوج + الطرق الوعره + المروحيه + دراجة رياضية + سكوتر + ملابس الدراجات النارية: لا توجد + ملابس الدراجات النارية + إطارات: لا + اطارات + قطع غيار: لا + قطع غيار + إصلاح: لا + إصلاح + تأجير: لا + تأجير + المبيعات: مستعملة + المبيعات: نعم ، مستعملة + مبيعات: لا + مبيعات + منصة + زواحف + صقور + مطير (قفص) + طيور + حديقة سفاري + سياج + حديقة حيوانات برية + حديقة الحيوانات الأليفة + طوق النجاة + مدرسة لغة + مخيم للأطفال + إصلاح الإلكترونيات: الهاتف + إصلاح الإلكترونيات: الأجهزة + إصلاح الإلكترونيات: أجهزة الكمبيوتر + مكتب تجهيزات الطاقة + نعم + مساحة عمل مشتركة + محطة الشحن + البناء: مخفي + البناء: قبة + البناء: طبق + البناء: قائم بذاته + البناء: شبكة فولاذية + النوع: إسطبل مفتوح + النوع:مربط خيول + كومة فحم + متجر الأجهزة + تاريخ الانتهاء + صخرة + دورة + إلكتروني + إبرة + دفتر ملاحظات + رمز + نقطة الختم + نقطة تفتيش للمشاة/الهايكنق + متوسط الميلان + أدنى نقطة + أعلى نقطة + اللسان الجليدي + بقايا + الجرف + صخرة + انهيار الجليد + معلقة + جبل + مياه المد + منفذ + وادي + هضبة + الحقل الجليدي + الغطاء الجليدي + الصعوبة + رقم الكابل + فيا فيراتا (مسار الحديد) + مغامرة التسلق + المسار الإنزلاقي + كفرات/جنوط + الإطارات + إصلاح مكاين/محركات + إصلاح قير + ميزان/وزن أذرعة ومقصات + شكمان/كاتم صوت/دبات + تصليح شاحنات ومعدات ثقيلة + زجاج + الكهربائية + سمكرة وتعديل جسم السيارة + تبريد/مكيفات + بطاريات + قطع غيار السيارات + تشخيص/فحص + مبيعات السيارات الجديدة + فرامل + مبيعات السيارات المستعملة + تغيير زيت + إصلاح السيارات + مكتب مرافق المياه + شواية: نعم + نقطة تسليم المحل + اسم منحدرات النهر + فخار + متجر الأرضيات + منخفض + متوسط + عالي + منخفض + متوسط + عالي + منخفض + متوسط + عالي + منخفض + متوسط + عالي + منخفض + متوسط + عالي + منخفض + متوسط + عالي + AS/NZS 3112 + BS 1363 \ No newline at end of file From 8379b2bbd714f447595b6b53eef50d3774b86f1e Mon Sep 17 00:00:00 2001 From: Softmap Date: Tue, 17 Nov 2020 21:22:14 +0000 Subject: [PATCH 34/70] Translated using Weblate (Arabic) Currently translated at 93.5% (3582 of 3830 strings) --- OsmAnd/res/values-ar/phrases.xml | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index 8581321bd9..bfb222313c 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -3585,4 +3585,78 @@ عالي AS/NZS 3112 BS 1363 + طاولة نزهة + وجهة نظر + منطقة دينية + الوصول إلى الإنترنت: رسوم مفروضة + الوصول إلى الإنترنت: نعم + الوصول إلى الإنترنت: خدمة + الوصول إلى الإنترنت: عام + ولوج الإنترنت: سلكي + "ولوج الإنترنت: terminal" + ولوج الإنترنت: wlan + ماهايانا + ماروني + شينجون شو + ارثوذكسي قبطي + موحد + الأرثوذكسية الإثيوبية التوحيدية + الأرثوذكسية الرومانية + عالم + الأرثوذكسية الجورجية + كنيسة المسيح المتحدة + كنيسة المسيح + قديسي اليوم الأخير + اصلاح + رسولي + رسولي أرميني + روحاني + الأرثوذكسية الصربية + المؤمنون القدامى + تجمعي + ناصري + سبتي + غير طائفي + تجميعات الإله + الأرثوذكسية البلغارية + كواكر + مينونايت + توحيد + كنيسة إغليسيا ني كريستو + جيش الخلاص + كنيسة اسكتلندا + الكنيسة الإصلاحية الموحدة + التبت + كاثوليكي يوناني + متحد + الأسقفية + كنيسة إنجلترا + رسولي جديد + سبتي (مؤمن برجوع المسيح في اليوم السابع) + تم إصلاحه + الأرثوذكسية اليونانية + شهود يهوه + المورمون + الأنجليكانية + الزرادشتية + ديانة تينريكيو اليابانية + علم السايونتولوجيا + البهائية + الديانة الجاينية الهندية + التوحيد الكوني + قطار (سياحي) + أرجوحة ملاهي دوارة + التزحلق الصيفي + قطار الملاهي + متاهة + دائري + عجلة فيريس/ملاهي + حيوان (جذب) + جولة تسلية + شيء سياحي + جذب سياحى + منجم تاريخي + حطام سفينة + حجر الشاهد القائم الروني + دبابة تاريخية \ No newline at end of file From 92e014aa40f23e2642f3e3ecd4212cd61ad7c2ea Mon Sep 17 00:00:00 2001 From: Translator Date: Wed, 18 Nov 2020 19:59:14 +0000 Subject: [PATCH 35/70] Translated using Weblate (Azerbaijani) Currently translated at 53.8% (1914 of 3555 strings) --- OsmAnd/res/values-az/strings.xml | 86 ++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-az/strings.xml b/OsmAnd/res/values-az/strings.xml index dfafcf937d..42fe8796e1 100644 --- a/OsmAnd/res/values-az/strings.xml +++ b/OsmAnd/res/values-az/strings.xml @@ -1700,8 +1700,8 @@ Proqramı növbəti dəfə başlatdığınızda qrup yox olacaq. Xəritədə oxları göstər Xəritə işarələrindən sil - azalan - artan + Z-A + A-Z Əlavə edildi Sırala: Bütün xəritə işarələri tarixçəyə daşındı @@ -2069,7 +2069,7 @@ Vikisəyahət Üst panel %1$s düzəliş, cəmi %2$s mBTC - Ye + Yeni marşrut yarat Hazırdır Naviqasiya profili OsmAnd Live məlumatları @@ -2090,4 +2090,84 @@ İstifadəçi adı Şəkil əlavə et Yeni hesab yarat + Bərpa et + t + + Daşıma + Xəritələri daşı + %1$d fayl kopyalandı (%2$s). + %1$d fayl daşındı (%2$s). + GPS axtarılır + Proqram profilləri + Profil adı + İcazə ver + Xeyr, təşəkkürlər + İkon + %s saxlandı + Standart + Pulsuz + Üç ay + İl + İl + İl + Ay + Ay + Ay + Həftə + Həftə + Həftə + Gün + Gün + Gün + OsmAnd parametrləri + Qovluq… + %1$s GB boş (%2$s GB-dan) + %1$s kB + %1$s MB + %1$s GB + %1$s TB + Xəritələr + Hesabla + Bütün xəritələri yenilə + + %s endirilir + OSM + İstifadəçi adı və şifrə + Bildiriş + %1$s/%2$s + %1$s — %2$s — %3$s + Menyu + Parametrləri aç + Profillər + Bucaq + Bucaq: %s° + Xüsusi profil + Yeni profil saxlanılır + %2$s-dən %1$s + Dillər + Dil + Bütün dillər + Xüsusi rəng + %1$s / %2$s + OsmAnd + Mapillary + Favoritlər + Naviqasiya profilləri + Profil əlavə et + Proqram profilini dəyiş + Hər zaman + SQLiteDB faylı + Hamısı silinsin\? + Aktiv saxla + Sil + ton + metr + Mapillary-ni göstər/gizlət + Mapillary-ni gizlət + Mapillary-ni göstər + %1$s silindi + Sil və yenidən başlat + Vikipediya xəritələrini endir + Bağlanmış OSM qeydi + Xüsusi + Son düzəliş \ No newline at end of file From f5e5c36757af0f0bf208f27f9643853fa432b837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Wed, 18 Nov 2020 10:43:24 +0000 Subject: [PATCH 36/70] Translated using Weblate (Icelandic) Currently translated at 100.0% (3555 of 3555 strings) --- OsmAnd/res/values-is/strings.xml | 44 ++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index 00458a4f90..8af3d89837 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -1772,7 +1772,7 @@ Hve snemma viltu fá tilkynningu um komu? Ekki nægt vinnsluminni til að birta valið svæði Ónettengdar breytingar - Alltaf nota ónettengdar breytingar. + Ef ónettengdar breytingar eru virkar, þá eru breytingar fyrst vistaðar á tækinu og síðan sendar inn samkvæmt beiðni. Annars gerist þetta jafnóðum. Senda breytingu inn til OSM Ósamstilltar (async) OSM-breytingar: Þú getur sótt eða uppfært %1$s kort. @@ -2164,7 +2164,7 @@ Engar v1.9 leiðareglur Ekki nota leiðareglur sem komu til sögunnar í útgáfu 1.9. Leiðir deilileigubíla - Nafn GPX skráar: + Heiti GPX-skráar: Sýna í korti eftir vistun Mæla vegalengd Geyma skráða ferla í undirmöppum fyrir hvern skráningamánuð (svo sem 2018-01). @@ -2514,7 +2514,7 @@ Veldu skráartegund Öll gögn Sýna lokaða minnispunkta - Birta/fela OSM-minnispunkta á kortinu. + Birta eða fela OSM-minnispunkta á kortinu. GPX - hentar til útflutnings fyrir JOSM eða aðra OSM-ritla. OSC - hentar til útflutnings í OSM. Flytja út sem OSM-minnispunkta, merkisstaði, eða bæði. @@ -3086,7 +3086,7 @@ Veldu notkunarsnið sem eiga að vera sýnileg í forriti. Forritssnið Nota WunderLINQ við stýringu - Brun/svigskíði + Brun og svigskíði Ferðaleiðir á skíðum. Brekkur notaðar fyrir sleða. Leyfa millileiðir @@ -3105,7 +3105,7 @@ Breyttu aðdrætti á kort með skruni músarhjóls upp og niður. Escape fer aftur með þig inn í WunderLINQ forritið. Þú verður að skilgreina a.m.k. eitt atriði í listanum í stillingum flýtiaðgerða Brekkur fyrir svigskíði eða brun og aðgangur að skíðalyftum. - Gönguskíði/norræn fjallaskíði + Gönguskíði og norræn fjallaskíði Leiðir fyrir gönguskíði eða norræn fjallaskíði. Leiðir sem troðnar eru einungis fyrir klassískan stíl en án hluta fyrir skautun. Þetta telur einnig með leiðir sem troðnar eru með minni farartækjum og lausari sporum sem jafnvel eru gerð af skíðagöngufólkinu sjálfu. Kjósa leiðir á þessu erfiðleikastigi, þótt leiðarval um erfiðari eða auðveldari leiðir séu mögulegar ef um stutta búta sé að ræða. @@ -3237,7 +3237,7 @@ Birta kort á læsiskjá á meðan leiðsögn stendur. Stillingar leiðarvals í valda sniðinu \"%1$s\". Tímamörk eftir vöknun - Einingar og snið þeirra + Einingar og snið Útlit Útlit landakorts Útlit korts @@ -3374,7 +3374,7 @@ Upphafspunktur Notað til að áætla komutíma á óþekktum gerðum vega og til takmörkunar á hraða á öllum vegum (gæti breytt leiðarvali) Ferill vistaður - Skráarheiti er autt + Vantar skráarheiti Afturkalla Hnappur til að gera miðju skjásins að upphafsstað. Mun síðan spyrja um áfangastað eða setja í gang útreikning á leiðum. Birta hnútanetkerfi fyrir hjólaleiðir @@ -3582,7 +3582,7 @@ Virkja til að sjá hæðaskyggingar eða brekkur á korti. Þú getur lesið meira um þessa eiginleika á vefnum okkar. Hæðaskygging Brekkur - Birta/fela yfirborð + Birta eða fela yfirborð Fela yfirborð Sýna yfirborð Hnappur til að birta eða fela yfirborðslag á kortinu. @@ -3689,7 +3689,7 @@ Nota tímamörk kerfis fyrir skjá Breyta nettengdum gagnagjafa OsmAnd rekjari - Búa til / breyta merkisstað + Búa til eða breyta merkisstað Geymslusnið Rennur út Flýtiaðgerð @@ -3698,7 +3698,7 @@ Þú getur komist í þessar aðgerðir með því að ýta á \"%1$s\"-hnappinn. Áskrift - OsmAnd Live Alltaf - Birta/fela almenningssamgöngur + Birta eða fela almenningssamgöngur Endurheimta sjálfgefna röð atriða Óstudd tegund Leiðsagnarleiðbeiningar @@ -3707,7 +3707,7 @@ Leiðsagnarsnið Halda áfram OsmAnd + Mapillary - Bæta við / breyta eftirlæti + Bæta við eða breyta eftirlæti Birta almenningssamgöngur Sjálfgefin tímamörk fyrir skjá Hnappur til að birta eða fela almenningssamgöngur á kortinu. @@ -3895,7 +3895,7 @@ Síðast breytt Nafn: Ö – A Nafn: A – Ö - Tákn við upphaf/enda + Tákn við upphaf og enda Forðast gangstéttir Forðast gangstéttir Þróun @@ -3911,12 +3911,12 @@ Útskráning tókst %s GPX-skrár valdar Mun setja GPX-skráningu í bið þegar forritið er drepið (slökkt á því í gegnum skjáinn fyrir nýleg forrit - bakgrunnsvísir OsmAnd hverfur þar með úr tilkynningastiku Android-kerfisins.) - Veldu millibil skráninga í almenna leiðarskráningu (virkjað með viðmótshlutanum fyrir GPX-skráningu á kortinu). + Veldu millibil skráninga í almenna leiðarskráningu (virkjað með viðmótshlutanum \'Skráning ferðar\' á kortinu). Setja skráningu í bið Halda áfram með skráningu • Uppfærðar aðgerðir í skipulagningu leiða: mismunandi leiðsögn á hverjum bút auk slóða \n -\n • Ný útlitsvalmynd fyrir slóðir: val á lit, þykkt, birting stefnuörva, táknmynda við upphaf/endi +\n • Ný útlitsvalmynd fyrir slóðir: val á lit, þykkt, birting stefnuörva, táknmynda við upphaf og endi \n \n • Bættur sýnileiki hjólreiðahnúta. \n @@ -3975,4 +3975,20 @@ OsmAnd notar MGRS, sem er svipað og UTM-snið NATO. Sýsla með áskrift MGRS + \"Opinbert\" þýðir að ferillinn birtist í GPS-ferlunum þínum og á opinberum listum yfir GPS-ferla, þar sem ferilpunktar eru með tímamerkjum á frumsniði. Gögn sem eru sótt í gegnum opinbert GPS API-forritsviðmót vísa ekki í ferlasíðuna þína. Tímamerki ferilpunkta eru ekki tiltæk í gegnum opinbera GPS API-forritsviðmótið og er ekki raðað í tímaröð. + Kayak + Bæta við mynd + \"Auðkennanlegt\" þýðir að ferillinn birtist í GPS-ferlunum þínum og á opinberum listum yfir GPS-ferla, sem þýðir að aðrir notendur geta sútt frumferilinn og tengt þær upplýsingar við notandanafnið þitt. Opinberir ferilpunktar með tímamerkjum sem eru sóttir í gegnum opinbera GPS API-forritsviðmótið vísa í ferlasíðuna þína. + Leitarferill + \"Einka\" þýðir að ferillinn birtist ekki á neinum opinberum listum, en ferilpunktar í ótímasettri röð eru tiltækir í gegnum opinbert GPS API-forritsviðmót án tímamerkja. + Loka OSM-minnispunkti + Ég er nú þegar með notandaaðgang + Skráðu þig á +\nOpenPlaceReviews.org + Búa til nýjan notandaaðgang + Þú getur skráð þig inn með öruggu OAuth-aðferðinni eða notað notandanafn og lykilorð innskráningar. + Vélbátar + Ljósmyndir eru í boði frá opna gagnaverkefninu OpenPlaceReviews.org. Til að geta sent inn myndir þarftu að skrá þig á vefsvæðinu. + Gera athugasemd við OSM-minnispunkt + \"Rekjanlegt\" þýðir að ferillinn birtist ekki á neinum opinberum listum, en meðhöndlaðir ferilpunktar með tímamerkjum úr ferlinum (sem ekki er hægt að tengja beint við þig) munu birtast í gögnum sem eru sótt í gegnum opinbert GPS API-forritsviðmót. \ No newline at end of file From d7d3455c25733e83ff2cd887ce7f0b35d7254142 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Tue, 17 Nov 2020 01:58:35 +0000 Subject: [PATCH 37/70] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3555 of 3555 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 33 +++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 0a000f7811..1636f2db70 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1913,7 +1913,7 @@ 完整報告 OSM 的使用者名稱與密碼 報告 - 檔案名稱包含非法字元 + 檔案名稱中有非法字元 現在應用程式允許寫入外部記憶體。但是需要重新啟動程式。 請透過地圖增加地圖標記 未發現任何航點 @@ -2632,7 +2632,7 @@ 複製地點/POI 名稱 無名稱的位置 顯示已關閉的註解 - 在地圖上顯示/隱藏 OSM 的註解。 + 在地圖上顯示或隱藏 OSM 的註解。 GPX - 適合匯出到 JOSM 或其他 OSM 編輯。 OSC - 適合匯出到 OSM。 GPX 檔案 @@ -3078,7 +3078,7 @@ 透過向上或向下捲以變更地圖縮放。Esc 會將您帶回 WunderLINQ 應用程式。 使用 WunderLINQ 來控制 至少在「快速動作」設定中新增一個項目 - 高山/下坡滑雪 + 高山與下坡滑雪 適合高山或下山滑雪的斜坡與滑雪纜車。 越野滑雪 越野滑雪的路線。 @@ -3360,7 +3360,7 @@ 起點 估計未知道路類型的到達時間,並限制所有道路的速度(可能會影響路徑) 已儲存軌跡 - 檔案名稱為空 + 空的檔案名稱 還原 讓出發點置於畫面中央的按鈕。 顯示節點網路自行車路徑 @@ -3571,7 +3571,7 @@ 啟用以檢視地形陰影或坡度圖。您可以在我們的網站上閱讀更多關於這些地圖類型的資訊。 地形陰影 坡度 - 顯示/隱藏地形 + 顯示或隱藏地形 隱藏地形 顯示地形 用於顯示或隱藏地圖上地形圖層的按鈕。 @@ -3689,10 +3689,10 @@ 您可以透過點選「%1$s」按鈕存取這些動作。 隱藏大眾運輸 在地圖上顯示或隱藏大眾運輸的按鈕。 - 顯示/隱藏大眾運輸 - 建立/編輯 POI + 顯示或隱藏大眾運輸 + 建立或編輯 POI 停車位置 - 新增/編輯收藏 + 新增與編輯收藏 恢復預設項目排序 返回編輯 恢復 @@ -3867,7 +3867,7 @@ 檔案名稱 已選定 %s 軌跡檔案 將會在應用程式被砍除時(透過最近的應用程式)暫停軌跡錄製。(OsmAnd 背景指示會從 Android 通知列中消失。) - 指定一般軌跡錄製的記錄間隔(透過地圖上的旅程錄製小工具啟用)。 + 指定一般軌跡錄製的記錄間隔(透過地圖上的旅程錄製小工具開啟)。 暫停旅程錄製 恢復旅程錄製 系統預設 @@ -3883,7 +3883,7 @@ 重做 • 更新「規劃路線」功能:允許每個路段使用不同的導航類型並包含軌跡 \n -\n • 新的軌跡外觀選項:選取顏色、厚度、開啟方向箭頭與開始/結束圖示 +\n • 新的軌跡外觀選項:選取顏色、厚度、開啟方向箭頭與開始與結束圖示 \n \n • 改善自行車節點的能見度 \n @@ -3899,7 +3899,7 @@ 最後修改時間 名稱:Z – A 名稱:A – Z - 開始/結束圖示 + 開始與結束圖示 感謝您購買 \'Contour lines\' 按選定週期收取訂閱費用。隨時在 AppGallery 上取消。 確認購買後將會從您的 AppGallery 帳號中付款。 @@ -3960,10 +3960,10 @@ 標記歷史 傳送 GPX 檔案到 OpenStreetMap 輸入以逗號分隔的標籤。 - 公開代表軌跡將會公開顯示在您的 GPS 軌跡與公開的 GPS 軌跡清單中。透過 API 取得的 API 不會參考您的軌跡頁面。軌跡點的時間戳不會透過公開的 GPS API 提供,也不會按時間排序。不過,其他使用者仍可以從公開的軌跡清單下載原始軌跡與任何其中包含的時間戳。 - 私有代表了軌跡不會顯示在任何公開的清單中,但其軌跡點仍可透過公開的 GPS API 取得,但沒有時間戳,也不會按時間順序排列。 - 可識別代表軌跡將會在您的 GPS 軌跡與公開 GPS 軌跡清單中顯示,亦即其他使用者將可以下載原始軌跡並將其與您的使用者名稱相關聯。透過軌跡點 API 提供的資料將會參考您的原始軌跡頁面。軌跡點的時間戳可透過公開的 GPS API 取得。 - 可追蹤代表軌跡不會顯示在任何公開的清單中,但其追蹤點仍可以透過帶有時間戳的公開 GPS API 使用。其他使用者將只能從您的軌跡中下載處理過的追蹤點,但這些追蹤點無法直接與與您相關聯。 + 「公開」代表軌跡將會公開顯示在您的 GPS 軌跡與公開的 GPS 軌跡清單中,且在公開軌跡清單中會以帶有原始形式的時間戳顯示。透過 API 取得的資料不會引用您的軌跡頁面。軌跡點的時間戳不會透過公開的 GPS API 提供,也不會按時間排序。 + 「私有」代表軌跡不會顯示在任何公開的清單中,但其軌跡點仍可透過公開的 GPS API 取得,但沒有時間戳,也不會按時間順序排列。 + 「可識別」代表軌跡將會在您的 GPS 軌跡與公開 GPS 軌跡清單中顯示,亦即其他使用者將可以下載原始軌跡並將其與您的使用者名稱相關聯。透過追蹤點 API 提供的 GPS API 中帶有公開時間戳的追蹤點資料將會引用您的原始追蹤頁面。 + 「可追蹤」代表軌跡不會在任何公開的清單中顯示,但帶有時間戳(這並不會與您直接相關聯)的已處理追蹤點可從公開的 GPS API 下載。 關閉 OSM 註記 評論 OSM 註記 您可以使用安全的 OAuth 方式或是使用您的帳號與密碼來登入。 @@ -3973,4 +3973,7 @@ 照片由開放資料專案 OpenPlaceReviews.org 提供。為了上傳您的照片,您必須在網站上註冊。 建立新帳號 我已經有帳號了 + 搜尋歷史紀錄 + 皮艇 + 快艇 \ No newline at end of file From 5c25b22e57cbdc3c9698a359725e2f70a7699031 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Tue, 17 Nov 2020 02:00:53 +0000 Subject: [PATCH 38/70] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3830 of 3830 strings) --- OsmAnd/res/values-zh-rTW/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 8244b4067d..f298b282cf 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -1579,7 +1579,7 @@ 玩具 冰淇淋 SIM 卡 - 分公司 + 分公司/分店 戰爭紀念碑 牌匾 雕像 From 5655b30d7c5be527e04cd19d78118f5da3a1b2e3 Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 17 Nov 2020 19:37:18 +0000 Subject: [PATCH 39/70] Translated using Weblate (Russian) Currently translated at 100.0% (3830 of 3830 strings) --- OsmAnd/res/values-ru/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index c75c0ac4ef..de96911a16 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3836,4 +3836,6 @@ Навесы Точка GPX Радиолокационная вышка + Придорожная стоянка + На крыше \ No newline at end of file From 02784da0e5a955f4afaf7691642344c6393660e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Wed, 18 Nov 2020 10:43:15 +0000 Subject: [PATCH 40/70] Translated using Weblate (Icelandic) Currently translated at 100.0% (271 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/is/ --- OsmAnd-telegram/res/values-is/strings.xml | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/OsmAnd-telegram/res/values-is/strings.xml b/OsmAnd-telegram/res/values-is/strings.xml index 6fa1ae4614..a915a2e4f4 100644 --- a/OsmAnd-telegram/res/values-is/strings.xml +++ b/OsmAnd-telegram/res/values-is/strings.xml @@ -43,8 +43,8 @@ Kílómetrar/metrar Síðasta uppfærsla frá Telegram: Fyrir %1$s síðan Vöktun er óvirk - Staða OsmAnd-rekjara - OsmAnd-rekjari + Staða OsmAnd-rakningar + OsmAnd-rakning Hópur mín/ml Netþjónn @@ -211,12 +211,12 @@ Ekki fundist ennþá Móttók GPX-punkta: %1$s Deili staðsetningu - Hvernig á að slökkva á OsmAnd-rekjaranum úr Telegram + Hvernig á að slökkva á OsmAnd-rakningu úr Telegram Ekki sent ennþá OsmAnd nettengdur GPS-rekjari - Skrá út úr OsmAnd-rekjara\? + Skrá út úr OsmAnd-rakningu\? Kveikt er á deilingu (slökkva) - Hvernig á að slökkva á OsmAnd-rekjaranum úr Telegram + Hvernig á að slökkva á OsmAnd-rakningu úr Telegram Virkjaðu \"Staðsetning\" í stillingunum stýrikerfisins Tengiliðir og hópar sem deila staðsetningu til þín. Tengstu við internetið til að geta skráð þig til fulls út úr Telegram. @@ -234,10 +234,10 @@ Veldu hvaða útgáfu OsmAnd þú vilt nota Gera alla deilingu óvirka Uppfærðu OsmAnd til að skoða gögn á kortinu - Veldu tímabelti til birtingar í staðsetningarskilaboðum þínum + Veldu tímabelti til birtingar í staðsetningarskilaboðum þínum. Veldu eina af staðsetningarþjónustunum til að deila staðsetningu þinni. Stilla tímabil þar sem allir eru sýnilegir - Veldu þá útgáfu OsmAnd sem OsmAnd-rekjarinn notar til að birta staðsetningar. + Veldu þá útgáfu OsmAnd sem OsmAnd-rakningin notar til að birta staðsetningar. Endilega settu upp Telegram og skráðu notandaaðgang. Settu inn Telegram-símanúmerið þitt á alþjóðlegu sniði Virkja vöktun til að vista allar staðsetningar í aðgerðaferli. @@ -260,4 +260,15 @@ Síðasta uppfærða staðsetning: Veldu nafn sem þú hefur ekki þegar notað Ekki mögulegt að senda á Telegram-spjöll: + Til að afturkalla heimildir til deilingar á staðsetningu, opnaðu Telegram, farðu í Stillingar → Gagnaleynd og öryggi → Setur, og bittu enda á setu OsmAnd-rakningar. + Þú getur útbúið og skoðað auðkenningu tækis (device ID) í Telegram-biðlaraforritinu með því að nota %1$s spjallvélmennið. %2$s + Ertu viss að þú viljir skrá þig út úr OsmAnd-rakningu þannig að þú getir ekki lengur deilt þinni staðsetningu eða séð staðsetningu annarra\? + Slokktu á bestun rafhlöðunýtingar fyrir OsmAnd-rakningu svo ekki slökkni á henni þegar forritið fer í bakgrunnsham (t.d. slökkt er á skjá). + OsmAnd-rakning er eitt af biðlaraforritunum sem nota opna Telegram-kerfið. Tengiliðirnir þínir geta notað eitthvað annað Telegram-biðlaraforrit. + OsmAnd-rakning gerir þér kleift að deila staðsetningu þinni og að sjá aðra í OsmAnd.

Forritið notar Telegram API-forritsviðmótið, þannig að þú verður að vera með Telegram-aðgang.
+ Ef þú ætlar að tengja mörg tæki við einn Telegram-notandaaðgang, þarftu að nota annað tæki til að deila staðsetningunni þinni. + Rauntíma + Breyta bestunarstillingum rafhlöðu til að auka stöðugleika í deilingu staðsetningar. + Veldu tímann sem valdir tengiliðir og hópar munu sjá staðsetningu þína í rauntíma. + Rauntíma núna \ No newline at end of file From ce498d7e04f958b9faefebf1d4e5fc6cdb81f515 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Thu, 19 Nov 2020 13:30:52 +0200 Subject: [PATCH 41/70] don't show duplicates fragment for history search items --- .../plus/settings/backend/backup/CollectionSettingsItem.java | 4 ++++ .../settings/backend/backup/SearchHistorySettingsItem.java | 5 +++++ .../osmand/plus/settings/backend/backup/SettingsHelper.java | 5 +++-- .../plus/settings/fragments/ImportDuplicatesFragment.java | 4 ---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/CollectionSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/CollectionSettingsItem.java index dea9d51bc8..7140c7826b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/CollectionSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/CollectionSettingsItem.java @@ -68,6 +68,10 @@ public abstract class CollectionSettingsItem extends SettingsItem { return res; } + public boolean shouldShowDuplicates() { + return true; + } + public abstract boolean isDuplicate(@NonNull T item); @NonNull diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SearchHistorySettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SearchHistorySettingsItem.java index a4af84f7ca..70e5db4ba5 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SearchHistorySettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SearchHistorySettingsItem.java @@ -143,6 +143,11 @@ public class SearchHistorySettingsItem extends CollectionSettingsItem) { - List duplicates = ((CollectionSettingsItem) item).processDuplicateItems(); - if (!duplicates.isEmpty()) { + CollectionSettingsItem settingsItem = (CollectionSettingsItem) item; + List duplicates = settingsItem.processDuplicateItems(); + if (!duplicates.isEmpty() && settingsItem.shouldShowDuplicates()) { duplicateItems.addAll(duplicates); } } else if (item instanceof FileSettingsItem) { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java index 6d5b74cef7..31255aac46 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java @@ -321,10 +321,6 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment { duplicates.add(getString(R.string.markers_history)); duplicates.addAll(markersHistoryGroups); } - if (!historyEntries.isEmpty()) { - duplicates.add(getString(R.string.shared_string_search_history)); - duplicates.addAll(historyEntries); - } return duplicates; } From f5c5ab03b436aaa0745775d63d17be8d152f3e3c Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Thu, 19 Nov 2020 12:14:20 +0000 Subject: [PATCH 42/70] Translated using Weblate (Hebrew) Currently translated at 99.9% (3558 of 3561 strings) --- OsmAnd/res/values-iw/strings.xml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 5e3f1a1567..b2dcee50ed 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -3930,7 +3930,7 @@ יש להיכנס עם OAuth כדי להשתמש ביכולות של osmedit להיכנס דרך OAuth למחוק את אסימון ה־OAuth של OpenStreetMap - היציאה הצליחה + יצאת הקובץ כבר ייובא אל OsmAnd להשתמש באלגוריתם חישוב מסלול דו־שלבי A*‎ לנהיגה ברכבי שלג עם דרכים ומסלולים יעודיים. @@ -3952,18 +3952,18 @@ MGRS MGRS עליך להוסיף שתי נקודות לפחות - כניסה ל־OpenStreetMap - כניסה ל־OpenStreetMap.org + כניסה עבור OpenStreetMap + כניסה עבור OpenStreetMap.org כניסה עם OpenStreetMap - להשתמש בשם כניסה וססמה + להיכנס עם שם משתמש וססמה חשבון - כניסה + שם משתמש ניהול מינוי תוקף המינוי ל־OsmAnd Live פג המינוי ל־OsmAnd Live הושהה - עליך להיכנס כדי להעלות דברים חדשים או כאלו ששינית. + עליך להיכנס כדי להעלות שינויים חדשים או כאלו שנערכו. \n -\nניתן להיכנס בשיטת OAuth המאובטחת או להשתמש בשם הכניסה והססמה שלך. +\nאו עם OAuth או באמצעות שם המשתמש והססמה שלך. יש בעיה עם המינוי שלך. יש ללחוץ על הכפתור כדי לגשת להגדרות המינוי של Google Play ולתקן את שיטת התשלום שלך. המינוי ל־OsmAnd Live מוחזק היסטוריית סמנים @@ -3972,15 +3972,21 @@ „ניתן למעקב” משמעו שהמסלול לא מופיע ברישומים ציבוריים אך נקודות המעקב שעובדו עם חותמות זמן ממנו (שלא ניתן לשייך אליך ישירות) תהיינה דרך ההורדות מה־API הציבורי של ה־GPS. סגירת הערת OSM להגיב על הערת OSM - ניתן להיכנס באמצעות שיטת האימות המאובטחת OAuth או להיכנס עם שם הכניסה והססמה שלך. + ניתן להיכנס באמצעות שיטת האימות המאובטחת OAuth או להיכנס עם שם המשתמש והססמה שלך. הוספת תמונה יש להירשם בכתובת \nOpenPlaceReviews.org - תמונות מסופקות על ידי מיזם הנתונים הפתוחים OpenPlaceReviews.org. כדי להעלות את התמונות שלך עליך להירשם לאתר. + יש להיכנס לאתר מיזם הנתונים הפתוחים OpenPlaceReviews.org כדי להעלות אף יותר תמונות. יצירת חשבון חדש כבר יש לי חשבון היסטוריית חיפוש קיאק סירת מנוע מגדהי + משאבים + גודל קובץ משוערך + נא לבחור את הנתונים שייוצאו לקובץ. + נדרש לייבוא + במכשיר שלך יש רק %1$s פנויים. נא לפנות מקום או לבטל כמה מהפריטים לייצוא. + אין מספיק מקום \ No newline at end of file From 8848da646675039b4bc47a59b9e9a62ade564adf Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 19 Nov 2020 16:00:12 +0200 Subject: [PATCH 43/70] Fix "register on" fragment, add "add photos" bottom sheet --- OsmAnd/res/layout/fragment_opr_login.xml | 53 +++++------- OsmAnd/res/layout/opr_add_photo.xml | 40 +++++++++ OsmAnd/res/values/strings.xml | 3 + .../plus/mapcontextmenu/MenuBuilder.java | 6 +- .../AddPhotosBottomSheetDialogFragment.java | 85 +++++++++++++++++++ .../openplacereviews/OprStartFragment.java | 37 +++++--- 6 files changed, 181 insertions(+), 43 deletions(-) create mode 100644 OsmAnd/res/layout/opr_add_photo.xml create mode 100644 OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java diff --git a/OsmAnd/res/layout/fragment_opr_login.xml b/OsmAnd/res/layout/fragment_opr_login.xml index 3313679aec..59c31069b9 100644 --- a/OsmAnd/res/layout/fragment_opr_login.xml +++ b/OsmAnd/res/layout/fragment_opr_login.xml @@ -1,15 +1,16 @@ - + android:layout_height="match_parent" + android:focusable="true"> + app:srcCompat="@drawable/ic_img_logo_openplacereview" /> - + android:gravity="center_horizontal" /> + android:text="@string/register_on_openplacereviews_desc" /> - + android:layout_height="@dimen/dialog_button_height" + android:layout_marginBottom="@dimen/content_padding_small" /> - + android:layout_height="@dimen/dialog_button_height" /> diff --git a/OsmAnd/res/layout/opr_add_photo.xml b/OsmAnd/res/layout/opr_add_photo.xml new file mode 100644 index 0000000000..827fda4a16 --- /dev/null +++ b/OsmAnd/res/layout/opr_add_photo.xml @@ -0,0 +1,40 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index bde6a98173..8fa1c6ab03 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -17,6 +17,9 @@ Select the data to be exported to the file. Approximate file size Resources + OsmAnd shows photos from several sources:\nOpenPlaceReviews - POI photos;\nMapillary - street-level imagery;\nWeb / Wikimedia - POI photos specified in OpenStreetMap data. + Add to OpenPlaceReviews + Add to Mapillary Motorboat Kayak Search history diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 1aa35b8589..35db3c821e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -46,7 +46,7 @@ import net.osmand.plus.mapcontextmenu.builders.cards.ImageCard; import net.osmand.plus.mapcontextmenu.builders.cards.ImageCard.GetImageCardsTask; import net.osmand.plus.mapcontextmenu.builders.cards.NoImagesCard; import net.osmand.plus.mapcontextmenu.controllers.TransportStopController; -import net.osmand.plus.openplacereviews.OprStartFragment; +import net.osmand.plus.openplacereviews.AddPhotosBottomSheetDialogFragment; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.render.RenderingIcons; import net.osmand.plus.transport.TransportStopRoute; @@ -316,7 +316,7 @@ public class MenuBuilder { b.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { - OprStartFragment.showInstance(mapActivity.getSupportFragmentManager()); + AddPhotosBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager()); } }); b.setTypeface(FontCache.getRobotoRegular(context)); @@ -337,7 +337,7 @@ public class MenuBuilder { b.setText(context.getResources().getString(R.string.shared_string_add_photo)); b.setBackgroundResource(R.drawable.btn_border_light); //TODO This feature is under development - b.setVisibility(View.GONE); + b.setVisibility(View.VISIBLE); b.setTextColor(ContextCompat.getColor(context, R.color.preference_category_title)); return b; } diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java new file mode 100644 index 0000000000..4a55e9b425 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java @@ -0,0 +1,85 @@ +package net.osmand.plus.openplacereviews; + +import android.app.Activity; +import android.os.Bundle; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; + +import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; +import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.base.MenuBottomSheetDialogFragment; +import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemButton; +import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; +import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem; +import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem; + +public class AddPhotosBottomSheetDialogFragment extends MenuBottomSheetDialogFragment { + + public static final String TAG = AddPhotosBottomSheetDialogFragment.class.getSimpleName(); + + @Override + public void createMenuItems(Bundle savedInstanceState) { + + View mainView = View.inflate(UiUtilities.getThemedContext(getMyApplication(), nightMode), + R.layout.opr_add_photo, null); + items.add(new SimpleBottomSheetItem.Builder() + .setCustomView(mainView) + .create()); + + DividerItem divider = new DividerItem(getContext()); + int contextPadding = getResources().getDimensionPixelSize(R.dimen.content_padding); + int contextPaddingSmall = getResources().getDimensionPixelSize(R.dimen.content_padding_small); + divider.setMargins(contextPadding, contextPadding, contextPadding, contextPaddingSmall); + items.add(divider); + + items.add(new BottomSheetItemButton.Builder() + .setTitle(getString(R.string.add_to_opr)) + .setLayoutId(R.layout.bottom_sheet_button) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + FragmentActivity activity = getActivity(); + if (activity != null) { + OprStartFragment.showInstance(activity.getSupportFragmentManager()); + } + dismiss(); + } + }) + .create()); + + items.add(new DividerSpaceItem(getContext(), contextPaddingSmall)); + + items.add(new BottomSheetItemButton.Builder() + .setButtonType(UiUtilities.DialogButtonType.SECONDARY) + .setTitle(getString(R.string.add_to_mapillary)) + .setLayoutId(R.layout.bottom_sheet_button) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Activity activity = getActivity(); + if (activity instanceof MapActivity) { + } + dismiss(); + } + }) + .create()); + + items.add(new DividerSpaceItem(getContext(), contextPaddingSmall)); + } + + @Override + protected int getDismissButtonTextId() { + return R.string.shared_string_cancel; + } + + public static void showInstance(@NonNull FragmentManager fragmentManager) { + if (!fragmentManager.isStateSaved()) { + AddPhotosBottomSheetDialogFragment fragment = new AddPhotosBottomSheetDialogFragment(); + fragment.show(fragmentManager, TAG); + } + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java index eecd0c3f32..19a4ba57be 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java @@ -1,6 +1,7 @@ package net.osmand.plus.openplacereviews; import android.content.Intent; +import android.graphics.Typeface; import android.os.Bundle; import android.text.SpannableString; import android.text.Spanned; @@ -11,23 +12,41 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; + import net.osmand.PlatformUtil; import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; import net.osmand.plus.base.BaseOsmAndFragment; + import org.apache.commons.logging.Log; public class OprStartFragment extends BaseOsmAndFragment { - private static final String TAG = "fragment_oprstart"; + private static final String TAG = OprStartFragment.class.getSimpleName(); private static final Log LOG = PlatformUtil.getLog(OprStartFragment.class); private static final String openPlaceReviewsUrl = "OpenPlaceReviews.org"; @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + boolean nightMode = getMyApplication().getDaynightHelper().isNightModeForMapControls(); View v = inflater.inflate(R.layout.fragment_opr_login, container, false); - v.findViewById(R.id.register_opr_create_account).setOnClickListener(new View.OnClickListener() { + View createAccount = v.findViewById(R.id.register_opr_create_account); + v.findViewById(R.id.back_button).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + FragmentActivity activity = getActivity(); + if (activity != null) { + activity.getSupportFragmentManager().popBackStack(); + } + } + }); + UiUtilities.setupDialogButton(nightMode, createAccount, UiUtilities.DialogButtonType.PRIMARY, + R.string.register_opr_create_new_account); + createAccount.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(requireContext(), OPRWebviewActivity.class); @@ -36,13 +55,10 @@ public class OprStartFragment extends BaseOsmAndFragment { startActivity(i); } }); - v.findViewById(R.id.back_button).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - getActivity().getSupportFragmentManager().popBackStack(); - } - }); - v.findViewById(R.id.register_opr_have_account).setOnClickListener(new View.OnClickListener() { + View haveAccount = v.findViewById(R.id.register_opr_have_account); + UiUtilities.setupDialogButton(nightMode, haveAccount, UiUtilities.DialogButtonType.SECONDARY, + R.string.register_opr_have_account); + haveAccount.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(requireContext(), OPRWebviewActivity.class); @@ -71,9 +87,10 @@ public class OprStartFragment extends BaseOsmAndFragment { } @Override - public void updateDrawState(TextPaint ds) { + public void updateDrawState(@NonNull TextPaint ds) { super.updateDrawState(ds); ds.setUnderlineText(false); + ds.setTypeface(Typeface.DEFAULT_BOLD); } } From 283673b6cf23a7105f2ae8031bf9fc80aebb0fb5 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2020 15:33:18 +0100 Subject: [PATCH 44/70] Format imports --- .../src/main/java/net/osmand/data/Amenity.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java index b0fe44ecfb..5b0079f03e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java @@ -1,16 +1,5 @@ package net.osmand.data; -import net.osmand.Location; -import net.osmand.osm.MapPoiTypes; -import net.osmand.osm.PoiCategory; -import net.osmand.util.Algorithms; - -import org.json.JSONObject; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -21,9 +10,14 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.TreeSet; -import java.util.zip.GZIPInputStream; + +import org.json.JSONObject; import gnu.trove.list.array.TIntArrayList; +import net.osmand.Location; +import net.osmand.osm.MapPoiTypes; +import net.osmand.osm.PoiCategory; +import net.osmand.util.Algorithms; public class Amenity extends MapObject { From bcea2e4e0eb969563baf43f3e13d29ffa487f2d3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2020 15:43:49 +0100 Subject: [PATCH 45/70] Add method for keys --- OsmAnd-java/src/main/java/net/osmand/data/Amenity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java index 5b0079f03e..13749ce706 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java @@ -1,6 +1,7 @@ package net.osmand.data; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -96,6 +97,13 @@ public class Amenity extends MapObject { } return additionalInfo; } + + public Collection getAdditionalInfoKeys() { + if (additionalInfo == null) { + return Collections.emptyList(); + } + return additionalInfo.keySet(); + } public void setAdditionalInfo(Map additionalInfo) { this.additionalInfo = null; From 3fc2dd89b9221ad15b664e3730bd3e0f8271f751 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2020 15:58:31 +0100 Subject: [PATCH 46/70] Refactor & hide internal method about additional info --- .../binary/BinaryMapPoiReaderAdapter.java | 12 ++---- .../main/java/net/osmand/data/Amenity.java | 37 +++++++++++++++++-- .../main/java/net/osmand/data/MapObject.java | 9 +++-- .../java/net/osmand/search/SearchUICore.java | 2 +- .../osmand/search/core/SearchCoreFactory.java | 4 +- 5 files changed, 46 insertions(+), 18 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java index 857eb4f4d3..cb348cf9b4 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -11,8 +11,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.LinkedList; import java.util.List; -import java.util.Map; -import java.util.Map.Entry; import net.osmand.Collator; import net.osmand.CollatorStringMatcher; @@ -576,13 +574,12 @@ public class BinaryMapPoiReaderAdapter { } } if (!matches) { - Map lt = am.getAdditionalInfo(); - for (Entry e : lt.entrySet()) { - if(!e.getKey().contains("_name") && - !e.getKey().equals("brand")) { + for (String key : am.getAdditionalInfoKeys()) { + if(!key.contains("_name") && + !key.equals("brand")) { continue; } - matches = matcher.matches(e.getValue()); + matches = matcher.matches(am.getAdditionalInfo(key)); if (matches) { break; } @@ -812,7 +809,6 @@ public class BinaryMapPoiReaderAdapter { } private boolean checkCategories(SearchRequest req, PoiRegion region) throws IOException { - StringBuilder subType = new StringBuilder(); while (true) { int t = codedIS.readTag(); int tag = WireFormat.getTagFieldNumber(t); diff --git a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java index 13749ce706..4af1596c2c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java @@ -91,13 +91,40 @@ public class Amenity extends MapObject { } - public Map getAdditionalInfo() { + // this method should be used carefully + public Map getInternalAdditionalInfoMap() { if (additionalInfo == null) { return Collections.emptyMap(); } return additionalInfo; } + public Collection getAdditionalInfoValues(boolean excludeZipped) { + if (additionalInfo == null) { + return Collections.emptyList(); + } + boolean zipped = false; + for(String v : additionalInfo.values()) { + if(isContentZipped(v)) { + zipped = true; + break; + } + } + if(zipped) { + List r = new ArrayList<>(additionalInfo.size()); + for(String str : additionalInfo.values()) { + if(excludeZipped && isContentZipped(str)) { + + } else { + r.add(unzipContent(str)); + } + } + return r; + } else { + return additionalInfo.values(); + } + } + public Collection getAdditionalInfoKeys() { if (additionalInfo == null) { return Collections.emptyList(); @@ -184,7 +211,7 @@ public class Amenity extends MapObject { } int maxLen = 0; String lng = defLang; - for (String nm : getAdditionalInfo().keySet()) { + for (String nm : getAdditionalInfoKeys()) { if (nm.startsWith(tag + ":")) { String key = nm.substring(tag.length() + 1); String cnt = getAdditionalInfo(tag + ":" + key); @@ -206,7 +233,7 @@ public class Amenity extends MapObject { public List getNames(String tag, String defTag) { List l = new ArrayList(); - for (String nm : getAdditionalInfo().keySet()) { + for (String nm : getAdditionalInfoKeys()) { if (nm.startsWith(tag + ":")) { l.add(nm.substring(tag.length() + 1)); } else if (nm.equals(tag)) { @@ -231,7 +258,7 @@ public class Amenity extends MapObject { if (!Algorithms.isEmpty(enName)) { return enName; } - for (String nm : getAdditionalInfo().keySet()) { + for (String nm : getAdditionalInfoKeys()) { if (nm.startsWith(tag + ":")) { return getAdditionalInfo(nm); } @@ -347,4 +374,6 @@ public class Amenity extends MapObject { } return a; } + + } 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 cb121cedfc..f9f9187223 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java @@ -13,7 +13,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -351,8 +350,8 @@ public abstract class MapObject implements Comparable { return json; } - public String unzipContent(String str) { - if (str != null && str.startsWith(" gz ")) { + String unzipContent(String str) { + if (isContentZipped(str)) { try { int ind = 4; byte[] bytes = new byte[str.length() - ind]; @@ -376,6 +375,10 @@ public abstract class MapObject implements Comparable { return str; } + boolean isContentZipped(String str) { + return str != null && str.startsWith(" gz "); + } + protected static void parseJSON(JSONObject json, MapObject o) { if (json.has("name")) { o.name = json.getString("name"); diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index becacd2775..e63870b1a7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -741,7 +741,7 @@ public class SearchUICore { } } if (Algorithms.isEmpty(object.alternateName) && object.object instanceof Amenity) { - for (String value : ((Amenity) object.object).getAdditionalInfo().values()) { + for (String value : ((Amenity) object.object).getAdditionalInfoValues(true)) { if (phrase.getFirstUnknownNameStringMatcher().matches(value)) { object.alternateName = value; break; diff --git a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java index e5c791a780..c221d2ca77 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/core/SearchCoreFactory.java @@ -602,7 +602,7 @@ public class SearchCoreFactory { sr.localeName = object.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); if (!nm.matches(sr.localeName) && !nm.matches(sr.otherNames) - && !nm.matches(object.getAdditionalInfo().values())) { + && !nm.matches(object.getAdditionalInfoValues(false))) { return false; } sr.object = object; @@ -1059,7 +1059,7 @@ public class SearchCoreFactory { if (!poiAdditionals.isEmpty()) { boolean found = false; for (String add : poiAdditionals) { - if(object.getAdditionalInfo().containsKey(add)) { + if (object.getAdditionalInfoKeys().contains(add)) { found = true; break; } From 9fa21ef01c305364e507996cf681dacf4c136da7 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 19 Nov 2020 17:12:34 +0200 Subject: [PATCH 47/70] Fix compilation --- .../src/net/osmand/plus/OsmAndFormatter.java | 37 +++++++++---------- .../builders/AmenityMenuBuilder.java | 22 +++++------ .../controllers/AmenityMenuController.java | 21 ++++------- .../plus/osmedit/OpenstreetmapLocalUtil.java | 9 ++--- 4 files changed, 37 insertions(+), 52 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java index f9d3315bf5..92bcdef9a6 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java @@ -14,11 +14,11 @@ import net.osmand.osm.AbstractPoiType; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiType; -import net.osmand.plus.settings.backend.ApplicationMode; -import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.helpers.enums.AngularConstants; import net.osmand.plus.helpers.enums.MetricsConstants; import net.osmand.plus.helpers.enums.SpeedConstants; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.util.Algorithms; import java.text.DateFormatSymbols; @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Locale; -import java.util.Map.Entry; import static net.osmand.data.PointDescription.getLocationOlcName; @@ -417,7 +416,7 @@ public class OsmAndFormatter { String typeName = amenity.getSubType(); if (pt != null) { typeName = pt.getTranslation(); - } else if(typeName != null){ + } else if (typeName != null) { typeName = Algorithms.capitalizeFirstLetterAndLowercase(typeName.replace('_', ' ')); } List res = new ArrayList<>(); @@ -426,7 +425,7 @@ public class OsmAndFormatter { for (String name : amenity.getAllNames(true)) { addPoiString(typeName, name, res); } - for (String name : amenity.getAdditionalInfo().values()) { + for (String name : amenity.getAdditionalInfoValues(false)) { addPoiString(typeName, name, res); } return res; @@ -444,36 +443,34 @@ public class OsmAndFormatter { public static String getAmenityDescriptionContent(OsmandApplication ctx, Amenity amenity, boolean shortDescription) { StringBuilder d = new StringBuilder(); - if(amenity.getType().isWiki()) { + if (amenity.getType().isWiki()) { return ""; } MapPoiTypes poiTypes = ctx.getPoiTypes(); - for(Entry e : amenity.getAdditionalInfo().entrySet()) { - String key = e.getKey(); - String vl = e.getValue(); - if(key.startsWith("name:")) { + for (String key : amenity.getAdditionalInfoKeys()) { + String vl = amenity.getAdditionalInfo(key); + if (key.startsWith("name:")) { continue; - } else if(vl.length() >= 150) { - if(shortDescription) { + } else if (vl.length() >= 150) { + if (shortDescription) { continue; } - } else if(Amenity.OPENING_HOURS.equals(key)) { + } else if (Amenity.OPENING_HOURS.equals(key)) { d.append(ctx.getString(R.string.opening_hours) + ": "); - } else if(Amenity.PHONE.equals(key)) { + } else if (Amenity.PHONE.equals(key)) { d.append(ctx.getString(R.string.phone) + ": "); - } else if(Amenity.WEBSITE.equals(key)) { + } else if (Amenity.WEBSITE.equals(key)) { d.append(ctx.getString(R.string.website) + ": "); } else { - AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(e.getKey()); + AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(key); if (pt != null) { - if(pt instanceof PoiType && !((PoiType) pt).isText()) { + if (pt instanceof PoiType && !((PoiType) pt).isText()) { vl = pt.getTranslation(); } else { - vl = pt.getTranslation() + ": " + amenity.unzipContent(e.getValue()); + vl = pt.getTranslation() + ": " + vl; } } else { - vl = Algorithms.capitalizeFirstLetterAndLowercase(e.getKey()) + - ": " + amenity.unzipContent(e.getValue()); + vl = Algorithms.capitalizeFirstLetterAndLowercase(key) + ": " + vl; } } d.append(vl).append('\n'); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index f0d33b68dd..29fb2e578d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -32,11 +32,11 @@ import net.osmand.plus.R; import net.osmand.plus.Version; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.FontCache; +import net.osmand.plus.helpers.enums.MetricsConstants; import net.osmand.plus.mapcontextmenu.CollapsableView; import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.poi.PoiUIFilter; -import net.osmand.plus.helpers.enums.MetricsConstants; import net.osmand.plus.views.layers.POIMapLayer; import net.osmand.plus.widgets.TextViewEx; import net.osmand.plus.widgets.tools.ClickableSpanTouchListener; @@ -344,12 +344,11 @@ public class AmenityMenuBuilder extends MenuBuilder { boolean osmEditingEnabled = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null; - for (Map.Entry e : amenity.getAdditionalInfo().entrySet()) { + for (String key : amenity.getAdditionalInfoKeys()) { int iconId = 0; Drawable icon = null; int textColor = 0; - String key = e.getKey(); - String vl = e.getValue(); + String vl = amenity.getAdditionalInfo(key); if (key.equals("image") || key.equals("mapillary") @@ -460,7 +459,7 @@ public class AmenityMenuBuilder extends MenuBuilder { isCuisine = true; iconId = R.drawable.ic_action_cuisine; StringBuilder sb = new StringBuilder(); - for (String c : e.getValue().split(";")) { + for (String c : vl.split(";")) { if (sb.length() > 0) { sb.append(", "); sb.append(poiTypes.getPoiTranslation("cuisine_" + c).toLowerCase()); @@ -502,7 +501,6 @@ public class AmenityMenuBuilder extends MenuBuilder { isText = true; isDescription = iconId == R.drawable.ic_action_note_dark; textPrefix = pType.getTranslation(); - vl = amenity.unzipContent(e.getValue()); if (needIntFormatting) { vl = getFormattedInt(vl); } @@ -519,8 +517,7 @@ public class AmenityMenuBuilder extends MenuBuilder { } else if (poiType != null) { collectedPoiTypes.add(poiType); } else { - textPrefix = Algorithms.capitalizeFirstLetterAndLowercase(e.getKey()); - vl = amenity.unzipContent(e.getValue()); + textPrefix = Algorithms.capitalizeFirstLetterAndLowercase(key); } } @@ -782,11 +779,10 @@ public class AmenityMenuBuilder extends MenuBuilder { @Override protected Map getAdditionalCardParams() { Map params = new HashMap<>(); - Map additionalInfo = amenity.getAdditionalInfo(); - String imageValue = additionalInfo.get("image"); - String mapillaryValue = additionalInfo.get("mapillary"); - String wikidataValue = additionalInfo.get(Amenity.WIKIDATA); - String wikimediaValue = additionalInfo.get(Amenity.WIKIMEDIA_COMMONS); + String imageValue = amenity.getAdditionalInfo("image"); + String mapillaryValue = amenity.getAdditionalInfo("mapillary"); + String wikidataValue = amenity.getAdditionalInfo(Amenity.WIKIDATA); + String wikimediaValue = amenity.getAdditionalInfo(Amenity.WIKIMEDIA_COMMONS); if (!Algorithms.isEmpty(imageValue)) { params.put("osm_image", imageValue); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index aa65a39e90..11564a1b73 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -12,13 +12,13 @@ import net.osmand.data.TransportStop; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiFilter; import net.osmand.osm.PoiType; -import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.builders.AmenityMenuBuilder; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.render.RenderingIcons; import net.osmand.plus.transport.TransportStopRoute; import net.osmand.plus.wikipedia.WikipediaDialogFragment; @@ -26,7 +26,6 @@ import net.osmand.util.Algorithms; import net.osmand.util.OpeningHoursParser; import java.util.List; -import java.util.Map; public class AmenityMenuController extends MenuController { @@ -160,12 +159,9 @@ public class AmenityMenuController extends MenuController { String preferredLang = OsmandPlugin.onGetMapObjectPreferredLang(amenity, getPreferredMapAppLang(), getPreferredMapLang()); String name = amenity.getName(preferredLang, isTransliterateNames()); - Map additionalInfo = amenity.getAdditionalInfo(); - if (additionalInfo != null) { - String ref = additionalInfo.get("ref"); - if (!TextUtils.isEmpty(ref) && !ref.equals(name)) { - return name + " (" + ref + ")"; - } + String ref = amenity.getAdditionalInfo("ref"); + if (!TextUtils.isEmpty(ref) && !ref.equals(name)) { + return name + " (" + ref + ")"; } if (Algorithms.isEmpty(name) && amenity.getSubType().equalsIgnoreCase("atm")) { String operator = amenity.getAdditionalInfo("operator"); @@ -247,12 +243,9 @@ public class AmenityMenuController extends MenuController { @Override public Drawable getRightIcon() { - Map addTypes = amenity.getAdditionalInfo(); - if (addTypes != null) { - String region = addTypes.get("subway_region"); - if (region != null) { - return RenderingIcons.getBigIcon(getMapActivity(), "subway_" + region); - } + String region = amenity.getAdditionalInfo("subway_region"); + if (region != null) { + return RenderingIcons.getBigIcon(getMapActivity(), "subway_" + region); } return null; } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java index 26eda5f4e5..4d42026026 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapLocalUtil.java @@ -21,7 +21,6 @@ import org.apache.commons.logging.Log; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Set; import static net.osmand.osm.edit.Entity.POI_TYPE_TAG; @@ -136,12 +135,12 @@ public class OpenstreetmapLocalUtil implements OpenstreetmapUtil { if (!Algorithms.isEmpty(amenity.getOpeningHours())) { entity.putTagNoLC(OSMTagKey.OPENING_HOURS.getValue(), amenity.getOpeningHours()); } - for (Map.Entry entry : amenity.getAdditionalInfo().entrySet()) { - AbstractPoiType abstractPoi = MapPoiTypes.getDefault().getAnyPoiAdditionalTypeByKey(entry.getKey()); - if (abstractPoi != null && abstractPoi instanceof PoiType) { + for (String key : amenity.getAdditionalInfoKeys()) { + AbstractPoiType abstractPoi = MapPoiTypes.getDefault().getAnyPoiAdditionalTypeByKey(key); + if (abstractPoi instanceof PoiType) { PoiType p = (PoiType) abstractPoi; if (!p.isNotEditableOsm() && !Algorithms.isEmpty(p.getEditOsmTag())) { - entity.putTagNoLC(p.getEditOsmTag(), entry.getValue()); + entity.putTagNoLC(p.getEditOsmTag(), amenity.getAdditionalInfo(key)); } } } From 88edf800d0fc3e28835fbbf514161dd0335315c6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2020 16:37:00 +0100 Subject: [PATCH 48/70] Refactor & hide internal method about additional info --- OsmAnd-java/src/main/java/net/osmand/data/MapObject.java | 4 ++++ 1 file changed, 4 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 f9f9187223..d3700896b2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java @@ -368,6 +368,10 @@ public abstract class MapObject implements Comparable { } br.close(); str = bld.toString(); + // ugly fix of temporary problem of map generation + if(isContentZipped(str)) { + str = unzipContent(str); + } } catch (IOException e) { e.printStackTrace(); } From 76315ec0997778098c8608c48dc3bbd8ba05023c Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 19 Nov 2020 17:51:10 +0200 Subject: [PATCH 49/70] Fix "add photos" bottom sheet --- OsmAnd/res/layout/fragment_opr_login.xml | 109 +++++++------ OsmAnd/res/layout/opr_add_photo.xml | 9 +- OsmAnd/res/values/sizes.xml | 1 + .../AddPhotosBottomSheetDialogFragment.java | 148 ++++++++++++------ 4 files changed, 172 insertions(+), 95 deletions(-) diff --git a/OsmAnd/res/layout/fragment_opr_login.xml b/OsmAnd/res/layout/fragment_opr_login.xml index 59c31069b9..5c5d4c23b5 100644 --- a/OsmAnd/res/layout/fragment_opr_login.xml +++ b/OsmAnd/res/layout/fragment_opr_login.xml @@ -1,14 +1,15 @@ - + android:background="?attr/bg_color" + android:clickable="true" + android:focusable="true" + android:orientation="vertical"> @@ -20,55 +21,71 @@ android:layout_height="match_parent" android:layout_gravity="start" android:contentDescription="@string/shared_string_back" - app:tint="@color/icon_color_default_light" - app:srcCompat="@drawable/ic_arrow_back"/> + app:srcCompat="@drawable/ic_arrow_back" + app:tint="@color/icon_color_default_light" /> - + - + + - + + + + + + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/content_padding" + android:layout_marginTop="@dimen/content_padding_small" + android:layout_marginRight="@dimen/content_padding" + android:layout_marginBottom="@dimen/content_padding_small" + android:layout_alignParentBottom="true" + android:orientation="vertical"> - \ No newline at end of file + \ No newline at end of file diff --git a/OsmAnd/res/layout/opr_add_photo.xml b/OsmAnd/res/layout/opr_add_photo.xml index 827fda4a16..80d43411fe 100644 --- a/OsmAnd/res/layout/opr_add_photo.xml +++ b/OsmAnd/res/layout/opr_add_photo.xml @@ -7,12 +7,11 @@ + osmand:srcCompat="@drawable/ic_action_photo_upload_colored" /> diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index 0cb79d23d1..64ab1cc330 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -289,6 +289,7 @@ 1.5 128dp 8dp + 28dp 236dp 68dp diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java index 4a55e9b425..dae4fcad4b 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/AddPhotosBottomSheetDialogFragment.java @@ -1,74 +1,128 @@ package net.osmand.plus.openplacereviews; -import android.app.Activity; +import android.content.Context; import android.os.Bundle; +import android.text.SpannableString; +import android.text.Spanned; import android.view.View; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; +import net.osmand.PlatformUtil; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; -import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.base.MenuBottomSheetDialogFragment; -import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemButton; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; -import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem; +import net.osmand.plus.helpers.FontCache; +import net.osmand.plus.mapillary.MapillaryPlugin; +import net.osmand.plus.widgets.style.CustomTypefaceSpan; + +import org.apache.commons.logging.Log; public class AddPhotosBottomSheetDialogFragment extends MenuBottomSheetDialogFragment { public static final String TAG = AddPhotosBottomSheetDialogFragment.class.getSimpleName(); + private static final Log LOG = PlatformUtil.getLog(AddPhotosBottomSheetDialogFragment.class); + + public static final String OPEN_PLACE_REVIEWS = "OpenPlaceReviews"; + public static final String MAPILLARY = "Mapillary"; + public static final String WEB_WIKIMEDIA = "Web / Wikimedia"; + public static final String OPEN_STREET_MAP = "OpenStreetMap"; @Override public void createMenuItems(Bundle savedInstanceState) { - View mainView = View.inflate(UiUtilities.getThemedContext(getMyApplication(), nightMode), + OsmandApplication app = getMyApplication(); + if (app == null) { + return; + } + View view = View.inflate(UiUtilities.getThemedContext(app, nightMode), R.layout.opr_add_photo, null); + setDescriptionSpan(view); items.add(new SimpleBottomSheetItem.Builder() - .setCustomView(mainView) + .setCustomView(view) .create()); + items.add(new DividerSpaceItem(app, app.getResources().getDimensionPixelSize(R.dimen.text_margin_small))); + } - DividerItem divider = new DividerItem(getContext()); - int contextPadding = getResources().getDimensionPixelSize(R.dimen.content_padding); - int contextPaddingSmall = getResources().getDimensionPixelSize(R.dimen.content_padding_small); - divider.setMargins(contextPadding, contextPadding, contextPadding, contextPaddingSmall); - items.add(divider); + private void setDescriptionSpan(View view) { + String desc = requireContext().getString(R.string.add_photos_descr); + BoldSpannableString ss = new BoldSpannableString(desc, view.getContext()); + ss.setBold(OPEN_PLACE_REVIEWS); + ss.setBold(MAPILLARY); + ss.setBold(WEB_WIKIMEDIA); + ss.setBold(OPEN_STREET_MAP); + view.findViewById(R.id.add_photos_descr).setText(ss); + } - items.add(new BottomSheetItemButton.Builder() - .setTitle(getString(R.string.add_to_opr)) - .setLayoutId(R.layout.bottom_sheet_button) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - FragmentActivity activity = getActivity(); - if (activity != null) { - OprStartFragment.showInstance(activity.getSupportFragmentManager()); - } - dismiss(); - } - }) - .create()); + static class BoldSpannableString extends SpannableString { + Context ctx; - items.add(new DividerSpaceItem(getContext(), contextPaddingSmall)); + public BoldSpannableString(CharSequence source, Context ctx) { + super(source); + this.ctx = ctx; + } - items.add(new BottomSheetItemButton.Builder() - .setButtonType(UiUtilities.DialogButtonType.SECONDARY) - .setTitle(getString(R.string.add_to_mapillary)) - .setLayoutId(R.layout.bottom_sheet_button) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Activity activity = getActivity(); - if (activity instanceof MapActivity) { - } - dismiss(); - } - }) - .create()); + public void setBold(String boldText) { + String source = toString(); + setSpan(new CustomTypefaceSpan(FontCache.getRobotoMedium(ctx)), + source.indexOf(boldText), source.indexOf(boldText) + boldText.length(), + Spanned.SPAN_INCLUSIVE_INCLUSIVE); + } + } - items.add(new DividerSpaceItem(getContext(), contextPaddingSmall)); + @Override + protected int getThirdBottomButtonTextId() { + return R.string.add_to_opr; + } + + @Override + protected DialogButtonType getThirdBottomButtonType() { + return DialogButtonType.SECONDARY; + } + + @Override + protected int getFirstDividerHeight() { + return getResources().getDimensionPixelSize(R.dimen.bottom_sheet_button_divider_height); + } + + @Override + protected void onThirdBottomButtonClick() { + FragmentActivity activity = getActivity(); + if (activity != null) { + OprStartFragment.showInstance(activity.getSupportFragmentManager()); + } + dismiss(); + } + + @Override + protected int getRightBottomButtonTextId() { + return R.string.add_to_mapillary; + } + + @Override + protected DialogButtonType getRightBottomButtonType() { + return DialogButtonType.SECONDARY; + } + + @Override + protected void onRightBottomButtonClick() { + FragmentActivity activity = getActivity(); + if (activity != null) { + MapillaryPlugin.openMapillary(activity, null); + } + dismiss(); + } + + @Override + protected int getSecondDividerHeight() { + return getResources().getDimensionPixelSize(R.dimen.content_padding_small); } @Override @@ -76,10 +130,14 @@ public class AddPhotosBottomSheetDialogFragment extends MenuBottomSheetDialogFra return R.string.shared_string_cancel; } - public static void showInstance(@NonNull FragmentManager fragmentManager) { - if (!fragmentManager.isStateSaved()) { - AddPhotosBottomSheetDialogFragment fragment = new AddPhotosBottomSheetDialogFragment(); - fragment.show(fragmentManager, TAG); + public static void showInstance(@NonNull FragmentManager fm) { + try { + if (!fm.isStateSaved()) { + AddPhotosBottomSheetDialogFragment fragment = new AddPhotosBottomSheetDialogFragment(); + fragment.show(fm, TAG); + } + } catch (RuntimeException e) { + LOG.error("showInstance", e); } } } \ No newline at end of file From 71753432b9e603154d0a47beaa790d50f2e6148e Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 18 Nov 2020 23:57:46 +0200 Subject: [PATCH 50/70] Account button on OSM Bottom Sheets Redirect to OSM Settings on acccount click --- .../net/osmand/plus/helpers/IntentHelper.java | 8 +++++++ .../plus/osmedit/OsmEditingFragment.java | 16 +++++++++++++ .../dialogs/SendGpxBottomSheetFragment.java | 24 +++++++++++++++++-- .../SendOsmNoteBottomSheetFragment.java | 19 +++++++++++++++ .../dialogs/SendPoiBottomSheetFragment.java | 20 ++++++++++++++++ 5 files changed, 85 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index a7d6dd7f79..7f3a9ca30c 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -21,6 +21,7 @@ import net.osmand.plus.activities.PluginsFragment; import net.osmand.plus.dashboard.DashboardOnMap.DashboardType; import net.osmand.plus.mapmarkers.MapMarkersDialogFragment; import net.osmand.plus.mapsource.EditMapSourceDialogFragment; +import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.search.QuickSearchDialogFragment; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.OsmandSettings; @@ -234,6 +235,13 @@ public class IntentHelper { } mapActivity.setIntent(null); } + if (intent.hasExtra(OsmEditingFragment.OPEN_PLUGIN)) { + boolean openPlugins = intent.getBooleanExtra(OsmEditingFragment.OPEN_PLUGIN, false); + if (openPlugins) { + OsmEditingFragment.showInstance(mapActivity.getSupportFragmentManager()); + } + mapActivity.setIntent(null); + } if (intent.hasExtra(BaseSettingsFragment.OPEN_CONFIG_ON_MAP)) { switch (intent.getStringExtra(BaseSettingsFragment.OPEN_CONFIG_ON_MAP)) { case BaseSettingsFragment.MAP_CONFIG: diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java index d6156bfcfb..ad066bcb39 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java @@ -37,8 +37,11 @@ import static net.osmand.plus.osmedit.OsmEditingPlugin.OSM_EDIT_TAB; public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged, ValidateOsmLoginListener, OsmAuthorizationListener { + public static final String TAG = OsmEditingFragment.class.getName(); + private static final Log log = PlatformUtil.getLog(OsmEditingFragment.class); + public static final String OPEN_PLUGIN = "open_plugins"; private static final String OSM_LOGOUT = "osm_logout"; private static final String OPEN_OSM_EDITS = "open_osm_edits"; public static final String OSM_LOGIN_DATA = "osm_login_data"; @@ -197,4 +200,17 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer public void authorizationCompleted() { updateAllSettings(); } + + public static boolean showInstance(FragmentManager fragmentManager) { + try { + OsmEditingFragment fragment = new OsmEditingFragment(); + fragmentManager.beginTransaction() + .add(R.id.fragmentContainer, fragment, TAG) + .addToBackStack(TAG) + .commitAllowingStateLoss(); + return true; + } catch (Exception e) { + return false; + } + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index 324f1f9d13..b2fd8b0da3 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -1,10 +1,13 @@ package net.osmand.plus.osmedit.dialogs; +import android.content.Context; +import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.text.Editable; import android.view.LayoutInflater; import android.view.View; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -21,12 +24,14 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities.DialogButtonType; +import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionAdapterListener; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionItem; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; +import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin.UploadVisibility; import net.osmand.plus.osmedit.UploadGPXFilesTask; @@ -95,9 +100,15 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { visibilityDescription.setText(selectedUploadVisibility.getDescriptionId()); horizontalSelectionAdapter.notifyDataSetChanged(); } - }); - + LinearLayout account = sendOsmPoiView.findViewById(R.id.account_container); + account.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dismiss(); + showOpenStreetMapScreen(); + } + }); RecyclerView iconCategoriesRecyclerView = sendOsmPoiView.findViewById(R.id.description_view); iconCategoriesRecyclerView.setAdapter(horizontalSelectionAdapter); iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false)); @@ -109,6 +120,15 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { items.add(titleItem); } + private void showOpenStreetMapScreen() { + Bundle params = new Bundle(); + params.putBoolean(OsmEditingFragment.OPEN_PLUGIN, true); + Context context = getView().getContext(); + Intent intent = getActivity().getIntent(); + MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); + getActivity().onBackPressed(); + } + @Override protected DialogButtonType getRightBottomButtonType() { return DialogButtonType.PRIMARY; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index 5046165ba7..8e8e37934c 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -1,6 +1,8 @@ package net.osmand.plus.osmedit.dialogs; import android.app.Activity; +import android.content.Context; +import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.ContextThemeWrapper; @@ -27,6 +29,7 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; +import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.osmedit.oauth.OsmOAuthAuthorizationAdapter; @@ -129,6 +132,14 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen uploadAnonymously.setPadding(paddingSmall, 0, paddingSmall, 0); } }); + LinearLayout account = accountBlockView.findViewById(R.id.account_container); + account.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dismiss(); + showOpenStreetMapScreen(); + } + }); final SimpleBottomSheetItem bottomSheetItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() .setCustomView(sendOsmNoteView) .create(); @@ -173,6 +184,14 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen } } + private void showOpenStreetMapScreen() { + Bundle params = new Bundle(); + params.putBoolean(OsmEditingFragment.OPEN_PLUGIN, true); + Context context = getView().getContext(); + Intent intent = getActivity().getIntent(); + MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); + } + @Override protected DialogButtonType getRightBottomButtonType() { return (DialogButtonType.PRIMARY); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index 748d9504f0..af4c92d4b9 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -1,11 +1,14 @@ package net.osmand.plus.osmedit.dialogs; import android.app.Activity; +import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.view.ContextThemeWrapper; import android.view.View; import android.widget.CompoundButton; import android.widget.EditText; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -22,6 +25,7 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.osmedit.OpenstreetmapPoint; +import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.util.Algorithms; @@ -84,12 +88,28 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0); } }); + LinearLayout account = sendOsmPoiView.findViewById(R.id.account_container); + account.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dismiss(); + showOpenStreetMapScreen(); + } + }); final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() .setCustomView(sendOsmPoiView) .create(); items.add(titleItem); } + private void showOpenStreetMapScreen() { + Bundle params = new Bundle(); + params.putBoolean(OsmEditingFragment.OPEN_PLUGIN, true); + Context context = getView().getContext(); + Intent intent = getActivity().getIntent(); + MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); + } + public static void showInstance(@NonNull FragmentManager fm, @NonNull OsmPoint[] points) { try { if (!fm.isStateSaved()) { From 6c3eda0faafccea3c7965ab940e640b0597e9ec9 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 19 Nov 2020 00:38:23 +0200 Subject: [PATCH 51/70] Update SendGpxBottomSheetFragment.java --- .../osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index b2fd8b0da3..9a3209fdc3 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -126,7 +126,6 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { Context context = getView().getContext(); Intent intent = getActivity().getIntent(); MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); - getActivity().onBackPressed(); } @Override From a992e4cefc990b2e25a808c40b341ebcdf86e439 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Thu, 19 Nov 2020 20:56:40 +0200 Subject: [PATCH 52/70] Go back to previous activity, refactor --- .../net/osmand/plus/helpers/IntentHelper.java | 8 ----- .../plus/myplaces/FavoritesActivity.java | 17 ++++++++-- .../plus/osmedit/OsmEditingFragment.java | 29 ++++++++-------- .../dialogs/SendGpxBottomSheetFragment.java | 33 +++++++++++++------ .../SendOsmNoteBottomSheetFragment.java | 18 ++++------ .../dialogs/SendPoiBottomSheetFragment.java | 22 +++++-------- 6 files changed, 66 insertions(+), 61 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index 7f3a9ca30c..a7d6dd7f79 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -21,7 +21,6 @@ import net.osmand.plus.activities.PluginsFragment; import net.osmand.plus.dashboard.DashboardOnMap.DashboardType; import net.osmand.plus.mapmarkers.MapMarkersDialogFragment; import net.osmand.plus.mapsource.EditMapSourceDialogFragment; -import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.search.QuickSearchDialogFragment; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.OsmandSettings; @@ -235,13 +234,6 @@ public class IntentHelper { } mapActivity.setIntent(null); } - if (intent.hasExtra(OsmEditingFragment.OPEN_PLUGIN)) { - boolean openPlugins = intent.getBooleanExtra(OsmEditingFragment.OPEN_PLUGIN, false); - if (openPlugins) { - OsmEditingFragment.showInstance(mapActivity.getSupportFragmentManager()); - } - mapActivity.setIntent(null); - } if (intent.hasExtra(BaseSettingsFragment.OPEN_CONFIG_ON_MAP)) { switch (intent.getStringExtra(BaseSettingsFragment.OPEN_CONFIG_ON_MAP)) { case BaseSettingsFragment.MAP_CONFIG: diff --git a/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java b/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java index c77cfbfc0d..43e1e73cc8 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java @@ -60,6 +60,8 @@ public class FavoritesActivity extends TabActivity { private int tabSize; private ImportHelper importHelper; + private ViewPager viewPager; + private Bundle intentParams = null; @Override @@ -80,7 +82,7 @@ public class FavoritesActivity extends TabActivity { List mTabs = getTabItems(); setTabs(mTabs); - ViewPager mViewPager = (ViewPager) findViewById(R.id.pager); + viewPager = findViewById(R.id.pager); if (savedInstanceState == null) { Intent intent = getIntent(); if (intent != null && intent.hasExtra(MapActivity.INTENT_PARAMS)) { @@ -93,7 +95,7 @@ public class FavoritesActivity extends TabActivity { break; } } - mViewPager.setCurrentItem(pagerItem, false); + viewPager.setCurrentItem(pagerItem, false); } } } @@ -191,6 +193,17 @@ public class FavoritesActivity extends TabActivity { return mTabs; } + public Bundle storeCurrentState() { + int currentItem = viewPager.getCurrentItem(); + if (currentItem >= 0 && currentItem < fragList.size()) { + FavoritesFragmentStateHolder stateHolder = fragList.get(currentItem).get(); + if (stateHolder != null) { + return stateHolder.storeState(); + } + } + return null; + } + @Override public void onAttachFragment(Fragment fragment) { if (fragment instanceof FavoritesFragmentStateHolder) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java index ad066bcb39..c590f80b95 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java @@ -9,6 +9,8 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; +import androidx.activity.OnBackPressedCallback; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.preference.Preference; import androidx.preference.PreferenceViewHolder; @@ -37,11 +39,8 @@ import static net.osmand.plus.osmedit.OsmEditingPlugin.OSM_EDIT_TAB; public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged, ValidateOsmLoginListener, OsmAuthorizationListener { - public static final String TAG = OsmEditingFragment.class.getName(); - private static final Log log = PlatformUtil.getLog(OsmEditingFragment.class); - public static final String OPEN_PLUGIN = "open_plugins"; private static final String OSM_LOGOUT = "osm_logout"; private static final String OPEN_OSM_EDITS = "open_osm_edits"; public static final String OSM_LOGIN_DATA = "osm_login_data"; @@ -53,6 +52,17 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); authorizationAdapter = app.getOsmOAuthHelper().getAuthorizationAdapter(); + + FragmentActivity activity = requireMyActivity(); + activity.getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) { + public void handleOnBackPressed() { + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + mapActivity.launchPrevActivityIntent(); + } + dismiss(); + } + }); } @Override @@ -200,17 +210,4 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer public void authorizationCompleted() { updateAllSettings(); } - - public static boolean showInstance(FragmentManager fragmentManager) { - try { - OsmEditingFragment fragment = new OsmEditingFragment(); - fragmentManager.beginTransaction() - .add(R.id.fragmentContainer, fragment, TAG) - .addToBackStack(TAG) - .commitAllowingStateLoss(); - return true; - } catch (Exception e) { - return false; - } - } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index 9a3209fdc3..ed982747b0 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -1,7 +1,5 @@ package net.osmand.plus.osmedit.dialogs; -import android.content.Context; -import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.text.Editable; @@ -31,16 +29,19 @@ import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionAdapterListener; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionItem; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; -import net.osmand.plus.osmedit.OsmEditingFragment; +import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin.UploadVisibility; import net.osmand.plus.osmedit.UploadGPXFilesTask; import net.osmand.plus.settings.backend.OsmandSettings; +import net.osmand.plus.settings.fragments.BaseSettingsFragment; import net.osmand.util.Algorithms; import java.util.ArrayList; import java.util.List; +import static net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenType.OPEN_STREET_MAP_EDITING; + public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { public static final String TAG = SendGpxBottomSheetFragment.class.getSimpleName(); @@ -105,8 +106,11 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { account.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + FragmentActivity activity = getActivity(); + if (activity != null) { + showOpenStreetMapScreen(activity); + } dismiss(); - showOpenStreetMapScreen(); } }); RecyclerView iconCategoriesRecyclerView = sendOsmPoiView.findViewById(R.id.description_view); @@ -120,12 +124,21 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { items.add(titleItem); } - private void showOpenStreetMapScreen() { - Bundle params = new Bundle(); - params.putBoolean(OsmEditingFragment.OPEN_PLUGIN, true); - Context context = getView().getContext(); - Intent intent = getActivity().getIntent(); - MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); + protected static void showOpenStreetMapScreen(@NonNull FragmentActivity activity) { + if (activity instanceof MapActivity) { + BaseSettingsFragment.showInstance(activity, OPEN_STREET_MAP_EDITING); + } else { + Bundle prevIntentParams = null; + if (activity instanceof FavoritesActivity) { + prevIntentParams = ((FavoritesActivity) activity).storeCurrentState(); + } else if (activity.getIntent() != null) { + prevIntentParams = activity.getIntent().getExtras(); + } + Bundle params = new Bundle(); + params.putString(BaseSettingsFragment.OPEN_SETTINGS, OPEN_STREET_MAP_EDITING.name()); + + MapActivity.launchMapActivityMoveToTop(activity, prevIntentParams, null, params); + } } @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java index 8e8e37934c..d26c1ac212 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendOsmNoteBottomSheetFragment.java @@ -1,8 +1,6 @@ package net.osmand.plus.osmedit.dialogs; import android.app.Activity; -import android.content.Context; -import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.ContextThemeWrapper; @@ -16,6 +14,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.SwitchCompat; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import com.google.android.material.textfield.TextInputLayout; @@ -29,7 +28,6 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; -import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.osmedit.oauth.OsmOAuthAuthorizationAdapter; @@ -43,6 +41,7 @@ import org.apache.commons.logging.Log; import static net.osmand.plus.UiUtilities.setupDialogButton; import static net.osmand.plus.osmedit.OsmEditingFragment.OSM_LOGIN_DATA; import static net.osmand.plus.osmedit.ValidateOsmLoginDetailsTask.ValidateOsmLoginListener; +import static net.osmand.plus.osmedit.dialogs.SendGpxBottomSheetFragment.showOpenStreetMapScreen; import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.OPENSTREETMAP_POINT; import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.ProgressDialogPoiUploader; import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.SimpleProgressDialogPoiUploader; @@ -136,8 +135,11 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen account.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + FragmentActivity activity = getActivity(); + if (activity != null) { + showOpenStreetMapScreen(activity); + } dismiss(); - showOpenStreetMapScreen(); } }); final SimpleBottomSheetItem bottomSheetItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() @@ -184,14 +186,6 @@ public class SendOsmNoteBottomSheetFragment extends MenuBottomSheetDialogFragmen } } - private void showOpenStreetMapScreen() { - Bundle params = new Bundle(); - params.putBoolean(OsmEditingFragment.OPEN_PLUGIN, true); - Context context = getView().getContext(); - Intent intent = getActivity().getIntent(); - MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); - } - @Override protected DialogButtonType getRightBottomButtonType() { return (DialogButtonType.PRIMARY); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java index af4c92d4b9..42ba887996 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendPoiBottomSheetFragment.java @@ -1,8 +1,6 @@ package net.osmand.plus.osmedit.dialogs; import android.app.Activity; -import android.content.Context; -import android.content.Intent; import android.os.Bundle; import android.view.ContextThemeWrapper; import android.view.View; @@ -13,6 +11,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.SwitchCompat; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import net.osmand.PlatformUtil; @@ -25,7 +24,6 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.osmedit.OpenstreetmapPoint; -import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.util.Algorithms; @@ -35,7 +33,10 @@ import org.apache.commons.logging.Log; import java.util.HashMap; import java.util.Map; -import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.*; +import static net.osmand.plus.osmedit.dialogs.SendGpxBottomSheetFragment.showOpenStreetMapScreen; +import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.OPENSTREETMAP_POINT; +import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.ProgressDialogPoiUploader; +import static net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.SimpleProgressDialogPoiUploader; public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { @@ -92,8 +93,11 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { account.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + FragmentActivity activity = getActivity(); + if (activity != null) { + showOpenStreetMapScreen(activity); + } dismiss(); - showOpenStreetMapScreen(); } }); final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() @@ -102,14 +106,6 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment { items.add(titleItem); } - private void showOpenStreetMapScreen() { - Bundle params = new Bundle(); - params.putBoolean(OsmEditingFragment.OPEN_PLUGIN, true); - Context context = getView().getContext(); - Intent intent = getActivity().getIntent(); - MapActivity.launchMapActivityMoveToTop(context, intent != null ? intent.getExtras() : null, null, params); - } - public static void showInstance(@NonNull FragmentManager fm, @NonNull OsmPoint[] points) { try { if (!fm.isStateSaved()) { From 78cead47f74256cee205444180a12dcd3da68d22 Mon Sep 17 00:00:00 2001 From: ssantos Date: Thu, 19 Nov 2020 21:42:59 +0000 Subject: [PATCH 53/70] Translated using Weblate (Portuguese) Currently translated at 99.2% (3533 of 3561 strings) --- OsmAnd/res/values-pt/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 0c7ff7cbac..5cef9b374a 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -3980,4 +3980,13 @@ As fotos são fornecidas pelo projeto de dados abertos OpenPlaceReviews.org. Para enviar as suas fotos precisa cadastrar-se no site. Criar uma conta Já tenho uma conta + Histórico de pesquisa + Caiaque + Barco a motor + Recursos + Tamanho aproximado do ficheiro + Selecione os dados a serem exportados para o ficheiro. + Necessário para a importação + O seu aparelho só tem %1$s livre. Por favor, libere algum espaço ou desmarque alguns itens para exportar. + Não há espaço suficiente \ No newline at end of file From 44238287449214abb6670950068613afdde7fc93 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Thu, 19 Nov 2020 13:49:00 +0000 Subject: [PATCH 54/70] Translated using Weblate (French) Currently translated at 99.7% (3552 of 3561 strings) --- OsmAnd/res/values-fr/strings.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index c48a9fb01e..3a02fa25d9 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3899,7 +3899,7 @@ Développement du transport public autochtone Connectez-vous avec OAuth Supprimer le jeton OAuth d\'OpenStreetMap - Déconnexion réussie + Déconnecté Le fichier est déjà importé dans OsmAnd Utiliser un algorithme de routage A* à 2 phases Le paiement sera débité de votre compte AppGallery dès confirmation de l\'achat. @@ -3930,10 +3930,10 @@ L\'abonnement OsmAnd Live est en attente L’abonnement OsmAnd Live a expiré L\'abonnement OsmAnd Live a été suspendu - Se connecter à OpenStreetMap - Se connecter à OpenStreetMap.org + Se connecter pour OpenStreetMap + Se connecter pour OpenStreetMap.org Identifiant - Utiliser un identifiant et un mot de passe + Se connecter avec un identifiant et un mot de passe Compte Gérer l\'abonnement Se connecter avec OpenStreetMap @@ -3955,4 +3955,11 @@ Les photos sont fournies par le projet open data OpenPlaceReviews.org. Pour envoyer vos photos, vous devez au préalable être inscrit sur ce site Web. Historique de recherche Kayak + Votre appareil n\'a que %1$s disponible. Veuillez libérer de l\'espace ou désélectionner l\'export pour certains éléments. + Bateau à moteur + Ressources + Taille approximative du fichier + Sélectionnez les données à exporter dans le fichier. + Nécessaire pour l\'import + L\'espace disponible est insuffisant \ No newline at end of file From 7598fe241efcdb438ed8721dfd5b39de6c7a59b1 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Thu, 19 Nov 2020 18:28:17 +0000 Subject: [PATCH 55/70] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3561 of 3561 strings) --- OsmAnd/res/values-uk/strings.xml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 61ff054492..7b6ac19748 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3914,10 +3914,10 @@ Двофазна маршрутизація для автомобільної навігації. Розвиток власного громадського транспорту Перемкнутися на розрахунок маршруту громадським транспортом за допомогою Java (безпечний) - Виконати вхід OAuth для користування функцією osmedit + Увійти за допомогою OAuth для користування функцією osmedit Увійти через OAuth Очистити токен OAuth OpenStreetMap - Ви успішно вийшли + Ви вийшли OsmAnd дані в реальному часі Уникати пішохідних шляхів Уникати пішохідних шляхів @@ -3951,10 +3951,10 @@ Передплата OsmAnd Live на утриманні Увійти до OpenStreetMap.org Увійти до OpenStreetMap.org - Увійдіть, щоб вивантажити нові або внесені зміни. + Увійдіть, щоб вивантажити нові або внесені зміни, \n -\nВи можете увійти, за допомогою безпечного методу OAuth, або скористатися своїм ім\'ям та паролем. - Використовувати ім\'я і пароль +\nабо за допомогою безпечного методу OAuth або свого ім\'я та паролю. + Увійти за допомогою імені користувача і паролю Обліковий запис Ім\'я користувача Увійти за допомогою OpenStreetMap @@ -3967,14 +3967,20 @@ «Відстежуваний» означає, що трек не з\'явиться в жодному загальнодоступному списку, але обробка точок з позначками часу від нього (які не можуть бути безпосередньо пов’язані з вами) виконується за допомогою завантажень із загальнодоступного API GPS. Закрити примітку OSM Коментувати примітку OSM - Ви можете увійти за допомогою безпечного методу OAuth або застосувавши свої ім\'я користувача й пароль. + Увійдіть за допомогою безпечного методу OAuth або застосувавши свої ім\'я користувача й пароль. Додати світлини Зареєструватися на \nOpenPlaceReviews.org - Світлини надаються проєктом відкритих даних OpenPlaceReviews.org. Щоб завантажити світлини зареєструйтеся на сайті. + Увійдіть на вебсайт проєкту відкритих даних OpenPlaceReviews.org, щоб завантажити ще більше світлин. Створити обліковий запис У мене вже є обліковий запис Журнал пошуку Каяк Моторний човен + Ресурси + Приблизний розмір файлу + Виберіть дані, які потрібно експортувати до файлу. + Необхідно для імпорту + На вашому пристрої лише %1$s вільного простору. Звільніть місце або приберіть позначки з деяких елементів для експорту. + Бракує простору \ No newline at end of file From 14288fcb2eb723044083f8eb6f6b3366907c387e Mon Sep 17 00:00:00 2001 From: jan madsen Date: Thu, 19 Nov 2020 14:15:46 +0000 Subject: [PATCH 56/70] Translated using Weblate (Danish) Currently translated at 91.8% (3272 of 3561 strings) --- OsmAnd/res/values-da/strings.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 3943611228..cd1249d5fd 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -3488,7 +3488,7 @@ Vinkel: %s° Vinkel Forbereder - IP typer + IP-typer Intet valgt Genveje Profiler @@ -3549,9 +3549,9 @@ Den importerede profil indeholder yderligere data. Klik på Importer for kun at importere profildata, eller vælg yderligere data, der skal importeres. Ruten vil blive genberegnet, hvis afstanden til ruten er længere end angivet parameter Mindste afstand for at genberegne ruten - OsmAnd har allerede elementer med de samme navne, som dem, der importeres. -\n -\nVælg en aktion. + OsmAnd har allerede elementer med de samme navne som de importerede. +\n +\nVælg en handling. Det angivne %1$s findes allerede. Mindste vinkel mellem placering og rute Ekstra lige segment mellem placering og den beregnede rute vises, indtil ruten genberegnes @@ -3790,4 +3790,6 @@ Start-/slutikoner %1$s — %2$s Hul + Der er ikke plads nok + Længdegrænse \ No newline at end of file From 855cf16e30bc30150a4e77f0bd53f429eae9459e Mon Sep 17 00:00:00 2001 From: Michal L Date: Thu, 19 Nov 2020 14:49:18 +0000 Subject: [PATCH 57/70] Translated using Weblate (Polish) Currently translated at 99.1% (3529 of 3561 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 5a3ad96826..f03716f861 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -1922,7 +1922,7 @@ Subskrypcja umożliwia cogodzinne aktualizacje wszystkich map na całym świecie. \n Część dochodów wraca do społeczności OSM i jest wypłacana za każdy wkład OSM. \n Jeśli kochasz OsmAnd i OSM i chcesz je wspierać i wspierać, jest to idealny sposób, aby to zrobić. - Nazwa pliku zawiera niedozwolony znak + Niedozwolony znak w nazwie pliku Domyślny kolor Wybierz kategorię Proszę wprowadzić kategorię @@ -2526,7 +2526,7 @@ Dodaje cel pośredni Dodaje pierwszy cel pośredni Wyświetl zamknięte uwagi - Pokaż/ukryj uwagi OSM na mapie. + Pokaż lub ukryj uwagi OSM na mapie. GPX - odpowiedni do eksportowania danych do JOSM i innych edytorów OSM. OSC - odpowiedni do eksportowania danych do OSM. Plik GPX @@ -3087,7 +3087,7 @@ Użyj WunderLINQ do kontroli Dodaj co najmniej jeden element do listy w ustawieniach \"Szybkiej Akcji\" Stoki narciarskie do narciarstwa alpejskiego i zjazdowego oraz dostęp do wyciągów narciarskich. - Narty biegowe/nordic ski + Biegi narciarskie i narciarstwo klasyczne Trasy do narciarstwa klasycznego lub biegowego. Turystyka narciarska Trasy wycieczek narciarskich. @@ -3570,7 +3570,7 @@ Przycisk do wyświetlania lub ukrywania warstwy terenu na mapie. Pokaż teren Ukryj teren - Pokaż / ukryj teren + Pokaż lub ukryj teren Nachylenie Włącz, aby wyświetlić cieniowanie wzniesień lub stoków. Możesz przeczytać więcej o tego rodzaju mapach na naszej stronie. Legenda @@ -3700,9 +3700,9 @@ Powrót do edycji Ukryj transport publiczny Pokaż transport publiczny - Pokaż/ukryj transport publiczny - Utwórz / Edytuj użyteczne miejsce - Dodaj / Edytuj Ulubione + Pokaż lub ukryj transport publiczny + Utwórz lub edytuj użyteczne miejsce + Dodaj lub edytuj ulubione miejsce Przycisk akcji przełącza między wybranymi profilami. Dodaj profil Zmiana profilu aplikacji @@ -3910,7 +3910,7 @@ Nazwa: Z – A Nazwa: A – Z Co nowego - Ikony start/koniec + Ikony startu i końca Dziękujemy za zakup \"Linii konturowych\" Subskrypcja naliczona za wybrany okres. Anuluj ją w AppGallery w dowolnym momencie. Płatność zostanie pobrana z konta AppGallery po potwierdzeniu zakupu. @@ -3958,14 +3958,14 @@ Musisz dodać co najmniej dwa punkty Wystąpił problem z Twoją subskrypcją. Kliknij przycisk, aby przejść do ustawień subskrypcji Google Play i naprawić metodę płatności. Subskrypcja OsmAnd Live jest wstrzymana - Login + Nazwa użytkownika Zaloguj się do OpenStreetMap Zaloguj się do OpenStreetMap.org Zaloguj się za pomocą OpenStreetMap Musisz się zalogować, aby przesłać nowe lub zmodyfikowane zmiany. \n \nMożesz zalogować się za pomocą bezpiecznej metody autoryzacji OAuth lub użyć swojego loginu i hasła. - Użyj loginu i hasła + Zaloguj się za pomocą nazwy użytkownika i hasła Konto Zamknij uwagę OSM Skomentuj uwagę OSM @@ -3973,7 +3973,7 @@ Wyślij plik GPX do OpenStreetMap Wpisz tagi oddzielone przecinkami. Możliwość śledzenia oznacza, że ślad nie pojawi się na żadnej publicznej liście, ale punkty śledzenia będą nadal dostępne za pośrednictwem publicznego API GPS ze znacznikami czasu. Inni użytkownicy będą mogli pobrać tylko te przetworzone punkty śledzenia z Twojego śladu, których nie można powiązać bezpośrednio z Tobą. - Możesz zalogować się przy użyciu bezpiecznej metody OAuth lub użyć swojego loginu i hasła. + Zaloguj się przy użyciu bezpiecznej metody autoryzacji OAuth lub użyj swojej nazwy użytkownika i hasła. Dodaj zdjęcie Zarejestruj się w \nOpenPlaceReviews.org From 5f594cf371f8636c9cfd0b603e4cb707cf6250c2 Mon Sep 17 00:00:00 2001 From: Softmap Date: Thu, 19 Nov 2020 19:47:26 +0000 Subject: [PATCH 58/70] Translated using Weblate (Arabic) Currently translated at 100.0% (3561 of 3561 strings) --- OsmAnd/res/values-ar/strings.xml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 07aaf2352e..7e5f375f16 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3909,10 +3909,10 @@ التوجيه على مرحلتين لملاحة السيارة. تطوير النقل العام المحلي قم بالتبديل إلى Java (الآمن) حساب توجيه النقل العام - قم بتسجيل الدخول إلى OAuth لاستخدام ميزات osmedit + سجّل الدخول باستخدام OAuth لاستخدام ميزات osmedit تسجيل الدخول عبر OAuth مسح رمز OpenStreetMap OAuth - تسجيل الخروج بنجاح + تم تسجيل الخروج تم استيراد الملف بالفعل في أوسماند استخدام خوارزمية توجيه من مرحلتين A* %1$s البيانات المتوفرة فقط على الطرق ، تحتاج إلى حساب طريق باستخدام \"الطريق بين النقاط\" للحصول عليها. @@ -3940,32 +3940,38 @@ انتهت صلاحية اشتراك OsmAnd Live تم إيقاف اشتراك OsmAnd Live مؤقتًا اشتراك OsmAnd Live معلق - تسجيل الدخول إلى خريطة الشارع المفتوح + تسجيل الدخول ل OpenStreetMap تسجيل الدخول إلى OpenStreetMap.org - تحتاج إلى تسجيل الدخول لرفع التغييرات الجديدة أو المعدلة. + قم بتسجيل الدخول لرفع التغييرات الجديدة أو المعدلة. \n -\nيمكنك تسجيل الدخول باستخدام طريقة التفويض الآمنة أو استخدام تسجيل الدخول وكلمة المرور. - استخدام تسجيل الدخول وكلمة المرور +\nإما باستخدام OAuth أو باستخدام اسم المستخدم وكلمة المرور. + سجل الدخول باسم المستخدم وكلمة المرور الحساب - تسجيل الدخول + اسم المستخدم \"إمكانية التتبع\" تعني أن التتبع لا يظهر في أي قوائم عامة ولكن نقاط التتبع المعالجة مع طوابع زمنية صادرة عنها(التي لا يمكن أن تكون مرتبطة بك مباشرة) ستظهر خلال التنزيلات من واجهة برمجة التطبيقات GPS API العامة. سجل تاريخ العلامات أرسل ملف GPX إلى OpenStreetMap أدخل العلامات مفصولة بفاصلة. \"خاص\"يعني أن التتبع لن يظهر في أي قوائم عامة ، ولكن نقاط التتبع الصادرة عنه ستظل متاحة من خلال واجهة برمجة تطبيقات GPS API العامة بدون طوابع زمنية ولكن لن يتم ترتيبها ترتيبًا زمنيًا. - قم بتسجيل الدخول باستخدام OpenStreetMap + سجّل الدخول باستخدام OpenStreetMap عام يعني أنه سيتم عرض التتبع بشكل عام في تتبعات GPS الخاصة بك وفي قوائم تتبع GPS العامة. البيانات المقدمة عبر API لا تشير إلى صفحة التتبع الخاصة بك. الطوابع الزمنية لنقاط التتبع غير متاحة من خلال واجهة برمجة تطبيقات GPS API العامة، والنقاط غير مرتبة ترتيبًا زمنيًا. ومع ذلك، لا يزال المستخدمون الآخرون قادرين على تنزيل التتبع الأولي من قائمة التتبع العامة وأي طوابع زمنية مضمنة فيه. متعرف عليه يعني أنه سيتم عرض التتبع بشكل عام في تتبعات GPS الخاصة بك وفي قوائم تتبع GPS العامة، أي سيتمكن المستخدمون الآخرون من تنزيل التتبع الأولي وربطه باسم المستخدم الخاص بك. ستشير البيانات التي يتم تقديمها عبر API نقاط التتبع إلى صفحة التتبع الأصلية الخاصة بك. الطوابع الزمنية لنقاط التتبع متاحة من خلال واجهة برمجة تطبيقات GPS API العامة. أغلاق ملاحظة OSM تعليق ملاحظة OSM - يمكنك تسجيل الدخول باستخدام طريقة OAuth الآمنة أو استخدام تسجيل الدخول وكلمة المرور الخاصة بك. + قم بتسجيل الدخول باستخدام طريقة OAuth الآمنة أو استخدم اسم المستخدم وكلمة المرور. إضافة صورة سجل في \nOpenPlaceReviews.org - يتم توفير الصور من خلال مشروع البيانات المفتوحة OpenPlaceReviews.org. من أجل رفع الصور الخاصة بك، تحتاج إلى الاشتراك بالموقع. + قم بتسجيل الدخول إلى موقع مشروع البيانات المفتوحة OpenPlaceReviews.org لرفع المزيد من الصور. إنشاء حساب جديد لدي حساب بالفعل كاياك (قوارب صغيرة فردية) زورق سجل البحث + جهازك يحتوي على %1$s فقط متاحة . الرجاء إخلاء بعض المساحة أو إلغاء تحديد بعض العناصر للتصدير. + المصادر + حجم الملف التقريبي + حدد البيانات التي سيتم تصديرها إلى الملف. + مطلوب للاستيراد + لا يوجد مساحة كافية \ No newline at end of file From a754644e84a1a5eb9803dabca1a036d138a68fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Thu, 19 Nov 2020 19:39:24 +0000 Subject: [PATCH 59/70] Translated using Weblate (Galician) Currently translated at 100.0% (3561 of 3561 strings) --- OsmAnd/res/values-gl/strings.xml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index 8b24fe075a..62847375d7 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -3946,7 +3946,7 @@ Lon %2$s Desenvolvemento do transporte público nativo Activar cálculo de enrutamento de transporte público do Java (seguro) Novidades - Inicia sesión co OAuth para empregar as funcións de edición do OSM + Inicia a sesión co OAuth para empregar as funcións de edición do OSM Entrar polo OAuth Limpar token do OpenStreetMap OAuth Sesión rematada @@ -3978,15 +3978,15 @@ Lon %2$s A subscrición do OsmAnd Live foi detida A subscrición do OsmAnd Live está en espera \"Público\" significa que a pista amosarase de xeito público na túa listaxe de pistas e nas listaxes de pistas GPS públicas con marcas de tempo en bruto. Os datos servidos a través da API no farán referencia á túa pácina de pistas. As marcaxes de tempo dos puntos da pista non estarán dispoñíbeis a través da API pública de GPS, aínda que os puntos son ordenados de xeito cronolóxico. - Iniciar sesión no OpenStreetMap - Entrar ó OpenStreetMap.org - Entrar co OpenStreetMap - Precisas iniciar sesión para subir modificacións novas. + Iniciar a sesión no OpenStreetMap + Iniciar a sesión no OpenStreetMap.org + Iniciar a sesión co OpenStreetMap + Inicia a sesión para subir as modificacións novas, \n -\nPodes iniciar sesión empregando o método seguro de OAuth ou empregar o nome de usuario e contrasinal. - Empregar nome de usuario e contrasinal +\nxa sexa co OAuth ou empregando o teu nome de usuario e contrasinal. + Iniciar a sesión co nome de usuario e contrasinal Conta - Iniciar sesión + Nome de usuario Historial de marcaxes Enviar ficheiro GPX ó OpenStreetMap Insire etiquetas separadas por comas. @@ -3995,14 +3995,20 @@ Lon %2$s \"Identificábel\" significa que a pista amosarase de xeito público na túa listaxe de pistas e na listaxe de pistas GPS públicas, é dicir que outros usuarios poderán baixar a pista en bruto e asociala co seu nome de usuario. Os datos servidos a través da API de conxunto de puntos fará referencia á páxina orixinal da pista. Pechar nota do OSM Comentar nota do OSM - Podes iniciar a sesión co método seguro do OAuth ou empregar o nome de usuario e contrasinal. + Inicia a sesión co método seguro do OAuth ou emprega o nome de usuario e contrasinal. Engadir imaxe Rexistrarse no \nOpenPlaceReviews.org - As imaxes son fornecidas polo proxecto de datos abertos OpenPlaceReviews.org. Para subir imaxes tes que rexistrarte no sitio web. + Inicia a sesión no sitio web do proxecto de datos abertos do OpenPlaceReviews.org para subir máis imaxes. Crear nova conta Xa teño unha conta Historial de procura Caiac Lancha a motor + Recursos + Tamaño aproximado do ficheiro + Marca os datos que serán exportados ó ficheiro. + Necesario para importar + O teu dispositivo só ten %1$s libre. Por favor, libera algo de espazo ou desmarca algúns elementos a exportar. + Sen espazo dabondo \ No newline at end of file From f305e4be1393ef44001c296b8f906b3096c140d9 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Thu, 19 Nov 2020 13:51:15 +0000 Subject: [PATCH 60/70] Translated using Weblate (Danish) Currently translated at 98.8% (3817 of 3860 strings) --- OsmAnd/res/values-da/phrases.xml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 7f1eb79c21..37ed57962e 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -3808,7 +3808,7 @@ Stand type Ja Nej - Signal for at finde stangen + Internetadgang: kunder Kun når det er tilladt at gå Kontrast Primitiv @@ -3852,4 +3852,32 @@ Små elektriske apparater Afgangstavle Genopfyldning af drikkevand + Nej + Ja + Nej + Ja + Nej + Ja + Repræsentantkontor + Kontor + Honorærkonsul + Generalkonsulat + Konsulært agentur + Ledet af en konsul + Bopæl + Højkommissær + Delegation + Afdeling + Ledet af en ambassadør + Forbindelsesofficerer + Ambassade + Radartårn + Tagterrasse + GPX-punkt + Borgerservice + Immigrant visum + Ikke-immigrant visum + Forbindelsesofficerer + Konsulat + Ambassade \ No newline at end of file From 9606e4136c268fd80520624bde53ce24cc082700 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Thu, 19 Nov 2020 18:45:06 +0000 Subject: [PATCH 61/70] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3860 of 3860 strings) --- OsmAnd/res/values-uk/phrases.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/OsmAnd/res/values-uk/phrases.xml b/OsmAnd/res/values-uk/phrases.xml index cc955e79c5..70d6d83d6b 100644 --- a/OsmAnd/res/values-uk/phrases.xml +++ b/OsmAnd/res/values-uk/phrases.xml @@ -3838,4 +3838,34 @@ Дах Точка GPX Радіолокаційна вежа + Багатонаціональне + Нунціатура + Розділ інтересів + Зв\'язок + Послуги для громадян + Імміграційні візи + Неімміграційні візи + Зв\'язок + Ні + Так + Ні + Так + Ні + Так + Представництво + Офіс + Почесний консул + Генеральне консульство + Консульський офіс + Консульський орган + Очолює консул + Резиденція + Місія + Верховний комісаріат + Делегація + Відділення + Очолює посол + Посольство + Консульство + Посольство \ No newline at end of file From 167e7a8ec57dfde0a97bc64601202f3a64736f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Babos=20G=C3=A1bor?= Date: Thu, 19 Nov 2020 22:27:15 +0000 Subject: [PATCH 62/70] Translated using Weblate (Hungarian) Currently translated at 99.1% (3829 of 3860 strings) --- OsmAnd/res/values-hu/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-hu/phrases.xml b/OsmAnd/res/values-hu/phrases.xml index f6fe9f9bfe..771e934b0d 100644 --- a/OsmAnd/res/values-hu/phrases.xml +++ b/OsmAnd/res/values-hu/phrases.xml @@ -3842,4 +3842,5 @@ Internetcsatlakozás: ügyfeleknek Radartorony GPX-pont + Állampolgári szolgáltatások \ No newline at end of file From cf3d5f32b0b5eab73a51a6bb480cf66e6705b19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Thu, 19 Nov 2020 20:08:04 +0000 Subject: [PATCH 63/70] Translated using Weblate (Galician) Currently translated at 100.0% (3860 of 3860 strings) --- OsmAnd/res/values-gl/phrases.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/OsmAnd/res/values-gl/phrases.xml b/OsmAnd/res/values-gl/phrases.xml index 955e90963e..1b72fedd88 100644 --- a/OsmAnd/res/values-gl/phrases.xml +++ b/OsmAnd/res/values-gl/phrases.xml @@ -3843,4 +3843,34 @@ Terrazo Punto GPX Torre de radar + Non + Si + Non + Si + Non + Si + Subnacional + Oficina representativa + Oficina + Cónsul honorario + Consulado xeral + Oficina consular + Axencia consular + Dirixido por un cónsul + Residencia + Nunciatura + Misión + Sección de intereses + Alto comisionado + Delegación + Sucursal + Dirixido por un embaixador + Ligazón + Embaixada + Servizos ó cidadán + Visados de inmigrante + Visados de non inmigrante + Ligazón + Consulado + Embaixada \ No newline at end of file From 2abd3e26b847b8f594a0ded9cfc24f2ea1858eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 19 Nov 2020 17:14:22 +0000 Subject: [PATCH 64/70] Translated using Weblate (Estonian) Currently translated at 99.3% (3835 of 3860 strings) --- OsmAnd/res/values-et/phrases.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-et/phrases.xml b/OsmAnd/res/values-et/phrases.xml index 97af8c5b8c..279982921e 100644 --- a/OsmAnd/res/values-et/phrases.xml +++ b/OsmAnd/res/values-et/phrases.xml @@ -3832,4 +3832,9 @@ Parkimine varjualustes Parkla katusel Radarimast + Residents + Nuntsiatuur + Saatkond + Konsulaat + Saatkond \ No newline at end of file From 26f1fbccdb1b81151da3d7919095ce7a72880e8d Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 19 Nov 2020 13:43:47 +0000 Subject: [PATCH 65/70] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3560 of 3561 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 3d4b451190..1e922a5610 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3927,7 +3927,7 @@ Desarrollo nativo del transporte público Cambiar al cálculo de ruta Java (seguro) del transporte público Novedades - Inicia sesión con OAuth para usar las funciones de edición de OSM + Ingresar con OAuth para usar las funciones de edición de OSM Ingresar a través de OAuth Vaciar llave OAuth de OpenStreetMap Sesión finalizada @@ -3958,13 +3958,13 @@ La suscripción a OsmAnd Live se ha pausado La suscripción a OsmAnd Live está en espera Iniciar sesión en OpenStreetMap - Ingresar a OpenStreetMap.org - Debes iniciar sesión para subir cambios nuevos o modificados. + Ingresar en OpenStreetMap.org + Inicia sesión para subir los cambios nuevos o modificados, \n -\nPuedes ingresar usando el método seguro de OAuth o usar el nombre de usuario y contraseña. - Usar nombre de usuario y contraseña +\nya sea con OAuth o usando el nombre de usuario y contraseña. + Ingresar nombre de usuario y contraseña Cuenta - Iniciar sesión + Nombre de usuario Ingresar con OpenStreetMap Historial de marcadores Enviar archivo GPX a OpenStreetMap @@ -3975,14 +3975,20 @@ «Identificable» significa que la traza se mostrará públicamente en tu listado de trazas y en el listado de trazas GPS públicas, es decir que otros usuarios podrán descargar la traza en bruto y asociarla con su nombre de usuario. Los datos servidos a través de la API de conjunto de puntos hará referencia a la página original de la traza. Cerrar nota de OSM Comentar nota de OSM - Puedes iniciar sesión con el método seguro de OAuth o usar el nombre de usuario y contraseña. + Ingresa usando el método seguro de OAuth o usa el nombre de usuario y contraseña. Añadir foto Registrarse en \nOpenPlaceReviews.org - Las fotos son provistas por el proyecto de datos abiertos OpenPlaceReviews.org. Para subir fotos debes registrarte en el sitio web. + Ingresa en el sitio web del proyecto de datos abiertos OpenPlaceReviews.org para subir más fotos. Crear nueva cuenta Ya tengo cuenta Historial de búsqueda Kayak Lancha a motor + Recursos + Tamaño aproximado del archivo + Marca los datos que serán exportados al archivo. + Necesario para importar + El dispositivo sólo tiene %1$s libre. Por favor, libera algo de espacio o desmarca algunos elementos a exportar. + Sin espacio suficiente \ No newline at end of file From 0afb51b93c474d2aeaace9bbeaa8f86c3fef1bb2 Mon Sep 17 00:00:00 2001 From: Franco Date: Thu, 19 Nov 2020 13:49:01 +0000 Subject: [PATCH 66/70] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3860 of 3860 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index c72ea55517..fb8d59ac34 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3857,4 +3857,34 @@ Azotea Punto GPX Torre de radar + No + + No + + No + + Subnacional + Oficina representativa + Oficina + Cónsul honorario + Consulado general + Oficina consular + Agencia consular + Dirigido por un cónsul + Residencia + Nunciatura + Misión + Sección de intereses + Alto comisionado + Delegación + Sucursal;Ramal + Dirigido por un embajador + Enlace + Embajada + Servicios al ciudadano + Visas de inmigrante + Visas de no inmigrante + Enlace + Consulado + Embajada \ No newline at end of file From 0e7230c7a6f6f011ce24737a665f8aec8d7edabe Mon Sep 17 00:00:00 2001 From: ssantos Date: Thu, 19 Nov 2020 21:38:11 +0000 Subject: [PATCH 67/70] Translated using Weblate (Portuguese) Currently translated at 99.9% (3858 of 3860 strings) --- OsmAnd/res/values-pt/phrases.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index eb04e28ff5..0795fa347c 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -3835,4 +3835,34 @@ Ponto GPX Torre de radar Área de repouso + Não + Sim + Não + Sim + Não + Sim + Subnacional + Escritório de representação + Escritório + Cônsul honorário + Consulado-geral + Escritório consular + Agência consular + Liderado por um cônsul + Residência + Nunciatura + Missão + Secção de interesses + Alta comissão + Delegação + Secção + Liderado por um embaixador + Ligação + Embaixada + Serviços ao cidadão + Vistos de imigrantes + Vistos de não-imigrantes + Ligação + Consulado + Embaixada \ No newline at end of file From 2e2bbe3644c8ecc8682469a3f4d7913d20b7a747 Mon Sep 17 00:00:00 2001 From: Nicolas Raoul Date: Fri, 20 Nov 2020 17:36:01 +0900 Subject: [PATCH 68/70] Fixed grammar: Removed duplicate verb --- .github/ISSUE_TEMPLATE/5-feature-request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/5-feature-request.md b/.github/ISSUE_TEMPLATE/5-feature-request.md index 9c46069f8c..1315456d77 100644 --- a/.github/ISSUE_TEMPLATE/5-feature-request.md +++ b/.github/ISSUE_TEMPLATE/5-feature-request.md @@ -12,7 +12,7 @@ Existing issues often contain information about workarounds, resolution, or prog GitHub is our main development tool for our developers. There are hundreds of requests a month and there are relatively few developers. So by opening an issue, please know that your issue will be sent out to all developers and acknowledge that it could be closed without explanation or with just a brief message. -Comments on the closed issues are also sent to all developers, so you will definitely will be heard. +Comments on the closed issues are also sent to all developers, so you definitely will be heard. However, there is no guarantee that a developer will pick up the issue to work on it. Please be sure to read our [FAQ](https://osmand.net/help-online) before creating an issue here. From 5c5627e499ddf1adb2ca3e79855ac4ceee40bafd Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 20 Nov 2020 10:56:28 +0200 Subject: [PATCH 69/70] Add colored point icon for Plan Route landscape UI --- .../ic_action_plan_route_point_colored.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 OsmAnd/res/drawable/ic_action_plan_route_point_colored.xml diff --git a/OsmAnd/res/drawable/ic_action_plan_route_point_colored.xml b/OsmAnd/res/drawable/ic_action_plan_route_point_colored.xml new file mode 100644 index 0000000000..7fb6be0078 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_plan_route_point_colored.xml @@ -0,0 +1,18 @@ + + + + + From 239fc9a118300fa71fbe7e3b25ea3bba490c2e00 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Fri, 20 Nov 2020 12:55:27 +0200 Subject: [PATCH 70/70] Buttons over soft keyboard (only for send gpx fragment) --- .../dialogs/SendGpxBottomSheetFragment.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index ed982747b0..ecf089c0b1 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -1,11 +1,16 @@ package net.osmand.plus.osmedit.dialogs; +import android.graphics.Rect; import android.os.AsyncTask; +import android.os.Build; import android.os.Bundle; import android.text.Editable; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; +import android.view.ViewTreeObserver; import android.widget.LinearLayout; +import android.widget.ScrollView; import android.widget.TextView; import androidx.annotation.NonNull; @@ -51,6 +56,7 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { private TextInputEditText tagsField; private TextInputEditText messageField; + private int contentHeightPrevious = 0; public void setGpxInfos(GpxInfo[] gpxInfos) { this.gpxInfos = gpxInfos; @@ -63,6 +69,7 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode); View sendOsmPoiView = themedInflater.inflate(R.layout.send_gpx_fragment, null); + sendOsmPoiView.getViewTreeObserver().addOnGlobalLayoutListener(getOnGlobalLayoutListener()); tagsField = sendOsmPoiView.findViewById(R.id.tags_field); messageField = sendOsmPoiView.findViewById(R.id.message_field); @@ -124,6 +131,36 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { items.add(titleItem); } + private ViewTreeObserver.OnGlobalLayoutListener getOnGlobalLayoutListener() { + return new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + Rect visibleDisplayFrame = new Rect(); + int buttonsHeight = getResources().getDimensionPixelSize(R.dimen.dialog_button_ex_max_width); + int shadowHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_top_shadow_height); + final ScrollView scrollView = getView().findViewById(R.id.scroll_view); + scrollView.getWindowVisibleDisplayFrame(visibleDisplayFrame); + int height = scrollView.getHeight(); + int contentHeight = visibleDisplayFrame.bottom - visibleDisplayFrame.top - buttonsHeight; + if (contentHeightPrevious != contentHeight || contentHeight < height) { + if (scrollView.getHeight() + shadowHeight > contentHeight) { + scrollView.getLayoutParams().height = contentHeight; + } else { + scrollView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; + } + scrollView.requestLayout(); + int delay = Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? 300 : 1000; + scrollView.postDelayed(new Runnable() { + public void run() { + scrollView.scrollTo(0, scrollView.getHeight()); + } + }, delay); + contentHeightPrevious = contentHeight; + } + } + }; + } + protected static void showOpenStreetMapScreen(@NonNull FragmentActivity activity) { if (activity instanceof MapActivity) { BaseSettingsFragment.showInstance(activity, OPEN_STREET_MAP_EDITING);