Merge branch 'master' into custom_plugins
# Conflicts: # OsmAnd/res/values/strings.xml # OsmAnd/src/net/osmand/plus/OsmandPlugin.java # OsmAnd/src/net/osmand/plus/SettingsHelper.java # OsmAnd/src/net/osmand/plus/quickaction/QuickActionRegistry.java # OsmAnd/src/net/osmand/plus/settings/ExportProfileBottomSheet.java
This commit is contained in:
commit
3e81b5926e
89 changed files with 1525 additions and 1116 deletions
|
@ -8,6 +8,7 @@ import java.util.Collections;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import gnu.trove.iterator.TIntObjectIterator;
|
||||
import gnu.trove.map.hash.TIntObjectHashMap;
|
||||
|
@ -305,18 +306,6 @@ public class StringBundle {
|
|||
}
|
||||
}
|
||||
|
||||
public void putArray(String key, String[] array) {
|
||||
if (array != null) {
|
||||
map.put(key, new StringItem(key, strArrayToString(array)));
|
||||
}
|
||||
}
|
||||
|
||||
public void putArray(String key, String[][] array) {
|
||||
if (array != null) {
|
||||
map.put(key, new StringItem(key, strStrArrayToString(array)));
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void putMap(String key, TIntObjectHashMap<T> map) {
|
||||
if (map != null) {
|
||||
StringBundle bundle = newInstance();
|
||||
|
@ -334,7 +323,7 @@ public class StringBundle {
|
|||
public <K, V> void putMap(String key, Map<K, V> map) {
|
||||
if (map != null) {
|
||||
StringBundle bundle = newInstance();
|
||||
for (Map.Entry<K, V> entry : map.entrySet()) {
|
||||
for (Entry<K, V> entry : map.entrySet()) {
|
||||
bundle.putString(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()));
|
||||
}
|
||||
this.map.put(key, new StringBundleItem(key, bundle));
|
||||
|
@ -433,17 +422,6 @@ public class StringBundle {
|
|||
b.append(intArrayToString(arr));
|
||||
}
|
||||
}
|
||||
/*
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
int[] value = a[i];
|
||||
if (value != null && value.length > 0) {
|
||||
if (b.length() > 0) {
|
||||
b.append(";");
|
||||
}
|
||||
b.append(i).append(":").append(intArrayToString(value));
|
||||
}
|
||||
}
|
||||
*/
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
|
@ -465,48 +443,6 @@ public class StringBundle {
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
String[] items = a.split(";");
|
||||
int[][] res = new int[items.length][];
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
String[] subItems = a.split(",");
|
||||
res[i] = new int[subItems.length];
|
||||
for (int k = 0; k < subItems.length; k++) {
|
||||
res[i][k] = Integer.parseInt(subItems[k]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
return res;
|
||||
}
|
||||
|
||||
private static String strArrayToString(String[] a) {
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (String value : a) {
|
||||
if (b.length() > 0) {
|
||||
b.append(0x1E);
|
||||
}
|
||||
b.append(value);
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
private static String strStrArrayToString(String[][] a) {
|
||||
if (a == null) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
String[] value = a[i];
|
||||
if (value != null && value.length > 0) {
|
||||
if (b.length() > 0) {
|
||||
b.append(0x1F);
|
||||
}
|
||||
b.append(String.valueOf(i)).append(":").append(strArrayToString(value));
|
||||
}
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,10 @@ package net.osmand.router;
|
|||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule;
|
||||
import net.osmand.binary.RouteDataObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -14,6 +16,7 @@ public class RouteDataResources {
|
|||
|
||||
private List<Location> locations;
|
||||
private int currentLocation;
|
||||
private Map<RouteDataObject, int[][]> pointNamesMap = new HashMap<>();
|
||||
|
||||
public RouteDataResources() {
|
||||
this.locations = new ArrayList<>();
|
||||
|
@ -43,4 +46,8 @@ public class RouteDataResources {
|
|||
public void incrementCurrentLocation(int index) {
|
||||
currentLocation += index;
|
||||
}
|
||||
|
||||
public Map<RouteDataObject, int[][]> getPointNamesMap() {
|
||||
return pointNamesMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,8 +62,7 @@ public class RouteExporter {
|
|||
}
|
||||
bundle.putBundleList("types", "type", typeList);
|
||||
|
||||
GPXFile gpx = new GPXFile("OsmAnd");
|
||||
gpx.author = OSMAND_ROUTER_V2;
|
||||
GPXFile gpx = new GPXFile(OSMAND_ROUTER_V2);
|
||||
Track track = new Track();
|
||||
track.name = name;
|
||||
gpx.tracks.add(track);
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static net.osmand.binary.RouteDataObject.HEIGHT_UNDEFINED;
|
||||
|
||||
public class RouteImporter {
|
||||
|
||||
public final static Log log = PlatformUtil.getLog(RouteImporter.class);
|
||||
|
@ -48,11 +50,15 @@ public class RouteImporter {
|
|||
public boolean readExtensions(GPXFile res, XmlPullParser parser) throws Exception {
|
||||
if (!resources.hasLocations()) {
|
||||
List<Location> locations = resources.getLocations();
|
||||
double lastElevation = HEIGHT_UNDEFINED;
|
||||
if (res.tracks.size() > 0 && res.tracks.get(0).segments.size() > 0 && res.tracks.get(0).segments.get(0).points.size() > 0) {
|
||||
for (WptPt point : res.tracks.get(0).segments.get(0).points) {
|
||||
Location loc = new Location("", point.getLatitude(), point.getLongitude());
|
||||
if (!Double.isNaN(point.ele)) {
|
||||
loc.setAltitude(point.ele);
|
||||
lastElevation = point.ele;
|
||||
} else if (lastElevation != HEIGHT_UNDEFINED) {
|
||||
loc.setAltitude(lastElevation);
|
||||
}
|
||||
locations.add(loc);
|
||||
}
|
||||
|
@ -108,7 +114,7 @@ public class RouteImporter {
|
|||
if (gpxFile != null) {
|
||||
GPXUtilities.loadGPXFile(null, gpxFile, extensionsReader);
|
||||
for (RouteSegmentResult segment : route) {
|
||||
segment.fillData();
|
||||
segment.fillNames(resources);
|
||||
}
|
||||
} else if (file != null) {
|
||||
FileInputStream fis = null;
|
||||
|
@ -116,7 +122,7 @@ public class RouteImporter {
|
|||
fis = new FileInputStream(file);
|
||||
GPXFile gpxFile = GPXUtilities.loadGPXFile(fis, null, extensionsReader);
|
||||
for (RouteSegmentResult segment : route) {
|
||||
segment.fillData();
|
||||
segment.fillNames(resources);
|
||||
}
|
||||
gpxFile.path = file.getAbsolutePath();
|
||||
gpxFile.modifiedTime = file.lastModified();
|
||||
|
|
|
@ -87,6 +87,21 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
|
|||
}
|
||||
}
|
||||
}
|
||||
if (object.pointNameTypes != null) {
|
||||
int start = Math.min(startPointIndex, endPointIndex);
|
||||
int end = Math.min(Math.max(startPointIndex, endPointIndex) + 1, object.pointNameTypes.length);
|
||||
for (int i = start; i < end; i++) {
|
||||
int[] types = object.pointNameTypes[i];
|
||||
if (types != null) {
|
||||
for (int type : types) {
|
||||
RouteTypeRule r = region.quickGetEncodingRule(type);
|
||||
if (!rules.containsKey(r)) {
|
||||
rules.put(r, rules.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void collectRules(Map<RouteTypeRule, Integer> rules, int[] types) {
|
||||
|
@ -158,7 +173,34 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
|
|||
return res;
|
||||
}
|
||||
|
||||
public void fillData() {
|
||||
private int[][] convertPointNames(int[][] nameTypes, Map<RouteTypeRule, Integer> rules) {
|
||||
if (nameTypes == null || nameTypes.length == 0) {
|
||||
return null;
|
||||
}
|
||||
int[][] res = new int[nameTypes.length][];
|
||||
for (int i = 0; i < nameTypes.length; i++) {
|
||||
int[] types = nameTypes[i];
|
||||
if (types != null) {
|
||||
int[] arr = new int[types.length];
|
||||
for (int k = 0; k < types.length; k++) {
|
||||
int type = types[k];
|
||||
String tag = object.region.quickGetEncodingRule(type).getTag();
|
||||
String name = object.pointNames[i][k];
|
||||
RouteTypeRule rule = new RouteTypeRule(tag, name);
|
||||
Integer ruleId = rules.get(rule);
|
||||
if (ruleId == null) {
|
||||
ruleId = rules.size();
|
||||
rules.put(rule, ruleId);
|
||||
}
|
||||
arr[k] = ruleId;
|
||||
}
|
||||
res[i] = arr;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public void fillNames(RouteDataResources resources) {
|
||||
if (object.nameIds != null && object.nameIds.length > 0) {
|
||||
RouteRegion region = object.region;
|
||||
int nameTypeRule = region.getNameTypeRule();
|
||||
|
@ -176,6 +218,33 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
|
|||
}
|
||||
}
|
||||
}
|
||||
String[][] pointNames = null;
|
||||
int[][] pointNameTypes = null;
|
||||
int[][] pointNamesArr = resources.getPointNamesMap().get(object);
|
||||
if (pointNamesArr != null) {
|
||||
pointNames = new String[pointNamesArr.length][];
|
||||
pointNameTypes = new int[pointNamesArr.length][];
|
||||
for (int i = 0; i < pointNamesArr.length; i++) {
|
||||
int[] namesIds = pointNamesArr[i];
|
||||
if (namesIds != null) {
|
||||
pointNames[i] = new String[namesIds.length];
|
||||
pointNameTypes[i] = new int[namesIds.length];
|
||||
for (int k = 0; k < namesIds.length; k++) {
|
||||
int id = namesIds[k];
|
||||
RouteTypeRule r = object.region.quickGetEncodingRule(id);
|
||||
if (r != null) {
|
||||
pointNames[i][k] = r.getValue();
|
||||
int nameType = object.region.searchRouteEncodingRule(r.getTag(), null);
|
||||
if (nameType != -1) {
|
||||
pointNameTypes[i][k] = nameType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
object.pointNames = pointNames;
|
||||
object.pointNameTypes = pointNameTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -199,11 +268,22 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
|
|||
}
|
||||
bundle.putLong("id", object.id);
|
||||
bundle.putArray("types", convertTypes(object.types, rules));
|
||||
|
||||
int start = Math.min(startPointIndex, endPointIndex);
|
||||
int end = Math.max(startPointIndex, endPointIndex);
|
||||
bundle.putArray("pointTypes", convertTypes(Arrays.copyOfRange(object.pointTypes, start,
|
||||
Math.min(end + 1, object.pointTypes.length)), rules));
|
||||
bundle.putArray("names", convertNameIds(object.nameIds, rules));
|
||||
int end = Math.max(startPointIndex, endPointIndex) + 1;
|
||||
if (object.pointTypes != null && start < object.pointTypes.length) {
|
||||
int[][] types = Arrays.copyOfRange(object.pointTypes, start, Math.min(end, object.pointTypes.length));
|
||||
bundle.putArray("pointTypes", convertTypes(types, rules));
|
||||
}
|
||||
if (object.nameIds != null) {
|
||||
bundle.putArray("names", convertNameIds(object.nameIds, rules));
|
||||
}
|
||||
if (object.pointNameTypes != null && start < object.pointNameTypes.length) {
|
||||
int[][] types = Arrays.copyOfRange(object.pointNameTypes, start, Math.min(end, object.pointNameTypes.length));
|
||||
if (object.pointNames != null) {
|
||||
bundle.putArray("pointNames", convertPointNames(types, rules));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -227,6 +307,10 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
|
|||
object.types = bundle.getIntArray("types", null);
|
||||
object.pointTypes = bundle.getIntIntArray("pointTypes", null);
|
||||
object.nameIds = bundle.getIntArray("names", null);
|
||||
int[][] pointNames = bundle.getIntIntArray("pointNames", null);
|
||||
if (pointNames != null) {
|
||||
bundle.getResources().getPointNamesMap().put(object, pointNames);
|
||||
}
|
||||
|
||||
RouteDataResources resources = bundle.getResources();
|
||||
object.pointsX = new int[length];
|
||||
|
@ -245,8 +329,12 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
|
|||
prevLocation = location;
|
||||
object.pointsX[i] = MapUtils.get31TileNumberX(location.getLongitude());
|
||||
object.pointsY[i] = MapUtils.get31TileNumberY(location.getLatitude());
|
||||
object.heightDistanceArray[i * 2] = (float) dist;
|
||||
object.heightDistanceArray[i * 2 + 1] = (float) location.getAltitude();
|
||||
if (location.hasAltitude() && object.heightDistanceArray.length > 0) {
|
||||
object.heightDistanceArray[i * 2] = (float) dist;
|
||||
object.heightDistanceArray[i * 2 + 1] = (float) location.getAltitude();
|
||||
} else {
|
||||
object.heightDistanceArray = new float[0];
|
||||
}
|
||||
if (plus) {
|
||||
index++;
|
||||
} else {
|
||||
|
|
|
@ -108,4 +108,40 @@
|
|||
<string name="please_update_osmand">Mettez à jour OsmAnd pour visualiser les données sur la carte</string>
|
||||
<string name="gps_points_in_buffer">envoyé (%1$d dans le tampon)</string>
|
||||
<string name="monitoring_is_enabled">Enregistrement activé</string>
|
||||
<string name="shared_string_enabled">Activé</string>
|
||||
<string name="shared_string_status">Statut</string>
|
||||
<string name="shared_string_disable">Désactiver</string>
|
||||
<string name="shared_string_save">Enregistrer</string>
|
||||
<string name="shared_string_name">Nom</string>
|
||||
<string name="shared_string_sort">Trier</string>
|
||||
<string name="shared_string_exit">Quitter</string>
|
||||
<string name="shared_string_all">Tout</string>
|
||||
<string name="shared_string_off">Inactif</string>
|
||||
<string name="shared_string_install">Installer</string>
|
||||
<string name="shared_string_share">Partager</string>
|
||||
<string name="shared_string_back">Retour</string>
|
||||
<string name="shared_string_continue">Continuer</string>
|
||||
<string name="shared_string_cancel">Annuler</string>
|
||||
<string name="shared_string_settings">Paramètres</string>
|
||||
<string name="yard">yd</string>
|
||||
<string name="foot">ft</string>
|
||||
<string name="mile">mi</string>
|
||||
<string name="km">km</string>
|
||||
<string name="m">m</string>
|
||||
<string name="nm">mn</string>
|
||||
<string name="min_mile">min/m</string>
|
||||
<string name="min_km">min/km</string>
|
||||
<string name="m_s">m/s</string>
|
||||
<string name="km_h">km/h</string>
|
||||
<string name="mile_per_hour">mph</string>
|
||||
<string name="si_kmh">Kilomètres par heure</string>
|
||||
<string name="si_mph">Miles par heure</string>
|
||||
<string name="si_m_s">Mètres par seconde</string>
|
||||
<string name="si_min_km">Minutes par kilomètre</string>
|
||||
<string name="si_min_m">Minutes par mile</string>
|
||||
<string name="si_mi_feet">Miles/pieds</string>
|
||||
<string name="si_mi_yard">Miles/yards</string>
|
||||
<string name="si_km_m">Kilomètres/mètres</string>
|
||||
<string name="si_nm">Miles nautiques</string>
|
||||
<string name="si_mi_meters">Miles / Mètres</string>
|
||||
</resources>
|
45
OsmAnd/res/layout/bottom_sheet_item_slider_with_two_text.xml
Normal file
45
OsmAnd/res/layout/bottom_sheet_item_slider_with_two_text.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="title"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@android:id/summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
android:textColor="?attr/active_color_basic"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="summary"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.slider.Slider
|
||||
android:id="@+id/slider"
|
||||
style="@style/Widget.MaterialComponents.Slider"
|
||||
android:theme="@style/Theme.MaterialComponents"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:labelBehavior="gone" />
|
||||
|
||||
</LinearLayout>
|
|
@ -2753,7 +2753,7 @@
|
|||
<string name="shared_string_do">افعل</string>
|
||||
<string name="wikivoyage_download_pics_descr">صور المقالة يمكن تحمل للاستخدام بدون اتصال.
|
||||
\nدائماً متوفرة في \'اكتشف\'←\'خيارات\'.</string>
|
||||
<string name="online_webpage_warning">الصفحة متوفرة فقط بالاتصال. هل تريد الفتح في المتصفح؟</string>
|
||||
<string name="online_webpage_warning">الصفحة متاحة على الإنترنت فقط. فتح في متصفح الويب؟</string>
|
||||
<string name="images_cache">الصور المؤقتة</string>
|
||||
<string name="use_two_digits_longitude">استخدم خط طول رقمين</string>
|
||||
<string name="last_intermediate_dest_description">إضافة كآخر توقف على طول الطريق</string>
|
||||
|
@ -3531,4 +3531,13 @@
|
|||
<string name="restore_all_profile_settings">استعادة جميع إعدادات الملف الشخصي؟</string>
|
||||
<string name="saving_new_profile">حفظ ملف تعريف جديد</string>
|
||||
<string name="profile_backup_failed">لا يمكن عمل نسخة احتياطية من الملف الشخصي.</string>
|
||||
<string name="clear_recorded_data_warning">هل أنت متأكد من أنك تريد مسح البيانات المسجلة؟</string>
|
||||
<string name="importing_from">استيراد البيانات من %1$s</string>
|
||||
<string name="shared_string_importing">استيراد</string>
|
||||
<string name="checking_for_duplicate_description">OsmAnd تحقق %1$s للتكرارات مع العناصر الموجودة في التطبيق.
|
||||
\n
|
||||
\nقد يستغرق الأمر بعض الوقت.</string>
|
||||
<string name="items_added">العناصر المضافة</string>
|
||||
<string name="shared_string_import_complete">اكتمل الاستيراد</string>
|
||||
<string name="import_complete_description">يتم استيراد جميع البيانات من %1$s، يمكنك استخدام الأزرار أدناه لفتح الجزء المطلوب من التطبيق لإدارته.</string>
|
||||
</resources>
|
|
@ -1021,7 +1021,7 @@
|
|||
<string name="av_photo_play_sound">Reprodueix un so en fer una foto</string>
|
||||
<string name="av_camera_focus_hiperfocal">Enfocament de nitidesa màxima</string>
|
||||
<string name="av_camera_focus_auto">Enfocament automàtic</string>
|
||||
<string name="osb_comment_dialog_error">No s\'ha pogut afegir el comentari</string>
|
||||
<string name="osb_comment_dialog_error">No s\'ha pogut afegir el comentari.</string>
|
||||
<string name="osb_author_dialog_password">Contrasenya de l\'OSM (opcional)</string>
|
||||
<string name="amenity_type_seamark">Balisa marina</string>
|
||||
<string name="app_modes_choose_descr">Seleccioneu els perfils per donar visibilitat en l\'aplicació.</string>
|
||||
|
@ -1673,7 +1673,7 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="shared_string_navigation">Navegació</string>
|
||||
<string name="osmand_running_in_background">Executa en procés de fons</string>
|
||||
<string name="favorite_category_add_new">Afegeix nova categoria</string>
|
||||
<string name="favorite_category_select">Selecciona categoria</string>
|
||||
<string name="favorite_category_select">Trieu la categoria</string>
|
||||
<string name="default_speed_system_descr">Definiu la unitat de velocitat.</string>
|
||||
<string name="default_speed_system">Unitats de velocitat</string>
|
||||
<string name="nm">NM</string>
|
||||
|
@ -1775,9 +1775,9 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="osn_reopen_dialog_title">Reobre nota</string>
|
||||
<string name="osn_close_dialog_title">Tanca nota</string>
|
||||
<string name="osn_add_dialog_success">S\'ha creat la nota</string>
|
||||
<string name="osn_add_dialog_error">No s\'ha pogut crear la nota</string>
|
||||
<string name="osn_add_dialog_error">No s\'ha pogut crear la nota.</string>
|
||||
<string name="osn_close_dialog_success">Nota tancada</string>
|
||||
<string name="osn_close_dialog_error">No s\'ha pogut tancar la nota</string>
|
||||
<string name="osn_close_dialog_error">No s\'ha pogut tancar la nota.</string>
|
||||
<string name="shared_string_commit">Valida</string>
|
||||
<string name="rendering_attr_currentTrackColor_description">Color de la traça GPX</string>
|
||||
<string name="rendering_attr_currentTrackWidth_description">Amplada traça GPX</string>
|
||||
|
@ -1815,7 +1815,7 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="missing_write_external_storage_permission">OsmAnd no té autorització per utilitzar la tarja de memòria</string>
|
||||
<string name="no_location_permission">L\'aplicació no tenia autorització per utilitzar les dades d\'ubicació.</string>
|
||||
<string name="no_camera_permission">L\'aplicació no tenia autorització per utilitzar la càmera.</string>
|
||||
<string name="no_microphone_permission">L\'aplicació no tenia autorització per utilitzar el micròfon.</string>
|
||||
<string name="no_microphone_permission">Autoritzeu accedir al micròfon.</string>
|
||||
<string name="impassable_road_desc">Indiqueu les vies que voleu evitar en la navegació.</string>
|
||||
<string name="shared_string_sound">So</string>
|
||||
<string name="live_updates">Actualitzacions al moment</string>
|
||||
|
@ -3306,7 +3306,7 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="shared_preference">Compartit</string>
|
||||
<string name="routing_attr_driving_style_prefer_unpaved_name">Millor les carreteres sense asfaltar</string>
|
||||
<string name="routing_attr_driving_style_prefer_unpaved_description">Millor les carreteres sense asfaltar.</string>
|
||||
<string name="layer_osm_edits">Edicions d\'OSM</string>
|
||||
<string name="layer_osm_edits">Edicions a OSM</string>
|
||||
<string name="quick_action_contour_lines_descr">Un botó per a mostrar o amagar les corbes de nivell en el mapa.</string>
|
||||
<string name="quick_action_contour_lines_show">Mostra les corbes de nivell</string>
|
||||
<string name="quick_action_contour_lines_hide">Amaga les corbes de nivell</string>
|
||||
|
@ -3315,7 +3315,7 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="quick_action_hillshade_show">Mostra l\'ombrejat de relleu</string>
|
||||
<string name="quick_action_hillshade_hide">Amaga l\'ombrejat de relleu</string>
|
||||
<string name="quick_action_show_hide_hillshade">Mostra/amaga l\'ombrejat de relleu</string>
|
||||
<string name="tts_initialization_error">No es pot iniciar el sistema text a veu</string>
|
||||
<string name="tts_initialization_error">No es pot iniciar el sistema text a veu.</string>
|
||||
<string name="utm_format_descr">L\'OsmAnd utilitza l\'estàndard UTM, que és molt similar però no idèntic al format UTM NATO.</string>
|
||||
<string name="coordinates_format_info">El format seleccionat s\'aplicarà a tota l\'aplicació.</string>
|
||||
<string name="pref_selected_by_default_for_profiles">Aquest paràmetre s\'ha seleccionat com el predeterminat per als perfils: %s</string>
|
||||
|
@ -3354,28 +3354,28 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="screen_alerts">Alertes de pantalla</string>
|
||||
<string name="route_parameters_descr">Configura els paràmetres de la ruta</string>
|
||||
<string name="rendering_attr_piste_type_hike_name">Senderisme</string>
|
||||
<string name="default_speed_dialog_msg">S\'utilitza per estimar l\'hora d\'arribada per carreteres de tipus desconegut i per limitar la velocitat a totes les vies (podria canviar la ruta)</string>
|
||||
<string name="default_speed_dialog_msg">Estima l\'hora d\'arribada per tipus de carretera desconeguts i limita la velocitat a totes les vies (podria afectar la ruta)</string>
|
||||
<string name="shared_string_other">Altres</string>
|
||||
<string name="shared_sting_tiles">Tessel·les</string>
|
||||
<string name="export_profile">Exporta el perfil</string>
|
||||
<string name="exported_osmand_profile">Perfil d\'OsmAnd: %1$s</string>
|
||||
<string name="overwrite_profile_q">El perfil «%1$s» ja existeix. El voleu sobreescriure\?</string>
|
||||
<string name="overwrite_profile_q">«%1$s» ja existeix. El voleu sobreescriure\?</string>
|
||||
<string name="export_profile_failed">No s\'ha pogut exportar el perfil.</string>
|
||||
<string name="profile_import">Importació del perfil</string>
|
||||
<string name="profile_import_descr">Per a importar un perfil, seleccioneu-ne el fitxer en el dispositiu i obriu-lo amb OsmAnd.</string>
|
||||
<string name="profile_import">Importa el perfil</string>
|
||||
<string name="profile_import_descr">Afegiu un perfil obrint el seu fitxer amb OsmAnd.</string>
|
||||
<string name="file_import_error">Error d\'importació de %1$s: %2$s</string>
|
||||
<string name="file_imported_successfully">S\'ha importat correctament %1$s.</string>
|
||||
<string name="file_imported_successfully">S\'ha importat %1$s.</string>
|
||||
<string name="rendering_value_white_name">Blanc</string>
|
||||
<string name="swap_two_places">Bescanvia %1$s i %2$s</string>
|
||||
<string name="route_start_point">Punt d\'inici</string>
|
||||
<string name="track_saved">La traça s\'ha desat</string>
|
||||
<string name="empty_filename">No hi ha nom del fitxer</string>
|
||||
<string name="empty_filename">No hi ha nom de fitxer</string>
|
||||
<string name="shared_string_revert">Reverteix</string>
|
||||
<string name="clear_confirmation_msg">Voleu netejar %1$s\?</string>
|
||||
<string name="dialogs_and_notifications_title">Diàlegs i notificacions</string>
|
||||
<string name="dialogs_and_notifications_descr">Emergents de control, diàlegs i notificacions que surten a OsmAnd mentre s\'utilitza.</string>
|
||||
<string name="dialogs_and_notifications_descr">Finestres emergents de control, diàlegs i notificacions.</string>
|
||||
<string name="join_segments">Uneix segments</string>
|
||||
<string name="add_new_profile_q">Voleu afegir el perfil nou \'%1$s\'\?</string>
|
||||
<string name="add_new_profile_q">Voleu afegir el nou perfil \'%1$s\'\?</string>
|
||||
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
|
||||
<string name="street_city">%1$s, %2$s</string>
|
||||
<string name="personal_category_name">Personal</string>
|
||||
|
@ -3384,9 +3384,9 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="download_map_dialog">Diàleg de baixada de mapa</string>
|
||||
<string name="rendering_value_walkingRoutesOSMCNodes_name">Xarxes de nodes</string>
|
||||
<string name="suggested_maps">Mapes suggerits</string>
|
||||
<string name="suggested_maps_descr">Aquests mapes són necessaris per utilitzar-los amb el connector</string>
|
||||
<string name="suggested_maps_descr">El connector necessita aquests mapes.</string>
|
||||
<string name="added_profiles">Perfils afegits</string>
|
||||
<string name="added_profiles_descr">El connector afegeix un nou perfil a OsmAnd</string>
|
||||
<string name="added_profiles_descr">El connector ha afegit els perfils</string>
|
||||
<string name="shared_string_turn_off">Desactiva</string>
|
||||
<string name="new_plugin_added">S\'ha afegit un nou connector</string>
|
||||
<string name="desert_render_descr">A deserts i altre àrees poc poblades. Mostra més detalls en una escala de visualització.</string>
|
||||
|
@ -3404,7 +3404,7 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="edit_profiles">Edita els perfils</string>
|
||||
<string name="select_nav_profile_dialog_message">El tipus de navegació determina les regles de càlcul de les rutes.</string>
|
||||
<string name="profile_appearance">Aparença del perfil</string>
|
||||
<string name="choose_icon_color_name">Trieu la icona, el color i el nom</string>
|
||||
<string name="choose_icon_color_name">Icona, color i nom</string>
|
||||
<string name="reorder_profiles">Edita la llista de perfils</string>
|
||||
<string name="selected_profile">Perfil seleccionat</string>
|
||||
<string name="quick_action_directions_from_desc">Un botó per establir el punt central de la pantalla com el punt de sortida i calcular la ruta vers la destinació o obrir una petició per seleccionar-la si no hi ha un marcador de destinació al mapa.</string>
|
||||
|
|
|
@ -3820,4 +3820,5 @@
|
|||
<string name="poi_drinking_water_refill_yes">Trinkwassernachfüllung: ja</string>
|
||||
<string name="poi_drinking_water_refill_no">Trinkwassernachfüllung: nein</string>
|
||||
<string name="poi_drinking_water_refill_network">Trinkwassernachfüllnetz</string>
|
||||
<string name="poi_internet_access_fee_customers">Internetzugang Gebühr für Kunden</string>
|
||||
</resources>
|
|
@ -3581,4 +3581,7 @@ Lon %2$s</string>
|
|||
\nDas kann einige Zeit dauern.</string>
|
||||
<string name="items_added">Elemente hinzugefügt</string>
|
||||
<string name="shared_string_import_complete">Import abgeschlossen</string>
|
||||
<string name="clear_recorded_data_warning">Sind Sie sicher, dass Sie die aufgezeichneten Daten löschen möchten\?</string>
|
||||
<string name="select_distance_route_will_recalc">Wählen Sie die Entfernung, nach der die Route neu berechnet wird.</string>
|
||||
<string name="recalculate_route_in_deviation">Neuberechnung der Route im Falle einer Abweichung</string>
|
||||
</resources>
|
|
@ -3470,7 +3470,7 @@ Indikas lokon: %1$s x %2$s"</string>
|
|||
<string name="live_monitoring_tracking_interval">Registrada intertempo</string>
|
||||
<string name="search_offline_geo_error">Ne povas pritrakti koordinat‑peton “%s”.</string>
|
||||
<string name="rearrange_categories">Reordigi kategoriojn</string>
|
||||
<string name="create_custom_categories_list_promo">Vi povas aldoni proprajn kategoriojn, kaŝi malnecesajn kategoriojn kaj ŝanĝi ilian ordigon. La liston oni povas enporti kaj elporti kune kun profiloj.</string>
|
||||
<string name="create_custom_categories_list_promo">Ŝanĝi ordigon de la listo, kaŝi malnecesajn kategoriojn. Vi povas enporti aŭ elporti ĉiujn ŝanĝojn kun profiloj.</string>
|
||||
<string name="add_new_custom_category_button_promo">Vi povas aldoni novan propran kategorion per elekti kelka(j)n bezonata(j)n kategorio(j)n.</string>
|
||||
<string name="reset_to_default_category_button_promo">Per restarigi implicitajn agordojn, ordigo de elementoj revenos al la postinstalada stato.</string>
|
||||
<string name="accessibility_mode_disabled">Alirebleca reĝimo estas malaktivigita en via sistemo.</string>
|
||||
|
@ -3559,4 +3559,7 @@ Indikas lokon: %1$s x %2$s"</string>
|
|||
<string name="items_added">Elementoj aldonitaj</string>
|
||||
<string name="shared_string_import_complete">Enportado finita</string>
|
||||
<string name="import_complete_description">Ĉiuj datumoj el %1$s estas enportitaj, uzu la butonojn sube por malfermi la taŭgan parton de la aplikaĵo por administri ilin.</string>
|
||||
<string name="recalculate_route_distance_promo">La kurso estos rekalkulita se la distanco inter la kurso kaj la nuna pozicio superas la enigitan valoron.</string>
|
||||
<string name="select_distance_route_will_recalc">Enigu la distancon super kiu la kurso estos rekalkulita.</string>
|
||||
<string name="recalculate_route_in_deviation">Rekalkuli kurson kiam devojiĝi</string>
|
||||
</resources>
|
|
@ -175,7 +175,7 @@
|
|||
<string name="poi_fuel_octane_91">91 octanos</string>
|
||||
<string name="poi_fuel_octane_92">92 octanos</string>
|
||||
<string name="poi_fuel_octane_95">Nafta súper (grado 2);Energy 5000;Super+;95 octanos</string>
|
||||
<string name="poi_fuel_octane_98">Nafta premium (grado 3);Infinia;V-Power Nitro+;Energy 8000;Podium;SL Magnum;98 octanos</string>
|
||||
<string name="poi_fuel_octane_98">Nafta premium (grado 3);Infinia;Podium;Shell V-Power Nafta;Axion Quantium;SL Magnum;98 octanos</string>
|
||||
<string name="poi_fuel_octane_100">100 octanos</string>
|
||||
<string name="poi_fuel_cng">GNC</string>
|
||||
<string name="poi_fuel_1_25">Combustible 1:25</string>
|
||||
|
@ -3812,4 +3812,17 @@
|
|||
<string name="poi_tactile_paving_primitive">Primitivo</string>
|
||||
<string name="poi_tactile_paving_incorrect">Incorrecto</string>
|
||||
<string name="poi_internet_access_fee_customers">Señal para encontrar el poste</string>
|
||||
<string name="poi_seamark_water_level_part_submerged">Nivel del agua: parcialmente sumergido</string>
|
||||
<string name="poi_seamark_water_level_submerged">Nivel del agua: sumergido</string>
|
||||
<string name="poi_seamark_water_level_dry">Nivel de agua: seco</string>
|
||||
<string name="poi_seamark_water_level_covers">Nivel del agua: cubierto</string>
|
||||
<string name="poi_seamark_water_level_awash">Nivel de agua: inundado</string>
|
||||
<string name="poi_seamark_water_level_floods">Nivel del agua: inundaciones</string>
|
||||
<string name="poi_seamark_water_level_floating">Nivel del agua: flotante</string>
|
||||
<string name="poi_seamark_water_level_above_mwl">Nivel del agua: por encima del nivel medio del agua</string>
|
||||
<string name="poi_seamark_water_level_below_mwl">Nivel del agua: por debajo del nivel medio del agua</string>
|
||||
<string name="poi_seamark_obstruction">Obstrucción</string>
|
||||
<string name="poi_drinking_water_refill_yes">Recarga de agua potable: sí</string>
|
||||
<string name="poi_drinking_water_refill_no">Recarga de agua potable: no</string>
|
||||
<string name="poi_drinking_water_refill_network">Red de recarga de agua potable</string>
|
||||
</resources>
|
|
@ -3481,7 +3481,7 @@ Lon %2$s</string>
|
|||
<string name="multimedia_photo_play_sound">Reproducir sonido al fotografiar</string>
|
||||
<string name="osm_authorization_success">Autorización exitosa</string>
|
||||
<string name="rearrange_categories">Reordenar categorías</string>
|
||||
<string name="create_custom_categories_list_promo">Puedes añadir categorías personalizadas, ocultar las categorías que no parezcan necesarias y cambiar el orden de clasificación de la lista. La lista puede ser importada y exportada con perfiles.</string>
|
||||
<string name="create_custom_categories_list_promo">Cambia el orden de clasificación de la lista u oculta las categorías innecesarias. Puedes importar o exportar todos los cambios con los perfiles.</string>
|
||||
<string name="add_new_custom_category_button_promo">Puedes añadir una nueva categoría personalizada marcando una o varias categorías necesarias.</string>
|
||||
<string name="shared_string_available">Disponible</string>
|
||||
<string name="add_custom_category">Añadir categoría personalizada</string>
|
||||
|
@ -3569,4 +3569,13 @@ Lon %2$s</string>
|
|||
<string name="restore_all_profile_settings">¿Restaurar todos los ajustes del perfil\?</string>
|
||||
<string name="saving_new_profile">Guardando el nuevo perfil</string>
|
||||
<string name="profile_backup_failed">No se pudo respaldar el perfil.</string>
|
||||
<string name="clear_recorded_data_warning">¿Borrar los datos registrados\?</string>
|
||||
<string name="importing_from">Importación de datos de %1$s</string>
|
||||
<string name="shared_string_importing">Importación</string>
|
||||
<string name="checking_for_duplicate_description">OsmAnd comprueba %1$s para ver si hay duplicados con los elementos existentes en la aplicación.
|
||||
\n
|
||||
\nPuede llevar algún tiempo.</string>
|
||||
<string name="items_added">Elementos añadidos</string>
|
||||
<string name="shared_string_import_complete">Importación completa</string>
|
||||
<string name="import_complete_description">Todos los datos de %1$s son importados, puedes usar los botones de abajo para abrir la parte necesaria de la aplicación para manejarla.</string>
|
||||
</resources>
|
|
@ -3812,4 +3812,17 @@
|
|||
<string name="poi_tactile_paving_contrasted">Contrastado</string>
|
||||
<string name="poi_tactile_paving_primitive">Primitivo</string>
|
||||
<string name="poi_tactile_paving_incorrect">Incorrecto</string>
|
||||
<string name="poi_seamark_water_level_part_submerged">Nivel del agua: parcialmente sumergido</string>
|
||||
<string name="poi_seamark_water_level_submerged">Nivel del agua: sumergido</string>
|
||||
<string name="poi_seamark_water_level_dry">Nivel de agua: seco</string>
|
||||
<string name="poi_seamark_water_level_covers">Nivel del agua: cubierto</string>
|
||||
<string name="poi_seamark_water_level_awash">Nivel del agua: inundado</string>
|
||||
<string name="poi_seamark_water_level_floods">Nivel del agua: inundaciones</string>
|
||||
<string name="poi_seamark_water_level_floating">Nivel del agua: flotante</string>
|
||||
<string name="poi_seamark_water_level_above_mwl">Nivel del agua: por encima del nivel medio del agua</string>
|
||||
<string name="poi_seamark_water_level_below_mwl">Nivel del agua: por debajo del nivel medio del agua</string>
|
||||
<string name="poi_seamark_obstruction">Obstrucción</string>
|
||||
<string name="poi_drinking_water_refill_yes">Recarga de agua potable: sí</string>
|
||||
<string name="poi_drinking_water_refill_no">Recarga de agua potable: no</string>
|
||||
<string name="poi_drinking_water_refill_network">Red de recarga de agua potable</string>
|
||||
</resources>
|
|
@ -3481,7 +3481,7 @@ Lon %2$s</string>
|
|||
<string name="multimedia_photo_play_sound">Reproducir sonido al fotografiar</string>
|
||||
<string name="osm_authorization_success">Autorización exitosa</string>
|
||||
<string name="rearrange_categories">Reordenar categorías</string>
|
||||
<string name="create_custom_categories_list_promo">Puedes añadir categorías personalizadas, ocultar las categorías que no parezcan necesarias y cambiar el orden de clasificación de la lista. La lista puede ser importada y exportada con perfiles.</string>
|
||||
<string name="create_custom_categories_list_promo">Cambia el orden de clasificación de la lista u oculta las categorías innecesarias. Puedes importar o exportar todos los cambios con los perfiles.</string>
|
||||
<string name="add_new_custom_category_button_promo">Puedes añadir una nueva categoría personalizada marcando una o varias categorías necesarias.</string>
|
||||
<string name="reset_to_default_category_button_promo">Restablecer al valor predefinido, restablecerá el orden de clasificación al estado predefinido después de la instalación.</string>
|
||||
<string name="shared_string_available">Disponible</string>
|
||||
|
@ -3569,4 +3569,13 @@ Lon %2$s</string>
|
|||
<string name="restore_all_profile_settings">¿Restaurar todos los ajustes del perfil\?</string>
|
||||
<string name="saving_new_profile">Guardando el nuevo perfil</string>
|
||||
<string name="profile_backup_failed">No se pudo respaldar el perfil.</string>
|
||||
<string name="clear_recorded_data_warning">¿Borrar los datos registrados\?</string>
|
||||
<string name="importing_from">Importación de datos de %1$s</string>
|
||||
<string name="shared_string_importing">Importación</string>
|
||||
<string name="checking_for_duplicate_description">OsmAnd comprueba %1$s para ver si hay duplicados con los elementos existentes en la aplicación.
|
||||
\n
|
||||
\nPuede llevar algún tiempo.</string>
|
||||
<string name="items_added">Elementos añadidos</string>
|
||||
<string name="shared_string_import_complete">Importación completa</string>
|
||||
<string name="import_complete_description">Todos los datos de %1$s son importados, puedes usar los botones de abajo para abrir la parte necesaria de la aplicación para manejarla.</string>
|
||||
</resources>
|
|
@ -2547,7 +2547,7 @@ représentant la zone : %1$s x %2$s</string>
|
|||
<string name="wrong_format">Format incorrect</string>
|
||||
<string name="wrong_input">Saisie erronée</string>
|
||||
<string name="enter_new_name">Saisissez un nouveau nom</string>
|
||||
<string name="shared_string_back">Précédent</string>
|
||||
<string name="shared_string_back">Retour</string>
|
||||
<string name="shared_string_view">Afficher</string>
|
||||
<string name="waypoints_added_to_map_markers">Étapes ajoutées comme marques</string>
|
||||
<string name="import_gpx_file_description">peut être importé comme Favoris ou Fichier GPX.</string>
|
||||
|
@ -3459,7 +3459,7 @@ représentant la zone : %1$s x %2$s</string>
|
|||
<string name="sunset_at">Coucher de soleil à %1$s</string>
|
||||
<string name="sunrise_at">Lever de soleil à %1$s</string>
|
||||
<string name="rearrange_categories">Réorganiser les catégories</string>
|
||||
<string name="create_custom_categories_list_promo">Vous pouvez ajouter des catégories personnelles, masquer les catégories que vous ne souhaitez pas utiliser et les trier. La liste des catégories peut être importée et exportée grâce aux profils.</string>
|
||||
<string name="create_custom_categories_list_promo">Modifiez l\'ordre de tri de la liste, masquez des catégories. Vous pouvez importer et exporter toutes vos modifications via les profils.</string>
|
||||
<string name="reset_to_default_category_button_promo">Restaurer les valeurs par défaut réinitialisera l\'ordre de tri.</string>
|
||||
<string name="accessibility_mode_disabled">Le mode d\'accessibilité est désactivé dans votre système.</string>
|
||||
<string name="add_new_custom_category_button_promo">Vous pouvez ajouter une catégorie personnelle en sélectionnant la ou les catégories souhaitées.</string>
|
||||
|
@ -3544,8 +3544,11 @@ représentant la zone : %1$s x %2$s</string>
|
|||
<string name="shared_string_importing">Import en cours</string>
|
||||
<string name="items_added">Éléments ajoutés</string>
|
||||
<string name="shared_string_import_complete">Import terminé</string>
|
||||
<string name="checking_for_duplicate_description">OsmAnd vérifie que %1$s ne duplique pas un élément déjà existant dans l\'application.
|
||||
\n
|
||||
<string name="checking_for_duplicate_description">OsmAnd vérifie que l\'élément %1$s n\'existe pas déjà dans l\'application.
|
||||
\n
|
||||
\nCela peut prendre un certain temps.</string>
|
||||
<string name="import_complete_description">Les données de %1$s ont été importées, vous pouvez utiliser les boutons ci-dessous pour ouvrir la partie adéquate de l\'application pour les gérer.</string>
|
||||
<string name="recalculate_route_distance_promo">L\'itinéraire sera recalculé lorsque la distance entre l\'itinéraire et votre position est supérieure à la valeur indiquée.</string>
|
||||
<string name="select_distance_route_will_recalc">Sélectionnez la distance au-delà de laquelle l’itinéraire sera recalculé.</string>
|
||||
<string name="recalculate_route_in_deviation">Recalculer l\'itinéraire en cas d\'écart de route</string>
|
||||
</resources>
|
|
@ -749,7 +749,7 @@
|
|||
<string name="poi_smoking">Fumatori</string>
|
||||
<string name="poi_delivery">Consegna</string>
|
||||
<string name="poi_drive_in">"Drive in "</string>
|
||||
<string name="poi_takeaway">A portar via</string>
|
||||
<string name="poi_takeaway">Cibo da asporto</string>
|
||||
<string name="poi_cocktails">Cocktail</string>
|
||||
<string name="poi_microbrewery">Microbirrificio</string>
|
||||
<string name="poi_beauty_salon_service">Servizio</string>
|
||||
|
@ -2285,7 +2285,7 @@
|
|||
<string name="poi_payment_union_card_no">Union Card non accettata</string>
|
||||
<string name="poi_payment_mtsmoney_yes">MTS-Money</string>
|
||||
<string name="poi_payment_mtsmoney_no">MTS-Money non accettato</string>
|
||||
<string name="poi_brewery_additional">Nome birrificio</string>
|
||||
<string name="poi_brewery_additional">Birre</string>
|
||||
<string name="poi_fire_hydrant_style_water_source_main">Principale</string>
|
||||
<string name="poi_fire_hydrant_style_water_source_pond">Stagno</string>
|
||||
<string name="poi_fire_hydrant_style_water_source_stream">Ruscello</string>
|
||||
|
@ -2714,4 +2714,72 @@
|
|||
<string name="poi_water_tap">Rubinetto</string>
|
||||
<string name="poi_free_flying_site_takeoff">Decollo</string>
|
||||
<string name="poi_free_flying_site_landing">Atterraggio</string>
|
||||
<string name="poi_seamark_building">Edificio di segnalazione marina</string>
|
||||
<string name="poi_seamark_bridge">Ponte di segnalazione marina</string>
|
||||
<string name="poi_beacon_cardinal">Segnalatore marino cardinale</string>
|
||||
<string name="poi_beacon_lateral">Segnalatore marino laterale</string>
|
||||
<string name="poi_beacon_safe_water">Segnalatore marino di acque sicure</string>
|
||||
<string name="poi_beacon_special_purpose">Segnalatore marino speciale</string>
|
||||
<string name="poi_buoy_cardinal">Boa di segnalazione cardinale</string>
|
||||
<string name="poi_buoy_safe_water">Boa di segnalazione di acque sicure</string>
|
||||
<string name="poi_buoy_special_purpose">Boa di segnalazione speciale</string>
|
||||
<string name="poi_daymark">Punto notevole</string>
|
||||
<string name="poi_small_craft_facility">Deposito per piccole imbarcazioni</string>
|
||||
<string name="poi_piste_playground">Pista di un parco giochi</string>
|
||||
<string name="poi_hanami">Hanami</string>
|
||||
<string name="poi_trail_riding_station">Stazione di equiturismo</string>
|
||||
<string name="poi_cattle_grid">Grata per il bestiame</string>
|
||||
<string name="poi_bump_gate">Cancello di tipo \"bump gate\"</string>
|
||||
<string name="poi_horse_stile">Scaletta per cavalli</string>
|
||||
<string name="poi_kissing_gate">Cancello per il contenimento del bestiame</string>
|
||||
<string name="poi_sally_port">Porta militare per sortita</string>
|
||||
<string name="poi_swing_gate">Porta a vento</string>
|
||||
<string name="poi_kent_carriage_gap">Apertura per carrozze Kent</string>
|
||||
<string name="poi_route_hiking_ref_poi">Riferimento di un itinerario di escursionismo</string>
|
||||
<string name="poi_denomination_mennonite">Mennonita</string>
|
||||
<string name="poi_denomination_old_believers">Vecchi credenti</string>
|
||||
<string name="poi_denomination_scientist">Scientifica</string>
|
||||
<string name="poi_denomination_wesleyan">Wesleyana</string>
|
||||
<string name="poi_denomination_shaktism">Shaktismo</string>
|
||||
<string name="poi_denomination_shingon_shu">Shingon shu</string>
|
||||
<string name="poi_denomination_mahayana">Mahayana</string>
|
||||
<string name="poi_wholesale">Grossista</string>
|
||||
<string name="poi_trees_pomegranate">Melograno</string>
|
||||
<string name="poi_nudism_customary">Solito</string>
|
||||
<string name="poi_information_route_marker">Cartello stradale</string>
|
||||
<string name="poi_leisure_common">Area di svago</string>
|
||||
<string name="poi_artwork_type_sculpture">Tipo di opera: scultura</string>
|
||||
<string name="poi_artwork_type_statue">Tipo di opera: statua</string>
|
||||
<string name="poi_artwork_type_mural">Tipo di opera: murale</string>
|
||||
<string name="poi_artwork_type_architecture">Tipo di opera: archittettura</string>
|
||||
<string name="poi_artwork_type_painting">Tipo di opera: dipinto</string>
|
||||
<string name="poi_artwork_type_stone">Tipo di opera: roccia</string>
|
||||
<string name="poi_artwork_type_bust">Tipo di opera: busto</string>
|
||||
<string name="poi_artwork_type_installation">Tipo di opera: installazione</string>
|
||||
<string name="poi_artwork_type_mosaic">Tipo di opera: mosaico</string>
|
||||
<string name="poi_artwork_type_relief">Tipo di opera: rilievo</string>
|
||||
<string name="poi_artwork_type_graffiti">Tipo di opera: graffiti</string>
|
||||
<string name="poi_artwork_type_stele">Tipo di opera: stele</string>
|
||||
<string name="poi_artwork_type_fountain">Tipo di opera: fontana</string>
|
||||
<string name="poi_wiki_lang_nap">Wiki napoletana</string>
|
||||
<string name="poi_lock_basin">Chiusa</string>
|
||||
<string name="poi_government_public_service">Servizio pubblico</string>
|
||||
<string name="poi_seamark_clearance_height">Margine di altezza</string>
|
||||
<string name="poi_seamark_clearance_height_closed">Margine di altezza (chiuso)</string>
|
||||
<string name="poi_seamark_clearance_height_open">Margine di altezza (aperto)</string>
|
||||
<string name="poi_seamark_clearance_width">Margine di larghezza</string>
|
||||
<string name="poi_car_pooling">Punto per la condivisione di automobili</string>
|
||||
<string name="poi_changing_table_yes">Fasciatoio: presente</string>
|
||||
<string name="poi_changing_table_no">Fasciatoio: non presente</string>
|
||||
<string name="poi_changing_table_limited">Fasciatoio: limitato</string>
|
||||
<string name="poi_changing_table_location_room">Posizionamento del fasciatoio: in stanza</string>
|
||||
<string name="poi_changing_table_location_male_toilet">Posizionamento del fasciatoio: bagno maschile</string>
|
||||
<string name="poi_changing_table_location_female_toilet">Posizionamento del fasciatoio: bagno femminile</string>
|
||||
<string name="poi_changing_table_location_unisex_toilet">Posizionamento del fasciatoio: bagno unisex</string>
|
||||
<string name="poi_changing_table_count">Numero di fasciatoi</string>
|
||||
<string name="poi_changing_table_fee_yes">Tarriffa per l\' uso del fasciatoio: si</string>
|
||||
<string name="poi_changing_table_fee_no">Tariffa per l\' uso del fasciatoio: nessuna</string>
|
||||
<string name="poi_historic_tank">Carro armato storico</string>
|
||||
<string name="poi_sms">SMS</string>
|
||||
<string name="poi_video_telephone">Video</string>
|
||||
</resources>
|
|
@ -3453,4 +3453,25 @@
|
|||
<string name="osm_edits_view_descr">Du kan vise alle dine uopplastede redigeringer eller OSM-feil i %1$s. Opplastede punkter viser ikke i OsmAnd.</string>
|
||||
<string name="select_nav_icon_descr">Du vil se ikonet kun under navigasjon eller bevegelse.</string>
|
||||
<string name="select_map_icon_descr">Kartikon vises kun på kartet, og endrer seg under navigasjon til navigasjonsikonet.</string>
|
||||
<string name="multimedia_use_system_camera">Bruk systemprogram</string>
|
||||
<string name="shared_string_available">Tilgjengelig</string>
|
||||
<string name="sunrise_at">Soloppgang klokken %1$s</string>
|
||||
<string name="copy_coordinates">Kopier koordinater</string>
|
||||
<string name="sort_by_category">Sorter etter kategori</string>
|
||||
<string name="index_name_antarctica">Antarktis</string>
|
||||
<string name="shared_string_app_default_w_val">Programforvalg (%s)</string>
|
||||
<string name="profile_type_custom_string">Egendefinert profil</string>
|
||||
<string name="shared_string_angle_param">Vinkel: %s°</string>
|
||||
<string name="shared_string_angle">Vinkel</string>
|
||||
<string name="shared_string_preparing">Forbereder</string>
|
||||
<string name="shared_string_poi_types">POI-typer</string>
|
||||
<string name="shared_string_nothing_selected">Ingenting valgt</string>
|
||||
<string name="shared_string_quick_actions">Hurtighandlinger</string>
|
||||
<string name="shared_string_profiles">Profiler</string>
|
||||
<string name="replace_all">Erstatt alle</string>
|
||||
<string name="keep_both">Behold begge</string>
|
||||
<string name="saving_new_profile">Lagrer ny profil</string>
|
||||
<string name="profile_backup_failed">Kunne ikke sikkerhetskopiere profil.</string>
|
||||
<string name="importing_from">Importerer data fra %1$s</string>
|
||||
<string name="shared_string_importing">Importerer</string>
|
||||
</resources>
|
|
@ -226,13 +226,13 @@
|
|||
<string name="maps_could_not_be_downloaded">Nie udało się pobrać tej mapy</string>
|
||||
<string name="continuous_rendering">Renderowanie ciągłe</string>
|
||||
<string name="continuous_rendering_descr">Wyświetlaj ciągłe renderowanie zamiast obrazu jednorazowego.</string>
|
||||
<string name="rendering_exception">Nie udało się narysować wybranej powierzchni</string>
|
||||
<string name="rendering_exception">Nie udało się narysować wybranej powierzchni.</string>
|
||||
<string name="rendering_out_of_memory">Brak wystarczającej ilości pamięci, aby wyświetlić wybrany obszar</string>
|
||||
<string name="show_point_options">Użyj położenia…</string>
|
||||
<string name="renderer_load_sucess">Wczytano renderer</string>
|
||||
<string name="renderer_load_exception">Nie wczytano renderera.</string>
|
||||
<string name="renderers">Renderer wektorowy</string>
|
||||
<string name="renderers_descr">Wybierz wygląd renderingu.</string>
|
||||
<string name="renderers_descr">Wybierz wygląd renderingu</string>
|
||||
<string name="poi_context_menu_website">Wyświetl stronę internetową użytecznego miejsca</string>
|
||||
<string name="poi_context_menu_call">Wyświetl nr telefonu użytecznego miejsca</string>
|
||||
<string name="website">Strona internetowa</string>
|
||||
|
@ -1111,7 +1111,7 @@
|
|||
<string name="routing_attr_avoid_toll_name">Omijanie płatnych dróg</string>
|
||||
<string name="routing_attr_avoid_toll_description">Omijaj płatne drogi</string>
|
||||
<string name="routing_attr_avoid_unpaved_name">Omijanie nieutwardzonych dróg</string>
|
||||
<string name="routing_attr_avoid_unpaved_description">Unikaj nieutwardzonych dróg.</string>
|
||||
<string name="routing_attr_avoid_unpaved_description">Unikaj nieutwardzonych dróg</string>
|
||||
<string name="routing_attr_avoid_ferries_name">Omijanie przepraw promowych</string>
|
||||
<string name="routing_attr_avoid_ferries_description">Omijaj przeprawy promowe</string>
|
||||
<string name="routing_attr_avoid_motorway_name">Omijanie autostrad</string>
|
||||
|
@ -2822,7 +2822,7 @@ Reprezentuje obszar: %1$s x %2$s</string>
|
|||
\n• Opcjonalne nagrywanie podróży również w tle (gdy urządzenie znajduje się w trybie uśpienia)
|
||||
\nOsmAnd jest aktywnie rozwijanym oprogramowaniem typu open source. Każdy może wnieść swój wkład do aplikacji poprzez zgłaszanie błędów, ulepszanie tłumaczeń lub kodowanie nowych funkcji. Dodatkowo projekt opiera się na wkładzie finansowym na finansowanie kodowania i testowania nowych funkcjonalności.
|
||||
\n</string>
|
||||
<string name="test_voice_desrc">Naciśnij przycisk i słuchaj odpowiedniego komunikatu głosowego, aby zidentyfikować brakujące lub błędne monity.</string>
|
||||
<string name="test_voice_desrc">Naciśnij przycisk i słuchaj odpowiedniego komunikatu głosowego, aby zidentyfikować brakujące lub błędne monity</string>
|
||||
<string name="ask_for_location_permission">Proszę przyznać uprawnienia udostępniania położenia, aby kontynuować.</string>
|
||||
<string name="release_3_2_pre">• Naprawiono awarię podczas uruchamiania, która wystąpiła na niektórych urządzeniach
|
||||
\n
|
||||
|
@ -2891,7 +2891,7 @@ Reprezentuje obszar: %1$s x %2$s</string>
|
|||
<string name="voice_announcements">Komunikaty głosowe</string>
|
||||
<string name="intermediate_destinations">Pośrednie cele podróży</string>
|
||||
<string name="arrive_at_time">Dotarcie do celu o %1$s</string>
|
||||
<string name="quick_action_switch_day_night_descr">Przełącznik zmiany pomiędzy trybem dziennym i nocnym w OsmAndzie</string>
|
||||
<string name="quick_action_switch_day_night_descr">Przełącznik zmiany pomiędzy trybem dziennym i nocnym w OsmAndzie.</string>
|
||||
<string name="quick_action_switch_day_mode">Tryb dzienny</string>
|
||||
<string name="quick_action_switch_night_mode">Tryb nocny</string>
|
||||
<string name="quick_action_day_night_switch_mode">Zmień tryb dzienny/nocny</string>
|
||||
|
@ -3571,4 +3571,6 @@ Reprezentuje obszar: %1$s x %2$s</string>
|
|||
<string name="restore_all_profile_settings_descr">Wszystkie ustawienia profilu zostaną przywrócone do pierwotnego stanu po utworzeniu/zaimportowaniu tego profilu.</string>
|
||||
<string name="profile_backup_failed">Nie można utworzyć kopii zapasowej profilu.</string>
|
||||
<string name="clear_recorded_data_warning">Wyczyścić zarejestrowane dane\?</string>
|
||||
<string name="importing_from">Importowanie danych z %1$s</string>
|
||||
<string name="shared_string_importing">Importowanie</string>
|
||||
</resources>
|
|
@ -3468,7 +3468,7 @@ Pôr do Sol: %2$s</string>
|
|||
<string name="multimedia_photo_play_sound">Som do obturador da câmera</string>
|
||||
<string name="osm_authorization_success">Autorização bem sucedida</string>
|
||||
<string name="rearrange_categories">Reorganizar categorias</string>
|
||||
<string name="create_custom_categories_list_promo">Você pode adicionar categorias personalizadas, ocultar categorias que não considera necessárias e alterar a ordem de classificação da lista. A lista pode ser importada e exportada com perfis.</string>
|
||||
<string name="create_custom_categories_list_promo">Altere a ordem de classificação da lista, oculte categorias desnecessárias. Você pode importar ou exportar todas as alterações com perfis.</string>
|
||||
<string name="add_new_custom_category_button_promo">Você pode adicionar uma nova categoria personalizada selecionando uma ou algumas categorias necessárias.</string>
|
||||
<string name="shared_string_available">Disponível</string>
|
||||
<string name="add_custom_category">Adicionar categoria personalizada</string>
|
||||
|
|
|
@ -3423,7 +3423,7 @@
|
|||
<string name="permission_is_required">Для использования этой функции требуется разрешение.</string>
|
||||
<string name="monitoring_min_speed_descr">Это низкоскоростной фильтр отсечки, чтобы не записывать точки ниже определенной скорости. Это может сделать записанные треки более гладкими при просмотре на карте.</string>
|
||||
<string name="rearrange_categories">Упорядочить категории</string>
|
||||
<string name="create_custom_categories_list_promo">Вы можете добавлять категории, скрыть те, которые вы не находите необходимыми и изменить порядок. Список может быть импортирован и экспортирован с профилями.</string>
|
||||
<string name="create_custom_categories_list_promo">Изменяйте порядок сортировки списка, скрывайте ненужные категории. Вы можете импортировать или экспортировать все изменения с профилями.</string>
|
||||
<string name="add_new_custom_category_button_promo">Вы можете добавить новую пользовательскую категорию, выбрав одну или несколько необходимых категорий.</string>
|
||||
<string name="reset_to_default_category_button_promo">Сброс к настройкам по умолчанию приведет к сбросу порядка сортировки к настройкам по умолчанию после установки.</string>
|
||||
<string name="add_custom_category">Добавить пользовательскую категорию</string>
|
||||
|
|
|
@ -2714,7 +2714,7 @@ Pro praghere iscrie su còdighe intreu</string>
|
|||
<string name="shared_string_wifi_only">WiFi ebbia</string>
|
||||
<string name="select_travel_book">Issèbera unu libru de biàgiu</string>
|
||||
<string name="shared_string_travel_book">Libru de biàgiu</string>
|
||||
<string name="online_webpage_warning">Pàgina disponìbile petzi in lìnia. La cheres abèrrere in un\'eploradore (unu browser) ìnternet?</string>
|
||||
<string name="online_webpage_warning">Custa pàgina est disponìbile in lìnia ebbia. La cheres abèrrere in s\'esploradore/navigadore (browser) web\?</string>
|
||||
<string name="images_cache">Cache de sas immàgines</string>
|
||||
<string name="delete_search_history">Iscantzella sa cronologia de sas chircas</string>
|
||||
<string name="download_images">Iscàrriga sas immàgines</string>
|
||||
|
@ -3472,7 +3472,7 @@ Pro praghere iscrie su còdighe intreu</string>
|
|||
<string name="monitoring_min_accuracy_descr_recommendation">Impòsitu: est prus difìtzile a intzertare ite at a èssere registradu e ite nono. Diat èssere mègius a istudare custu filtru.</string>
|
||||
<string name="live_monitoring_time_buffer">Durada de sa memòria tampone (buffer)</string>
|
||||
<string name="rearrange_categories">Torra a ordinare sas categorias</string>
|
||||
<string name="create_custom_categories_list_promo">Podes importare categorias personalizadas, cuare categorias chi non pensas chi ti serbant e mudare s\'òrdine de sa lista. Sa lista podet èssere importada e esportada cun sos profilos.</string>
|
||||
<string name="create_custom_categories_list_promo">Modìfica s\'òrdine de sa lista e cua sas categorias chi non ti serbint. Podes importare o esportare totu sas modìficas cun sos profilos.</string>
|
||||
<string name="add_new_custom_category_button_promo">Podes annànghere una categoria personalizada noa ischertende·nde una o unas cantas pagas chi ti serbint.</string>
|
||||
<string name="shared_string_available">Disponìbile</string>
|
||||
<string name="add_custom_category">Annanghe una categoria personalizada</string>
|
||||
|
@ -3577,4 +3577,7 @@ Pro praghere iscrie su còdighe intreu</string>
|
|||
<string name="items_added">Elementos annànghidos</string>
|
||||
<string name="shared_string_import_complete">Importatzione acabada</string>
|
||||
<string name="import_complete_description">As importadu totu sos datos dae su %1$s, podes impreare sos butones in suta pro abèrrere sa parte de s\'aplicatzione chi serbit pro los amministrare.</string>
|
||||
<string name="recalculate_route_distance_promo">S\'àndala at a torrare a èssere carculada si sa distàntzia dae s\'àndala a sa positzione de su momentu at a èssere prus manna de su valore ischertadu.</string>
|
||||
<string name="select_distance_route_will_recalc">Ischerta sa distàntzia a pustis de sa cale s\'àndala at a torrare a èssere carculada.</string>
|
||||
<string name="recalculate_route_in_deviation">Torra a carculare s\'àndala in casu de deviatzione</string>
|
||||
</resources>
|
|
@ -3471,7 +3471,7 @@
|
|||
<string name="multimedia_photo_play_sound">Звук затвору камери</string>
|
||||
<string name="osm_authorization_success">Авторизація пройшла успішно</string>
|
||||
<string name="rearrange_categories">Перевпорядкувати категорії</string>
|
||||
<string name="create_custom_categories_list_promo">Ви можете додати особливі приховані категорії, які вам не здаються потрібними, і змінити упорядкування списку. Список можна імпортувати та експортувати за допомогою профілів.</string>
|
||||
<string name="create_custom_categories_list_promo">Змінюйте порядок сортування списку, приховайте непотрібні категорії. Ви можете імпортувати або експортувати всі зміни з профілями.</string>
|
||||
<string name="add_new_custom_category_button_promo">Ви можете додати нову власну категорію, вибравши одну або кілька необхідних категорій.</string>
|
||||
<string name="shared_string_available">Доступні</string>
|
||||
<string name="add_custom_category">Додати власну категорію</string>
|
||||
|
@ -3568,4 +3568,7 @@
|
|||
<string name="items_added">Елементи додано</string>
|
||||
<string name="shared_string_import_complete">Імпорт завершено</string>
|
||||
<string name="import_complete_description">Усі дані з %1$s імпортуються, ви можете використовувати кнопки нижче, щоб відкрити необхідну частину застосунку для управління ними.</string>
|
||||
<string name="recalculate_route_distance_promo">Маршрут буде перераховано, якщо відстань від маршруту до поточного місця розташування перевищує вибране значення.</string>
|
||||
<string name="select_distance_route_will_recalc">Виберіть відстань, після якого маршрут буде перераховано.</string>
|
||||
<string name="recalculate_route_in_deviation">Перерахунок маршруту у випадку відхилення</string>
|
||||
</resources>
|
|
@ -2071,7 +2071,7 @@
|
|||
<string name="gpx_no_tracks_title">您尚未有任何的 GPX 檔案</string>
|
||||
<string name="gpx_no_tracks_title_folder">您也可以增加 GPX 檔案到資料夾</string>
|
||||
<string name="gpx_add_track">增加更多…</string>
|
||||
<string name="shared_string_appearance">外表</string>
|
||||
<string name="shared_string_appearance">外觀</string>
|
||||
<string name="trip_rec_notification_settings">啟用快速錄製</string>
|
||||
<string name="trip_rec_notification_settings_desc">顯示允許行程錄製的系統通知。</string>
|
||||
<string name="rendering_value_fine_name">精細</string>
|
||||
|
@ -3471,7 +3471,7 @@
|
|||
<string name="multimedia_photo_play_sound">相機快門聲</string>
|
||||
<string name="osm_authorization_success">驗證成功</string>
|
||||
<string name="rearrange_categories">重新排列分類</string>
|
||||
<string name="create_custom_categories_list_promo">您可以新增自訂的分類,隱藏您不需要的分類並變更清單順序。清單可與設定檔一起匯入與匯出。</string>
|
||||
<string name="create_custom_categories_list_promo">變更清單順序,隱藏不需要的分類。你可以匯入或匯出所有包含變更的設定檔。</string>
|
||||
<string name="add_new_custom_category_button_promo">您可以透過選取一個或多個需要的分類來新增自訂的分類。</string>
|
||||
<string name="shared_string_available">可用</string>
|
||||
<string name="add_custom_category">新增自訂分類</string>
|
||||
|
@ -3568,4 +3568,7 @@
|
|||
<string name="items_added">已新增項目</string>
|
||||
<string name="shared_string_import_complete">匯入完成</string>
|
||||
<string name="import_complete_description">所有從 %1$s 而來的資料都已匯入,您可以使用下方的按鈕以開啟應用程式中需要的部份來管理它。</string>
|
||||
</resources>
|
||||
<string name="recalculate_route_distance_promo">如果從路徑到目前位置的距離大於選定的值,將會重新計算路徑。</string>
|
||||
<string name="select_distance_route_will_recalc">選取要重新計算路徑的距離。</string>
|
||||
<string name="recalculate_route_in_deviation">發生偏離時重新計算路線</string>
|
||||
</resources>
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
-->
|
||||
<string name="custom_osmand_plugin">Custom OsmAnd plugin</string>
|
||||
<string name="recalculate_route_distance_promo">The route will be recalculated if the distance from the route to the current location is more than selected value.</string>
|
||||
<string name="select_distance_route_will_recalc">Select the distance after which the route will be recalculated.</string>
|
||||
<string name="recalculate_route_in_deviation">Recalculate route in case of deviation</string>
|
||||
<string name="clear_recorded_data_warning">Are you sure you want to clear recorded data?</string>
|
||||
<string name="restore_all_profile_settings_descr">All profile settings will be restored to their original state after creating/importing this profile.</string>
|
||||
<string name="restore_all_profile_settings">Restore all profile settings?</string>
|
||||
|
@ -74,7 +77,7 @@
|
|||
<string name="use_system_screen_timeout_promo">Disabled by default, if OsmAnd running on foreground, the screen doesn’t time out.\n\nIf enabled OsmAnd will use system timeout settings.</string>
|
||||
<string name="accessibility_mode_disabled">Accessibility mode disabled in your system.</string>
|
||||
<string name="rearrange_categories">Rearrange categories</string>
|
||||
<string name="create_custom_categories_list_promo">You can add custom categories hide categories that you don’t find necessary and change the sort order of the list. The list can be imported and exported with profiles.</string>
|
||||
<string name="create_custom_categories_list_promo">Change the sort order of the list, hide unnecessary categories. You can import or export all changes with profiles.</string>
|
||||
<string name="add_new_custom_category_button_promo">You can add a new custom category by selecting one or a few needed categories.</string>
|
||||
<string name="shared_string_available">Available</string>
|
||||
<string name="add_custom_category">Add custom category</string>
|
||||
|
|
|
@ -39,6 +39,7 @@ import net.osmand.plus.myplaces.FavoritesActivity;
|
|||
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
|
@ -345,6 +346,7 @@ public abstract class OsmandPlugin {
|
|||
initPlugin(app, plugin);
|
||||
}
|
||||
}
|
||||
app.getQuickActionRegistry().updateActionTypes();
|
||||
}
|
||||
|
||||
private static void initPlugin(OsmandApplication app, OsmandPlugin plugin) {
|
||||
|
@ -400,6 +402,7 @@ public abstract class OsmandPlugin {
|
|||
}
|
||||
updateMarketPlugin(app, enabledPlugins, plugin);
|
||||
}
|
||||
app.getQuickActionRegistry().updateActionTypes();
|
||||
}
|
||||
|
||||
protected boolean pluginAvailable(OsmandApplication app) {
|
||||
|
@ -423,6 +426,7 @@ public abstract class OsmandPlugin {
|
|||
plugin.setActive(false);
|
||||
}
|
||||
app.getSettings().enablePlugin(plugin.getId(), enable);
|
||||
app.getQuickActionRegistry().updateActionTypes();
|
||||
if (activity != null) {
|
||||
if (activity instanceof MapActivity) {
|
||||
final MapActivity mapActivity = (MapActivity) activity;
|
||||
|
@ -494,14 +498,16 @@ public abstract class OsmandPlugin {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) {
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
}
|
||||
|
||||
public void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) {
|
||||
protected void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) {
|
||||
}
|
||||
|
||||
public void registerOptionsMenuItems(MapActivity mapActivity, ContextMenuAdapter helper) {
|
||||
protected void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) {
|
||||
}
|
||||
|
||||
protected void registerOptionsMenuItems(MapActivity mapActivity, ContextMenuAdapter helper) {
|
||||
}
|
||||
|
||||
public DashFragmentData getCardFragment() {
|
||||
|
@ -511,13 +517,13 @@ public abstract class OsmandPlugin {
|
|||
public void updateLocation(Location location) {
|
||||
}
|
||||
|
||||
public void addMyPlacesTab(FavoritesActivity favoritesActivity, List<TabItem> mTabs, Intent intent) {
|
||||
protected void addMyPlacesTab(FavoritesActivity favoritesActivity, List<TabItem> mTabs, Intent intent) {
|
||||
}
|
||||
|
||||
public void contextMenuFragment(Activity activity, Fragment fragment, Object info, ContextMenuAdapter adapter) {
|
||||
protected void contextMenuFragment(Activity activity, Fragment fragment, Object info, ContextMenuAdapter adapter) {
|
||||
}
|
||||
|
||||
public void optionsMenuFragment(Activity activity, Fragment fragment, ContextMenuAdapter optionsMenuAdapter) {
|
||||
protected void optionsMenuFragment(Activity activity, Fragment fragment, ContextMenuAdapter optionsMenuAdapter) {
|
||||
}
|
||||
|
||||
public List<String> indexingFiles(IProgress progress) {
|
||||
|
@ -757,6 +763,8 @@ public abstract class OsmandPlugin {
|
|||
return installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static boolean onMapActivityKeyUp(MapActivity mapActivity, int keyCode) {
|
||||
for (OsmandPlugin p : getEnabledPlugins()) {
|
||||
if (p.mapActivityKeyUp(mapActivity, keyCode))
|
||||
|
@ -765,6 +773,14 @@ public abstract class OsmandPlugin {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static void registerQuickActionTypesPlugins(List<QuickActionType> quickActionTypes) {
|
||||
for (OsmandPlugin p : getEnabledPlugins()) {
|
||||
p.registerQuickActionTypes(quickActionTypes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void updateLocationPlugins(net.osmand.Location location) {
|
||||
for (OsmandPlugin p : getEnabledPlugins()) {
|
||||
p.updateLocation(location);
|
||||
|
|
|
@ -959,7 +959,7 @@ public class OsmandSettings {
|
|||
}
|
||||
}
|
||||
|
||||
private class FloatPreference extends CommonPreference<Float> {
|
||||
public class FloatPreference extends CommonPreference<Float> {
|
||||
|
||||
|
||||
private FloatPreference(String id, float defaultValue) {
|
||||
|
|
|
@ -25,6 +25,7 @@ import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo;
|
|||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionRegistry;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -1262,19 +1263,27 @@ public class SettingsHelper {
|
|||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<HashMap<String, String>>() {
|
||||
}.getType();
|
||||
QuickActionRegistry quickActionRegistry = app.getQuickActionRegistry();
|
||||
JSONArray itemsJson = json.getJSONArray("items");
|
||||
for (int i = 0; i < itemsJson.length(); i++) {
|
||||
JSONObject object = itemsJson.getJSONObject(i);
|
||||
String name = object.getString("name");
|
||||
int actionType = object.getInt("type");
|
||||
String paramsString = object.getString("params");
|
||||
HashMap<String, String> params = gson.fromJson(paramsString, type);
|
||||
QuickAction quickAction = new QuickAction(actionType);
|
||||
if (!name.isEmpty()) {
|
||||
quickAction.setName(name);
|
||||
QuickAction quickAction = null;
|
||||
if(object.has("actionType")) {
|
||||
quickAction = quickActionRegistry .newActionByStringType(object.getString("actionType"));
|
||||
} else if(object.has("type")) {
|
||||
quickAction = quickActionRegistry .newActionByType(object.getInt("type"));
|
||||
}
|
||||
if (quickAction != null) {
|
||||
String paramsString = object.getString("params");
|
||||
HashMap<String, String> params = gson.fromJson(paramsString, type);
|
||||
|
||||
if (!name.isEmpty()) {
|
||||
quickAction.setName(name);
|
||||
}
|
||||
quickAction.setParams(params);
|
||||
items.add(quickAction);
|
||||
}
|
||||
quickAction.setParams(params);
|
||||
items.add(quickAction);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
throw new IllegalArgumentException("Json parse error", e);
|
||||
|
@ -1293,7 +1302,7 @@ public class SettingsHelper {
|
|||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("name", action.hasCustomName(app)
|
||||
? action.getName(app) : "");
|
||||
jsonObject.put("type", action.getType());
|
||||
jsonObject.put("actionType", action.getActionType().getStringId());
|
||||
jsonObject.put("params", gson.toJson(action.getParams(), type));
|
||||
jsonArray.put(jsonObject);
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ import net.osmand.plus.helpers.AndroidUiHelper;
|
|||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
|
||||
import net.osmand.plus.myplaces.FavoritesActivity;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.settings.BaseSettingsFragment;
|
||||
import net.osmand.plus.views.MapInfoLayer;
|
||||
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
|
||||
|
@ -869,6 +870,12 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
mapActivity.startActivityForResult(intent, 205);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
quickActionTypes.add(TakeAudioNoteAction.TYPE);
|
||||
quickActionTypes.add(TakePhotoNoteAction.TYPE);
|
||||
quickActionTypes.add(TakeVideoNoteAction.TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mapActivityScreenOff(MapActivity activity) {
|
||||
|
|
|
@ -10,9 +10,14 @@ import net.osmand.plus.OsmandPlugin;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class TakeAudioNoteAction extends QuickAction {
|
||||
public static final int TYPE = 8;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(8,
|
||||
"audio.note", TakeAudioNoteAction.class).
|
||||
nameRes(R.string.quick_action_take_audio_note).iconRes(R.drawable.ic_action_micro_dark).nonEditable().
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
public TakeAudioNoteAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -10,9 +10,14 @@ import net.osmand.plus.OsmandPlugin;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class TakePhotoNoteAction extends QuickAction {
|
||||
public static final int TYPE = 10;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(10,
|
||||
"photo.note", TakePhotoNoteAction .class).
|
||||
nameRes(R.string.quick_action_take_photo_note).iconRes(R.drawable.ic_action_photo_dark).nonEditable().
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
public TakePhotoNoteAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -10,9 +10,14 @@ import net.osmand.plus.OsmandPlugin;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class TakeVideoNoteAction extends QuickAction {
|
||||
public static final int TYPE = 9;
|
||||
public static final QuickActionType TYPE = new QuickActionType(9,
|
||||
"video.note", TakeVideoNoteAction.class).
|
||||
nameRes(R.string.quick_action_take_video_note).iconRes(R.drawable.ic_action_video_dark).nonEditable().
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
|
||||
public TakeVideoNoteAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -26,7 +26,7 @@ public class DividerHalfItem extends DividerItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected int getLeftMargin(Context context) {
|
||||
protected int getStartMargin(Context context) {
|
||||
return context.getResources().getDimensionPixelSize(R.dimen.bottom_sheet_divider_margin_start);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,10 +39,10 @@ public class DividerItem extends BaseBottomSheetItem {
|
|||
public void inflate(Context context, ViewGroup container, boolean nightMode) {
|
||||
super.inflate(context, container, nightMode);
|
||||
|
||||
int height = AndroidUtils.dpToPx(context, 1);
|
||||
int height = getHeight(context);
|
||||
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) view.getLayoutParams();
|
||||
params.setMargins(getLeftMargin(context), getTopMargin(context), 0, getBottomMargin(context));
|
||||
AndroidUtils.setMargins(params, getStartMargin(context), getTopMargin(context), 0, getBottomMargin(context));
|
||||
params.height = height;
|
||||
|
||||
view.setMinimumHeight(height);
|
||||
|
@ -53,7 +53,7 @@ public class DividerItem extends BaseBottomSheetItem {
|
|||
return context.getResources().getDimensionPixelSize(R.dimen.bottom_sheet_content_padding_small);
|
||||
}
|
||||
|
||||
protected int getLeftMargin(Context context) {
|
||||
protected int getStartMargin(Context context) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -61,8 +61,12 @@ public class DividerItem extends BaseBottomSheetItem {
|
|||
return context.getResources().getDimensionPixelSize(R.dimen.bottom_sheet_content_padding_small);
|
||||
}
|
||||
|
||||
protected int getHeight(Context ctx) {
|
||||
return AndroidUtils.dpToPx(ctx, 1);
|
||||
}
|
||||
|
||||
@ColorRes
|
||||
private int getBgColorId(boolean nightMode) {
|
||||
protected int getBgColorId(boolean nightMode) {
|
||||
if (colorId != INVALID_ID) {
|
||||
return colorId;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package net.osmand.plus.base.bottomsheetmenu.simpleitems;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public class DividerSpaceItem extends DividerItem {
|
||||
|
||||
private int verticalSpacePx;
|
||||
|
||||
public DividerSpaceItem(Context context, int verticalSpacePx) {
|
||||
super(context);
|
||||
this.verticalSpacePx = verticalSpacePx;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTopMargin(Context context) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getBottomMargin(Context context) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHeight(Context ctx) {
|
||||
return verticalSpacePx;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getBgColorId(boolean nightMode) {
|
||||
return android.R.color.transparent;
|
||||
}
|
||||
}
|
|
@ -26,7 +26,7 @@ public class DividerStartItem extends DividerItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected int getLeftMargin(Context context) {
|
||||
protected int getStartMargin(Context context) {
|
||||
return context.getResources().getDimensionPixelSize(R.dimen.bottom_sheet_divider_margin_start);
|
||||
}
|
||||
}
|
|
@ -26,7 +26,7 @@ public class SubtitmeListDividerItem extends DividerItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected int getLeftMargin(Context context) {
|
||||
protected int getStartMargin(Context context) {
|
||||
return context.getResources().getDimensionPixelSize(R.dimen.list_content_padding);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,13 +31,9 @@ import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
|||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
||||
import net.osmand.plus.quickaction.CreateEditActionDialog;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionFactory;
|
||||
import net.osmand.plus.quickaction.QuickActionRegistry;
|
||||
import net.osmand.plus.quickaction.SwitchableAction;
|
||||
import net.osmand.plus.quickaction.actions.MapOverlayAction;
|
||||
import net.osmand.plus.quickaction.actions.MapSourceAction;
|
||||
import net.osmand.plus.quickaction.actions.MapStyleAction;
|
||||
import net.osmand.plus.quickaction.actions.MapUnderlayAction;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.render.RenderingRulesStorage;
|
||||
|
||||
|
@ -71,7 +67,7 @@ public class SelectMapViewQuickActionsBottomSheet extends MenuBottomSheetDialogF
|
|||
|
||||
QuickActionRegistry quickActionRegistry = app.getQuickActionRegistry();
|
||||
action = quickActionRegistry.getQuickAction(id);
|
||||
action = QuickActionFactory.produceAction(action);
|
||||
action = QuickActionRegistry.produceAction(action);
|
||||
if (action == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -79,22 +75,7 @@ public class SelectMapViewQuickActionsBottomSheet extends MenuBottomSheetDialogF
|
|||
if (savedInstanceState != null) {
|
||||
selectedItem = savedInstanceState.getString(SELECTED_ITEM_KEY);
|
||||
} else {
|
||||
if (action instanceof MapStyleAction) {
|
||||
RenderingRulesStorage current = app.getRendererRegistry().getCurrentSelectedRenderer();
|
||||
if (current != null) {
|
||||
selectedItem = current.getName();
|
||||
} else {
|
||||
selectedItem = RendererRegistry.DEFAULT_RENDER;
|
||||
}
|
||||
} else if (action instanceof MapSourceAction) {
|
||||
selectedItem = settings.MAP_ONLINE_DATA.get()
|
||||
? settings.MAP_TILE_SOURCES.get()
|
||||
: MapSourceAction.LAYER_OSM_VECTOR;
|
||||
} else if (action instanceof MapUnderlayAction) {
|
||||
selectedItem = settings.MAP_UNDERLAY.get();
|
||||
} else if (action instanceof MapOverlayAction) {
|
||||
selectedItem = settings.MAP_OVERLAY.get();
|
||||
}
|
||||
selectedItem = ((SwitchableAction<?>) action).getSelectedItem(app);
|
||||
}
|
||||
rbColorList = AndroidUtils.createCheckedColorStateList(app, R.color.icon_color_default_light, getActiveColorId());
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.osmedit;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -13,14 +13,19 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class AddOSMBugAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 12;
|
||||
|
||||
private static final String KEY_MESSAGE = "message";
|
||||
private static final String KEY_SHO_DIALOG = "dialog";
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(12,
|
||||
"osmbug.add", AddOSMBugAction.class).
|
||||
nameRes(R.string.quick_action_add_osm_bug).iconRes(R.drawable.ic_action_bug_dark).
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
public AddOSMBugAction() {
|
||||
super(TYPE);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.osmedit;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -40,16 +40,10 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.osmedit.EditPoiData;
|
||||
import net.osmand.plus.osmedit.EditPoiDialogFragment;
|
||||
import net.osmand.plus.osmedit.OpenstreetmapLocalUtil;
|
||||
import net.osmand.plus.osmedit.OpenstreetmapPoint;
|
||||
import net.osmand.plus.osmedit.OpenstreetmapUtil;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.osmedit.OsmPoint;
|
||||
import net.osmand.plus.osmedit.dialogs.PoiSubTypeDialogFragment;
|
||||
import net.osmand.plus.quickaction.CreateEditActionDialog;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
|
@ -66,7 +60,10 @@ import static net.osmand.plus.osmedit.AdvancedEditPoiFragment.addPoiToStringSet;
|
|||
import static net.osmand.plus.osmedit.EditPoiData.POI_TYPE_TAG;
|
||||
|
||||
public class AddPOIAction extends QuickAction {
|
||||
public static final int TYPE = 13;
|
||||
public static final QuickActionType TYPE = new QuickActionType(13,
|
||||
"osmpoi.add", AddPOIAction.class).
|
||||
nameRes(R.string.quick_action_add_poi).iconRes(R.drawable.ic_action_gabout_dark).
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
public static final String KEY_TAG = "key_tag";
|
||||
public static final String KEY_DIALOG = "dialog";
|
||||
|
|
@ -41,6 +41,7 @@ import net.osmand.plus.myplaces.AvailableGPXFragment;
|
|||
import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo;
|
||||
import net.osmand.plus.myplaces.FavoritesActivity;
|
||||
import net.osmand.plus.osmedit.OsmPoint.Action;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.settings.BaseSettingsFragment;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -136,6 +137,13 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
private OsmEditsLayer osmEditsLayer;
|
||||
// private EditingPOIDialogProvider poiActions;
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
quickActionTypes.add(AddPOIAction.TYPE);
|
||||
quickActionTypes.add(AddOSMBugAction.TYPE);
|
||||
quickActionTypes.add(ShowHideOSMBugAction.TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLayers(OsmandMapTileView mapView, MapActivity activity) {
|
||||
if (isActive()) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.osmedit;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -9,13 +9,16 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class ShowHideOSMBugAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 24;
|
||||
public static final QuickActionType TYPE = new QuickActionType(24,
|
||||
"osmbug.showhide", ShowHideOSMBugAction.class).
|
||||
nameRes(R.string.quick_action_showhide_osmbugs_title).iconRes(R.drawable.ic_action_bug_dark).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public ShowHideOSMBugAction() {
|
||||
super(TYPE);
|
|
@ -10,10 +10,14 @@ import net.osmand.plus.OsmandPlugin;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class ParkingAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 7;
|
||||
public static final QuickActionType TYPE = new QuickActionType(7,
|
||||
"parking.add", ParkingAction.class).
|
||||
nameRes(R.string.quick_action_add_parking).iconRes(R.drawable.ic_action_parking_dark).nonEditable().
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
public ParkingAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.osmand.plus.UiUtilities;
|
|||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.dashboard.tools.DashFragmentData;
|
||||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.MapInfoLayer;
|
||||
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
|
||||
|
@ -40,6 +41,7 @@ import net.osmand.plus.views.OsmandMapTileView;
|
|||
import net.osmand.plus.views.mapwidgets.TextInfoWidget;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_MARK_AS_PARKING_LOC;
|
||||
|
||||
|
@ -626,4 +628,10 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
|||
public DashFragmentData getCardFragment() {
|
||||
return DashParkingFragment.FRAGMENT_DATA;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
quickActionTypes.add(ParkingAction.TYPE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,14 +48,12 @@ public class AddQuickActionDialog extends DialogFragment {
|
|||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
List<QuickAction> active = ((MapActivity) getActivity())
|
||||
.getMyApplication()
|
||||
.getQuickActionRegistry()
|
||||
.getQuickActions();
|
||||
QuickActionRegistry quickActionRegistry = ((MapActivity) getActivity())
|
||||
.getMyApplication()
|
||||
.getQuickActionRegistry();
|
||||
|
||||
View root = UiUtilities.getInflater(getActivity(), !isLightContent).inflate(R.layout.quick_action_add_dialog, container, false);
|
||||
Adapter adapter = new Adapter(QuickActionFactory.produceTypeActionsListWithHeaders(active));
|
||||
Adapter adapter = new Adapter(quickActionRegistry.produceTypeActionsListWithHeaders());
|
||||
|
||||
TextView tvTitle = root.findViewById(R.id.tvTitle);
|
||||
RecyclerView recyclerView = (RecyclerView) root.findViewById(R.id.recycler_view);
|
||||
|
@ -86,7 +84,7 @@ public class AddQuickActionDialog extends DialogFragment {
|
|||
private static final int HEADER = 1;
|
||||
private static final int ITEM = 2;
|
||||
|
||||
private List<QuickAction> data;
|
||||
private List<QuickActionType> data;
|
||||
|
||||
public class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
|
@ -114,7 +112,7 @@ public class AddQuickActionDialog extends DialogFragment {
|
|||
}
|
||||
}
|
||||
|
||||
public Adapter(List<QuickAction> data) {
|
||||
public Adapter(List<QuickActionType> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
@ -138,7 +136,7 @@ public class AddQuickActionDialog extends DialogFragment {
|
|||
@Override
|
||||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
final QuickAction action = data.get(position);
|
||||
final QuickActionType action = data.get(position);
|
||||
|
||||
if (getItemViewType(position) == HEADER) {
|
||||
|
||||
|
@ -161,7 +159,7 @@ public class AddQuickActionDialog extends DialogFragment {
|
|||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(action.type);
|
||||
CreateEditActionDialog dialog = CreateEditActionDialog.newInstance(action.getId());
|
||||
dialog.show(getFragmentManager(), CreateEditActionDialog.TAG);
|
||||
|
||||
dismiss();
|
||||
|
@ -179,7 +177,7 @@ public class AddQuickActionDialog extends DialogFragment {
|
|||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
|
||||
if (data.get(position).type == 0)
|
||||
if (data.get(position).getId() == 0)
|
||||
return HEADER;
|
||||
|
||||
return ITEM;
|
||||
|
|
|
@ -123,8 +123,8 @@ public class CreateEditActionDialog extends DialogFragment {
|
|||
? isNew = actionId == 0
|
||||
: savedInstanceState.getBoolean(KEY_ACTION_IS_NEW);
|
||||
|
||||
action = QuickActionFactory.produceAction(isNew
|
||||
? QuickActionFactory.newActionByType(type)
|
||||
action = QuickActionRegistry.produceAction(isNew
|
||||
? quickActionRegistry.newActionByType(type)
|
||||
: quickActionRegistry.getQuickAction(actionId));
|
||||
|
||||
setupToolbar(view);
|
||||
|
@ -139,7 +139,7 @@ public class CreateEditActionDialog extends DialogFragment {
|
|||
super.onSaveInstanceState(outState);
|
||||
|
||||
outState.putLong(KEY_ACTION_ID, action.getId());
|
||||
outState.putInt(KEY_ACTION_TYPE, action.type);
|
||||
outState.putInt(KEY_ACTION_TYPE, action.getType());
|
||||
outState.putBoolean(KEY_ACTION_IS_NEW, isNew);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,19 +2,28 @@ package net.osmand.plus.quickaction;
|
|||
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.actions.NewAction;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class QuickAction {
|
||||
|
||||
|
@ -22,68 +31,55 @@ public class QuickAction {
|
|||
|
||||
void onActionSelected(QuickAction action);
|
||||
}
|
||||
private static int SEQ = 0;
|
||||
|
||||
protected int type;
|
||||
protected long id;
|
||||
|
||||
private @StringRes Integer nameRes;
|
||||
private @DrawableRes int iconRes;
|
||||
private boolean isActionEditable;
|
||||
|
||||
private String name;
|
||||
private HashMap<String, String> params;
|
||||
private Map<String, String> params;
|
||||
private QuickActionType actionType;
|
||||
|
||||
protected QuickAction() {
|
||||
this.id = System.currentTimeMillis();
|
||||
this(QuickActionRegistry.TYPE_ADD_ITEMS);
|
||||
}
|
||||
|
||||
protected QuickAction(int type, @StringRes int nameRes) {
|
||||
this.id = System.currentTimeMillis();
|
||||
this.nameRes = nameRes;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public QuickAction(int type) {
|
||||
this.id = System.currentTimeMillis();
|
||||
this.type = type;
|
||||
this.nameRes = QuickActionFactory.getActionName(type);
|
||||
this.iconRes = QuickActionFactory.getActionIcon(type);
|
||||
this.isActionEditable = QuickActionFactory.isActionEditable(type);
|
||||
public QuickAction(QuickActionType type) {
|
||||
this.id = System.currentTimeMillis() + (SEQ++);
|
||||
this.actionType = type;
|
||||
}
|
||||
|
||||
public QuickAction(QuickAction quickAction) {
|
||||
this.type = quickAction.type;
|
||||
this.actionType = quickAction.actionType;
|
||||
this.id = quickAction.id;
|
||||
this.name = quickAction.name;
|
||||
this.params = quickAction.params;
|
||||
|
||||
this.nameRes = QuickActionFactory.getActionName(type);
|
||||
this.iconRes = QuickActionFactory.getActionIcon(type);
|
||||
this.isActionEditable = QuickActionFactory.isActionEditable(type);
|
||||
}
|
||||
|
||||
public int getNameRes() {
|
||||
return nameRes;
|
||||
return actionType == null ? 0 : actionType.getNameRes();
|
||||
}
|
||||
|
||||
public int getIconRes() {
|
||||
return iconRes;
|
||||
return actionType == null ? 0 : actionType.getIconRes();
|
||||
}
|
||||
|
||||
public int getIconRes(Context context) {
|
||||
return iconRes;
|
||||
return actionType == null ? 0 : actionType.getIconRes();
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public long getType() {
|
||||
return type;
|
||||
public int getType() {
|
||||
return actionType.getId();
|
||||
}
|
||||
|
||||
public void setActionType(QuickActionType actionType) {
|
||||
this.actionType = actionType;
|
||||
}
|
||||
|
||||
public boolean isActionEditable() {
|
||||
return isActionEditable;
|
||||
return actionType == null ? false : actionType.isActionEditable();
|
||||
}
|
||||
|
||||
public boolean isActionEnable(OsmandApplication app) {
|
||||
|
@ -92,16 +88,25 @@ public class QuickAction {
|
|||
|
||||
public String getName(Context context) {
|
||||
if (Algorithms.isEmpty(name)) {
|
||||
return nameRes != null ? context.getString(nameRes) : "";
|
||||
} else {
|
||||
return getDefaultName(context);
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
public HashMap<String, String> getParams() {
|
||||
public String getRawName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
if (params == null) params = new HashMap<>();
|
||||
@NonNull
|
||||
private String getDefaultName(Context context) {
|
||||
return getNameRes() != 0 ? context.getString(getNameRes()) : "";
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
if (params == null) {
|
||||
params = new HashMap<>();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
|
@ -109,7 +114,11 @@ public class QuickAction {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public void setParams(HashMap<String, String> params) {
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
@ -121,7 +130,11 @@ public class QuickAction {
|
|||
return getName(application);
|
||||
}
|
||||
|
||||
public void setAutoGeneratedTitle(EditText title){
|
||||
public QuickActionType getActionType() {
|
||||
return actionType;
|
||||
}
|
||||
|
||||
public void setAutoGeneratedTitle(EditText title){
|
||||
}
|
||||
|
||||
public void execute(MapActivity activity){};
|
||||
|
@ -130,9 +143,9 @@ public class QuickAction {
|
|||
|
||||
public boolean hasInstanceInList(List<QuickAction> active){
|
||||
|
||||
for (QuickAction action: active){
|
||||
if (action.type == type) return true;
|
||||
}
|
||||
for (QuickAction action : active) {
|
||||
if (action.getType() == getType()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -146,7 +159,7 @@ public class QuickAction {
|
|||
|
||||
QuickAction action = (QuickAction) o;
|
||||
|
||||
if (type != action.type) return false;
|
||||
if (getType() != action.getType()) return false;
|
||||
if (id != action.id) return false;
|
||||
|
||||
return true;
|
||||
|
@ -156,15 +169,12 @@ public class QuickAction {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = type;
|
||||
int result = getType();
|
||||
result = 31 * result + (int) (id ^ (id >>> 32));
|
||||
result = 31 * result + nameRes;
|
||||
result = 31 * result + iconRes;
|
||||
result = 31 * result + (name != null ? name.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean hasCustomName(Context context) {
|
||||
return !getName(context).equals(context.getString(nameRes));
|
||||
return !getName(context).equals(getDefaultName(context));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,595 +0,0 @@
|
|||
package net.osmand.plus.quickaction;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.audionotes.AudioVideoNotesPlugin;
|
||||
import net.osmand.plus.audionotes.TakeAudioNoteAction;
|
||||
import net.osmand.plus.audionotes.TakePhotoNoteAction;
|
||||
import net.osmand.plus.audionotes.TakeVideoNoteAction;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.parkingpoint.ParkingAction;
|
||||
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
|
||||
import net.osmand.plus.quickaction.actions.AddOSMBugAction;
|
||||
import net.osmand.plus.quickaction.actions.AddPOIAction;
|
||||
import net.osmand.plus.quickaction.actions.ContourLinesAction;
|
||||
import net.osmand.plus.quickaction.actions.DayNightModeAction;
|
||||
import net.osmand.plus.quickaction.actions.FavoriteAction;
|
||||
import net.osmand.plus.quickaction.actions.GPXAction;
|
||||
import net.osmand.plus.quickaction.actions.HillshadeAction;
|
||||
import net.osmand.plus.quickaction.actions.MapOverlayAction;
|
||||
import net.osmand.plus.quickaction.actions.MapSourceAction;
|
||||
import net.osmand.plus.quickaction.actions.MapStyleAction;
|
||||
import net.osmand.plus.quickaction.actions.MapUnderlayAction;
|
||||
import net.osmand.plus.quickaction.actions.MarkerAction;
|
||||
import net.osmand.plus.quickaction.actions.NavAddDestinationAction;
|
||||
import net.osmand.plus.quickaction.actions.NavAddFirstIntermediateAction;
|
||||
import net.osmand.plus.quickaction.actions.NavAutoZoomMapAction;
|
||||
import net.osmand.plus.quickaction.actions.NavDirectionsFromAction;
|
||||
import net.osmand.plus.quickaction.actions.NavReplaceDestinationAction;
|
||||
import net.osmand.plus.quickaction.actions.NavResumePauseAction;
|
||||
import net.osmand.plus.quickaction.actions.NavStartStopAction;
|
||||
import net.osmand.plus.quickaction.actions.NavVoiceAction;
|
||||
import net.osmand.plus.quickaction.actions.NewAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHideFavoritesAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHideGpxTracksAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHideOSMBugAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHidePoiAction;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
import net.osmand.plus.srtmplugin.SRTMPlugin;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class QuickActionFactory {
|
||||
|
||||
public String quickActionListToString(List<QuickAction> quickActions) {
|
||||
return new Gson().toJson(quickActions);
|
||||
}
|
||||
|
||||
public List<QuickAction> parseActiveActionsList(String json) {
|
||||
Type type = new TypeToken<List<QuickAction>>() {
|
||||
}.getType();
|
||||
ArrayList<QuickAction> quickActions = new Gson().fromJson(json, type);
|
||||
return quickActions != null ? quickActions : new ArrayList<QuickAction>();
|
||||
}
|
||||
|
||||
public static List<QuickAction> produceTypeActionsListWithHeaders(List<QuickAction> active) {
|
||||
ArrayList<QuickAction> quickActions = new ArrayList<>();
|
||||
quickActions.add(new QuickAction(0, R.string.quick_action_add_create_items));
|
||||
quickActions.add(new FavoriteAction());
|
||||
quickActions.add(new GPXAction());
|
||||
QuickAction marker = new MarkerAction();
|
||||
|
||||
if (!marker.hasInstanceInList(active)) {
|
||||
quickActions.add(marker);
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class) != null) {
|
||||
QuickAction audio = new TakeAudioNoteAction();
|
||||
QuickAction photo = new TakePhotoNoteAction();
|
||||
QuickAction video = new TakeVideoNoteAction();
|
||||
|
||||
if (!audio.hasInstanceInList(active)) {
|
||||
quickActions.add(audio);
|
||||
}
|
||||
|
||||
if (!photo.hasInstanceInList(active)) {
|
||||
quickActions.add(photo);
|
||||
}
|
||||
|
||||
if (!video.hasInstanceInList(active)) {
|
||||
quickActions.add(video);
|
||||
}
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) {
|
||||
quickActions.add(new AddPOIAction());
|
||||
quickActions.add(new AddOSMBugAction());
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(ParkingPositionPlugin.class) != null) {
|
||||
QuickAction parking = new ParkingAction();
|
||||
if (!parking.hasInstanceInList(active)) {
|
||||
quickActions.add(parking);
|
||||
}
|
||||
}
|
||||
|
||||
quickActions.add(new QuickAction(0, R.string.quick_action_add_configure_map));
|
||||
|
||||
QuickAction favorites = new ShowHideFavoritesAction();
|
||||
if (!favorites.hasInstanceInList(active)) {
|
||||
quickActions.add(favorites);
|
||||
}
|
||||
|
||||
quickActions.add(new ShowHideGpxTracksAction());
|
||||
|
||||
quickActions.add(new ShowHidePoiAction());
|
||||
if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) {
|
||||
QuickAction showHideOSMBugAction = new ShowHideOSMBugAction();
|
||||
if (!showHideOSMBugAction.hasInstanceInList(active)) {
|
||||
quickActions.add(showHideOSMBugAction);
|
||||
}
|
||||
}
|
||||
|
||||
quickActions.add(new MapStyleAction());
|
||||
if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null) {
|
||||
quickActions.add(new MapSourceAction());
|
||||
quickActions.add(new MapOverlayAction());
|
||||
quickActions.add(new MapUnderlayAction());
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null) {
|
||||
quickActions.add(new ContourLinesAction());
|
||||
quickActions.add(new HillshadeAction());
|
||||
}
|
||||
|
||||
quickActions.add(new DayNightModeAction());
|
||||
|
||||
|
||||
QuickAction voice = new NavVoiceAction();
|
||||
QuickAction directionFrom = new NavDirectionsFromAction();
|
||||
QuickAction addDestination = new NavAddDestinationAction();
|
||||
QuickAction addFirstIntermediate = new NavAddFirstIntermediateAction();
|
||||
QuickAction replaceDestination = new NavReplaceDestinationAction();
|
||||
QuickAction autoZoomMap = new NavAutoZoomMapAction();
|
||||
QuickAction startStopNavigation = new NavStartStopAction();
|
||||
QuickAction resumePauseNavigation = new NavResumePauseAction();
|
||||
|
||||
ArrayList<QuickAction> navigationQuickActions = new ArrayList<>();
|
||||
|
||||
if (!voice.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(voice);
|
||||
}
|
||||
if (!directionFrom.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(directionFrom);
|
||||
}
|
||||
if (!addDestination.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(addDestination);
|
||||
}
|
||||
if (!addFirstIntermediate.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(addFirstIntermediate);
|
||||
}
|
||||
if (!replaceDestination.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(replaceDestination);
|
||||
}
|
||||
if (!autoZoomMap.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(autoZoomMap);
|
||||
}
|
||||
if (!startStopNavigation.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(startStopNavigation);
|
||||
}
|
||||
if (!resumePauseNavigation.hasInstanceInList(active)) {
|
||||
navigationQuickActions.add(resumePauseNavigation);
|
||||
}
|
||||
|
||||
if (navigationQuickActions.size() > 0) {
|
||||
quickActions.add(new QuickAction(0, R.string.quick_action_add_navigation));
|
||||
quickActions.addAll(navigationQuickActions);
|
||||
}
|
||||
|
||||
return quickActions;
|
||||
}
|
||||
|
||||
public static QuickAction newActionByType(int type) {
|
||||
|
||||
switch (type) {
|
||||
|
||||
case NewAction.TYPE:
|
||||
return new NewAction();
|
||||
|
||||
case MarkerAction.TYPE:
|
||||
return new MarkerAction();
|
||||
|
||||
case FavoriteAction.TYPE:
|
||||
return new FavoriteAction();
|
||||
|
||||
case ShowHideFavoritesAction.TYPE:
|
||||
return new ShowHideFavoritesAction();
|
||||
|
||||
case ShowHidePoiAction.TYPE:
|
||||
return new ShowHidePoiAction();
|
||||
|
||||
case GPXAction.TYPE:
|
||||
return new GPXAction();
|
||||
|
||||
case ParkingAction.TYPE:
|
||||
return new ParkingAction();
|
||||
|
||||
case TakeAudioNoteAction.TYPE:
|
||||
return new TakeAudioNoteAction();
|
||||
|
||||
case TakePhotoNoteAction.TYPE:
|
||||
return new TakePhotoNoteAction();
|
||||
|
||||
case TakeVideoNoteAction.TYPE:
|
||||
return new TakeVideoNoteAction();
|
||||
|
||||
case NavVoiceAction.TYPE:
|
||||
return new NavVoiceAction();
|
||||
|
||||
case ShowHideOSMBugAction.TYPE:
|
||||
return new ShowHideOSMBugAction();
|
||||
|
||||
case AddOSMBugAction.TYPE:
|
||||
return new AddOSMBugAction();
|
||||
|
||||
case AddPOIAction.TYPE:
|
||||
return new AddPOIAction();
|
||||
|
||||
case MapStyleAction.TYPE:
|
||||
return new MapStyleAction();
|
||||
|
||||
case MapSourceAction.TYPE:
|
||||
return new MapSourceAction();
|
||||
|
||||
case MapOverlayAction.TYPE:
|
||||
return new MapOverlayAction();
|
||||
|
||||
case MapUnderlayAction.TYPE:
|
||||
return new MapUnderlayAction();
|
||||
|
||||
case NavDirectionsFromAction.TYPE:
|
||||
return new NavDirectionsFromAction();
|
||||
|
||||
case NavAddDestinationAction.TYPE:
|
||||
return new NavAddDestinationAction();
|
||||
|
||||
case NavAddFirstIntermediateAction.TYPE:
|
||||
return new NavAddFirstIntermediateAction();
|
||||
|
||||
case NavReplaceDestinationAction.TYPE:
|
||||
return new NavReplaceDestinationAction();
|
||||
|
||||
case NavAutoZoomMapAction.TYPE:
|
||||
return new NavAutoZoomMapAction();
|
||||
|
||||
case NavStartStopAction.TYPE:
|
||||
return new NavStartStopAction();
|
||||
|
||||
case NavResumePauseAction.TYPE:
|
||||
return new NavResumePauseAction();
|
||||
|
||||
case DayNightModeAction.TYPE:
|
||||
return new DayNightModeAction();
|
||||
|
||||
case ShowHideGpxTracksAction.TYPE:
|
||||
return new ShowHideGpxTracksAction();
|
||||
|
||||
case ContourLinesAction.TYPE:
|
||||
return new ContourLinesAction();
|
||||
|
||||
case HillshadeAction.TYPE:
|
||||
return new HillshadeAction();
|
||||
|
||||
default:
|
||||
return new QuickAction();
|
||||
}
|
||||
}
|
||||
|
||||
public static QuickAction produceAction(QuickAction quickAction) {
|
||||
|
||||
switch (quickAction.type) {
|
||||
|
||||
case NewAction.TYPE:
|
||||
return new NewAction(quickAction);
|
||||
|
||||
case MarkerAction.TYPE:
|
||||
return new MarkerAction(quickAction);
|
||||
|
||||
case FavoriteAction.TYPE:
|
||||
return new FavoriteAction(quickAction);
|
||||
|
||||
case ShowHideFavoritesAction.TYPE:
|
||||
return new ShowHideFavoritesAction(quickAction);
|
||||
|
||||
case ShowHidePoiAction.TYPE:
|
||||
return new ShowHidePoiAction(quickAction);
|
||||
|
||||
case GPXAction.TYPE:
|
||||
return new GPXAction(quickAction);
|
||||
|
||||
case ParkingAction.TYPE:
|
||||
return new ParkingAction(quickAction);
|
||||
|
||||
case TakeAudioNoteAction.TYPE:
|
||||
return new TakeAudioNoteAction(quickAction);
|
||||
|
||||
case TakePhotoNoteAction.TYPE:
|
||||
return new TakePhotoNoteAction(quickAction);
|
||||
|
||||
case TakeVideoNoteAction.TYPE:
|
||||
return new TakeVideoNoteAction(quickAction);
|
||||
|
||||
case NavVoiceAction.TYPE:
|
||||
return new NavVoiceAction(quickAction);
|
||||
|
||||
case ShowHideOSMBugAction.TYPE:
|
||||
return new ShowHideOSMBugAction(quickAction);
|
||||
|
||||
case AddOSMBugAction.TYPE:
|
||||
return new AddOSMBugAction(quickAction);
|
||||
|
||||
case AddPOIAction.TYPE:
|
||||
return new AddPOIAction(quickAction);
|
||||
|
||||
case MapStyleAction.TYPE:
|
||||
return new MapStyleAction(quickAction);
|
||||
|
||||
case MapSourceAction.TYPE:
|
||||
return new MapSourceAction(quickAction);
|
||||
|
||||
case MapOverlayAction.TYPE:
|
||||
return new MapOverlayAction(quickAction);
|
||||
|
||||
case MapUnderlayAction.TYPE:
|
||||
return new MapUnderlayAction(quickAction);
|
||||
|
||||
case NavDirectionsFromAction.TYPE:
|
||||
return new NavDirectionsFromAction(quickAction);
|
||||
|
||||
case NavAddDestinationAction.TYPE:
|
||||
return new NavAddDestinationAction(quickAction);
|
||||
|
||||
case NavAddFirstIntermediateAction.TYPE:
|
||||
return new NavAddFirstIntermediateAction(quickAction);
|
||||
|
||||
case NavReplaceDestinationAction.TYPE:
|
||||
return new NavReplaceDestinationAction(quickAction);
|
||||
|
||||
case NavAutoZoomMapAction.TYPE:
|
||||
return new NavAutoZoomMapAction(quickAction);
|
||||
|
||||
case NavStartStopAction.TYPE:
|
||||
return new NavStartStopAction(quickAction);
|
||||
|
||||
case NavResumePauseAction.TYPE:
|
||||
return new NavResumePauseAction(quickAction);
|
||||
|
||||
case DayNightModeAction.TYPE:
|
||||
return new DayNightModeAction(quickAction);
|
||||
|
||||
case ShowHideGpxTracksAction.TYPE:
|
||||
return new ShowHideGpxTracksAction(quickAction);
|
||||
|
||||
case ContourLinesAction.TYPE:
|
||||
return new ContourLinesAction(quickAction);
|
||||
|
||||
case HillshadeAction.TYPE:
|
||||
return new HillshadeAction(quickAction);
|
||||
|
||||
default:
|
||||
return quickAction;
|
||||
}
|
||||
}
|
||||
|
||||
public static @DrawableRes int getActionIcon(int type) {
|
||||
|
||||
switch (type) {
|
||||
|
||||
case NewAction.TYPE:
|
||||
return R.drawable.ic_action_plus;
|
||||
|
||||
case MarkerAction.TYPE:
|
||||
return R.drawable.ic_action_flag_dark;
|
||||
|
||||
case FavoriteAction.TYPE:
|
||||
return R.drawable.ic_action_fav_dark;
|
||||
|
||||
case ShowHideFavoritesAction.TYPE:
|
||||
return R.drawable.ic_action_fav_dark;
|
||||
|
||||
case ShowHidePoiAction.TYPE:
|
||||
return R.drawable.ic_action_gabout_dark;
|
||||
|
||||
case GPXAction.TYPE:
|
||||
return R.drawable.ic_action_flag_dark;
|
||||
|
||||
case ParkingAction.TYPE:
|
||||
return R.drawable.ic_action_parking_dark;
|
||||
|
||||
case TakeAudioNoteAction.TYPE:
|
||||
return R.drawable.ic_action_micro_dark;
|
||||
|
||||
case TakePhotoNoteAction.TYPE:
|
||||
return R.drawable.ic_action_photo_dark;
|
||||
|
||||
case TakeVideoNoteAction.TYPE:
|
||||
return R.drawable.ic_action_video_dark;
|
||||
|
||||
case NavVoiceAction.TYPE:
|
||||
return R.drawable.ic_action_volume_up;
|
||||
|
||||
case ShowHideOSMBugAction.TYPE:
|
||||
return R.drawable.ic_action_bug_dark;
|
||||
|
||||
case AddOSMBugAction.TYPE:
|
||||
return R.drawable.ic_action_bug_dark;
|
||||
|
||||
case AddPOIAction.TYPE:
|
||||
return R.drawable.ic_action_gabout_dark;
|
||||
|
||||
case MapStyleAction.TYPE:
|
||||
return R.drawable.ic_map;
|
||||
|
||||
case MapSourceAction.TYPE:
|
||||
return R.drawable.ic_world_globe_dark;
|
||||
|
||||
case MapOverlayAction.TYPE:
|
||||
return R.drawable.ic_layer_top;
|
||||
|
||||
case MapUnderlayAction.TYPE:
|
||||
return R.drawable.ic_layer_bottom;
|
||||
|
||||
case NavDirectionsFromAction.TYPE:
|
||||
return R.drawable.ic_action_route_direction_from_here;
|
||||
|
||||
case NavAddDestinationAction.TYPE:
|
||||
return R.drawable.ic_action_point_add_destination;
|
||||
|
||||
case NavAddFirstIntermediateAction.TYPE:
|
||||
return R.drawable.ic_action_intermediate;
|
||||
|
||||
case NavReplaceDestinationAction.TYPE:
|
||||
return R.drawable.ic_action_point_add_destination;
|
||||
|
||||
case NavAutoZoomMapAction.TYPE:
|
||||
return R.drawable.ic_action_search_dark;
|
||||
|
||||
case NavStartStopAction.TYPE:
|
||||
return R.drawable.ic_action_start_navigation;
|
||||
|
||||
case NavResumePauseAction.TYPE:
|
||||
return R.drawable.ic_play_dark;
|
||||
|
||||
case DayNightModeAction.TYPE:
|
||||
return R.drawable.ic_action_map_day;
|
||||
|
||||
case ShowHideGpxTracksAction.TYPE:
|
||||
return R.drawable.ic_gpx_track;
|
||||
|
||||
case ContourLinesAction.TYPE:
|
||||
return R.drawable.ic_plugin_srtm;
|
||||
|
||||
case HillshadeAction.TYPE:
|
||||
return R.drawable.ic_action_hillshade_dark;
|
||||
|
||||
default:
|
||||
return R.drawable.ic_action_plus;
|
||||
}
|
||||
}
|
||||
|
||||
public static @StringRes int getActionName(int type) {
|
||||
|
||||
switch (type) {
|
||||
|
||||
case NewAction.TYPE:
|
||||
return R.string.quick_action_new_action;
|
||||
|
||||
case MarkerAction.TYPE:
|
||||
return R.string.quick_action_add_marker;
|
||||
|
||||
case FavoriteAction.TYPE:
|
||||
return R.string.quick_action_add_favorite;
|
||||
|
||||
case ShowHideFavoritesAction.TYPE:
|
||||
return R.string.quick_action_showhide_favorites_title;
|
||||
|
||||
case ShowHidePoiAction.TYPE:
|
||||
return R.string.quick_action_showhide_poi_title;
|
||||
|
||||
case GPXAction.TYPE:
|
||||
return R.string.quick_action_add_gpx;
|
||||
|
||||
case ParkingAction.TYPE:
|
||||
return R.string.quick_action_add_parking;
|
||||
|
||||
case TakeAudioNoteAction.TYPE:
|
||||
return R.string.quick_action_take_audio_note;
|
||||
|
||||
case TakePhotoNoteAction.TYPE:
|
||||
return R.string.quick_action_take_photo_note;
|
||||
|
||||
case TakeVideoNoteAction.TYPE:
|
||||
return R.string.quick_action_take_video_note;
|
||||
|
||||
case NavVoiceAction.TYPE:
|
||||
return R.string.quick_action_navigation_voice;
|
||||
|
||||
case ShowHideOSMBugAction.TYPE:
|
||||
return R.string.quick_action_showhide_osmbugs_title;
|
||||
|
||||
case AddOSMBugAction.TYPE:
|
||||
return R.string.quick_action_add_osm_bug;
|
||||
|
||||
case AddPOIAction.TYPE:
|
||||
return R.string.quick_action_add_poi;
|
||||
|
||||
case MapStyleAction.TYPE:
|
||||
return R.string.quick_action_map_style;
|
||||
|
||||
case MapSourceAction.TYPE:
|
||||
return R.string.quick_action_map_source;
|
||||
|
||||
case MapOverlayAction.TYPE:
|
||||
return R.string.quick_action_map_overlay;
|
||||
|
||||
case MapUnderlayAction.TYPE:
|
||||
return R.string.quick_action_map_underlay;
|
||||
|
||||
case DayNightModeAction.TYPE:
|
||||
return R.string.quick_action_day_night_switch_mode;
|
||||
|
||||
case NavDirectionsFromAction.TYPE:
|
||||
return R.string.context_menu_item_directions_from;
|
||||
|
||||
case NavAddDestinationAction.TYPE:
|
||||
return R.string.quick_action_add_destination;
|
||||
|
||||
case NavAddFirstIntermediateAction.TYPE:
|
||||
return R.string.quick_action_add_first_intermediate;
|
||||
|
||||
case NavReplaceDestinationAction.TYPE:
|
||||
return R.string.quick_action_replace_destination;
|
||||
|
||||
case NavAutoZoomMapAction.TYPE:
|
||||
return R.string.quick_action_auto_zoom;
|
||||
|
||||
case NavStartStopAction.TYPE:
|
||||
return R.string.quick_action_start_stop_navigation;
|
||||
|
||||
case NavResumePauseAction.TYPE:
|
||||
return R.string.quick_action_resume_pause_navigation;
|
||||
|
||||
case ShowHideGpxTracksAction.TYPE:
|
||||
return R.string.quick_action_show_hide_gpx_tracks;
|
||||
|
||||
case ContourLinesAction.TYPE:
|
||||
return R.string.quick_action_show_hide_contour_lines;
|
||||
|
||||
case HillshadeAction.TYPE:
|
||||
return R.string.quick_action_show_hide_hillshade;
|
||||
|
||||
default:
|
||||
return R.string.quick_action_new_action;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isActionEditable(int type) {
|
||||
|
||||
switch (type) {
|
||||
|
||||
case NewAction.TYPE:
|
||||
case MarkerAction.TYPE:
|
||||
case ShowHideFavoritesAction.TYPE:
|
||||
case ShowHidePoiAction.TYPE:
|
||||
case ParkingAction.TYPE:
|
||||
case TakeAudioNoteAction.TYPE:
|
||||
case TakePhotoNoteAction.TYPE:
|
||||
case TakeVideoNoteAction.TYPE:
|
||||
case NavVoiceAction.TYPE:
|
||||
case NavDirectionsFromAction.TYPE:
|
||||
case NavAddDestinationAction.TYPE:
|
||||
case NavAddFirstIntermediateAction.TYPE:
|
||||
case NavReplaceDestinationAction.TYPE:
|
||||
case NavAutoZoomMapAction.TYPE:
|
||||
case ShowHideOSMBugAction.TYPE:
|
||||
case NavStartStopAction.TYPE:
|
||||
case NavResumePauseAction.TYPE:
|
||||
case DayNightModeAction.TYPE:
|
||||
case ShowHideGpxTracksAction.TYPE:
|
||||
case ContourLinesAction.TYPE:
|
||||
case HillshadeAction.TYPE:
|
||||
return false;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -220,7 +220,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
|
|||
@Override
|
||||
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
|
||||
int viewType = getItemViewType(position);
|
||||
final QuickAction item = QuickActionFactory.produceAction(itemsList.get(position));
|
||||
final QuickAction item = QuickActionRegistry.produceAction(itemsList.get(position));
|
||||
|
||||
if (viewType == SCREEN_ITEM_TYPE) {
|
||||
final QuickActionItemVH itemVH = (QuickActionItemVH) holder;
|
||||
|
@ -271,7 +271,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
|
|||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return itemsList.get(position).type == 0 ? SCREEN_HEADER_TYPE : SCREEN_ITEM_TYPE;
|
||||
return itemsList.get(position).getType() == 0 ? SCREEN_HEADER_TYPE : SCREEN_ITEM_TYPE;
|
||||
}
|
||||
|
||||
public void deleteItem(int position) {
|
||||
|
|
|
@ -3,33 +3,47 @@ package net.osmand.plus.quickaction;
|
|||
import android.content.Context;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.audionotes.AudioVideoNotesPlugin;
|
||||
import net.osmand.plus.audionotes.TakeAudioNoteAction;
|
||||
import net.osmand.plus.audionotes.TakePhotoNoteAction;
|
||||
import net.osmand.plus.audionotes.TakeVideoNoteAction;
|
||||
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.parkingpoint.ParkingAction;
|
||||
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
|
||||
import net.osmand.plus.quickaction.actions.AddOSMBugAction;
|
||||
import net.osmand.plus.quickaction.actions.AddPOIAction;
|
||||
import net.osmand.plus.quickaction.actions.ContourLinesAction;
|
||||
import net.osmand.plus.quickaction.actions.HillshadeAction;
|
||||
import net.osmand.plus.quickaction.actions.MapSourceAction;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.quickaction.actions.DayNightModeAction;
|
||||
import net.osmand.plus.quickaction.actions.FavoriteAction;
|
||||
import net.osmand.plus.quickaction.actions.GPXAction;
|
||||
import net.osmand.plus.quickaction.actions.MapStyleAction;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
import net.osmand.plus.srtmplugin.SRTMPlugin;
|
||||
import net.osmand.plus.quickaction.actions.MarkerAction;
|
||||
import net.osmand.plus.quickaction.actions.NavAddDestinationAction;
|
||||
import net.osmand.plus.quickaction.actions.NavAddFirstIntermediateAction;
|
||||
import net.osmand.plus.quickaction.actions.NavAutoZoomMapAction;
|
||||
import net.osmand.plus.quickaction.actions.NavDirectionsFromAction;
|
||||
import net.osmand.plus.quickaction.actions.NavReplaceDestinationAction;
|
||||
import net.osmand.plus.quickaction.actions.NavResumePauseAction;
|
||||
import net.osmand.plus.quickaction.actions.NavStartStopAction;
|
||||
import net.osmand.plus.quickaction.actions.NavVoiceAction;
|
||||
import net.osmand.plus.quickaction.actions.NewAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHideFavoritesAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHideGpxTracksAction;
|
||||
import net.osmand.plus.quickaction.actions.ShowHidePoiAction;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* Created by rosty on 12/27/16.
|
||||
|
@ -37,161 +51,95 @@ import java.util.Map;
|
|||
|
||||
public class QuickActionRegistry {
|
||||
|
||||
public interface QuickActionUpdatesListener{
|
||||
public interface QuickActionUpdatesListener {
|
||||
|
||||
void onActionsUpdated();
|
||||
}
|
||||
|
||||
private final QuickActionFactory factory;
|
||||
private final OsmandSettings settings;
|
||||
|
||||
private final List<QuickAction> quickActions;
|
||||
private final Map<String, Boolean> fabStateMap;
|
||||
|
||||
private QuickActionUpdatesListener updatesListener;
|
||||
|
||||
public QuickActionRegistry(OsmandSettings settings) {
|
||||
|
||||
this.factory = new QuickActionFactory();
|
||||
this.settings = settings;
|
||||
|
||||
quickActions = factory.parseActiveActionsList(settings.QUICK_ACTION_LIST.get());
|
||||
fabStateMap = getQuickActionFabStateMapFromJson(settings.QUICK_ACTION.get());
|
||||
}
|
||||
|
||||
public void setUpdatesListener(QuickActionUpdatesListener updatesListener) {
|
||||
this.updatesListener = updatesListener;
|
||||
}
|
||||
|
||||
public void notifyUpdates() {
|
||||
if (updatesListener != null) updatesListener.onActionsUpdated();
|
||||
}
|
||||
|
||||
public List<QuickAction> getQuickActions() {
|
||||
List<QuickAction> actions = new ArrayList<>();
|
||||
actions.addAll(quickActions);
|
||||
return actions;
|
||||
}
|
||||
|
||||
public List<QuickAction> getFilteredQuickActions() {
|
||||
|
||||
List<QuickAction> actions = getQuickActions();
|
||||
List<QuickAction> filteredActions = new ArrayList<>();
|
||||
|
||||
List<QuickAction> disabledPluginActions = new ArrayList<>();
|
||||
for (OsmandPlugin plugin : OsmandPlugin.getNotEnabledPlugins()) {
|
||||
disabledPluginActions.addAll(plugin.getQuickActions());
|
||||
}
|
||||
|
||||
for (QuickAction action : actions) {
|
||||
boolean skip = false;
|
||||
if (OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class) == null) {
|
||||
|
||||
if (action.type == TakeAudioNoteAction.TYPE || action.type == TakePhotoNoteAction.TYPE
|
||||
|| action.type == TakeVideoNoteAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(ParkingPositionPlugin.class) == null) {
|
||||
if (action.type == ParkingAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(NauticalMapsPlugin.class) == null) {
|
||||
if (action.type == MapStyleAction.TYPE) {
|
||||
if (((MapStyleAction) QuickActionFactory.produceAction(action)).getFilteredStyles().isEmpty()) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) == null) {
|
||||
if (action.type == MapSourceAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) == null) {
|
||||
if (action.type == AddPOIAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
if (action.type == AddOSMBugAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null) {
|
||||
if (action.type == ContourLinesAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
if (action.type == HillshadeAction.TYPE) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
if (disabledPluginActions.contains(action)) {
|
||||
skip = true;
|
||||
}
|
||||
if (!skip) {
|
||||
filteredActions.add(action);
|
||||
}
|
||||
}
|
||||
|
||||
return filteredActions;
|
||||
void onActionsUpdated();
|
||||
}
|
||||
|
||||
public void addQuickAction(QuickAction action){
|
||||
quickActions.add(action);
|
||||
settings.QUICK_ACTION_LIST.set(factory.quickActionListToString(quickActions));
|
||||
}
|
||||
public static final QuickActionType TYPE_ADD_ITEMS = new QuickActionType(0, "").
|
||||
nameRes(R.string.quick_action_add_create_items).category(QuickActionType.CREATE_CATEGORY);
|
||||
public static final QuickActionType TYPE_CONFIGURE_MAP = new QuickActionType(0, "").
|
||||
nameRes(R.string.quick_action_add_configure_map).category(QuickActionType.CONFIGURE_MAP);
|
||||
public static final QuickActionType TYPE_NAVIGATION = new QuickActionType(0, "").
|
||||
nameRes(R.string.quick_action_add_navigation).category(QuickActionType.NAVIGATION);
|
||||
|
||||
public void deleteQuickAction(QuickAction action){
|
||||
int index = quickActions.indexOf(action);
|
||||
if (index >= 0) {
|
||||
quickActions.remove(index);
|
||||
}
|
||||
settings.QUICK_ACTION_LIST.set(factory.quickActionListToString(quickActions));
|
||||
}
|
||||
|
||||
public void deleteQuickAction(int id){
|
||||
private final OsmandSettings settings;
|
||||
|
||||
int index = -1;
|
||||
for (QuickAction action: quickActions){
|
||||
if (action.id == id) {
|
||||
index = quickActions.indexOf(action);
|
||||
}
|
||||
}
|
||||
if (index >= 0) {
|
||||
quickActions.remove(index);
|
||||
}
|
||||
settings.QUICK_ACTION_LIST.set(factory.quickActionListToString(quickActions));
|
||||
}
|
||||
private List<QuickAction> quickActions;
|
||||
private final Map<String, Boolean> fabStateMap;
|
||||
private final Gson gson;
|
||||
private List<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
private Map<Integer, QuickActionType> quickActionTypesInt = new TreeMap<>();
|
||||
private Map<String, QuickActionType> quickActionTypesStr = new TreeMap<>();
|
||||
|
||||
public void updateQuickAction(QuickAction action){
|
||||
int index = quickActions.indexOf(action);
|
||||
if (index >= 0) {
|
||||
quickActions.set(index, action);
|
||||
}
|
||||
settings.QUICK_ACTION_LIST.set(factory.quickActionListToString(quickActions));
|
||||
}
|
||||
private QuickActionUpdatesListener updatesListener;
|
||||
|
||||
public void updateQuickActions(List<QuickAction> quickActions){
|
||||
this.quickActions.clear();
|
||||
this.quickActions.addAll(quickActions);
|
||||
settings.QUICK_ACTION_LIST.set(factory.quickActionListToString(this.quickActions));
|
||||
}
|
||||
public QuickActionRegistry(OsmandSettings settings) {
|
||||
this.settings = settings;
|
||||
gson = new GsonBuilder().registerTypeAdapter(QuickAction.class, new QuickActionSerializer()).create();
|
||||
fabStateMap = getQuickActionFabStateMapFromJson(settings.QUICK_ACTION.get());
|
||||
updateActionTypes();
|
||||
}
|
||||
|
||||
public QuickAction getQuickAction(long id){
|
||||
for (QuickAction action: quickActions){
|
||||
if (action.id == id) {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void setUpdatesListener(QuickActionUpdatesListener updatesListener) {
|
||||
this.updatesListener = updatesListener;
|
||||
}
|
||||
|
||||
public void notifyUpdates() {
|
||||
if (updatesListener != null) updatesListener.onActionsUpdated();
|
||||
}
|
||||
|
||||
public List<QuickAction> getQuickActions() {
|
||||
return new ArrayList<>(quickActions);
|
||||
}
|
||||
|
||||
public List<QuickAction> getFilteredQuickActions() {
|
||||
return getQuickActions();
|
||||
}
|
||||
|
||||
public void addQuickAction(QuickAction action) {
|
||||
quickActions.add(action);
|
||||
saveActions();
|
||||
}
|
||||
|
||||
private void saveActions() {
|
||||
Type type = new TypeToken<List<QuickAction>>() {
|
||||
}.getType();
|
||||
settings.QUICK_ACTION_LIST.set(gson.toJson(quickActions, type));
|
||||
}
|
||||
|
||||
public void deleteQuickAction(QuickAction action) {
|
||||
quickActions.remove(action);
|
||||
saveActions();
|
||||
}
|
||||
|
||||
public void updateQuickAction(QuickAction action) {
|
||||
int index = quickActions.indexOf(action);
|
||||
if (index >= 0) {
|
||||
quickActions.set(index, action);
|
||||
}
|
||||
saveActions();
|
||||
}
|
||||
|
||||
public void updateQuickActions(List<QuickAction> quickActions) {
|
||||
this.quickActions.clear();
|
||||
this.quickActions.addAll(quickActions);
|
||||
saveActions();
|
||||
}
|
||||
|
||||
public QuickAction getQuickAction(long id) {
|
||||
for (QuickAction action : quickActions) {
|
||||
if (action.id == id) {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public QuickAction getQuickAction(OsmandApplication app, int type, String name, Map<String, String> params) {
|
||||
for (QuickAction action : quickActions) {
|
||||
if (action.type == type
|
||||
if (action.getType() == type
|
||||
&& (action.hasCustomName(app) && action.getName(app).equals(name) || !action.hasCustomName(app))
|
||||
&& action.getParams().equals(params)) {
|
||||
return action;
|
||||
|
@ -200,44 +148,191 @@ public class QuickActionRegistry {
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean isNameUnique(QuickAction action, Context context){
|
||||
for (QuickAction a: quickActions){
|
||||
if (action.id != a.id) {
|
||||
if (action.getName(context).equals(a.getName(context))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean isNameUnique(QuickAction action, Context context) {
|
||||
for (QuickAction a : quickActions) {
|
||||
if (action.id != a.id) {
|
||||
if (action.getName(context).equals(a.getName(context))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public QuickAction generateUniqueName(QuickAction action, Context context) {
|
||||
int number = 0;
|
||||
String name = action.getName(context);
|
||||
while (true) {
|
||||
number++;
|
||||
action.setName(name + " (" + number + ")");
|
||||
if (isNameUnique(action, context)) {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
}
|
||||
public QuickAction generateUniqueName(QuickAction action, Context context) {
|
||||
int number = 0;
|
||||
String name = action.getName(context);
|
||||
while (true) {
|
||||
number++;
|
||||
action.setName(name + " (" + number + ")");
|
||||
if (isNameUnique(action, context)) {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isQuickActionOn() {
|
||||
Boolean result = fabStateMap.get(settings.APPLICATION_MODE.get().getStringKey());
|
||||
return result != null && result;
|
||||
}
|
||||
public boolean isQuickActionOn() {
|
||||
Boolean result = fabStateMap.get(settings.APPLICATION_MODE.get().getStringKey());
|
||||
return result != null && result;
|
||||
}
|
||||
|
||||
public void setQuickActionFabState(boolean isOn) {
|
||||
fabStateMap.put(settings.APPLICATION_MODE.get().getStringKey(), isOn);
|
||||
settings.QUICK_ACTION.set(new Gson().toJson(fabStateMap));
|
||||
}
|
||||
public void setQuickActionFabState(boolean isOn) {
|
||||
fabStateMap.put(settings.APPLICATION_MODE.get().getStringKey(), isOn);
|
||||
settings.QUICK_ACTION.set(gson.toJson(fabStateMap));
|
||||
}
|
||||
|
||||
private Map<String, Boolean> getQuickActionFabStateMapFromJson(String json) {
|
||||
Type type = new TypeToken<HashMap<String, Boolean>>() {
|
||||
}.getType();
|
||||
HashMap<String, Boolean> quickActions = new Gson().fromJson(json, type);
|
||||
private Map<String, Boolean> getQuickActionFabStateMapFromJson(String json) {
|
||||
Type type = new TypeToken<HashMap<String, Boolean>>() {
|
||||
}.getType();
|
||||
HashMap<String, Boolean> quickActions = gson.fromJson(json, type);
|
||||
|
||||
return quickActions != null ? quickActions : new HashMap<String, Boolean>();
|
||||
}
|
||||
return quickActions != null ? quickActions : new HashMap<String, Boolean>();
|
||||
}
|
||||
|
||||
|
||||
private List<QuickAction> parseActiveActionsList(String json) {
|
||||
Type type = new TypeToken<List<QuickAction>>() {
|
||||
}.getType();
|
||||
List<QuickAction> quickActions = gson.fromJson(json, type);
|
||||
List<QuickAction> rquickActions = new ArrayList<>(quickActions.size());
|
||||
if (quickActions != null) {
|
||||
for (QuickAction qa : quickActions) {
|
||||
if (qa != null) {
|
||||
rquickActions.add(qa);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.quickActions = rquickActions;
|
||||
return rquickActions;
|
||||
}
|
||||
|
||||
public List<QuickActionType> updateActionTypes() {
|
||||
List<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
quickActionTypes.add(NewAction.TYPE);
|
||||
quickActionTypes.add(FavoriteAction.TYPE);
|
||||
quickActionTypes.add(GPXAction.TYPE);
|
||||
quickActionTypes.add(MarkerAction.TYPE);
|
||||
// configure map
|
||||
quickActionTypes.add(ShowHideFavoritesAction.TYPE);
|
||||
quickActionTypes.add(ShowHideGpxTracksAction.TYPE);
|
||||
quickActionTypes.add(ShowHidePoiAction.TYPE);
|
||||
quickActionTypes.add(MapStyleAction.TYPE);
|
||||
quickActionTypes.add(DayNightModeAction.TYPE);
|
||||
// navigation
|
||||
quickActionTypes.add(NavVoiceAction.TYPE);
|
||||
quickActionTypes.add(NavDirectionsFromAction.TYPE);
|
||||
quickActionTypes.add(NavAddDestinationAction.TYPE);
|
||||
quickActionTypes.add(NavAddFirstIntermediateAction.TYPE);
|
||||
quickActionTypes.add(NavReplaceDestinationAction.TYPE);
|
||||
quickActionTypes.add(NavAutoZoomMapAction.TYPE);
|
||||
quickActionTypes.add(NavStartStopAction.TYPE);
|
||||
quickActionTypes.add(NavResumePauseAction.TYPE);
|
||||
OsmandPlugin.registerQuickActionTypesPlugins(quickActionTypes);
|
||||
|
||||
Map<Integer, QuickActionType> quickActionTypesInt = new TreeMap<>();
|
||||
Map<String, QuickActionType> quickActionTypesStr = new TreeMap<>();
|
||||
for (QuickActionType qt : quickActionTypes) {
|
||||
quickActionTypesInt.put(qt.getId(), qt);
|
||||
quickActionTypesStr.put(qt.getStringId(), qt);
|
||||
}
|
||||
this.quickActionTypes = quickActionTypes;
|
||||
this.quickActionTypesInt = quickActionTypesInt;
|
||||
this.quickActionTypesStr = quickActionTypesStr;
|
||||
// reparse to get new quick actions
|
||||
parseActiveActionsList(settings.QUICK_ACTION_LIST.get());
|
||||
return quickActionTypes;
|
||||
}
|
||||
|
||||
public List<QuickActionType> produceTypeActionsListWithHeaders() {
|
||||
List<QuickActionType> result = new ArrayList<>();
|
||||
filterQuickActions(TYPE_ADD_ITEMS, result);
|
||||
filterQuickActions(TYPE_CONFIGURE_MAP, result);
|
||||
filterQuickActions(TYPE_NAVIGATION, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void filterQuickActions(QuickActionType filter, List<QuickActionType> result) {
|
||||
result.add(filter);
|
||||
Set<Integer> set = new TreeSet<>();
|
||||
for (QuickAction qa : quickActions) {
|
||||
set.add(qa.getActionType().getId());
|
||||
}
|
||||
for (QuickActionType t : quickActionTypes) {
|
||||
if (t.getCategory() == filter.getCategory()) {
|
||||
if (!t.isActionEditable()) {
|
||||
boolean instanceInList = set.contains(t.getId());
|
||||
if (!instanceInList) {
|
||||
result.add(t);
|
||||
}
|
||||
} else {
|
||||
result.add(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public QuickAction newActionByStringType(String actionType) {
|
||||
QuickActionType quickActionType = quickActionTypesStr.get(actionType);
|
||||
if (quickActionType != null) {
|
||||
return quickActionType.createNew();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public QuickAction newActionByType(int type) {
|
||||
QuickActionType quickActionType = quickActionTypesInt.get(type);
|
||||
if (quickActionType != null) {
|
||||
return quickActionType.createNew();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static QuickAction produceAction(QuickAction quickAction) {
|
||||
return quickAction.getActionType().createNew(quickAction);
|
||||
}
|
||||
|
||||
private class QuickActionSerializer implements JsonDeserializer<QuickAction>,
|
||||
JsonSerializer<QuickAction> {
|
||||
|
||||
@Override
|
||||
public QuickAction deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
JsonObject obj = json.getAsJsonObject();
|
||||
QuickActionType found = null;
|
||||
if (obj.has("actionType")) {
|
||||
String actionType = obj.get("actionType").getAsString();
|
||||
found = quickActionTypesStr.get(actionType);
|
||||
} else if (obj.has("type")) {
|
||||
int type = obj.get("type").getAsInt();
|
||||
found = quickActionTypesInt.get(type);
|
||||
}
|
||||
if (found != null) {
|
||||
QuickAction qa = found.createNew();
|
||||
if (obj.has("name")) {
|
||||
qa.setName(obj.get("name").getAsString());
|
||||
}
|
||||
if (obj.has("id")) {
|
||||
qa.setId(obj.get("id").getAsLong());
|
||||
}
|
||||
if (obj.has("params")) {
|
||||
qa.setParams((Map<String, String>) context.deserialize(obj.get("params"),
|
||||
new TypeToken<HashMap<String, String>>() {}.getType())
|
||||
);
|
||||
}
|
||||
return qa;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(QuickAction src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
JsonObject el = new JsonObject();
|
||||
el.addProperty("actionType", src.getActionType().getStringId());
|
||||
el.addProperty("id", src.getId());
|
||||
if (src.getRawName() != null) {
|
||||
el.addProperty("name", src.getRawName());
|
||||
}
|
||||
el.add("params", context.serialize(src.getParams()));
|
||||
return el;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
111
OsmAnd/src/net/osmand/plus/quickaction/QuickActionType.java
Normal file
111
OsmAnd/src/net/osmand/plus/quickaction/QuickActionType.java
Normal file
|
@ -0,0 +1,111 @@
|
|||
package net.osmand.plus.quickaction;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class QuickActionType {
|
||||
|
||||
public static final int CREATE_CATEGORY = 0;
|
||||
public static final int CONFIGURE_MAP = 1;
|
||||
public static final int NAVIGATION = 2;
|
||||
|
||||
private final int id;
|
||||
private final String stringId;
|
||||
private boolean actionEditable;
|
||||
private @StringRes int nameRes;
|
||||
private @DrawableRes int iconRes;
|
||||
private Class<? extends QuickAction> cl;
|
||||
private int category;
|
||||
|
||||
public QuickActionType(int id, String stringId) {
|
||||
this.id = id;
|
||||
this.stringId = stringId;
|
||||
}
|
||||
|
||||
public QuickActionType(int id, String stringId, Class<? extends QuickAction> cl) {
|
||||
this.id = id;
|
||||
this.stringId = stringId;
|
||||
this.cl = cl;
|
||||
this.actionEditable = cl != null;
|
||||
}
|
||||
|
||||
public QuickActionType nameRes(int nameRes) {
|
||||
this.nameRes = nameRes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QuickActionType category(int cat) {
|
||||
this.category = cat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QuickActionType iconRes(int iconRes) {
|
||||
this.iconRes = iconRes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QuickActionType nonEditable() {
|
||||
actionEditable = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public QuickAction createNew() {
|
||||
if(cl != null) {
|
||||
try {
|
||||
return cl.newInstance();
|
||||
} catch (InstantiationException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
} else {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public QuickAction createNew(QuickAction q) {
|
||||
if(cl != null) {
|
||||
try {
|
||||
return cl.getConstructor(QuickAction.class).newInstance(q);
|
||||
} catch (InstantiationException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
} else {
|
||||
return new QuickAction(q);
|
||||
}
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getStringId() {
|
||||
return stringId;
|
||||
}
|
||||
|
||||
public boolean isActionEditable() {
|
||||
return actionEditable;
|
||||
}
|
||||
|
||||
public int getNameRes() {
|
||||
return nameRes;
|
||||
}
|
||||
|
||||
public int getIconRes() {
|
||||
return iconRes;
|
||||
}
|
||||
|
||||
public int getCategory() {
|
||||
return category;
|
||||
}
|
||||
}
|
|
@ -221,7 +221,7 @@ public class QuickActionsWidget extends LinearLayout {
|
|||
|
||||
if (i + (position * ELEMENT_PER_PAGE) < actions.size()) {
|
||||
|
||||
final QuickAction action = QuickActionFactory.produceAction(
|
||||
final QuickAction action = QuickActionRegistry.produceAction(
|
||||
actions.get(i + (position * ELEMENT_PER_PAGE)));
|
||||
|
||||
((ImageView) view.findViewById(imageView))
|
||||
|
|
|
@ -18,6 +18,7 @@ import androidx.fragment.app.FragmentManager;
|
|||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.dialogs.SelectMapViewQuickActionsBottomSheet;
|
||||
|
@ -37,7 +38,7 @@ public abstract class SwitchableAction<T> extends QuickAction {
|
|||
|
||||
private transient ItemTouchHelper touchHelper;
|
||||
|
||||
protected SwitchableAction(int type) {
|
||||
protected SwitchableAction(QuickActionType type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
@ -117,7 +118,11 @@ public abstract class SwitchableAction<T> extends QuickAction {
|
|||
fragment.setArguments(args);
|
||||
fragment.show(fm, SelectMapViewQuickActionsBottomSheet.TAG);
|
||||
}
|
||||
|
||||
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected class Adapter extends RecyclerView.Adapter<Adapter.ItemHolder> implements ReorderItemTouchHelperCallback.OnItemMoveCallback {
|
||||
|
||||
private List<T> itemsList = new ArrayList<>();
|
||||
|
|
|
@ -11,9 +11,14 @@ import net.osmand.plus.OsmandSettings.DayNightMode;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class DayNightModeAction extends QuickAction {
|
||||
public static final int TYPE = 27;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(27,
|
||||
"daynight.switch", DayNightModeAction.class).
|
||||
nameRes(R.string.quick_action_day_night_switch_mode).iconRes(R.drawable.ic_action_map_day).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
public DayNightModeAction() {super(TYPE);}
|
||||
|
||||
|
|
|
@ -23,12 +23,16 @@ import net.osmand.plus.mapcontextmenu.editors.EditCategoryDialogFragment;
|
|||
import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor;
|
||||
import net.osmand.plus.mapcontextmenu.editors.SelectCategoryDialogFragment;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.widgets.AutoCompleteTextViewEx;
|
||||
|
||||
public class FavoriteAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 3;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(3,
|
||||
"fav.add", FavoriteAction.class).
|
||||
nameRes(R.string.quick_action_add_favorite).iconRes(R.drawable.ic_action_fav_dark).
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
public static final String KEY_NAME = "name";
|
||||
public static final String KEY_DIALOG = "dialog";
|
||||
public static final String KEY_CATEGORY_NAME = "category_name";
|
||||
|
|
|
@ -17,11 +17,15 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.mapcontextmenu.editors.EditCategoryDialogFragment;
|
||||
import net.osmand.plus.mapcontextmenu.editors.SelectCategoryDialogFragment;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.widgets.AutoCompleteTextViewEx;
|
||||
|
||||
public class GPXAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 6;
|
||||
public static final QuickActionType TYPE = new QuickActionType(6,
|
||||
"gpx.add", GPXAction.class).
|
||||
nameRes(R.string.quick_action_add_gpx).iconRes(R.drawable.ic_action_flag_dark).
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
public static final String KEY_NAME = "name";
|
||||
public static final String KEY_DIALOG = "dialog";
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
||||
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.quickaction.SwitchableAction;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
|
@ -30,9 +31,13 @@ import java.util.List;
|
|||
|
||||
public class MapStyleAction extends SwitchableAction<String> {
|
||||
|
||||
public static final int TYPE = 14;
|
||||
|
||||
private final static String KEY_STYLES = "styles";
|
||||
public static final QuickActionType TYPE = new QuickActionType(14,
|
||||
"mapstyle.change", MapStyleAction.class).
|
||||
nameRes(R.string.quick_action_map_style).iconRes(R.drawable.ic_map).
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public MapStyleAction() {
|
||||
super(TYPE);
|
||||
|
@ -42,6 +47,16 @@ public class MapStyleAction extends SwitchableAction<String> {
|
|||
super(quickAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
RenderingRulesStorage current = app.getRendererRegistry().getCurrentSelectedRenderer();
|
||||
if (current != null) {
|
||||
return current.getName();
|
||||
} else {
|
||||
return RendererRegistry.DEFAULT_RENDER;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapActivity activity) {
|
||||
List<String> mapStyles = getFilteredStyles();
|
||||
|
|
|
@ -10,10 +10,15 @@ import net.osmand.data.PointDescription;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class MarkerAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 2;
|
||||
public static final QuickActionType TYPE = new QuickActionType(2,
|
||||
"marker.add", MarkerAction.class).
|
||||
nameRes(R.string.quick_action_add_marker).iconRes(R.drawable.ic_action_flag_dark).nonEditable().
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
|
||||
public MarkerAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -9,10 +9,15 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NavAddDestinationAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 20;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(20,
|
||||
"nav.destination.add", NavAddDestinationAction.class).
|
||||
nameRes(R.string.quick_action_add_destination).iconRes(R.drawable.ic_action_point_add_destination).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
public NavAddDestinationAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -9,10 +9,14 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NavAddFirstIntermediateAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 22;
|
||||
public static final QuickActionType TYPE = new QuickActionType(22,
|
||||
"nav.intermediate.add", NavAddFirstIntermediateAction.class).
|
||||
nameRes(R.string.quick_action_add_first_intermediate).iconRes(R.drawable.ic_action_intermediate).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
public NavAddFirstIntermediateAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -11,10 +11,15 @@ import net.osmand.plus.OsmandSettings;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NavAutoZoomMapAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 23;
|
||||
public static final QuickActionType TYPE = new QuickActionType(23,
|
||||
"nav.autozoom", NavAutoZoomMapAction.class).
|
||||
nameRes(R.string.quick_action_auto_zoom).iconRes(R.drawable.ic_action_search_dark).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
|
||||
public NavAutoZoomMapAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -9,10 +9,14 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NavDirectionsFromAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 19;
|
||||
public static final QuickActionType TYPE = new QuickActionType(19,
|
||||
"nav.directions", NavDirectionsFromAction.class).
|
||||
nameRes(R.string.context_menu_item_directions_from).iconRes(R.drawable.ic_action_route_direction_from_here).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
public NavDirectionsFromAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -9,10 +9,14 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NavReplaceDestinationAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 21;
|
||||
public static final QuickActionType TYPE = new QuickActionType(21,
|
||||
"nav.destination.replace", NavReplaceDestinationAction.class).
|
||||
nameRes(R.string.quick_action_replace_destination).iconRes(R.drawable.ic_action_point_add_destination).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
public NavReplaceDestinationAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -10,11 +10,16 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
|
||||
public class NavResumePauseAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 26;
|
||||
public static final QuickActionType TYPE = new QuickActionType(26,
|
||||
"nav.resumepause", NavResumePauseAction .class).
|
||||
nameRes(R.string.quick_action_resume_pause_navigation).iconRes(R.drawable.ic_play_dark).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
|
||||
public NavResumePauseAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -12,12 +12,18 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
|
||||
public class NavStartStopAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 25;
|
||||
private static final String KEY_DIALOG = "dialog";
|
||||
public static final QuickActionType TYPE = new QuickActionType(25,
|
||||
"nav.startstop", NavStartStopAction .class).
|
||||
nameRes(R.string.quick_action_start_stop_navigation).iconRes(R.drawable.ic_action_start_navigation).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
|
||||
|
||||
public NavStartStopAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -9,9 +9,13 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NavVoiceAction extends QuickAction {
|
||||
public static final int TYPE = 11;
|
||||
public static final QuickActionType TYPE = new QuickActionType(11,
|
||||
"nav.voice", NavVoiceAction.class).
|
||||
nameRes(R.string.quick_action_navigation_voice).iconRes(R.drawable.ic_action_volume_up).nonEditable().
|
||||
category(QuickActionType.NAVIGATION);
|
||||
|
||||
public NavVoiceAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -2,13 +2,18 @@ package net.osmand.plus.quickaction.actions;
|
|||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.AddQuickActionDialog;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class NewAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 1;
|
||||
public static final QuickActionType TYPE = new QuickActionType(1, "new",
|
||||
NewAction.class).
|
||||
nonEditable().iconRes(R.drawable.ic_action_plus).nameRes(R.string.quick_action_new_action);
|
||||
|
||||
|
||||
public NewAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -8,11 +8,18 @@ import android.widget.TextView;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.audionotes.TakeVideoNoteAction;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class ShowHideFavoritesAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 4;
|
||||
public static final QuickActionType TYPE = new QuickActionType(4,
|
||||
"favorites.showhide", ShowHideFavoritesAction.class).
|
||||
nameRes(R.string.quick_action_showhide_favorites_title).iconRes(R.drawable.ic_action_fav_dark).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
|
||||
public ShowHideFavoritesAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -18,10 +18,16 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.GpxUiHelper;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
public class ShowHideGpxTracksAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 28;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(28,
|
||||
"gpx.showhide", ShowHideGpxTracksAction.class).
|
||||
nameRes(R.string.quick_action_show_hide_gpx_tracks).iconRes(R.drawable.ic_gpx_track).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public ShowHideGpxTracksAction() {
|
||||
super(TYPE);
|
||||
|
|
|
@ -25,6 +25,7 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -34,7 +35,12 @@ import java.util.Set;
|
|||
|
||||
public class ShowHidePoiAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 5;
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(5,
|
||||
"poi.showhide", ShowHidePoiAction.class).
|
||||
nameRes(R.string.quick_action_showhide_poi_title).iconRes(R.drawable.ic_action_gabout_dark).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public static final String KEY_FILTERS = "filters";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.rastermaps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -21,6 +21,7 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.quickaction.SwitchableAction;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
|
||||
|
@ -30,11 +31,16 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
|
||||
public static final int TYPE = 15;
|
||||
|
||||
private final static String KEY_OVERLAYS = "overlays";
|
||||
private final static String KEY_NO_OVERLAY = "no_overlay";
|
||||
|
||||
public static final QuickActionType TYPE = new QuickActionType(15,
|
||||
"mapoverlay.change", MapOverlayAction.class).
|
||||
nameRes(R.string.quick_action_map_overlay).iconRes(R.drawable.ic_layer_top).
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public MapOverlayAction() {
|
||||
super(TYPE);
|
||||
}
|
||||
|
@ -53,6 +59,11 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
: filters.get(0).second;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
return app.getSettings().MAP_OVERLAY.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveListToParams(List<Pair<String, String>> list) {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.rastermaps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -20,6 +20,7 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.quickaction.SwitchableAction;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
|
||||
|
@ -31,8 +32,11 @@ import java.util.Map;
|
|||
|
||||
public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
|
||||
|
||||
public static final int TYPE = 17;
|
||||
public static final String LAYER_OSM_VECTOR = "LAYER_OSM_VECTOR";
|
||||
public static final QuickActionType TYPE = new QuickActionType(17,
|
||||
"mapsource.change", MapSourceAction.class).
|
||||
nameRes(R.string.quick_action_map_source).iconRes(R.drawable.ic_world_globe_dark).
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
private final static String KEY_SOURCE = "source";
|
||||
|
||||
|
@ -54,6 +58,13 @@ public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
|
|||
: filters.get(0).second;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
return app.getSettings().MAP_ONLINE_DATA.get()
|
||||
? app.getSettings().MAP_TILE_SOURCES.get()
|
||||
: MapSourceAction.LAYER_OSM_VECTOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveListToParams(List<Pair<String, String>> list) {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.rastermaps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -21,6 +21,7 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.quickaction.SwitchableAction;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
|
||||
|
@ -30,10 +31,14 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
|
||||
public static final int TYPE = 16;
|
||||
|
||||
private final static String KEY_UNDERLAYS = "underlays";
|
||||
private final static String KEY_NO_UNDERLAY = "no_underlay";
|
||||
public static final QuickActionType TYPE = new QuickActionType(16,
|
||||
"mapunderlay.change", MapUnderlayAction.class).
|
||||
nameRes(R.string.quick_action_map_underlay).iconRes(R.drawable.ic_layer_bottom).
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public MapUnderlayAction() {
|
||||
super(TYPE);
|
||||
|
@ -53,6 +58,11 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
|
|||
: filters.get(0).second;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSelectedItem(OsmandApplication app) {
|
||||
return app.getSettings().MAP_UNDERLAY.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveListToParams(List<Pair<String, String>> list) {
|
||||
|
|
@ -45,6 +45,7 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.activities.MapActivityLayers;
|
||||
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
|
||||
import net.osmand.plus.dialogs.RasterMapMenu;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.views.MapTileLayer;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -679,4 +680,11 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
|||
public interface OnMapSelectedCallback {
|
||||
void onMapSelected(boolean canceled);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
quickActionTypes.add(MapSourceAction.TYPE);
|
||||
quickActionTypes.add(MapOverlayAction.TYPE);
|
||||
quickActionTypes.add(MapUnderlayAction.TYPE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -462,10 +462,11 @@ public class RoutingOptionsHelper {
|
|||
}
|
||||
|
||||
public List<LocalRoutingParameter> getGpxRouterParameters(ApplicationMode am) {
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
List<LocalRoutingParameter> list = new ArrayList<LocalRoutingParameter>();
|
||||
RouteProvider.GPXRouteParamsBuilder rparams = app.getRoutingHelper().getCurrentGPXRoute();
|
||||
RouteProvider.GPXRouteParamsBuilder rparams = routingHelper.getCurrentGPXRoute();
|
||||
boolean osmandRouter = am.getRouteService() == RouteProvider.RouteService.OSMAND;
|
||||
if (rparams != null && osmandRouter) {
|
||||
if (rparams != null && !routingHelper.isCurrentGPXRouteV2() && osmandRouter) {
|
||||
GPXUtilities.GPXFile fl = rparams.getFile();
|
||||
if (fl.hasRtePt()) {
|
||||
list.add(new OtherLocalRoutingParameter(R.string.use_points_as_intermediates,
|
||||
|
|
|
@ -251,7 +251,7 @@ public class RouteProvider {
|
|||
}
|
||||
if (OSMAND_ROUTER_V2.equals(file.author)) {
|
||||
route = parseOsmAndGPXRoute(points, file);
|
||||
addMissingTurns = reverse;
|
||||
addMissingTurns = false;
|
||||
} else if (file.isCloudmadeRouteFile() || OSMAND_ROUTER.equals(file.author)) {
|
||||
directions = parseOsmAndGPXRoute(points, file, OSMAND_ROUTER.equals(file.author), builder.leftSide, 10);
|
||||
if (OSMAND_ROUTER.equals(file.author)) {
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo;
|
|||
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
|
||||
import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||
import net.osmand.router.RouteCalculationProgress;
|
||||
import net.osmand.router.RouteExporter;
|
||||
import net.osmand.router.RouteSegmentResult;
|
||||
import net.osmand.router.TurnType;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -245,7 +246,9 @@ public class RoutingHelper {
|
|||
return currentGPXRoute;
|
||||
}
|
||||
|
||||
|
||||
public boolean isCurrentGPXRouteV2() {
|
||||
return currentGPXRoute != null && RouteExporter.OSMAND_ROUTER_V2.equals(currentGPXRoute.getFile().author);
|
||||
}
|
||||
|
||||
public void setGpxParams(GPXRouteParamsBuilder params) {
|
||||
currentGPXRoute = params;
|
||||
|
|
|
@ -41,7 +41,8 @@ import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
|||
import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo;
|
||||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionFactory;
|
||||
import net.osmand.plus.quickaction.QuickActionRegistry;
|
||||
import net.osmand.plus.settings.bottomsheets.BasePreferenceBottomSheet;
|
||||
import net.osmand.plus.settings.ExportImportSettingsAdapter.Type;
|
||||
import net.osmand.plus.settings.bottomsheets.BasePreferenceBottomSheet;
|
||||
|
||||
|
@ -220,8 +221,9 @@ public class ExportProfileBottomSheet extends BasePreferenceBottomSheet {
|
|||
private Map<Type, List<?>> getAdditionalData() {
|
||||
Map<Type, List<?>> dataList = new HashMap<>();
|
||||
|
||||
QuickActionFactory factory = new QuickActionFactory();
|
||||
List<QuickAction> actionsList = factory.parseActiveActionsList(app.getSettings().QUICK_ACTION_LIST.get());
|
||||
|
||||
QuickActionRegistry registry = app.getQuickActionRegistry();
|
||||
List<QuickAction> actionsList = registry.getQuickActions();
|
||||
if (!actionsList.isEmpty()) {
|
||||
dataList.put(Type.QUICK_ACTIONS, actionsList);
|
||||
}
|
||||
|
|
|
@ -708,6 +708,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
|
|||
}
|
||||
|
||||
private void saveProfile() {
|
||||
profile = changedProfile;
|
||||
if (isNewProfile) {
|
||||
DialogInterface.OnShowListener showListener = new DialogInterface.OnShowListener() {
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.widget.TextView;
|
|||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
|
@ -30,6 +31,7 @@ import net.osmand.plus.activities.SettingsBaseActivity;
|
|||
import net.osmand.plus.activities.SettingsNavigationActivity;
|
||||
import net.osmand.plus.routing.RouteProvider;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.settings.bottomsheets.RecalculateRouteInDeviationBottomSheet;
|
||||
import net.osmand.plus.settings.preferences.ListPreferenceEx;
|
||||
import net.osmand.plus.settings.preferences.MultiSelectBooleanPreference;
|
||||
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
|
||||
|
@ -55,6 +57,10 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
private static final String ROUTE_PARAMETERS_INFO = "route_parameters_info";
|
||||
private static final String ROUTE_PARAMETERS_IMAGE = "route_parameters_image";
|
||||
private static final String RELIEF_SMOOTHNESS_FACTOR = "relief_smoothness_factor";
|
||||
private static final String ROUTING_RECALC_DISTANCE= "routing_recalc_distance";
|
||||
|
||||
public static final float DISABLE_MODE = -1.0f;
|
||||
public static final float DEFAULT_MODE = 0.0f;
|
||||
|
||||
private List<RoutingParameter> avoidParameters = new ArrayList<RoutingParameter>();
|
||||
private List<RoutingParameter> preferParameters = new ArrayList<RoutingParameter>();
|
||||
|
@ -147,9 +153,7 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
fastRoute.setSummaryOn(R.string.shared_string_on);
|
||||
fastRoute.setSummaryOff(R.string.shared_string_off);
|
||||
|
||||
float defaultAllowedDeviation = RoutingHelper.getDefaultAllowedDeviation(settings, am,
|
||||
RoutingHelper.getPosTolerance(0));
|
||||
setupSelectRouteRecalcDistance(screen, defaultAllowedDeviation);
|
||||
setupSelectRouteRecalcDistance(screen);
|
||||
|
||||
if (am.getRouteService() == RouteProvider.RouteService.OSMAND){
|
||||
GeneralRouter router = app.getRouter(am);
|
||||
|
@ -261,6 +265,18 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
return super.onPreferenceClick(preference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog(Preference preference) {
|
||||
if (preference.getKey().equals(settings.ROUTE_RECALCULATION_DISTANCE.getId())) {
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
if (fragmentManager != null) {
|
||||
RecalculateRouteInDeviationBottomSheet.showInstance(getFragmentManager(), preference.getKey(), this, false, getSelectedAppMode());
|
||||
}
|
||||
} else {
|
||||
super.onDisplayPreferenceDialog(preference);
|
||||
}
|
||||
}
|
||||
|
||||
private void showSeekbarSettingsDialog(Activity activity, final ApplicationMode mode) {
|
||||
if (activity == null || mode == null) {
|
||||
return;
|
||||
|
@ -318,35 +334,30 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
UiUtilities.setupSeekBar(angleBar, activeColor, nightMode);
|
||||
}
|
||||
|
||||
private void setupSelectRouteRecalcDistance(PreferenceScreen screen, float defaultAllowedDeviation) {
|
||||
Float[] entryValues;
|
||||
OsmandSettings settings = app.getSettings();
|
||||
OsmandSettings.MetricsConstants mc = settings.METRIC_SYSTEM.get();
|
||||
if (mc == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) {
|
||||
entryValues = new Float[] {-1.0f, 0.f, 10.f, 20.0f, 30.0f, 50.0f, 100.0f, 200.0f, 500.0f, 1000.0f, 1500.0f};
|
||||
} else {
|
||||
entryValues = new Float[] {-1.0f, 0.f, 9.1f, 18.3f, 30.5f, 45.7f, 91.5f, 183.0f, 482.0f, 965.0f, 1609.0f};
|
||||
private void setupSelectRouteRecalcDistance(PreferenceScreen screen) {
|
||||
final SwitchPreferenceEx switchPref = createSwitchPreferenceEx(ROUTING_RECALC_DISTANCE,
|
||||
R.string.route_recalculation_dist_title, R.layout.preference_with_descr_dialog_and_switch);
|
||||
switchPref.setIcon(getRoutingPrefIcon(ROUTING_RECALC_DISTANCE));
|
||||
screen.addPreference(switchPref);
|
||||
updateRouteRecalcDistancePref();
|
||||
}
|
||||
|
||||
private void updateRouteRecalcDistancePref() {
|
||||
SwitchPreferenceEx switchPref = (SwitchPreferenceEx) findPreference(ROUTING_RECALC_DISTANCE);
|
||||
if (switchPref == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String[] entries = new String[entryValues.length];
|
||||
entries[0] = getString(R.string.no_recalculation_setting);
|
||||
String defaultDistance = defaultAllowedDeviation < 0 ? getString(R.string.no_recalculation_setting) :
|
||||
OsmAndFormatter.getFormattedDistance(defaultAllowedDeviation , app, false);
|
||||
entries[1] = String.format(getString(R.string.shared_string_app_default_w_val), defaultDistance);
|
||||
|
||||
for (int i = 2; i < entryValues.length; i++) {
|
||||
entries[i] = OsmAndFormatter.getFormattedDistance(entryValues[i], app, false);
|
||||
ApplicationMode appMode = getSelectedAppMode();
|
||||
float allowedValue = settings.ROUTE_RECALCULATION_DISTANCE.getModeValue(appMode);
|
||||
boolean enabled = allowedValue != DISABLE_MODE;
|
||||
if (allowedValue <= 0) {
|
||||
allowedValue = RoutingHelper.getDefaultAllowedDeviation(settings, appMode, RoutingHelper.getPosTolerance(0));
|
||||
}
|
||||
|
||||
ListPreferenceEx routeRecalculationDist = createListPreferenceEx(settings.ROUTE_RECALCULATION_DISTANCE.getId(),
|
||||
entries, entryValues, R.string.route_recalculation_dist_title, R.layout.preference_with_descr);
|
||||
routeRecalculationDist.setEntries(entries);
|
||||
routeRecalculationDist.setEntryValues(entryValues);
|
||||
routeRecalculationDist.setDescription(getString(R.string.route_recalculation_dist_descr));
|
||||
routeRecalculationDist.setIcon(getRoutingPrefIcon("routing_recalc_distance"));
|
||||
|
||||
|
||||
screen.addPreference(routeRecalculationDist);
|
||||
String summary = String.format(getString(R.string.ltr_or_rtl_combine_via_bold_point),
|
||||
enabled ? getString(R.string.shared_string_enabled) : getString(R.string.shared_string_disabled),
|
||||
OsmAndFormatter.getFormattedDistance(allowedValue, app, false));
|
||||
switchPref.setSummary(summary);
|
||||
switchPref.setChecked(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -414,12 +425,12 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
return true;
|
||||
} else if ("prouting_short_way".equals(key) && newValue instanceof Boolean) {
|
||||
return app.getSettings().FAST_ROUTE_MODE.setModeValue(getSelectedAppMode(), !(Boolean) newValue);
|
||||
} else if (settings.ROUTE_RECALCULATION_DISTANCE.getId().equals(key) && newValue instanceof Float) {
|
||||
if ((float) newValue == -1.f) {
|
||||
settings.DISABLE_OFFROUTE_RECALC.setModeValue(getSelectedAppMode(), true);
|
||||
} else {
|
||||
settings.DISABLE_OFFROUTE_RECALC.setModeValue(getSelectedAppMode(), false);
|
||||
}
|
||||
} else if (ROUTING_RECALC_DISTANCE.equals(key) && newValue instanceof Boolean) {
|
||||
boolean enabled = (Boolean) newValue;
|
||||
settings.ROUTE_RECALCULATION_DISTANCE.setModeValue(getSelectedAppMode(),
|
||||
enabled ? DEFAULT_MODE : DISABLE_MODE);
|
||||
settings.DISABLE_OFFROUTE_RECALC.setModeValue(getSelectedAppMode(), !enabled);
|
||||
updateRouteRecalcDistancePref();
|
||||
}
|
||||
|
||||
return super.onPreferenceChange(preference, newValue);
|
||||
|
@ -429,6 +440,8 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
public void onPreferenceChanged(String prefId) {
|
||||
if (AVOID_ROUTING_PARAMETER_PREFIX.equals(prefId) || PREFER_ROUTING_PARAMETER_PREFIX.equals(prefId)) {
|
||||
recalculateRoute();
|
||||
} else if (ROUTING_RECALC_DISTANCE.equals(prefId)) {
|
||||
updateRouteRecalcDistancePref();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -529,7 +542,7 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
return getPersistentPrefIcon(R.drawable.ic_action_fastest_route);
|
||||
case "enable_time_conditional_routing":
|
||||
return getPersistentPrefIcon(R.drawable.ic_action_road_works_dark);
|
||||
case "routing_recalc_distance":
|
||||
case ROUTING_RECALC_DISTANCE:
|
||||
return getPersistentPrefIcon(R.drawable.ic_action_minimal_distance);
|
||||
|
||||
default:
|
||||
|
|
|
@ -109,14 +109,14 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
|
|||
return R.string.shared_string_cancel;
|
||||
}
|
||||
|
||||
private View getCustomButtonView(boolean checked) {
|
||||
protected View getCustomButtonView(boolean checked) {
|
||||
View customView = UiUtilities.getInflater(getContext(), nightMode).inflate(R.layout.bottom_sheet_item_preference_switch, null);
|
||||
updateCustomButtonView(customView, checked);
|
||||
|
||||
return customView;
|
||||
}
|
||||
|
||||
private void updateCustomButtonView(View customView, boolean checked) {
|
||||
protected void updateCustomButtonView(View customView, boolean checked) {
|
||||
OsmandApplication app = requiredMyApplication();
|
||||
View buttonView = customView.findViewById(R.id.button_container);
|
||||
|
||||
|
|
|
@ -0,0 +1,239 @@
|
|||
package net.osmand.plus.settings.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.google.android.material.slider.Slider;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
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.simpleitems.LongDescriptionItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.SubtitmeListDividerItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.settings.OnPreferenceChanged;
|
||||
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
|
||||
|
||||
import static net.osmand.plus.settings.RouteParametersFragment.DEFAULT_MODE;
|
||||
import static net.osmand.plus.settings.RouteParametersFragment.DISABLE_MODE;
|
||||
|
||||
public class RecalculateRouteInDeviationBottomSheet extends BooleanPreferenceBottomSheet {
|
||||
|
||||
public static final String TAG = RecalculateRouteInDeviationBottomSheet.class.getSimpleName();
|
||||
|
||||
private static final String CURRENT_VALUE = "current_value";
|
||||
|
||||
private OsmandApplication app;
|
||||
private OsmandSettings settings;
|
||||
private ApplicationMode appMode;
|
||||
private OsmandSettings.CommonPreference<Float> preference;
|
||||
|
||||
private Slider slider;
|
||||
private TextView tvSliderTitle;
|
||||
private TextView tvSliderSummary;
|
||||
|
||||
private Float[] entryValues;
|
||||
private float currentValue;
|
||||
private boolean enabled = false;
|
||||
private boolean sliderPositionChanged = false;
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
app = requiredMyApplication();
|
||||
settings = app.getSettings();
|
||||
appMode = getAppMode();
|
||||
preference = settings.ROUTE_RECALCULATION_DISTANCE;
|
||||
getPreferenceStateAndValue();
|
||||
|
||||
final SwitchPreferenceEx switchPref = (SwitchPreferenceEx) getPreference();
|
||||
if (switchPref == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (savedInstanceState != null && savedInstanceState.containsKey(CURRENT_VALUE)) {
|
||||
currentValue = savedInstanceState.getFloat(CURRENT_VALUE);
|
||||
}
|
||||
|
||||
int contentPaddingSmall = app.getResources().getDimensionPixelSize(R.dimen.content_padding_small);
|
||||
int dialogContentMargin = app.getResources().getDimensionPixelSize(R.dimen.dialog_content_margin);
|
||||
|
||||
OsmandSettings.MetricsConstants mc = settings.METRIC_SYSTEM.get();
|
||||
if (mc == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) {
|
||||
entryValues = new Float[]{10.f, 20.0f, 30.0f, 50.0f, 100.0f, 200.0f, 500.0f, 1000.0f, 1500.0f};
|
||||
} else {
|
||||
entryValues = new Float[]{9.1f, 18.3f, 30.5f, 45.7f, 91.5f, 183.0f, 482.0f, 965.0f, 1609.0f};
|
||||
}
|
||||
|
||||
final int appModeColor = appMode.getIconColorInfo().getColor(nightMode);
|
||||
final int activeColor = AndroidUtils.resolveAttribute(app, R.attr.active_color_basic);
|
||||
final int disabledColor = AndroidUtils.resolveAttribute(app, android.R.attr.textColorSecondary);
|
||||
|
||||
String title = getString(R.string.recalculate_route_in_deviation);
|
||||
items.add(new TitleItem(title));
|
||||
|
||||
final View sliderView = UiUtilities.getInflater(getContext(), nightMode).inflate(R.layout.bottom_sheet_item_slider_with_two_text, null);
|
||||
slider = sliderView.findViewById(R.id.slider);
|
||||
tvSliderTitle = sliderView.findViewById(android.R.id.title);
|
||||
tvSliderTitle.setText(getString(R.string.distance));
|
||||
tvSliderSummary = sliderView.findViewById(android.R.id.summary);
|
||||
slider.setValueFrom(0);
|
||||
slider.setValueTo(entryValues.length - 1);
|
||||
slider.setStepSize(1);
|
||||
updateSliderView();
|
||||
|
||||
final String on = getString(R.string.shared_string_enabled);
|
||||
final String off = getString(R.string.shared_string_disabled);
|
||||
final BottomSheetItemWithCompoundButton[] preferenceBtn = new BottomSheetItemWithCompoundButton[1];
|
||||
preferenceBtn[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()
|
||||
.setChecked(enabled)
|
||||
.setCompoundButtonColorId(appModeColor)
|
||||
.setTitle(enabled ? on : off)
|
||||
.setTitleColorId(enabled ? activeColor : disabledColor)
|
||||
.setCustomView(getCustomButtonView(enabled))
|
||||
.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
enabled = !enabled;
|
||||
if (switchPref.callChangeListener(enabled)) {
|
||||
sliderPositionChanged = false;
|
||||
switchPref.setChecked(enabled);
|
||||
preferenceBtn[0].setTitle(enabled ? on : off);
|
||||
preferenceBtn[0].setTitleColorId(enabled ? activeColor : disabledColor);
|
||||
preferenceBtn[0].setChecked(enabled);
|
||||
getDefaultValue();
|
||||
updateSliderView();
|
||||
updateCustomButtonView(v, enabled);
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof OnPreferenceChanged) {
|
||||
((OnPreferenceChanged) target).onPreferenceChanged(switchPref.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.create();
|
||||
items.add(preferenceBtn[0]);
|
||||
items.add(new DividerSpaceItem(app, contentPaddingSmall));
|
||||
items.add(new LongDescriptionItem(getString(R.string.select_distance_route_will_recalc)));
|
||||
items.add(new DividerSpaceItem(app, dialogContentMargin));
|
||||
|
||||
slider.addOnChangeListener(new Slider.OnChangeListener() {
|
||||
@Override
|
||||
public void onValueChange(@NonNull Slider slider, float value, boolean fromUser) {
|
||||
sliderPositionChanged = true;
|
||||
if (fromUser) {
|
||||
currentValue = entryValues[(int) slider.getValue()];
|
||||
tvSliderSummary.setText(getFormattedDistance(app, currentValue));
|
||||
}
|
||||
}
|
||||
});
|
||||
items.add(new BaseBottomSheetItem.Builder()
|
||||
.setCustomView(sliderView)
|
||||
.create());
|
||||
items.add(new SubtitmeListDividerItem(getContext()));
|
||||
items.add(new DividerSpaceItem(app, contentPaddingSmall));
|
||||
items.add(new LongDescriptionItem(getString(R.string.recalculate_route_distance_promo)));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRightBottomButtonClick() {
|
||||
if (enabled && sliderPositionChanged) {
|
||||
preference.setModeValue(getAppMode(), currentValue);
|
||||
}
|
||||
Fragment target = getTargetFragment();
|
||||
if (target instanceof OnPreferenceChanged) {
|
||||
((OnPreferenceChanged) target).onPreferenceChanged(preference.getId());
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRightBottomButtonTextId() {
|
||||
return R.string.shared_string_apply;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putFloat(CURRENT_VALUE, currentValue);
|
||||
}
|
||||
|
||||
private void updateSliderView() {
|
||||
int activeColor = AndroidUtils.resolveAttribute(app, R.attr.active_color_basic);
|
||||
int disabledColor = AndroidUtils.resolveAttribute(app, android.R.attr.textColorSecondary);
|
||||
int textColorPrimary = AndroidUtils.resolveAttribute(app, android.R.attr.textColorPrimary);
|
||||
tvSliderTitle.setTextColor(ContextCompat.getColor(app, enabled ? textColorPrimary : disabledColor));
|
||||
tvSliderSummary.setTextColor(ContextCompat.getColor(app, enabled ? activeColor : disabledColor));
|
||||
tvSliderSummary.setText(getFormattedDistance(app, currentValue));
|
||||
slider.setValue(findIndexOfValue(currentValue));
|
||||
slider.setEnabled(enabled);
|
||||
}
|
||||
|
||||
private void getPreferenceStateAndValue() {
|
||||
float allowedValue = preference.getModeValue(appMode);
|
||||
if (allowedValue == DISABLE_MODE) {
|
||||
enabled = false;
|
||||
getDefaultValue();
|
||||
} else {
|
||||
enabled = true;
|
||||
if (allowedValue == DEFAULT_MODE) {
|
||||
getDefaultValue();
|
||||
} else {
|
||||
currentValue = allowedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getDefaultValue() {
|
||||
currentValue = RoutingHelper.getDefaultAllowedDeviation(settings, appMode,
|
||||
RoutingHelper.getPosTolerance(0));
|
||||
}
|
||||
|
||||
private int findIndexOfValue(float allowedValue) {
|
||||
for (int i = 0; i < entryValues.length; i++) {
|
||||
float value = entryValues[i];
|
||||
if (allowedValue == value) {
|
||||
return i;
|
||||
} else if (value > allowedValue) {
|
||||
return i > 0 ? --i : i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static String getFormattedDistance(@NonNull OsmandApplication app, float value) {
|
||||
return OsmAndFormatter.getFormattedDistance(value, app, false);
|
||||
}
|
||||
|
||||
public static boolean showInstance(@NonNull FragmentManager fragmentManager, String key, Fragment target,
|
||||
boolean usedOnMap, @Nullable ApplicationMode appMode) {
|
||||
try {
|
||||
Bundle args = new Bundle();
|
||||
args.putString(PREFERENCE_ID, key);
|
||||
|
||||
RecalculateRouteInDeviationBottomSheet fragment = new RecalculateRouteInDeviationBottomSheet();
|
||||
fragment.setArguments(args);
|
||||
fragment.setUsedOnMap(usedOnMap);
|
||||
fragment.setAppMode(appMode);
|
||||
fragment.setTargetFragment(target, 0);
|
||||
fragment.show(fragmentManager, TAG);
|
||||
return true;
|
||||
} catch (RuntimeException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.srtmplugin;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -12,6 +12,7 @@ import net.osmand.plus.OsmandSettings;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.srtmplugin.SRTMPlugin;
|
||||
import net.osmand.render.RenderingRuleProperty;
|
||||
|
||||
|
@ -20,7 +21,12 @@ import static net.osmand.plus.srtmplugin.SRTMPlugin.CONTOUR_LINES_DISABLED_VALUE
|
|||
|
||||
public class ContourLinesAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 29;
|
||||
public static final QuickActionType TYPE = new QuickActionType(29,
|
||||
"contourlines.showhide", ContourLinesAction.class).
|
||||
nameRes(R.string.quick_action_show_hide_contour_lines).iconRes(R.drawable.ic_plugin_srtm).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
|
||||
public ContourLinesAction() {
|
||||
super(TYPE);
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.quickaction.actions;
|
||||
package net.osmand.plus.srtmplugin;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -11,11 +11,16 @@ import net.osmand.plus.OsmandPlugin;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.srtmplugin.SRTMPlugin;
|
||||
|
||||
public class HillshadeAction extends QuickAction {
|
||||
|
||||
public static final int TYPE = 30;
|
||||
public static final QuickActionType TYPE = new QuickActionType(30,
|
||||
"contourlines.showhide", HillshadeAction.class).
|
||||
nameRes(R.string.quick_action_show_hide_hillshade).iconRes(R.drawable.ic_action_hillshade_dark).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
public HillshadeAction() {
|
||||
super(TYPE);
|
|
@ -30,6 +30,7 @@ import net.osmand.plus.download.DownloadIndexesThread;
|
|||
import net.osmand.plus.download.DownloadResources;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
import net.osmand.plus.inapp.InAppPurchaseHelper;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.render.RenderingRuleProperty;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -439,4 +440,10 @@ public class SRTMPlugin extends OsmandPlugin {
|
|||
private static int getThemeRes(Activity activity, OsmandApplication app) {
|
||||
return isNightMode(activity, app) ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
quickActionTypes.add(ContourLinesAction.TYPE);
|
||||
quickActionTypes.add(HillshadeAction.TYPE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ import net.osmand.plus.mapcontextmenu.MapContextMenuFragment;
|
|||
import net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu;
|
||||
import net.osmand.plus.measurementtool.MeasurementToolLayer;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionFactory;
|
||||
import net.osmand.plus.quickaction.QuickActionRegistry;
|
||||
import net.osmand.plus.quickaction.QuickActionsWidget;
|
||||
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
|
||||
|
@ -431,7 +430,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
|
|||
|
||||
@Override
|
||||
public void onActionSelected(QuickAction action) {
|
||||
QuickActionFactory.produceAction(action).execute(mapActivity);
|
||||
QuickActionRegistry.produceAction(action).execute(mapActivity);
|
||||
setLayerState(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -1023,7 +1023,9 @@ public class MapInfoWidgetsFactory {
|
|||
}
|
||||
|
||||
if (showExitInfo) {
|
||||
text = exitInfo.getExitStreetName();
|
||||
if(!Algorithms.isEmpty(exitInfo.getExitStreetName())) {
|
||||
text = exitInfo.getExitStreetName();
|
||||
}
|
||||
}
|
||||
|
||||
if (directionInfo != null && directionInfo.getRouteDataObject() != null) {
|
||||
|
|
|
@ -407,7 +407,7 @@ public class RouteInfoWidgetsFactory {
|
|||
@Override
|
||||
public boolean updateInfo(DrawSettings drawSettings) {
|
||||
float mx = 0;
|
||||
if ((rh == null || !rh.isFollowingMode() || rh.isDeviatedFromRoute() || rh.getCurrentGPXRoute() != null)
|
||||
if ((rh == null || !rh.isFollowingMode() || rh.isDeviatedFromRoute() || !rh.isCurrentGPXRouteV2())
|
||||
&& trackingUtilities.isMapLinkedToLocation()) {
|
||||
RouteDataObject ro = locationProvider.getLastKnownRouteSegment();
|
||||
if(ro != null) {
|
||||
|
@ -811,7 +811,7 @@ public class RouteInfoWidgetsFactory {
|
|||
int[] loclanes = null;
|
||||
int dist = 0;
|
||||
// TurnType primary = null;
|
||||
if ((rh == null || !rh.isFollowingMode() || rh.isDeviatedFromRoute() || rh.getCurrentGPXRoute() != null)
|
||||
if ((rh == null || !rh.isFollowingMode() || rh.isDeviatedFromRoute() || !rh.isCurrentGPXRouteV2())
|
||||
&& trackingUtilities.isMapLinkedToLocation() && settings.SHOW_LANES.get()) {
|
||||
RouteDataObject ro = locationProvider.getLastKnownRouteSegment();
|
||||
Location lp = locationProvider.getLastKnownLocation();
|
||||
|
@ -1272,7 +1272,7 @@ public class RouteInfoWidgetsFactory {
|
|||
if ((rh.isFollowingMode() || trackingUtilities.isMapLinkedToLocation())
|
||||
&& showRoutingAlarms && (trafficWarnings || cams)) {
|
||||
AlarmInfo alarm;
|
||||
if(rh.isFollowingMode() && !rh.isDeviatedFromRoute() && rh.getCurrentGPXRoute() == null) {
|
||||
if(rh.isFollowingMode() && !rh.isDeviatedFromRoute() && (rh.getCurrentGPXRoute() == null || rh.isCurrentGPXRouteV2())) {
|
||||
alarm = wh.getMostImportantAlarm(settings.SPEED_SYSTEM.get(), cams);
|
||||
} else {
|
||||
RouteDataObject ro = locationProvider.getLastKnownRouteSegment();
|
||||
|
|
Loading…
Reference in a new issue