Merge pull request #9840 from osmandapp/master

update test branch
This commit is contained in:
Hardy 2020-09-18 00:12:39 +02:00 committed by GitHub
commit 185ff8a1f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 158 additions and 55 deletions

View file

@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20,16L17,20L14,16H16V4H18V16H20Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M5,13H12V15L7.5,20H12V22H5V20L9.5,15H5V13Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:fillAlpha="0.5"/>
<path
android:pathData="M9.5,2H7.5L4,11H6L6.7692,9H10.2308L11,11H13L9.5,2ZM9.4615,7L8.5,4.5L7.5385,7H9.4615Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M20,16L17,20L14,16H16V4H18V16H20Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M5,13H12V15L7.5,20H12V22H5V20L9.5,15H5V13Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillAlpha="0.5"/>
<path
android:pathData="M9.5,2H7.5L4,11H6L6.7692,9H10.2308L11,11H13L9.5,2ZM9.4615,7L8.5,4.5L7.5385,7H9.4615Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20,16L17,20L14,16H16V4H18V16H20Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M5,2H12V4L7.5,9H12V11H5V9L9.5,4H5V2Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M9.5,13H7.5L4,22H6L6.7692,20H10.2308L11,22H13L9.5,13ZM9.4615,18L8.5,15.5L7.5385,18H9.4615Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:fillAlpha="0.5"/>
<path
android:pathData="M20,16L17,20L14,16H16V4H18V16H20Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M5,2H12V4L7.5,9H12V11H5V9L9.5,4H5V2Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M9.5,13H7.5L4,22H6L6.7692,20H10.2308L11,22H13L9.5,13ZM9.4615,18L8.5,15.5L7.5385,18H9.4615Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:fillAlpha="0.5"/>
</vector>

View file

@ -3844,4 +3844,5 @@
<string name="poi_traffic_signals_arrow_no">Abbiegepfeil: nein</string>
<string name="poi_departures_board">Anzeige der Abreisezeiten</string>
<string name="poi_drinking_water_refill">Nachfüllen von Trinkwasser</string>
<string name="poi_beehive">Bienenstock</string>
</resources>

View file

@ -3850,4 +3850,5 @@
<string name="poi_drinking_water_refill">Recarga de agua potable</string>
<string name="poi_recycling_small_electrical_appliances">Pequeños electrodomésticos</string>
<string name="poi_beehive">Panal de abejas</string>
<string name="poi_nuts">Frutos secos</string>
</resources>

View file

