Merge branch 'master' of ssh://github.com/osmandapp/Osmand into alex_fixes

# Conflicts:
#	OsmAnd/res/values-da/strings.xml
#	OsmAnd/res/values-es-rAR/strings.xml
#	OsmAnd/res/values-es-rUS/strings.xml
#	OsmAnd/res/values-zh-rTW/strings.xml
This commit is contained in:
Alexander Sytnyk 2017-07-17 13:12:00 +03:00
commit cd5b3875a3
12 changed files with 315 additions and 311 deletions

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><resources> <?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="app_mode_bus">Bus</string> <string name="app_mode_bus">Bus</string>
<string name="app_mode_train">Ćah</string> <string name="app_mode_train">Ćah</string>
<string name="map_widget_battery">Staw baterije</string> <string name="map_widget_battery">Staw baterije</string>
@ -903,4 +904,4 @@
<string name="storage_directory_card">Składowanska karta</string> <string name="storage_directory_card">Składowanska karta</string>
<string name="coords_format">Format koordinatow</string> <string name="coords_format">Format koordinatow</string>
<string name="coords_format_descr">Format za geografiske koordinaty</string> <string name="coords_format_descr">Format za geografiske koordinaty</string>
</resources> </resources>

View file

@ -2799,10 +2799,10 @@ Tidligere destination bliver sidste mellemliggende punkt.</string>
\n \n
\n • Lineal modul til afstandsmåling \n • Lineal modul til afstandsmåling
\n \n
\n• GPX split intervaller med detaljeret info om spor \n • GPX split intervaller med detaljeret info om spor
\n \n
\n • Andre forbedringer og fejlrettelser \n • Andre forbedringer og fejlrettelser
\n \n
\n</string> \n</string>
<string name="rendering_value_translucent_pink_name">Gennemsigtig pink</string> <string name="rendering_value_translucent_pink_name">Gennemsigtig lyserød</string>
</resources> </resources>

View file

@ -2093,7 +2093,7 @@
<string name="poi_clothes_denim">De mezclilla (vaqueros/jeans)</string> <string name="poi_clothes_denim">De mezclilla (vaqueros/jeans)</string>
<string name="poi_historic_milestone">Hito histórico</string> <string name="poi_historic_milestone">Hito histórico</string>
<string name="poi_shoes_children">De niños</string> <string name="poi_shoes_children">Infantil</string>
<string name="poi_shoes_women">Femenino</string> <string name="poi_shoes_women">Femenino</string>
<string name="poi_shoes_sport">Deportivo</string> <string name="poi_shoes_sport">Deportivo</string>
<string name="poi_shoes_men">Masculino</string> <string name="poi_shoes_men">Masculino</string>
@ -3079,7 +3079,7 @@
<string name="poi_shoes_type">Tipo de calzado</string> <string name="poi_shoes_type">Tipo de calzado</string>
<string name="poi_fire_hydrant_type">Tipo de hidrante</string> <string name="poi_fire_hydrant_type">Tipo de hidrante</string>
<string name="poi_fire_hydrant_position">Ubicación del hidrante</string> <string name="poi_fire_hydrant_position">Ubicación del hidrante</string>
<string name="poi_fire_hydrant_water_source">Fuente del agua</string> <string name="poi_fire_hydrant_water_source">Origen del agua</string>
<string name="poi_payment_toll_type">Forma de pago (peaje)</string> <string name="poi_payment_toll_type">Forma de pago (peaje)</string>
<string name="poi_traffic_signals_sound">Sonoro</string> <string name="poi_traffic_signals_sound">Sonoro</string>
<string name="poi_highway_crossing_type">Tipo de cruce</string> <string name="poi_highway_crossing_type">Tipo de cruce</string>

View file

@ -2678,7 +2678,7 @@ Proporciona un código completo</string>
<string name="range_min_max">Rango = Min/Máx</string> <string name="range_min_max">Rango = Min/Máx</string>
<string name="min_max">Min/Máx</string> <string name="min_max">Min/Máx</string>
<string name="release_2_7">\\u2022 Complemento de Mapillary con imágenes a nivel de calle <string name="release_2_7"> Complemento de Mapillary con imágenes a nivel de calle
\n \n
\n • Control de regla para medir distancias \n • Control de regla para medir distancias
\n \n

View file

@ -1927,7 +1927,7 @@
<string name="poi_clothes_military">Militar</string> <string name="poi_clothes_military">Militar</string>
<string name="poi_clothes_denim">De mezclilla (vaqueros/jeans)</string> <string name="poi_clothes_denim">De mezclilla (vaqueros/jeans)</string>
<string name="poi_historic_milestone">Hito histórico</string> <string name="poi_historic_milestone">Hito histórico</string>
<string name="poi_shoes_children">De niños</string> <string name="poi_shoes_children">Infantil</string>
<string name="poi_shoes_women">Femenino</string> <string name="poi_shoes_women">Femenino</string>
<string name="poi_shoes_sport">Deportivo</string> <string name="poi_shoes_sport">Deportivo</string>
<string name="poi_shoes_men">Masculino</string> <string name="poi_shoes_men">Masculino</string>
@ -2842,7 +2842,7 @@
<string name="poi_shoes_type">Tipo de calzado</string> <string name="poi_shoes_type">Tipo de calzado</string>
<string name="poi_fire_hydrant_type">Tipo de hidrante</string> <string name="poi_fire_hydrant_type">Tipo de hidrante</string>
<string name="poi_fire_hydrant_position">Ubicación del hidrante</string> <string name="poi_fire_hydrant_position">Ubicación del hidrante</string>
<string name="poi_fire_hydrant_water_source">Fuente del agua</string> <string name="poi_fire_hydrant_water_source">Origen del agua</string>
<string name="poi_payment_toll_type">Forma de pago (peaje)</string> <string name="poi_payment_toll_type">Forma de pago (peaje)</string>
<string name="poi_traffic_signals_sound">Sonoro</string> <string name="poi_traffic_signals_sound">Sonoro</string>
<string name="poi_highway_crossing_type">Tipo de cruce</string> <string name="poi_highway_crossing_type">Tipo de cruce</string>

View file

@ -2679,7 +2679,7 @@ Proporciona un código completo</string>
<string name="range_min_max">Rango = Min/Máx</string> <string name="range_min_max">Rango = Min/Máx</string>
<string name="min_max">Min/Máx</string> <string name="min_max">Min/Máx</string>
<string name="release_2_7">\\u2022 Complemento de Mapillary con imágenes a nivel de calle <string name="release_2_7"> Complemento de Mapillary con imágenes a nivel de calle
\n \n
\n • Control de regla para medir distancias \n • Control de regla para medir distancias
\n \n

View file