@ -3181,7 +3181,7 @@
<string name="quick_action_page_list_descr">Nupp alloleva loendi sirvimiseks.</string>
<string name="osmand_extended_description_part1">OsmAnd (OSM automatiseeritud navigeerimisjuhised) on kaardi- ja navigatsioonirakendus, millel on juurdepääs tasuta, ülemaailmsetele ja kvaliteetsetele OpenStreetMap (OSM) andmetele.
\n
\n Naudi hääl- ja optilist navigaatorit, HP-de (huvipunktide) vaatamist, GPX radade loomist ja haldamist, kõrgusjoonte visuaalse kuvamise ja kõrguse teabe kasutamist (lisa kaudu), valikut sõidu, jalgrattasõidu, jalakäijate režiimide, OSM redigeerimise ja palju muu vahel.</string>
\n Naudi hääl- ja optilist navigaatorit, HP-de (huvipunktide) vaatamist, GPX radade loomist ja haldamist, kõrgusjoonte visuaalse kuvamise ja kõrguse teabe kasutamist (lisa kaudu), valikut sõidu, jalgrattasõidu, jalakäijate režiimide, OSM\'i andmete muutmise ja palju muu vahel.</string>
<string name="osmand_extended_description_part3">Kaart
\n • Kuvab HP-d (huvipunktid) sinu ümber
\n • Kohandab kaarti sinu liikumissuunaga (või kompassiga)
@ -3557,7 +3557,7 @@
<string name="use_volume_buttons_as_zoom">Helitugevuse nupud toimivad suumina</string>
<string name="please_provide_point_name_error">Palun sisestage punkti nimi</string>
<string name="search_download_wikipedia_maps">Lae alla Vikipeedia kaardid</string>
<string name="plugin_wikipedia_description">Hangi huviväärsuste kohta teavet Vikipeediast. See on sinu võrguühenduseta reisiraamat - luba lihtsalt Vikipeedia lisaprogramm ja loe artikleid enda ümber asuvate objektide kohta.</string>
<string name="plugin_wikipedia_description">Hangi huviväärsuste kohta teavet Vikipeediast. See on sinu võrguühenduseta reisiraamat - lihtsalt võta kasutusele Vikipeedia lisaprogramm ja loe artikleid enda ümber asuvate objektide kohta.</string>
<string name="add_hidden_group_info">Kuna valitud grupp on peidetud, siis lisatud punkt ei ole kaardil nähtav. Vajadusel leiad ta „%s“ alt.</string>
<string name="app_mode_go_cart">Kartauto</string>
<string name="parking_positions">Parkimiskohad</string>
@ -3728,7 +3728,7 @@
<string name="plan_route_trim_before">Kärbi enne</string>
<string name="attach_to_the_roads">Kinnita teede külge</string>
<string name="route_between_points_warning_desc">Selle valiku kasutamiseks mõne oma navigeerimisprofiili kasutamisel kinnita oma rada lähimale lubatud teele.</string>
<string name="route_between_points_next_segment_button_desc">Valitud profiili alusel arvutatakse uus teekond vaid järgmise segmendi osas.</string>
<string name="route_between_points_next_segment_button_desc">Selle valitud profiili alusel arvutatakse uus teekond vaid järgmise segmendi osas.</string>
<string name="main_actions">Põhitegevused</string>
<string name="osm_live_payment_subscription_management">Ostu kinnitusel võetakse sinu Google Play kontolt tasu.
\n
@ -3737,7 +3737,7 @@
\nTellimuste haldamiseks ja tühistamiseks ava Google Play seadistused.</string>
<string name="export_import_quick_actions_with_profiles_promo">Kiirtegevusi saad eksportida või importida koos rakenduse profiilidega.</string>
<string name="delete_all_actions_message_q">Kas sa oled kindel, et soovid pöördumatult kustutada %d kiirtegevust\?</string>
<string name="route_between_points_desc">Vali kas soovid ühendada punkte sirge joonega või arvutada nendevahelist teekonda vastavalt oma valitud profiilile.</string>
<string name="route_between_points_desc">Vali kas soovid ühendada punkte sirge joonega või arvutada nendevahelist teekonda selle alusel kuidas järgnevalt on määratud.</string>
<string name="release_3_8">• Uuendatud teekonnaplaneerija: võimaldab kasutada igal segmendil erinevat liikumisviisi ning radade kaasamist
\n
\n • Uus radade kujunduse seadistamise menüü: valida saad värve, joone paksust, suunanoolte kuvamist ning alguse ja lõpu ikoone

View file

@ -3814,7 +3814,7 @@
<string name="poi_seamark_water_level_above_mwl">Niveau d\'eau : au-dessus du niveau d\'eau moyen</string>
<string name="poi_seamark_water_level_below_mwl">Niveau d\'eau : en-dessous du niveau d\'eau moyen</string>
<string name="poi_seamark_obstruction">Obstacle</string>
<string name="poi_drinking_water_refill_yes">Remplissage d\'eau potable : oui</string>
<string name="poi_drinking_water_refill_yes">Oui</string>
<string name="poi_drinking_water_refill_no">Remplissage d\'eau potable : non</string>
<string name="poi_drinking_water_refill_network">Réseau de remplissage d\'eau potable</string>
<string name="poi_traffic_signals_sound_locate">Uniquement si la marche est autorisée</string>

View file

@ -1386,7 +1386,7 @@
<string name="route_descr_select_destination">Задать пункт назначения</string>
<string name="route_preferences">Предпочтения маршрута</string>
<string name="route_info">Информация про маршрут</string>
<string name="keep_and_add_destination_point">Добавить следующим пунктом назначения</string>
<string name="keep_and_add_destination_point">Добавить как новый пункт назначения</string>
<string name="use_displayed_track_for_navigation">Использовать показанный путь для навигации?</string>
<string name="calculate_osmand_route_without_internet">Рассчитать сегмент маршрута OsmAnd без интернета</string>
<string name="gpx_option_calculate_first_last_segment">Рассчитать маршрут OsmAnd для первого и последнего сегмента маршрута</string>