@ -944,7 +944,7 @@ Fonctionnalités principales :
<string name="target_point">Étape %1$s</string> <string name="target_point">Étape %1$s</string>
<string name="target_points">Itinéraire</string> <string name="target_points">Itinéraire</string>
<string name="intermediate_point_too_far">Étape %1$s trop éloignée de la route la plus proche.</string> <string name="intermediate_point_too_far">Étape %1$s trop éloignée de la route la plus proche.</string>
<string name="arrived_at_intermediate_point">Vous avez atteint l\'étape intermédiaire</string> <string name="arrived_at_intermediate_point">Vous êtes arrivés à l\'étape intermédiaire</string>
<string name="context_menu_item_intermediate_point">Ajouter comme étape</string> <string name="context_menu_item_intermediate_point">Ajouter comme étape</string>
<string name="map_widget_intermediate_distance">Étape</string> <string name="map_widget_intermediate_distance">Étape</string>
<string name="ending_point_too_far">Point d\'arrivée trop éloigné de la route la plus proche.</string> <string name="ending_point_too_far">Point d\'arrivée trop éloigné de la route la plus proche.</string>
@ -2848,4 +2848,5 @@ Fonctionnalités principales :
<string name="of">%1$d de %2$d</string> <string name="of">%1$d de %2$d</string>
<string name="moving_time">Durée de déplacement</string> <string name="moving_time">Durée de déplacement</string>
<string name="min_max">Min / Max</string> <string name="min_max">Min / Max</string>
<string name="rendering_value_translucent_pink_name">Rose translucide</string>
</resources> </resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><resources> <?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="shared_string_no">לא</string> <string name="shared_string_no">לא</string>
<string name="shared_string_yes">כן</string> <string name="shared_string_yes">כן</string>
<string name="close_changeset">סגירת ערכת השינויים</string> <string name="close_changeset">סגירת ערכת השינויים</string>
@ -1199,4 +1200,17 @@
<string name="osm_live_enter_email">נא להזין כתובת דוא״ל חוקית</string> <string name="osm_live_enter_email">נא להזין כתובת דוא״ל חוקית</string>
<string name="osm_live_enter_user_name">נא להזין שם פומבי</string> <string name="osm_live_enter_user_name">נא להזין שם פומבי</string>
<string name="osm_live_month_cost_desc">תשלום חודשי</string> <string name="osm_live_month_cost_desc">תשלום חודשי</string>
</resources> <string name="store_tracks_in_monthly_directories">אחסון המסלולים המוקלטים בתיקיות לפי חודש</string>
<string name="shared_string_reset">איפוס</string>
<string name="shared_string_reload">רענון</string>
<string name="mapillary_menu_descr_tile_cache">יש לרענן את האריחים כדי לראות מידע עדכני.</string>
<string name="mapillary_menu_title_tile_cache">מטמון האריחים</string>
<string name="wrong_user_name">שם המשתמש שגוי!</string>
<string name="shared_string_to">עד</string>
<string name="mapillary_menu_date_from">מ־</string>
<string name="mapillary_menu_descr_dates">הצגת תמונות שנוספו בתקופה מסוימת.</string>
<string name="mapillary_menu_title_dates">תאריכים</string>
<string name="mapillary_menu_edit_text_hint">הקלדת שם משתמש</string>
<string name="mapillary_menu_descr_username">הצגת תמונות שנוספו על ידי משתמש מסוים.</string>
<string name="mapillary_menu_title_username">שם משתמש</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><resources> <?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="rendering_attr_roadColors_description">Velg fargeskjema for veier:</string> <string name="rendering_attr_roadColors_description">Velg fargeskjema for veier:</string>
<string name="rendering_attr_roadColors_name">Veifargeskjema</string> <string name="rendering_attr_roadColors_name">Veifargeskjema</string>
<string name="map_widget_show_destination_arrow">Vis retning til målet</string> <string name="map_widget_show_destination_arrow">Vis retning til målet</string>
@ -353,7 +354,7 @@
<string name="shared_string_select_all">Velg alle</string> <string name="shared_string_select_all">Velg alle</string>
<string name="fast_route_mode">Raskeste rute</string> <string name="fast_route_mode">Raskeste rute</string>
<string name="fast_route_mode_descr">"Aktiver for å beregne raskeste rute eller deaktiver for drivstoffbesparende rute "</string> <string name="fast_route_mode_descr">Aktiver for å beregne raskeste rute eller deaktiver for drivstoffbesparende rute</string>
<string name="tiles_to_download_estimated_size">Ved zoom {0} last ned {1} fliser ({2} MB)</string> <string name="tiles_to_download_estimated_size">Ved zoom {0} last ned {1} fliser ({2} MB)</string>
<string name="shared_string_download_map">Last ned kart</string> <string name="shared_string_download_map">Last ned kart</string>
<string name="renderers">Vektor-opptegning</string> <string name="renderers">Vektor-opptegning</string>
@ -1868,7 +1869,7 @@
<string name="trip_rec_notification_settings">Turopptak (ingen data)</string> <string name="trip_rec_notification_settings">Turopptak (ingen data)</string>
<string name="trip_rec_notification_settings_desc">Vis merknader som lar deg starte en tur ved å trykke opptaksknappen</string> <string name="trip_rec_notification_settings_desc">Vis merknader som lar deg starte en tur ved å trykke opptaksknappen</string>
<string name="save_track_min_speed">Minimumshastighet for logging</string> <string name="save_track_min_speed">Minimumshastighet for logging</string>
<string name="save_track_min_speed_descr">Still inn minimumshastighet for at et punkt skal logges</string> <string name="save_track_min_speed_descr">Filter: Still inn minimumshastighet for at et punkt skal logges</string>
<string name="save_track_min_distance">Logging ved bevegelsesoppdagelse</string> <string name="save_track_min_distance">Logging ved bevegelsesoppdagelse</string>
<string name="save_track_min_distance_descr">Angi minste avstand fra siste posisjon for at et punkt skal logges</string> <string name="save_track_min_distance_descr">Angi minste avstand fra siste posisjon for at et punkt skal logges</string>
<string name="save_track_precision">Minste loggingspresisjon</string> <string name="save_track_precision">Minste loggingspresisjon</string>
@ -2280,4 +2281,5 @@ Representerer området: %1$s x %2$s</string>
<string name="mapillary_menu_title_dates">Datoer</string> <string name="mapillary_menu_title_dates">Datoer</string>
<string name="mapillary_menu_edit_text_hint">Skriv inn brukernavn</string> <string name="mapillary_menu_edit_text_hint">Skriv inn brukernavn</string>
<string name="mapillary_menu_title_username">Brukernavn</string> <string name="mapillary_menu_title_username">Brukernavn</string>
</resources> <string name="shared_string_reset">Tilbakestill</string>
</resources>

View file

@ -2708,6 +2708,6 @@ Pro praghere iscrie su còdighe intreu</string>
\n \n
\n</string> \n</string>
<string name="rendering_value_translucent_pink_name">Rosa translùtzidu</string> <string name="rendering_value_translucent_pink_name">Rosa translùtzidu</string>
<string name="average">Mesanu/mèdiu</string> <string name="average">Mèdiu</string>
<string name="ascent_descent">Ascendente/Discendente</string> <string name="ascent_descent">Ascendente/Discendente</string>
</resources> </resources>

View file

@ -2787,7 +2787,7 @@ OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式
<string name="range_min_max">範圍 = 最小/最大</string> <string name="range_min_max">範圍 = 最小/最大</string>
<string name="min_max">最小/最大</string> <string name="min_max">最小/最大</string>
<string name="release_2_7">\\u2022 Mapillary 外掛元件與街道級影像 <string name="release_2_7">\\u2022 Mapillary 外掛元件與街道級影像
\n \n
\n • 用於距離測量的尺規小工具 \n • 用於距離測量的尺規小工具
\n \n

View file

@ -1,6 +1,5 @@
package net.osmand.plus.quickaction; package net.osmand.plus.quickaction;
import android.support.annotation.DrawableRes; import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes; import android.support.annotation.StringRes;
@ -42,76 +41,65 @@ import java.util.List;
public class QuickActionFactory { public class QuickActionFactory {
public String quickActionListToString(List<QuickAction> quickActions) { public String quickActionListToString(List<QuickAction> quickActions) {
return new Gson().toJson(quickActions); return new Gson().toJson(quickActions);
} }
public List<QuickAction> parseActiveActionsList(String json) { 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>();
}
Type type = new TypeToken<List<QuickAction>>() { public static List<QuickAction> produceTypeActionsListWithHeaders(List<QuickAction> active) {
}.getType(); ArrayList<QuickAction> quickActions = new ArrayList<>();
ArrayList<QuickAction> quickActions = new Gson().fromJson(json, type); quickActions.add(new QuickAction(0, R.string.quick_action_add_create_items));
quickActions.add(new FavoriteAction());
quickActions.add(new GPXAction());
QuickAction marker = new MarkerAction();
return quickActions != null ? quickActions : new ArrayList<QuickAction>(); if (!marker.hasInstanceInList(active)) {
} quickActions.add(marker);
}
public static List<QuickAction> produceTypeActionsListWithHeaders(List<QuickAction> active) { if (OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class) != null) {
QuickAction audio = new TakeAudioNoteAction();
QuickAction photo = new TakePhotoNoteAction();
QuickAction video = new TakeVideoNoteAction();
ArrayList<QuickAction> quickActions = new ArrayList<>(); if (!audio.hasInstanceInList(active)) {
quickActions.add(audio);
}
quickActions.add(new QuickAction(0, R.string.quick_action_add_create_items)); if (!photo.hasInstanceInList(active)) {
quickActions.add(new FavoriteAction()); quickActions.add(photo);
quickActions.add(new GPXAction()); }
QuickAction marker = new MarkerAction(); if (!video.hasInstanceInList(active)) {
quickActions.add(video);
}
}
if (!marker.hasInstanceInList(active)) { if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) {
quickActions.add(marker); quickActions.add(new AddPOIAction());
} quickActions.add(new AddOSMBugAction());
}
if (OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class) != null) { if (OsmandPlugin.getEnabledPlugin(ParkingPositionPlugin.class) != null) {
QuickAction parking = new ParkingAction();
if (!parking.hasInstanceInList(active)) {
quickActions.add(parking);
}
}
QuickAction audio = new TakeAudioNoteAction(); quickActions.add(new QuickAction(0, R.string.quick_action_add_configure_map));
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 ShowHidePoiAction());
QuickAction favorites = new ShowHideFavoritesAction();
if (!favorites.hasInstanceInList(active)) {
quickActions.add(favorites);
}
quickActions.add(new ShowHidePoiAction());
if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) { if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) {
QuickAction showHideOSMBugAction = new ShowHideOSMBugAction(); QuickAction showHideOSMBugAction = new ShowHideOSMBugAction();
if (!showHideOSMBugAction.hasInstanceInList(active)) { if (!showHideOSMBugAction.hasInstanceInList(active)) {
@ -120,15 +108,13 @@ public class QuickActionFactory {
} }
quickActions.add(new MapStyleAction()); 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(OsmandRasterMapsPlugin.class) != null) { QuickAction voice = new NavVoiceAction();
quickActions.add(new MapSourceAction());
quickActions.add(new MapOverlayAction());
quickActions.add(new MapUnderlayAction());
}
QuickAction voice = new NavVoiceAction();
QuickAction addDestination = new NavAddDestinationAction(); QuickAction addDestination = new NavAddDestinationAction();
QuickAction addFirstIntermediate = new NavAddFirstIntermediateAction(); QuickAction addFirstIntermediate = new NavAddFirstIntermediateAction();
QuickAction replaceDestination = new NavReplaceDestinationAction(); QuickAction replaceDestination = new NavReplaceDestinationAction();
@ -136,9 +122,9 @@ public class QuickActionFactory {
ArrayList<QuickAction> navigationQuickActions = new ArrayList<>(); ArrayList<QuickAction> navigationQuickActions = new ArrayList<>();
if (!voice.hasInstanceInList(active)) { if (!voice.hasInstanceInList(active)) {
navigationQuickActions.add(voice); navigationQuickActions.add(voice);
} }
if (!addDestination.hasInstanceInList(active)) { if (!addDestination.hasInstanceInList(active)) {
navigationQuickActions.add(addDestination); navigationQuickActions.add(addDestination);
} }
@ -157,331 +143,331 @@ public class QuickActionFactory {
quickActions.addAll(navigationQuickActions); quickActions.addAll(navigationQuickActions);
} }
return quickActions; return quickActions;
} }
public static QuickAction newActionByType(int type) { public static QuickAction newActionByType(int type) {
switch (type) { switch (type) {
case NewAction.TYPE: case NewAction.TYPE:
return new NewAction(); return new NewAction();
case MarkerAction.TYPE: case MarkerAction.TYPE:
return new MarkerAction(); return new MarkerAction();
case FavoriteAction.TYPE: case FavoriteAction.TYPE:
return new FavoriteAction(); return new FavoriteAction();
case ShowHideFavoritesAction.TYPE: case ShowHideFavoritesAction.TYPE:
return new ShowHideFavoritesAction(); return new ShowHideFavoritesAction();
case ShowHidePoiAction.TYPE: case ShowHidePoiAction.TYPE:
return new ShowHidePoiAction(); return new ShowHidePoiAction();
case GPXAction.TYPE: case GPXAction.TYPE:
return new GPXAction(); return new GPXAction();
case ParkingAction.TYPE: case ParkingAction.TYPE:
return new ParkingAction(); return new ParkingAction();
case TakeAudioNoteAction.TYPE: case TakeAudioNoteAction.TYPE:
return new TakeAudioNoteAction(); return new TakeAudioNoteAction();
case TakePhotoNoteAction.TYPE: case TakePhotoNoteAction.TYPE:
return new TakePhotoNoteAction(); return new TakePhotoNoteAction();
case TakeVideoNoteAction.TYPE: case TakeVideoNoteAction.TYPE:
return new TakeVideoNoteAction(); return new TakeVideoNoteAction();
case NavVoiceAction.TYPE: case NavVoiceAction.TYPE:
return new NavVoiceAction(); return new NavVoiceAction();
case ShowHideOSMBugAction.TYPE: case ShowHideOSMBugAction.TYPE:
return new ShowHideOSMBugAction(); return new ShowHideOSMBugAction();
case AddOSMBugAction.TYPE: case AddOSMBugAction.TYPE:
return new AddOSMBugAction(); return new AddOSMBugAction();
case AddPOIAction.TYPE: case AddPOIAction.TYPE:
return new AddPOIAction(); return new AddPOIAction();
case MapStyleAction.TYPE: case MapStyleAction.TYPE:
return new MapStyleAction(); return new MapStyleAction();
case MapSourceAction.TYPE: case MapSourceAction.TYPE:
return new MapSourceAction(); return new MapSourceAction();
case MapOverlayAction.TYPE: case MapOverlayAction.TYPE:
return new MapOverlayAction(); return new MapOverlayAction();
case MapUnderlayAction.TYPE: case MapUnderlayAction.TYPE:
return new MapUnderlayAction(); return new MapUnderlayAction();
case NavAddDestinationAction.TYPE: case NavAddDestinationAction.TYPE:
return new NavAddDestinationAction(); return new NavAddDestinationAction();
case NavAddFirstIntermediateAction.TYPE: case NavAddFirstIntermediateAction.TYPE:
return new NavAddFirstIntermediateAction(); return new NavAddFirstIntermediateAction();
case NavReplaceDestinationAction.TYPE: case NavReplaceDestinationAction.TYPE:
return new NavReplaceDestinationAction(); return new NavReplaceDestinationAction();
case NavAutoZoomMapAction.TYPE: case NavAutoZoomMapAction.TYPE:
return new NavAutoZoomMapAction(); return new NavAutoZoomMapAction();
default: default:
return new QuickAction(); return new QuickAction();
} }
} }
public static QuickAction produceAction(QuickAction quickAction) { public static QuickAction produceAction(QuickAction quickAction) {
switch (quickAction.type) { switch (quickAction.type) {
case NewAction.TYPE: case NewAction.TYPE:
return new NewAction(quickAction); return new NewAction(quickAction);
case MarkerAction.TYPE: case MarkerAction.TYPE:
return new MarkerAction(quickAction); return new MarkerAction(quickAction);
case FavoriteAction.TYPE: case FavoriteAction.TYPE:
return new FavoriteAction(quickAction); return new FavoriteAction(quickAction);
case ShowHideFavoritesAction.TYPE: case ShowHideFavoritesAction.TYPE:
return new ShowHideFavoritesAction(quickAction); return new ShowHideFavoritesAction(quickAction);
case ShowHidePoiAction.TYPE: case ShowHidePoiAction.TYPE:
return new ShowHidePoiAction(quickAction); return new ShowHidePoiAction(quickAction);
case GPXAction.TYPE: case GPXAction.TYPE:
return new GPXAction(quickAction); return new GPXAction(quickAction);
case ParkingAction.TYPE: case ParkingAction.TYPE:
return new ParkingAction(quickAction); return new ParkingAction(quickAction);
case TakeAudioNoteAction.TYPE: case TakeAudioNoteAction.TYPE:
return new TakeAudioNoteAction(quickAction); return new TakeAudioNoteAction(quickAction);
case TakePhotoNoteAction.TYPE: case TakePhotoNoteAction.TYPE:
return new TakePhotoNoteAction(quickAction); return new TakePhotoNoteAction(quickAction);
case TakeVideoNoteAction.TYPE: case TakeVideoNoteAction.TYPE:
return new TakeVideoNoteAction(quickAction); return new TakeVideoNoteAction(quickAction);
case NavVoiceAction.TYPE: case NavVoiceAction.TYPE:
return new NavVoiceAction(quickAction); return new NavVoiceAction(quickAction);
case ShowHideOSMBugAction.TYPE: case ShowHideOSMBugAction.TYPE:
return new ShowHideOSMBugAction(quickAction); return new ShowHideOSMBugAction(quickAction);
case AddOSMBugAction.TYPE: case AddOSMBugAction.TYPE:
return new AddOSMBugAction(quickAction); return new AddOSMBugAction(quickAction);
case AddPOIAction.TYPE: case AddPOIAction.TYPE:
return new AddPOIAction(quickAction); return new AddPOIAction(quickAction);
case MapStyleAction.TYPE: case MapStyleAction.TYPE:
return new MapStyleAction(quickAction); return new MapStyleAction(quickAction);
case MapSourceAction.TYPE: case MapSourceAction.TYPE:
return new MapSourceAction(quickAction); return new MapSourceAction(quickAction);
case MapOverlayAction.TYPE: case MapOverlayAction.TYPE:
return new MapOverlayAction(quickAction); return new MapOverlayAction(quickAction);
case MapUnderlayAction.TYPE: case MapUnderlayAction.TYPE:
return new MapUnderlayAction(quickAction); return new MapUnderlayAction(quickAction);
case NavAddDestinationAction.TYPE: case NavAddDestinationAction.TYPE:
return new NavAddDestinationAction(quickAction); return new NavAddDestinationAction(quickAction);
case NavAddFirstIntermediateAction.TYPE: case NavAddFirstIntermediateAction.TYPE:
return new NavAddFirstIntermediateAction(quickAction); return new NavAddFirstIntermediateAction(quickAction);
case NavReplaceDestinationAction.TYPE: case NavReplaceDestinationAction.TYPE:
return new NavReplaceDestinationAction(quickAction); return new NavReplaceDestinationAction(quickAction);
case NavAutoZoomMapAction.TYPE: case NavAutoZoomMapAction.TYPE:
return new NavAutoZoomMapAction(quickAction); return new NavAutoZoomMapAction(quickAction);
default: default:
return quickAction; return quickAction;
} }
} }
public static @DrawableRes int getActionIcon(int type) { public static @DrawableRes int getActionIcon(int type) {
switch (type) { switch (type) {
case NewAction.TYPE: case NewAction.TYPE:
return R.drawable.ic_action_plus; return R.drawable.ic_action_plus;
case MarkerAction.TYPE: case MarkerAction.TYPE:
return R.drawable.ic_action_flag_dark; return R.drawable.ic_action_flag_dark;
case FavoriteAction.TYPE: case FavoriteAction.TYPE:
return R.drawable.ic_action_fav_dark; return R.drawable.ic_action_fav_dark;
case ShowHideFavoritesAction.TYPE: case ShowHideFavoritesAction.TYPE:
return R.drawable.ic_action_fav_dark; return R.drawable.ic_action_fav_dark;
case ShowHidePoiAction.TYPE: case ShowHidePoiAction.TYPE:
return R.drawable.ic_action_gabout_dark; return R.drawable.ic_action_gabout_dark;
case GPXAction.TYPE: case GPXAction.TYPE:
return R.drawable.ic_action_flag_dark; return R.drawable.ic_action_flag_dark;
case ParkingAction.TYPE: case ParkingAction.TYPE:
return R.drawable.ic_action_parking_dark; return R.drawable.ic_action_parking_dark;
case TakeAudioNoteAction.TYPE: case TakeAudioNoteAction.TYPE:
return R.drawable.ic_action_micro_dark; return R.drawable.ic_action_micro_dark;
case TakePhotoNoteAction.TYPE: case TakePhotoNoteAction.TYPE:
return R.drawable.ic_action_photo_dark; return R.drawable.ic_action_photo_dark;
case TakeVideoNoteAction.TYPE: case TakeVideoNoteAction.TYPE:
return R.drawable.ic_action_video_dark; return R.drawable.ic_action_video_dark;
case NavVoiceAction.TYPE: case NavVoiceAction.TYPE:
return R.drawable.ic_action_volume_up; return R.drawable.ic_action_volume_up;
case ShowHideOSMBugAction.TYPE: case ShowHideOSMBugAction.TYPE:
return R.drawable.ic_action_bug_dark; return R.drawable.ic_action_bug_dark;
case AddOSMBugAction.TYPE: case AddOSMBugAction.TYPE:
return R.drawable.ic_action_bug_dark; return R.drawable.ic_action_bug_dark;
case AddPOIAction.TYPE: case AddPOIAction.TYPE:
return R.drawable.ic_action_gabout_dark; return R.drawable.ic_action_gabout_dark;
case MapStyleAction.TYPE: case MapStyleAction.TYPE:
return R.drawable.ic_map; return R.drawable.ic_map;
case MapSourceAction.TYPE: case MapSourceAction.TYPE:
return R.drawable.ic_world_globe_dark; return R.drawable.ic_world_globe_dark;
case MapOverlayAction.TYPE: case MapOverlayAction.TYPE:
return R.drawable.ic_layer_top_dark; return R.drawable.ic_layer_top_dark;
case MapUnderlayAction.TYPE: case MapUnderlayAction.TYPE:
return R.drawable.ic_layer_bottom_dark; return R.drawable.ic_layer_bottom_dark;
case NavAddDestinationAction.TYPE: case NavAddDestinationAction.TYPE:
return R.drawable.ic_action_target; return R.drawable.ic_action_target;
case NavAddFirstIntermediateAction.TYPE: case NavAddFirstIntermediateAction.TYPE:
return R.drawable.ic_action_intermediate; return R.drawable.ic_action_intermediate;
case NavReplaceDestinationAction.TYPE: case NavReplaceDestinationAction.TYPE:
return R.drawable.ic_action_target; return R.drawable.ic_action_target;
case NavAutoZoomMapAction.TYPE: case NavAutoZoomMapAction.TYPE:
return R.drawable.ic_action_search_dark; return R.drawable.ic_action_search_dark;
default: default:
return R.drawable.ic_action_plus; return R.drawable.ic_action_plus;
} }
} }
public static @StringRes int getActionName(int type) { public static @StringRes int getActionName(int type) {
switch (type) { switch (type) {
case NewAction.TYPE: case NewAction.TYPE:
return R.string.quick_action_new_action; return R.string.quick_action_new_action;
case MarkerAction.TYPE: case MarkerAction.TYPE:
return R.string.quick_action_add_marker; return R.string.quick_action_add_marker;
case FavoriteAction.TYPE: case FavoriteAction.TYPE:
return R.string.quick_action_add_favorite; return R.string.quick_action_add_favorite;
case ShowHideFavoritesAction.TYPE: case ShowHideFavoritesAction.TYPE:
return R.string.quick_action_showhide_favorites_title; return R.string.quick_action_showhide_favorites_title;
case ShowHidePoiAction.TYPE: case ShowHidePoiAction.TYPE:
return R.string.quick_action_showhide_poi_title; return R.string.quick_action_showhide_poi_title;
case GPXAction.TYPE: case GPXAction.TYPE:
return R.string.quick_action_add_gpx; return R.string.quick_action_add_gpx;
case ParkingAction.TYPE: case ParkingAction.TYPE:
return R.string.quick_action_add_parking; return R.string.quick_action_add_parking;
case TakeAudioNoteAction.TYPE: case TakeAudioNoteAction.TYPE:
return R.string.quick_action_take_audio_note; return R.string.quick_action_take_audio_note;
case TakePhotoNoteAction.TYPE: case TakePhotoNoteAction.TYPE:
return R.string.quick_action_take_photo_note; return R.string.quick_action_take_photo_note;
case TakeVideoNoteAction.TYPE: case TakeVideoNoteAction.TYPE:
return R.string.quick_action_take_video_note; return R.string.quick_action_take_video_note;
case NavVoiceAction.TYPE: case NavVoiceAction.TYPE:
return R.string.quick_action_navigation_voice; return R.string.quick_action_navigation_voice;
case ShowHideOSMBugAction.TYPE: case ShowHideOSMBugAction.TYPE:
return R.string.quick_action_showhide_osmbugs_title; return R.string.quick_action_showhide_osmbugs_title;
case AddOSMBugAction.TYPE: case AddOSMBugAction.TYPE:
return R.string.quick_action_add_osm_bug; return R.string.quick_action_add_osm_bug;
case AddPOIAction.TYPE: case AddPOIAction.TYPE:
return R.string.quick_action_add_poi; return R.string.quick_action_add_poi;
case MapStyleAction.TYPE: case MapStyleAction.TYPE:
return R.string.quick_action_map_style; return R.string.quick_action_map_style;
case MapSourceAction.TYPE: case MapSourceAction.TYPE:
return R.string.quick_action_map_source; return R.string.quick_action_map_source;
case MapOverlayAction.TYPE: case MapOverlayAction.TYPE:
return R.string.quick_action_map_overlay; return R.string.quick_action_map_overlay;
case MapUnderlayAction.TYPE: case MapUnderlayAction.TYPE:
return R.string.quick_action_map_underlay; return R.string.quick_action_map_underlay;
case NavAddDestinationAction.TYPE: case NavAddDestinationAction.TYPE:
return R.string.quick_action_add_destination; return R.string.quick_action_add_destination;
case NavAddFirstIntermediateAction.TYPE: case NavAddFirstIntermediateAction.TYPE:
return R.string.quick_action_add_first_intermediate; return R.string.quick_action_add_first_intermediate;
case NavReplaceDestinationAction.TYPE: case NavReplaceDestinationAction.TYPE:
return R.string.quick_action_replace_destination; return R.string.quick_action_replace_destination;
case NavAutoZoomMapAction.TYPE: case NavAutoZoomMapAction.TYPE:
return R.string.quick_action_auto_zoom; return R.string.quick_action_auto_zoom;
default: default:
return R.string.quick_action_new_action; return R.string.quick_action_new_action;
} }
} }
public static boolean isActionEditable(int type) { public static boolean isActionEditable(int type) {
switch (type) { switch (type) {
case NewAction.TYPE: case NewAction.TYPE:
case MarkerAction.TYPE: case MarkerAction.TYPE:
case ShowHideFavoritesAction.TYPE: case ShowHideFavoritesAction.TYPE:
case ShowHidePoiAction.TYPE: case ShowHidePoiAction.TYPE:
case ParkingAction.TYPE: case ParkingAction.TYPE:
case TakeAudioNoteAction.TYPE: case TakeAudioNoteAction.TYPE:
case TakePhotoNoteAction.TYPE: case TakePhotoNoteAction.TYPE:
case TakeVideoNoteAction.TYPE: case TakeVideoNoteAction.TYPE:
case NavVoiceAction.TYPE: case NavVoiceAction.TYPE:
case NavAddDestinationAction.TYPE: case NavAddDestinationAction.TYPE:
case NavAddFirstIntermediateAction.TYPE: case NavAddFirstIntermediateAction.TYPE:
case NavReplaceDestinationAction.TYPE: case NavReplaceDestinationAction.TYPE:
case NavAutoZoomMapAction.TYPE: case NavAutoZoomMapAction.TYPE:
case ShowHideOSMBugAction.TYPE: case ShowHideOSMBugAction.TYPE:
return false; return false;
default: return true; default:
} return true;
} }
}
} }