View file

@ -3842,4 +3842,5 @@
<string name="poi_drinking_water_refill">飲用水補充</string>
<string name="poi_recycling_small_electrical_appliances">小電器</string>
<string name="poi_beehive">蜂箱</string>
<string name="poi_nuts">堅果店</string>
</resources>

View file

@ -3251,7 +3251,7 @@
<string name="tts_language_not_supported">The selected language is not supported by the Android TTS (text-to-speech) engine installed, its preset TTS language will be used instead. Look for another TTS engine in the market?</string>
<string name="tts_missing_language_data_title">Missing data</string>
<string name="tts_missing_language_data">Go to the market to download selected language?</string>
<string name="gpx_option_reverse_route">Reverse GPX direction</string>
<string name="gpx_option_reverse_route">Reverse track direction</string>
<string name="gpx_option_destination_point">Use current destination</string>
<string name="gpx_option_from_start_point">Pass along entire track</string>
<!-- Use ← for RTL languages -->

View file

@ -738,9 +738,9 @@ public class MapActivityActions implements DialogProvider {
Map<String, RoutingProfileDataObject> profilesObjects = getRoutingProfiles(app);
for (final ApplicationMode appMode : activeModes) {
if (appMode.isCustomProfile()) {
modeDescription = getCustomProfileDescription(app, appMode, profilesObjects);
modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_custom_string));
} else {
modeDescription = getString(R.string.profile_type_base_string);
modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_base_string));
}
int tag = currentMode.equals(appMode) ? PROFILES_CHOSEN_PROFILE_TAG : PROFILES_NORMAL_PROFILE_TAG;
@ -1047,12 +1047,13 @@ public class MapActivityActions implements DialogProvider {
//switch profile button
ApplicationMode currentMode = app.getSettings().APPLICATION_MODE.get();
String modeDescription;
if (currentMode.isCustomProfile()) {
Map<String, RoutingProfileDataObject> profilesObjects = getRoutingProfiles(app);
modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects);
if (currentMode.isCustomProfile()) {
modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_custom_string));
} else {
modeDescription = getString(R.string.profile_type_base_string);
modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_base_string));
}
int icArrowResId = listExpanded ? R.drawable.ic_action_arrow_drop_up : R.drawable.ic_action_arrow_drop_down;
final int nextMode = listExpanded ? DRAWER_MODE_NORMAL : DRAWER_MODE_SWITCH_PROFILE;
optionsMenuHelper.addItem(new ItemBuilder().setLayout(R.layout.main_menu_drawer_btn_switch_profile)
@ -1084,9 +1085,9 @@ public class MapActivityActions implements DialogProvider {
.createItem());
}
private String getCustomProfileDescription(OsmandApplication app, ApplicationMode mode,
Map<String, RoutingProfileDataObject> profilesObjects){
String description = getString(R.string.profile_type_custom_string);
private String getProfileDescription(OsmandApplication app, ApplicationMode mode,
Map<String, RoutingProfileDataObject> profilesObjects, String defaultDescription){
String description = defaultDescription;
String routingProfileKey = mode.getRoutingProfile();
if (!Algorithms.isEmpty(routingProfileKey)) {

View file

@ -307,7 +307,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
FavoritePointEditor editor = getFavoritePointEditor();
if (editor != null && helper != null) {
if (editor.isNew()) {
doAddFavorite(name, category, description, color, backgroundType, iconId);
doAddFavorite(name, category, description, address, color, backgroundType, iconId);
} else {
doEditFavorite(favorite, name, category, description, address, color, backgroundType, iconId, helper);
}
@ -341,7 +341,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
}
}
private void doAddFavorite(String name, String category, String description, @ColorInt int color,
private void doAddFavorite(String name, String category, String description, String address, @ColorInt int color,
BackgroundType backgroundType, @DrawableRes int iconId) {
OsmandApplication app = getMyApplication();
FavouritesDbHelper helper = getHelper();
@ -350,6 +350,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
favorite.setName(name);
favorite.setCategory(category);
favorite.setDescription(description);
favorite.setAddress(address);
favorite.setColor(color);
favorite.setBackgroundType(backgroundType);
favorite.setIconId(iconId);

View file

@ -817,11 +817,15 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
hideKeyboard();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
MapContextMenu mapContextMenu = mapActivity.getContextMenu();
if (includingMenu) {
mapActivity.getSupportFragmentManager().popBackStack();
mapActivity.getContextMenu().close();
mapContextMenu.close();
} else {
mapActivity.getSupportFragmentManager().popBackStack();
if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) {
mapContextMenu.show();
}
}
}
}
@ -932,17 +936,6 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
private void exitEditing() {
cancelled = true;
dismiss();
showContextMenu();
}
private void showContextMenu() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
MapContextMenu mapContextMenu = mapActivity.getContextMenu();
if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) {
mapContextMenu.show();
}
}
}
private AlertDialog.Builder createWarningDialog(Activity activity, int title, int message, int negButton) {

View file

@ -1037,7 +1037,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
OsmandApplication app = getMyApplication();
if (app != null) {
File dir = getMyApplication().getAppPath(GPX_INDEX_DIR);
if (folderName != null) {
if (folderName != null && !dir.getName().equals(folderName)) {
dir = new File(dir, folderName);
}
fileName += GPX_FILE_EXT;

View file

@ -76,6 +76,8 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
sourceFileName = savedInstanceState.getString(SOURCE_FILE_NAME_KEY);
sourceFolderName = savedInstanceState.getString(SOURCE_FOLDER_NAME_KEY);
showSimplifiedButton = savedInstanceState.getBoolean(SHOW_SIMPLIFIED_BUTTON_KEY);
} else {
folderName = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getName();
}
items.add(new TitleItem(getString(R.string.save_as_new_track)));
@ -290,7 +292,7 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
private File getFile(OsmandApplication app, String folderName, String fileName) {
File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
File source = dir;
if (folderName != null) {
if (folderName != null && !dir.getName().equals(folderName)) {
source = new File(dir, folderName);
}
source = new File(source, fileName + IndexConstants.GPX_FILE_EXT);

View file

@ -48,7 +48,8 @@ public class FolderListAdapter extends RecyclerView.Adapter<FolderListAdapter.Gr
private Collection<? extends String> getFolders() {
List<File> dirs = new ArrayList<>();
final File gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
File gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
dirs.add(gpxDir);
Algorithms.collectDirs(gpxDir, dirs);
List<String> dirItems = new ArrayList<>();
for (File dir : dirs) {

View file

@ -37,6 +37,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
@ -102,7 +103,11 @@ import java.util.regex.Pattern;
import static net.osmand.plus.GpxSelectionHelper.CURRENT_TRACK;
import static net.osmand.plus.myplaces.FavoritesActivity.GPX_TAB;
import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID;
import static net.osmand.util.Algorithms.*;
import static net.osmand.util.Algorithms.capitalizeFirstLetter;
import static net.osmand.util.Algorithms.collectDirs;
import static net.osmand.util.Algorithms.formatDuration;
import static net.osmand.util.Algorithms.objectEquals;
import static net.osmand.util.Algorithms.removeAllFiles;
public class AvailableGPXFragment extends OsmandExpandableListFragment implements
FavoritesFragmentStateHolder {
@ -129,6 +134,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
private boolean importing = false;
private View emptyView;
private GpxSelectionHelper.SelectGpxTaskListener gpxTaskListener;
private boolean sortByName;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@ -157,6 +163,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
public void onAttach(Context activity) {
super.onAttach(activity);
this.app = (OsmandApplication) getActivity().getApplication();
sortByName = app.getSettings().SORT_TRACKS_BY_NAME.get();
final Collator collator = Collator.getInstance();
collator.setStrength(Collator.SECONDARY);
currentRecording = new GpxInfo(getMyApplication().getSavingTrackHelper().getCurrentGpx(), getString(R.string.shared_string_currently_recording_track));
@ -495,6 +502,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
addTrack();
}else if (itemId == R.string.coordinate_input) {
openCoordinatesInput();
} else if (itemId == R.string.shared_string_sort) {
updateTracksSort();
}
return true;
}
@ -512,6 +521,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
.setIcon(R.drawable.ic_action_delete_dark).setListener(listener).createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_refresh, getActivity())
.setIcon(R.drawable.ic_action_refresh_dark).setListener(listener).createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_sort, getActivity())
.setIcon(getSortIconId(!sortByName)).setListener(listener).createItem());
OsmandPlugin.onOptionsMenuActivity(getActivity(), this, optionsMenuAdapter);
for (int j = 0; j < optionsMenuAdapter.length(); j++) {
final MenuItem item;
@ -536,6 +547,11 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
}
}
@DrawableRes
private int getSortIconId(boolean sortByName) {
return sortByName ? R.drawable.ic_action_sort_by_name : R.drawable.ic_action_list_sort;
}
public void doAction(int actionResId) {
if (actionResId == R.string.shared_string_delete) {
operationTask = new DeleteGpxTask();
@ -555,6 +571,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i);
if (itemId == contextMenuItem.getTitleId()) {
contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false, null);
if (itemId == R.string.shared_string_sort) {
item.setIcon(getSortIconId(!sortByName));
}
return true;
}
}
@ -565,6 +584,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
((FavoritesActivity) getActivity()).addTrack();
}
private void updateTracksSort() {
sortByName = !sortByName;
app.getSettings().SORT_TRACKS_BY_NAME.set(sortByName);
reloadTracks();
}
private void openCoordinatesInput() {
CoordinateInputDialogFragment fragment = new CoordinateInputDialogFragment();
fragment.setRetainInstance(true);
@ -948,12 +973,16 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
Arrays.sort(listFiles, new Comparator<File>() {
@Override
public int compare(File f1, File f2) {
if (sortByName) {
return -f1.getName().compareTo(f2.getName());
} else {
// here we could guess date from file name '2017-08-30 ...' - first part date
if (f1.lastModified() == f2.lastModified()) {
return -f1.getName().compareTo(f2.getName());
}
return -Long.compare(f1.lastModified(), f2.lastModified());
}
}
});
return listFiles;
}
@ -970,7 +999,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
private void loadGPXFolder(File mapPath, List<GpxInfo> result, LoadGpxTask loadTask, List<GpxInfo> progress,
String gpxSubfolder) {
for (File gpxFile : listFilesSorted(mapPath)) {
File[] listFiles = listFilesSorted(mapPath);
for (File gpxFile : listFiles) {
if (gpxFile.isDirectory()) {
String sub = gpxSubfolder.length() == 0 ? gpxFile.getName() : gpxSubfolder + "/"
+ gpxFile.getName();
@ -985,7 +1015,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
loadTask.loadFile(progress.toArray(new GpxInfo[progress.size()]));
progress.clear();
}
}
}
}
@ -993,7 +1022,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
public List<GpxInfo> getResult() {
return result;
}
}
protected class GpxIndexesAdapter extends OsmandBaseExpandableListAdapter implements Filterable {
@ -1050,7 +1078,16 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
Collections.sort(selected, new Comparator<GpxInfo>() {
@Override
public int compare(GpxInfo i1, GpxInfo i2) {
if (sortByName) {
return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase());
} else {
long time1 = i1.file.lastModified();
long time2 = i2.file.lastModified();
if (time1 == time2) {
return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase());
}
return -Long.compare(time1, time2);
}
}
});
}
@ -1112,7 +1149,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement
data.get(category.get(found)).add(info);
}
// disable sort
public void sort() {
Collections.sort(category, new Comparator<String>() {
@Override

View file

@ -149,10 +149,10 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
underlayLayer.setMap(null);
}
if(settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.UNDERLAY &&
underlayLayer.getMap() != null) {
underlayLayer.getMap() != null || underlayLayer.getMapTileAdapter() != null) {
layers.getMapControlsLayer().showTransparencyBar(settings.MAP_TRANSPARENCY, true);
} else if(settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.OVERLAY &&
overlayLayer.getMap() != null) {
overlayLayer.getMap() != null || overlayLayer.getMapTileAdapter() != null) {
layers.getMapControlsLayer().showTransparencyBar(settings.MAP_OVERLAY_TRANSPARENCY, true);
} else {
layers.getMapControlsLayer().hideTransparencyBar();

View file

@ -894,7 +894,10 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
public void onSaveAsNewTrack(String folderName, String fileName, boolean showOnMap, boolean simplifiedTrack) {
OsmandApplication app = getMyApplication();
if (app != null) {
File fileDir = new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), folderName == null ? "" : folderName);
File fileDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
if (folderName != null && !fileDir.getName().equals(folderName)) {
fileDir = new File(fileDir, folderName);
}
File toSave = new File(fileDir, fileName + GPX_FILE_EXT);
new SaveDirectionsAsyncTask(app, showOnMap).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, toSave);
}

View file

@ -91,8 +91,8 @@ public class GpxApproximator {
this.env = routingHelper.getRoutingEnvironment(ctx, mode, start, end);
}
private GpxRouteApproximation getNewGpxApproximationContext(@Nullable GpxRouteApproximation gctx) {
GpxRouteApproximation newContext = gctx != null ? new GpxRouteApproximation(gctx) : new GpxRouteApproximation(env.getCtx());
private GpxRouteApproximation getNewGpxApproximationContext() {
GpxRouteApproximation newContext = new GpxRouteApproximation(env.getCtx());
newContext.ctx.calculationProgress = new RouteCalculationProgress();
newContext.MINIMUM_POINT_APPROXIMATION = pointApproximation;
return newContext;
@ -100,7 +100,7 @@ public class GpxApproximator {
private List<GpxPoint> getPoints() {
if (points == null) {
points = routingHelper.generateGpxPoints(env, getNewGpxApproximationContext(null), locationsHolder);
points = routingHelper.generateGpxPoints(env, getNewGpxApproximationContext(), locationsHolder);
}
List<GpxPoint> points = new ArrayList<>(this.points.size());
for (GpxPoint p : this.points) {
@ -150,7 +150,7 @@ public class GpxApproximator {
if (gctx != null) {
gctx.ctx.calculationProgress.isCancelled = true;
}
final GpxRouteApproximation gctx = getNewGpxApproximationContext(this.gctx);
final GpxRouteApproximation gctx = getNewGpxApproximationContext();
this.gctx = gctx;
startProgress();
updateProgress(gctx);

View file

@ -3936,6 +3936,9 @@ public class OsmandSettings {
public final CommonPreference<Integer> FAVORITES_TAB =
new IntPreference("FAVORITES_TAB", 0).makeGlobal().cache();
public final CommonPreference<Boolean> SORT_TRACKS_BY_NAME
= new BooleanPreference("sort_tracks_by_name", true).makeGlobal().cache();
public final CommonPreference<Integer> OSMAND_THEME =
new IntPreference("osmand_theme", OSMAND_LIGHT_THEME) {
@Override

View file

@ -25,6 +25,7 @@ public class YandexTrafficAdapter extends MapTileAdapter {
private final static Log log = PlatformUtil.getLog(MapTileLayer.class);
private final static String YANDEX_PREFFIX = ".YandexTraffic_";
private final static String YANDEX_BASE_URL = "https://core-jams-rdr.maps.yandex.net";
private static final long DELTA = 10 * 60 * 1000;
private long lastTimestampUpdated;
@ -59,11 +60,6 @@ public class YandexTrafficAdapter extends MapTileAdapter {
}
protected void updateTimeStampImpl() {
String YANDEX_BASE_URL;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD)
YANDEX_BASE_URL = "https://core-jams-rdr.maps.yandex.net";
else
YANDEX_BASE_URL = "http://core-jams-rdr.maps.yandex.net";
if (mTimestamp == null || (System.currentTimeMillis() - lastTimestampUpdated) > DELTA) {
log.info("Updating timestamp"); //$NON-NLS-1$
try {

View file

@ -323,7 +323,9 @@ public class ContextMenuLayer extends OsmandMapLayer {
return false;
}
showContextMenu(point, tileBox, true);
LatLon pointLatLon = tileBox.getLatLonFromPixel(point.x, point.y);
menu.show(pointLatLon, null, null);
view.refreshMap();
return true;
}