Merge pull request #4 from osmandapp/master

update
This commit is contained in:
Yuriy Ridkous 2016-03-27 23:40:40 +03:00
commit feb15e7d2e
112 changed files with 1634 additions and 1044 deletions

View file

@ -37,7 +37,7 @@
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="com.sec.feature.spen_usp" android:required="true"/>
<uses-feature android:name="com.sec.feature.spen_usp" android:required="false"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -118,6 +118,7 @@
</LinearLayout>
<View
android:id="@+id/divSharedStorage"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="fill_horizontal"

View file

@ -2176,4 +2176,5 @@
<string name="osm_live_support_region">Падтрымоўваны рэгіён</string>
<string name="osm_live_enter_user_name">Калі ласка ўвядзіце імя</string>
<string name="select_map_markers">Абярыце маркеры</string>
</resources>
<string name="file_name_containes_illegal_char">Назва файлу зьмяшчае недапушчальны сымбаль</string>
</resources>

View file

@ -2675,7 +2675,7 @@
<string name="poi_nuclear_explosion_type_space">Eksplosionstype: rummet (højde over 80 km)</string>
<string name="poi_nuclear_explosion_type_underwater">Eksplosionstype: undersøisk</string>
<string name="poi_nuclear_explosion_date_utc">Eksplosionsdato (UTC)</string>
<string name="poi_nuclear_explosion_shot_name_en">Skudnavnet (en)</string>
<string name="poi_nuclear_explosion_shot_name_en">Skudnavn (en)</string>
<string name="poi_nuclear_explosion_series">Eksplosionsserie</string>
<string name="poi_nuclear_explosion_purpose_nuclear_weapons_related">Eksplosionsformål: atomvåben relateret</string>
<string name="poi_nuclear_explosion_purpose_weapons_effects">Eksplosionsformål: våbeneffekt</string>
@ -2688,11 +2688,11 @@
<string name="poi_nuclear_explosion_purpose_industrial_application">Eksplosionsformål: industriel anvendelse</string>
<string name="poi_nuclear_explosion_purpose_industrial_application_earth_moving">Eksplosionsformål: industriel anvendelse, jordflytning</string>
<string name="poi_nuclear_explosion_time_utc">Eksplosionstidpunkt (UTC)</string>
<string name="poi_nuclear_explosion_yield">Eksplosion udbytte</string>
<string name="poi_nuclear_explosion_yield">Eksplosionsudbytte</string>
<string name="poi_nuclear_explosion_hole">Eksplosionshul</string>
<string name="poi_nuclear_explosion_height_of_burst">Eksplosionenshøjde</string>
<string name="poi_nuclear_explosion_ground_zero_altitude">Højde over jordoverfladen</string>
<string name="poi_nuclear_explosion_body_wave_magnitude">bølge størrelsesorden</string>
<string name="poi_nuclear_explosion_body_wave_magnitude">Seismiskbølge størrelsesorden</string>
<string name="poi_nuclear_explosion_salvo_first_detonation">Eksplosionssalve: første detonation af en salvetest</string>
<string name="poi_nuclear_explosion_salvo_second_or_later_detonation">Eksplosionssalve: anden eller senere detonation af en salvetest</string>
<string name="poi_nuclear_explosion_crater_diameter">Eksplosion: kraterdiameter</string>
@ -2715,7 +2715,7 @@
<string name="poi_amenity_vacuum_cleaner">Støvsuger</string>
<string name="poi_sport_free_flying">Freeflying (sport)</string>
<string name="poi_bicycle_repair_station">Cykel reparation stander</string>
<string name="poi_bicycle_repair_station">Cykelreparationsstander</string>
<string name="poi_water_tap">Vandhane</string>
@ -2726,25 +2726,25 @@
<string name="poi_free_flying_paragliding_no">Paragliding: nej</string>
<string name="poi_free_flying_hanggliding_yes">Hanggliding: ja</string>
<string name="poi_free_flying_hanggliding_no">Hanggliding: nej</string>
<string name="poi_free_flying_site_orientation_s">Freeflying sted orientering: S</string>
<string name="poi_free_flying_site_orientation_sw">Freeflying sted orientering: SV</string>
<string name="poi_free_flying_site_orientation_w">Freeflying sted orientering: V</string>
<string name="poi_free_flying_site_orientation_nw">Freeflying sted orientering: NV</string>
<string name="poi_free_flying_site_orientation_n">Freeflying sted orientering: N</string>
<string name="poi_free_flying_site_orientation_ne">Freeflying sted orientering: NØ</string>
<string name="poi_free_flying_site_orientation_e">Freeflying sted orientering: Ø</string>
<string name="poi_free_flying_site_orientation_se">Freeflying sted orientering: SØ</string>
<string name="poi_free_flying_site_orientation_s">Freeflying flyvepladsorientering: S</string>
<string name="poi_free_flying_site_orientation_sw">Freeflying flyvepladsorientering: SV</string>
<string name="poi_free_flying_site_orientation_w">Freeflying flyvepladsorientering: V</string>
<string name="poi_free_flying_site_orientation_nw">Freeflying flyvepladsorientering: NV</string>
<string name="poi_free_flying_site_orientation_n">Freeflying flyvepladsorientering: N</string>
<string name="poi_free_flying_site_orientation_ne">Freeflying flyvepladsorientering: NØ</string>
<string name="poi_free_flying_site_orientation_e">Freeflying flyvepladsorientering: Ø</string>
<string name="poi_free_flying_site_orientation_se">Freeflying flyvepladsorientering: SØ</string>
<string name="poi_free_flying_no_flight_time">Ingen flyvetid (Freeflying)</string>
<string name="poi_free_flying_guest_guidelines_yes">Gæsteretningslinjer for freeflying: ja</string>
<string name="poi_free_flying_guest_guidelines_no">Gæsteretningslinjer for freeflying: nej</string>
<string name="poi_solarium">Solarium</string>
<string name="poi_free_flying_site_takeoff">Freeflying sted: start</string>
<string name="poi_free_flying_site_landing">Freeflying sted: landing</string>
<string name="poi_free_flying_site_toplanding">Freeflying sted: toplanding</string>
<string name="poi_free_flying_site_towing">Freeflying sted: trækanordning</string>
<string name="poi_free_flying_site_training">"Freeflying sted: træning"</string>
<string name="poi_free_flying_site_takeoff">Freeflying flyveplads: start</string>
<string name="poi_free_flying_site_landing">Freeflying flyveplads: landing</string>
<string name="poi_free_flying_site_toplanding">Freeflying flyveplads: toplanding</string>
<string name="poi_free_flying_site_towing">Freeflying flyveplads: trækanordning</string>
<string name="poi_free_flying_site_training">"Freeflying flyveplads: træning"</string>
<string name="poi_free_flying_official_yes">Freeflying funktionær: ja</string>
<string name="poi_free_flying_official_no">Freeflying funktionær: nej</string>
<string name="poi_free_flying_rigid_yes">Freeflying fastvinge: ja</string>

View file

@ -788,4 +788,33 @@
<string name="osmo_group_policy">Politiko</string>
<string name="osmo_connect_to_device_name">Uzantnomo</string>
<string name="osmo_group_name">Grupnomo</string>
<string name="osmo_connect_to_device">Kupli kun aparato</string>
<string name="osmo_connect_to_group">Kupli kun grupo</string>
<string name="osmo_create_group">Krei grupon</string>
<string name="osmo_server_operation_failed">Servilo de OsMo malfunkciis</string>
<string name="osmo_activity">OpenStreetMap Observado</string>
<string name="osmo_enable_tracker">Sendi mian pozicion</string>
<string name="osmo_control">Rapidaliro al OsMo</string>
<string name="hours_ago">horoj antaŭe</string>
<string name="minutes_ago">minutoj antaŭe</string>
<string name="seconds_ago">sekundoj antaŭe</string>
<string name="osmo_connected_devices">Konektitaj aparatoj</string>
<string name="osmo_session_token">Seanca ĵetono: %1$s</string>
<string name="osmo_auth_pending">Atendanta rajtigadon…</string>
<string name="osmo_locations_sent">"Pozicioj senditaj %1$d (en bufro %2$d) "</string>
<string name="osmo_conn_successfull">"Konektita: %1$s "</string>
<string name="osmo_io_error">"Problemo kun OsMo konekto: "</string>
<string name="osmo_settings_uuid">Ununura aparata identigilo</string>
<string name="use_points_as_intermediates">Prikalkuli kurson inter punktojn</string>
<string name="osmo_mode_restart">Restartigi OsMo seancon</string>
<string name="osmo_mode_on">Ĉesigi OsMo seancon</string>
<string name="osmo_mode_off">Eki OsMo seancon</string>
<string name="osmo_settings_debug">Informoj pri senerarigo</string>
<string name="osmo_settings_descr">Agordu observadon kaj personan observadan kanalon</string>
<string name="osmo_settings">OsMo</string>
<string name="always_center_position_on_map">Ĉiam montri centrigitan pozicion</string>
<string name="localization_pref_title">Loko</string>
<string name="index_item_nation_addresses">adresoj tutmondaj</string>
<string name="index_item_world_altitude_correction">Korekto de altitudo</string>
<string name="index_item_world_seamarks">Mondaj maraj navigadpunktoj</string>
</resources>

File diff suppressed because one or more lines are too long

View file

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="lang_es_ar">ಅರ್ಜಿಂಟಿನೆಯಾದ ಸ್ಪೇನಿಷ್</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources><string name="lang_es_ar">ಅರ್ಜಿಂಟಿನೆಯಾದ ಸ್ಪೇನಿಷ್</string>
<string name="lang_th">ಥಾಯಿ</string>
<string name="lang_te">ತೆಲುಗು</string>
<string name="lang_nn"/>
<string name="lang_new">ನೇಪಾಳಿ</string>
<string name="lang_ms">ಮಲೇಷ್ಯಾ</string>
<string name="lang_ms">ಮಲೇಷ್ಯಾನ್</string>
<string name="download_wikipedia_files">ನೀವು ಅಧಿಕ ವಿಕಿಪೀಡಿಯ ದತ್ತಾಂಶವನ್ನು (%1$s MB) ಡೌನ್ ಲೋಡ್ ಮಾಡಲು ಇಚ್ಚಿಸುವಿರಾ?</string>
<string name="read_full_article">ಪೂರ್ಣ ಲೇಖನ ಓದಿ(ಮಿಂಬಲೆಯೊಳಗೆ)</string>
<string name="shared_string_wikipedia">ವಿಕಿಪೀಡಿಯ</string>
<string name="local_indexes_cat_wiki">ವಿಕಿಪೀಡಿಯ</string>
<string name="shared_string_show_details">ವಿವರಣೆ ತೋರಿಸಿ</string>
<string name="osm_edit_context_menu_delete">ಒಎಸ್ಎಂ ಸಂಪಾದನೆಯನ್ನು ಅಳಿಸು</string>
<string name="rendering_value_disabled_name">ಹೆಳವುಗೊಳಿಸು</string>
<string name="osmo_share_my_location">ನ್ನ ಜಾಗವನ್ನು ಇತರರೊಡನೆ ಹಂಚ</string>
<string name="rendering_value_disabled_name">ನಿಷ್ಕ್ರೀಯೆಗೊಳಿಸಿದೆ</string>
<string name="osmo_share_my_location">ಾನಿರುವ ಸ್ಥಳವನ್ನು ಬೇರೆಯವರಿಗೆ ಕಳಿಸ</string>
<string name="shared_string_logoff">ಹೊರನಡೆ</string>
<string name="rendering_attr_hideHouseNumbers_name">ಮನೆ ಸಂಖ್ಯಯನ್ನು ಅಡಗಿಸು</string>
<string name="shared_string_copy">ಪ್ರತಿ</string>
@ -97,7 +98,7 @@
<string name="shared_string_address">ಒಕ್ಕಣೆ</string>
<string name="shared_string_add">ಸೇರಿಸು</string>
<string name="shared_string_add_to_favorites">ಇಷ್ಟವಾದವುಗಳಿಗೆ ಸೇರಿಸು</string>
<string name="shared_string_my_location">ನನ್ನ ಜಾಗ</string>
<string name="shared_string_my_location">ನನ್ನ ಈಗಿನ ಸ್ಥಳ</string>
<string name="shared_string_my_places">ನನ್ನ ಸ್ಥಳಗಳು</string>
<string name="shared_string_my_favorites">ನನ್ನ ಇಷ್ಟವಾದವುಗಳು</string>
<string name="shared_string_my_tracks">ನನ್ನ ಟ್ರ್ಯಾಕ್ ಗಳು</string>
@ -107,7 +108,7 @@
<string name="shared_string_photo">ಛಾಯಾಚಿತ್ರ</string>
<string name="shared_string_online_maps">ಮಿಂಬಲೆ ನಕ್ಷೆಗಳು</string>
<string name="record_plugin_name">ಪ್ರಯಾಣ ದಾಖಲಿಸಿಕೊಳ್ಳುವುದು</string>
<string name="osmo_plugin_name">ಸ್ಮೊ (ಒಎಸ್ಎಂ ಪರಿವೀಕ್ಷಿಸುವಿಕೆ)</string>
<string name="osmo_plugin_name">ಪನ್‌ಸ್ಟ್ರೀಟ್‌ಮ್ಯಾಪ್ ಪರಿವೀಕ್ಷಿಸುವಿಕೆ</string>
<string name="plugin_nautical_name">ಹಡಗಿನ ನಕ್ಷೆ ವೀಕ್ಷಣೆ</string>
<string name="plugin_ski_name">ಆಕಾಶ ನಕ್ಷೆ ವೀಕ್ಷಣೆ</string>
<string name="audionotes_plugin_name">ದೃಶ್ಯ / ಶ್ರಾವ್ಯ ಟಿಪ್ಪಣೆಗಳು</string>
@ -115,7 +116,7 @@
<string name="shared_string_accessibility">ಲಭ್ಯಾರ್ಹತೆ</string>
<string name="osm_settings">ಒಎಸ್ಎಂ ಸಂಪಾದನೆ</string>
<string name="debugging_and_development">ಒಸ್ಮಾಂಡ್ ತಂತ್ರಾಶ ಅಭಿವೃದ್ಧಿ</string>
<string name="rename_failed">ಮರುನಾಮಕರಣ ವಿಫಲವಾಗಿದೆ</string>
<string name="rename_failed">ಮರುನಾಮಕರಣ ವಿಫಲವಾಗಿದೆ.</string>
<string name="days_behind">ದಿನಗಳು ಹಿಂದುಗಡೆಗೆ</string>
<string name="back_to_map">ನಕ್ಷೆಗೆ ಹಿಂದುರುಗಿ</string>
<string name="share_note">ಟಿಪ್ಪಣಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳಿ</string>
@ -125,7 +126,7 @@
<string name="roads_only">ಕೇವಲ ರಸ್ತೆಗಳು</string>
<string name="edit_group">ಗುಂಪನ್ನು ಸಂಪಾದಿಸಿ</string>
<string name="parking_place">ನಿಲುಗಡೆ ಸ್ಥಳ</string>
<string name="remove_the_tag"/>
<string name="remove_the_tag">ಟ್ಯಾಗ್ಅನ್ನು ತೆಗೆಯಿರಿ</string>
<string name="gps_status">ಜಿಪಿಎಸ್ ಮಟ್ಟ</string>
<string name="rendering_attr_streetLighting_name">ದಾರಿ ದೀಪಗಳು</string>
<string name="settings_privacy">ಗುಪ್ತತೆ</string>
@ -143,7 +144,7 @@
<string name="navigate_point_zone">ವಲಯ</string>
<string name="navigate_point_northing">ಉತ್ತರದಿಕ್ಕಿನೆಡೆಗೆ</string>
<string name="navigate_point_easting">ಪೂರ್ವದಿಕ್ಕಿನೆಡೆಗೆ</string>
<string name="download_tab_downloads">ಎಲ್ಲಾ ನಕಲಿಳಿಸುಗಳು</string>
<string name="download_tab_downloads">ಎಲ್ಲಾ ಡೌನ್‌ಲೋಡ್‌ಗಳು</string>
<string name="download_tab_updates">ಇಂದಿನವುಗಳು</string>
<string name="download_tab_local">ಸ್ಥಳಿಯ</string>
<string name="everything_up_to_date">ಎಲ್ಲಾ ಕಡತಗಳು ಇಂದಿನವಾಗಿವೆ</string>
@ -174,4 +175,73 @@
<string name="traffic_warning_speed_limit">ವೇಗದ ಮಿತಿ</string>
<string name="traffic_warning_payment">ದಾಟುಸುಂಕ</string>
<string name="traffic_warning_stop">ನಿಲುಗಡೆ ಫಲಕ</string>
<string name="report">ವರದಿ ಮಾಡಿ</string>
<string name="osmo_connect">ಜೊತೆಗೂಡಿ</string>
<string name="night">ರಾತ್ರಿ</string>
<string name="select_month_and_country">ತಿಂಗಳು ಮತ್ತು ದೇಶವನ್ನು ಆಯ್ದುಕೊಳ್ಳಿ</string>
<string name="daily">ಪ್ರತಿದಿನ</string>
<string name="weekly">ಪ್ರತಿವಾರ</string>
<string name="morning">ಮುಂಜಾನೆ</string>
<string name="no_map_markers_found">ದಯವಿಟ್ಟು ನಕ್ಷೆಯ ಮೇಲೆ ಚಿಹ್ನೆಯನ್ನು ಸೇರಿಸಿ</string>
<string name="osmo_groups">ಒಸ್ಮೋ ಗುಂಪುಗಳು</string>
<string name="shared_string_move_up">ಮೇಲೆ ಸರಿಸಿ</string>
<string name="shared_string_move_down">ಕೆಳಗೆ ಸರಿಸಿ</string>
<string name="full_report">ಪೂರ್ಣ ವರದಿ</string>
<string name="open_street_map_login_and_pass">ಒಪನ್‌ಸ್ಟ್ರೀಟ್‌ಮ್ಯಾಪ್ ಬಳಕೆದಾರರ ಹೆಸರು ಮತ್ತು ಗುಪ್ತಪದ</string>
<string name="donations">ದೇಣಿಗೆಗಳು</string>
<string name="osm_editors_ranking">ಒಎಸ್ಎಂ ಸಂಪಾದಕರ ರ‍್ಯಾಂಕಿಗ್</string>
<string name="osm_live_subscribe_btn">ಚಂದಾದಾರರಾಗಿ</string>
<string name="osm_live_user_public_name">ಸಾರ್ವಜನಿಕ ಹೆಸರು</string>
<string name="osm_live_hide_user_name">ವರದಿಯಲ್ಲಿ ನನ್ನ ಹೆಸರು ತೋರಿಸಬೇಡಿ</string>
<string name="select_map_marker">ನಕ್ಷೆಯ ಗುರುತನ್ನು ಆರಿಸಿ</string>
<string name="map_markers_other">ಇತರೆ ಗುರುತುಗಳು</string>
<string name="upload_anonymously">ಅನಾಮದೇಯರಾಗಿ ಅಪ್ಲೋಡ್ ಮಾಡಿ</string>
<string name="upload_osm_note">ಒಎಸ್ಎಂ ಟಿಪ್ಪಣಿಯನ್ನು ಅಪ್ಲೋಡ್ ಮಾಡಿ</string>
<string name="map_marker_1st">ಮೊದಲ ನಕಾಶೆಯ ಗುರುತು</string>
<string name="map_marker_2nd">ಎರಡನೆಯ ನಕಾಶೆಯ ಗುರುತು</string>
<string name="shared_string_add_to_map_markers">ನಕಾಶೆಯ ಗುರುತುಗಳಿಗೆ ಸೇರಿಸಿ</string>
<string name="select_map_markers">ನಕಾಶೆಯ ಗುರುತುಗಳನ್ನು ಆರಿಸಿ</string>
<string name="map_markers">ನಕಾಶೆಯ ಗುರುತುಗಳು</string>
<string name="map_marker">ನಕಾಶೆಯ ಗುರುತು</string>
<string name="shared_string_status">ಸ್ಥಿತಿಗತಿ</string>
<string name="shared_string_save_changes">ಬದಲಾವಣೆಗಳನ್ನು ಉಳಿಸಿ</string>
<string name="shared_string_email_address">ಈ-ಮೇಲ್ ವಿಳಾಸ</string>
<string name="shared_string_remove">ತೆಗೆಯಿರಿ</string>
<string name="shared_string_select">ಆಯ್ದುಕೊಳ್ಳಿ</string>
<string name="starting_point">ಬಿಡುವ ಸ್ಥಳ</string>
<string name="shared_string_near">ಹತ್ತಿರ</string>
<string name="route_duration">ಸಮಯ:</string>
<string name="available_maps">ಲಭ್ಯವಿರುವ ನಕ್ಷೆಗಳು</string>
<string name="route_distance">ದೂರ:</string>
<string name="context_menu_item_open_note">ಒಎಸ್ಎಂ ಟಿಪ್ಪಣಿಯನ್ನು ತೆರೆಯಿರಿ</string>
<string name="osm_edit_removed_note">ಅಳಿಸಲಾದ ಒಎಸ್ಎಂ ಟಿಪ್ಪಣಿ</string>
<string name="osm_edit_created_note">ಸೃಷ್ಟಿಸಲಾದ ಒಎಸ್ಎಂ ಟಿಪ್ಪಣಿ</string>
<string name="osn_bug_name">ಒಎಸ್ಎಂ ಟಿಪ್ಪಣಿ</string>
<string name="osn_add_dialog_title">ಟಿಪ್ಪಣಿಯನ್ನು ಹಾಕಿರಿ</string>
<string name="osn_comment_dialog_title">ಪ್ರತಿಕ್ರಿಯೆಯನ್ನು ಸೇರಿಸಿ</string>
<string name="osn_close_dialog_title">ಟಿಪ್ಪಣಿಯನ್ನು ಮುಚ್ಚಿರಿ</string>
<string name="osb_comment_dialog_message">ಸಂದೇಶ</string>
<string name="osb_comment_dialog_author">ಬರೆದವರ ಹೆಸರು</string>
<string name="shared_string_location">ಸ್ಥಳ</string>
<string name="whats_new">ಇದರಲ್ಲಿ ಹೊಸದೇನಿದೆ</string>
<string name="go_to_map">ನಕ್ಷೆಗೆ ಹೋಗಿ</string>
<string name="shared_string_send">ಕಳುಹಿಸಿ</string>
<string name="regions">ಪ್ರದೇಶಗಳು</string>
<string name="region_maps">ಪ್ರದೇಶಗಳ ನಕ್ಷೆಗಳು</string>
<string name="world_maps">ಪ್ರಪಂಚದ ನಕ್ಷೆಗಳು</string>
<string name="favorite_category_add_new">ಹೊಸದನ್ನು ಸೇರಿಸಿ</string>
<string name="rendering_value_red_name">ಕೆಂಪು</string>
<string name="rendering_value_yellow_name">ಹಳದಿ</string>
<string name="rendering_value_green_name">ಹಸಿರು</string>
<string name="rendering_value_lightblue_name">ತೆಳು ನೀಲಿ</string>
<string name="rendering_value_blue_name">ನೀಲಿ</string>
<string name="lang_bn">ಬೆಂಗಾಲಿ</string>
<string name="lang_az">ಅಜೇರಿ</string>
<string name="lang_br">ಬ್ರೆಟನ್</string>
<string name="lang_ga">ಐರಿಷ್</string>
<string name="lang_la">ಲ್ಯಾಟಿನ್</string>
<string name="lang_ku">ಕುರ್ಡಿಷ್</string>
<string name="lang_ta">ತಮಿಳು</string>
<string name="lang_ml">ಮಲಯಾಳಂ</string>
<string name="shared_string_import2osmand">ಒಸ್ಮಾಂಡ್‌ಗೆ ಆಮದುಮಾಡಿ</string>
</resources>

View file

@ -1319,7 +1319,7 @@
<string name="osmo_settings_descr">Konfigūruoti stebėjimo nustatymus ir nustatyti asmeninį stebėjimo kanalą</string>
<string name="osmo_plugin_description">"Pateikia OsMo - taip vadinamo pažangaus tiesioginio stebėjimo, nustatymus, daugiau http://osmo.mobi.
\nSuteikia galimybę stebėti visus įrenginius konkrečioje grupėje realiuoju laiku bei bendrauti tarpusavyje. Tebėti glima tik konkrečios sesijos metu arba pastoviai.\nSusikurkite anonimines grupes tik kelioms dienoms su ribotomis funkcijomis, t.y. nėra nuotolinio valdymo ar grupės administratoriaus. Viso funkcionalumo grupes galima susikurti interneto svetainėje ir tik registruoti vartotojai galės prie jų prieiti. "</string>
<string name="osmo_plugin_name">OsMo (OSM stebėjimas)</string>
<string name="osmo_plugin_name">OpenStreetMap stebėjimas</string>
<string name="osmo_settings">OsMo</string>
<string name="keep_informing_never">Tik rankiniu būdu (spauskite rodyklę)</string>
<string name="keep_informing_descr">Maršruto instrukcijas pakartotinai pranešinėti reguliariais intervalais</string>
@ -1339,10 +1339,10 @@
<string name="osmo_connected_devices">Prijungti įrenginiai</string>
<string name="osmo_groups">OsMo grupės/įrenginiai</string>
<string name="osmo_groups">OsMo grupės</string>
<string name="osmo_auto_send_locations_descr">Automatiškai pradėti sekimo sesiją ir siųsti buvimo vietą tik paleidus programą</string>
<string name="osmo_auto_send_locations">Automatiškai pradėti sekimo sesiją</string>
<string name="osmo_tracker_id">Asmeninis sekiklio ID</string>
<string name="osmo_tracker_id">Sekiklio ID</string>
<string name="osmo_tracker_id_descr">Paspauskite peržiūrėti ar bendrinti sekiklio ID.
Naudodami sekiklio ID prijungti prietaisai galės stebėti visą šio įrenginio judėjimą! Norėdami atjungti pasirinkite Regeneravimo nustatymą.</string>
<string name="osmo_session_token">Sesijos žymė: %1$s</string>
@ -1390,7 +1390,7 @@
<string name="osmo_center_location">Centruoti ekrane</string>
<string name="osmo_set_moving_target">Nustatyti judančiu taikiniu</string>
<string name="osmo_use_server_name">Registruotas vardas</string>
<string name="osmo_connect_to_my_nickname">Mano slapyvardis</string>
<string name="osmo_connect_to_my_nickname">Slapyvardis</string>
<string name="osmo_user_name">Vartotojas</string>
<string name="rendering_value_pink_name">rožinė</string>
@ -1516,7 +1516,7 @@
<string name="osmo_invite">Pakvietimas…</string>
<string name="osmo_leave_confirmation_msg">Ar norite atsijungti nuo grupės %1$s?</string>
<string name="osmo_specify_tracker_id">Prašome nurodyti id</string>
<string name="osmo_specify_tracker_id">Prašome nurodyti ID</string>
<string name="arrival_distance_factor_early">Anksti</string>
<string name="arrival_distance_factor_normally">Įprastai</string>
<string name="arrival_distance_factor_late">Vėlai</string>
@ -1572,7 +1572,7 @@
<string name="speed_limit_exceed">Greičio ribojimo viršijimo reikšmė</string>
<string name="speed_limit_exceed_message">Pasirinkite greičio ribojimo viršijimo ribą, kurią pasiekus bus pranešta balsu.</string>
<string name="osmo_device_not_found">Įrenginys neaptiktas</string>
<string name="osmo_no_connection_msg">OsMo paslauga negalima:\n- patikrinkite internetinį ryšį;\n- patikrinkite nustatymus;\n- užeikite į Twitter: https://twitter.com/OsMomobi</string>
<string name="osmo_no_connection_msg">Nepavykp prisijungti prie OsMo serverio:\n- patikrinkite internetinį ryšį;\n- patikrinkite nustatymus;\n- užeikite į Twitter: https://twitter.com/OsMomobi</string>
<string name="anonymous_user_hint">Anonimas negali:\n- kurti grupių;\n- sinchronizuoti grupes bei įranginius su sreveriu;\n- valdyti grupes bei įrenginius privačiame biure.</string>
<string name="anonymous_user">Anonimas</string>
<string name="logged_as">Prisijungėte kaip %1$s</string>
@ -1779,7 +1779,7 @@
<string name="routing_attr_height_description">Nurodykite transporto priemonės aukštį, leidžiamą maršrutuose</string>
<string name="use_fast_recalculation_desc">Perskaičiuoti tik pradinę ilgos kelionės maršruto dalį</string>
<string name="rendering_value_disabled_name">Išjungtas</string>
<string name="osmo_share_my_location">Pasidalinti mano vieta</string>
<string name="osmo_share_my_location">Perduoti mano vieta</string>
<string name="shared_string_logoff">Atsijungti</string>
<string name="search_poi_category_hint">Rašykite, norėdami pradėti paiešką</string>
<string name="track_points">Maršruto taškai</string>
@ -1847,7 +1847,7 @@
<string name="rendering_value_translucent_blue_name">Permatoma mėlyna</string>
<string name="rendering_value_purple_name">Purpurinė</string>
<string name="rendering_value_translucent_purple_name">Permatoma purpurinė</string>
<string name="restart_is_required">Siekiant viviškai pritaikyti pakeitimus, būtina iš naujo startuoti programą.</string>
<string name="restart_is_required">Siekiant visiškai pritaikyti pakeitimus, būtina iš naujo startuoti programą.</string>
<string name="lang_bpy">Bišnuprų</string>
<string name="rendering_attr_currentTrackColor_name">GPX spalva</string>
<string name="rendering_attr_currentTrackWidth_name">GPX plotis</string>
@ -1963,7 +1963,7 @@
<string name="contact_us">Susisiekti</string>
<string name="world_map_download_descr">Pasaulio žemėlapis (padengiantis visą pasauli stambiu masteliu) neįdiegtas arba pasenęs. Prašome atsisiųsti arba atnaujinti.</string>
<string name="share_geo">geo:</string>
<string name="nm">nm</string>
<string name="nm">nmi</string>
<string name="shared_string_trip_recording">Kelionės įrašymas</string>
<string name="tab_title_basic">Pagrindinis</string>
<string name="tab_title_advanced">Išplėstinis</string>
@ -2131,4 +2131,19 @@
<string name="osm_live_ask_for_purchase">Prašome pirmiau įsigyti OSM Live prenumeratą</string>
<string name="download_files_error_not_enough_space">Nepakanka vietos! Failams reikalinga {3} MB laikinai ir {1} MB pastoviai. Šiuo metu galimi tik {2} MB vietos.</string>
<string name="report">Ataskaita</string>
<string name="shared_string_move_up">Perkelti viršun</string>
<string name="shared_string_move_down">Perkelti žemyn</string>
<string name="avoid_road">Vengti kelių</string>
<string name="full_report">Visa ataskaita</string>
<string name="recalculate_route">Iš naujo perskaičiuoti maršrutą</string>
<string name="donations">Paremti</string>
<string name="select_map_marker">Pasirinite žymeklį</string>
<string name="map_markers_other">Kiti žymekliai</string>
<string name="upload_anonymously">Siųsti anonimiškai</string>
<string name="map_marker_1st">Pirmasis žymeklis</string>
<string name="map_marker_2nd">Antrasis žymeklis</string>
<string name="shared_string_reverse_order">Atvirkštinė tvarka</string>
<string name="switch_start_finish">Sukeisti vietomis pradžios tašką ir galutinį tikslą</string>
<string name="routing_attr_avoid_borders_name">Vengti sienų kirtimo</string>
</resources>

View file

@ -922,17 +922,17 @@
<string name="poi_abandoned_poi">Obiekt opuszczony</string>
<string name="poi_disused">Wyłączony z użycia</string>
<string name="poi_operator">Obsługujący</string>
<string name="poi_operator">Operator</string>
<string name="poi_brand">Marka</string>
<string name="poi_fee_yes">Opłata</string>
<string name="poi_enforcement_traffic_signals">Sygnalizacja świetlna</string>
<string name="poi_enforcement_maxspeed">Fotoradar</string>
<string name="poi_enforcement_maxheight">Kontrola wysokości pojazdu</string>
<string name="poi_enforcement_mindistance">Kontrola minimalnego dystansu</string>
<string name="poi_enforcement_check">Kontrola</string>
<string name="poi_enforcement_access">Kontrola dostępu</string>
<string name="poi_enforcement_toll">Kontrola opłat</string>
<string name="poi_enforcement_traffic_signals">Egzekwowanie: Sygnalizacja świetlna</string>
<string name="poi_enforcement_maxspeed">Egzekwowanie: ograniczeń prędkości</string>
<string name="poi_enforcement_maxheight">Egzekwowanie: wysokości pojazdu</string>
<string name="poi_enforcement_mindistance">Egzekwowanie: minimalnego dystansu</string>
<string name="poi_enforcement_check">Egzekwowanie: kontrola</string>
<string name="poi_enforcement_access">Egzekwowanie: dostępu</string>
<string name="poi_enforcement_toll">Egzekwowanie: opłat</string>
<string name="poi_doors">Drzwi</string>
<string name="poi_perfumery">Perfumeria</string>
@ -1050,7 +1050,7 @@
<string name="poi_height">Wysokość</string>
<string name="poi_ele">Wysokość nad poziomem morza</string>
<string name="poi_fee_no">Bez opłat</string>
<string name="poi_drinking_water_yes">Woda pitna</string>
<string name="poi_drinking_water_yes">Woda pitna: tak</string>
<string name="poi_seasonal_yes">Sezonowe</string>
<string name="poi_seasonal_spring">Wiosna</string>
<string name="poi_seasonal_summer">Lato</string>
@ -1068,8 +1068,8 @@
<string name="poi_nudism_customary">Nudyzm: zwyczajowy</string>
<string name="poi_trade_building_supplies">Materiały budowlane</string>
<string name="poi_population">Populacja</string>
<string name="poi_parking_underground">Podziemny</string>
<string name="poi_parking_multi_storey">Wielopoziomowy</string>
<string name="poi_parking_underground">Typ: podziemny</string>
<string name="poi_parking_multi_storey">Typ: wielopoziomowy</string>
<string name="poi_leaf_type_broadleaved">Liściaste</string>
<string name="poi_leaf_type_needleleaved">Iglaste</string>
@ -1077,10 +1077,10 @@
<string name="poi_leaf_type_leafless">Bezlistne</string>
<string name="poi_species">Gatunki</string>
<string name="poi_trees_oil">Olej palmowy</string>
<string name="poi_animal_shelter_dog">Schronisko dla psów</string>
<string name="poi_animal_shelter_cat">Schronisko dla kotów</string>
<string name="poi_animal_shelter_dog_cat">Schronisko dla psów i kotów</string>
<string name="poi_animal_shelter_bird">Schronisko dla ptaków</string>
<string name="poi_animal_shelter_dog">Typ schroniska: dla psów</string>
<string name="poi_animal_shelter_cat">Typ schroniska: dla kotów</string>
<string name="poi_animal_shelter_dog_cat">Typ schroniska: dla psów i kotów</string>
<string name="poi_animal_shelter_bird">Typ schroniska: dla ptaków</string>
<string name="poi_seats">Siedzenia</string>
<string name="poi_backrest_yes">Oparcia: tak</string>
@ -1115,10 +1115,10 @@
<string name="poi_information_route_marker">Znacznik trasy</string>
<string name="poi_information_sign">Znak</string>
<string name="poi_information_bicyclemap">Mapa rowerowa</string>
<string name="poi_board_type_plants">Informacje o roślinach</string>
<string name="poi_board_type_public_transport">Informacje na temat transportu publicznego</string>
<string name="poi_board_type_technology">Informacje o technologii</string>
<string name="poi_board_type_astronomy">Informacje na temat astronomii</string>
<string name="poi_board_type_plants">Informacje: o roślinach</string>
<string name="poi_board_type_public_transport">Informacje: na temat transportu publicznego</string>
<string name="poi_board_type_technology">Informacje: technologiczne</string>
<string name="poi_board_type_astronomy">Informacje: astronomiczne</string>
<string name="poi_smoking_no">Zakaz palenia</string>
<string name="poi_smoking_outside">Palenie dozwolone na zewnątrz</string>
@ -1202,7 +1202,7 @@
<string name="poi_denomination_dutch_reformed">Holenderski Kościół Reformowany</string>
<string name="poi_denomination_apostolic">Kościół Apostolski</string>
<string name="poi_denomination_latter_day_saints">Kościół Jezusa Chrystusa Świętych w Dniach Ostatnich</string>
<string name="poi_denomination_church_of_christ"/>
<string name="poi_denomination_church_of_christ">Kościół Chrystusowy</string>
<string name="poi_denomination_georgian_orthodox">Gruziński prawosławny</string>
<string name="poi_denomination_romanian_orthodox">Rumuński prawosławny</string>
<string name="poi_denomination_coptic_orthodox">Koptyjski</string>
@ -1252,4 +1252,13 @@
<string name="poi_amenity_vacuum_cleaner">Odkurzacz</string>
<string name="poi_cooling_tower">Chłodnia przemysłowa</string>
<string name="poi_bunker_silo">Silos do składowania sypkich materiałów</string>
<string name="poi_denomination_nondenominational">Bezwyznaniowy</string>
<string name="poi_denomination_congregational">Kongregacyjny</string>
<string name="poi_denomination_spiritist">Spirytyczny</string>
<string name="poi_denomination_united_church_of_christ">Zjednoczony Kościół Chrystusowy</string>
<string name="poi_denomination_ethiopian_orthodox_tewahedo">Etiopski ortodoksyjny tewahedo</string>
<string name="poi_denomination_iglesia_ni_cristo">Iglesia ni cristo</string>
<string name="poi_denomination_uniting">Zjednoczony</string>
</resources>

View file

@ -2138,7 +2138,7 @@
<string name="number_of_recipients">Liczba odbiorców</string>
<string name="report">Raport</string>
<string name="avoid_road">Omiń drogę</string>
<string name="recalculate_route">Wyznacz trasę ponownie</string>
<string name="recalculate_route">Przelicz trasę</string>
<string name="open_street_map_login_and_pass">Nazwa użytkownika i hasło OpenStreetMap</string>
<string name="osm_editors_ranking">Ranking edytorów OSM</string>
<string name="osm_live_enter_email">Proszę wprowadzić prawidłowy adres e-mail</string>

View file

@ -6,11 +6,10 @@ import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
@ -33,11 +32,314 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import gnu.trove.list.array.TIntArrayList;
public class ContextMenuAdapter {
private static final Log LOG = PlatformUtil.getLog(ContextMenuAdapter.class);
private final Context ctx;
@LayoutRes
private int defaultLayoutId = Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB ?
R.layout.list_menu_item : R.layout.list_menu_item_native;
List<ContextMenuItem> items = new ArrayList<>();
private ConfigureMapMenu.OnClickListener changeAppModeListener = null;
//neded to detect whether user opened all modes or not
private BooleanResult allModes = new BooleanResult();
public ContextMenuAdapter(Context ctx, boolean allModes) {
this.ctx = ctx;
this.allModes.setResult(allModes);
}
public ContextMenuAdapter(Context ctx) {
this.ctx = ctx;
}
public int length() {
return items.size();
}
public int getElementId(int position) {
return items.get(position).getTitleId();
}
public OnContextMenuClick getClickAdapter(int position) {
return items.get(position).getCheckBoxListener();
}
public OnIntegerValueChangedListener getIntegerLister(int position) {
return items.get(position).getIntegerListener();
}
public String getItemName(int position) {
return items.get(position).getTitle();
}
public String getItemDescr(int position) {
return items.get(position).getDescription();
}
public Boolean getSelection(int position) {
return items.get(position).getSelected();
}
public int getProgress(int position) {
return items.get(position).getProgress();
}
public int getLoading(int position) {
return items.get(position).isLoading() ? 1 : 0;
}
public Drawable getImage(OsmandApplication ctx, int position, boolean light) {
@DrawableRes
int lst = items.get(position).getIcon();
if (lst != -1) {
return ctx.getResources().getDrawable(lst);
}
@DrawableRes
int lstLight = items.get(position).getLightIcon();
if (lstLight != -1) {
return ctx.getIconsCache().getIcon(lstLight, light);
}
return null;
}
public Drawable getSecondaryImage(OsmandApplication ctx, int position, boolean light) {
@DrawableRes
int secondaryDrawableId = items.get(position).getSecondaryLightIcon();
if (secondaryDrawableId != -1) {
return ctx.getIconsCache().getIcon(secondaryDrawableId, light);
}
return null;
}
public int getBackgroundColor(Context ctx, boolean holoLight) {
if (holoLight) {
return ctx.getResources().getColor(R.color.bg_color_light);
} else {
return ctx.getResources().getColor(R.color.bg_color_dark);
}
}
public boolean isCategory(int pos) {
return items.get(pos).isCategory();
}
public int getLayoutId(int position) {
int l = items.get(position).getLayout();
if (l != -1) {
return l;
}
return defaultLayoutId;
}
public void setItemName(int position, String str) {
items.get(position).setTitle(str);
}
public void setItemDescription(int position, String str) {
items.get(position).setDescription(str);
}
public void setSelection(int position, boolean s) {
items.get(position).setSelected(s);
}
public void setProgress(int position, int progress) {
items.get(position).setProgress(progress);
}
// Adapter related
public String[] getItemNames() {
String[] itemNames = new String[items.size()];
for (int i = 0; i < items.size(); i++) {
itemNames[i] = items.get(i).getTitle();
}
return itemNames;
}
public void addItem(ContextMenuItem item) {
items.add(item);
}
public void removeItem(int pos) {
items.remove(pos);
}
public void setDefaultLayoutId(int defaultLayoutId) {
this.defaultLayoutId = defaultLayoutId;
}
public void setChangeAppModeListener(ConfigureMapMenu.OnClickListener changeAppModeListener) {
this.changeAppModeListener = changeAppModeListener;
}
public ArrayAdapter<?> createListAdapter(final Activity activity, final boolean holoLight) {
final int layoutId = defaultLayoutId;
final OsmandApplication app = ((OsmandApplication) activity.getApplication());
return new ContextMenuArrayAdapter(activity, layoutId, R.id.title,
items.toArray(new ContextMenuItem[items.size()]), app, holoLight);
}
public class ContextMenuArrayAdapter extends ArrayAdapter<ContextMenuItem> {
private OsmandApplication app;
private boolean holoLight;
private int layoutId;
public ContextMenuArrayAdapter(Activity context, int resource, int textViewResourceId,
ContextMenuItem[] objects, OsmandApplication app, boolean holoLight) {
super(context, resource, textViewResourceId, objects);
this.app = app;
this.holoLight = holoLight;
layoutId = resource;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
// User super class to create the View
final ContextMenuItem item = getItem(position);
Integer lid = getLayoutId(position);
if (lid == R.layout.mode_toggles) {
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>();
return AppModeDialog.prepareAppModeDrawerView((Activity) getContext(),
selected, allModes, true, new View.OnClickListener() {
@Override
public void onClick(View view) {
if (selected.size() > 0) {
app.getSettings().APPLICATION_MODE.set(selected.iterator().next());
notifyDataSetChanged();
}
if (changeAppModeListener != null) {
changeAppModeListener.onClick(allModes.getResult());
}
}
});
}
if (convertView == null || (!lid.equals(convertView.getTag()))) {
convertView = LayoutInflater.from(getContext()).inflate(lid, parent, false);
// AndroidUtils.setListItemBackground(ctx, convertView, !holoLight);
convertView.setTag(lid);
}
TextView tv = (TextView) convertView.findViewById(R.id.title);
if (!isCategory(position)) {
AndroidUtils.setTextPrimaryColor(getContext(), tv, !holoLight);
}
tv.setText(isCategory(position) ? getItemName(position).toUpperCase() : getItemName(position));
if (layoutId == R.layout.simple_list_menu_item) {
int color = ContextCompat.getColor(getContext(),
holoLight ? R.color.icon_color : R.color.dashboard_subheader_text_dark);
Drawable imageId = ContextCompat.getDrawable(getContext(), item.getLightIcon());
DrawableCompat.setTint(imageId, color);
float density = getContext().getResources().getDisplayMetrics().density;
int paddingInPixels = (int) (24 * density);
int drawableSizeInPixels = (int) (24 * density); // 32
imageId.setBounds(0, 0, drawableSizeInPixels, drawableSizeInPixels);
tv.setCompoundDrawables(imageId, null, null, null);
tv.setCompoundDrawablePadding(paddingInPixels);
} else {
Drawable drawable = getImage(app, position, holoLight);
if (drawable != null) {
((ImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable);
convertView.findViewById(R.id.icon).setVisibility(View.VISIBLE);
} else if (convertView.findViewById(R.id.icon) != null) {
convertView.findViewById(R.id.icon).setVisibility(View.GONE);
}
}
@DrawableRes
int secondaryLightDrawable = item.getSecondaryLightIcon();
if (secondaryLightDrawable != -1) {
int color = ContextCompat.getColor(getContext(),
holoLight ? R.color.icon_color : R.color.dashboard_subheader_text_dark);
Drawable drawable = getSecondaryImage(app, position, holoLight);
DrawableCompat.setTint(drawable, color);
ImageView imageView = (ImageView) convertView.findViewById(R.id.secondary_icon);
imageView.setImageDrawable(drawable);
imageView.setVisibility(View.VISIBLE);
} else {
ImageView imageView = (ImageView) convertView.findViewById(R.id.secondary_icon);
if (imageView != null) {
imageView.setVisibility(View.GONE);
}
}
if (isCategory(position)) {
tv.setTypeface(Typeface.DEFAULT_BOLD);
} else {
tv.setTypeface(null);
}
if (convertView.findViewById(R.id.toggle_item) != null) {
final CompoundButton ch = (CompoundButton) convertView.findViewById(R.id.toggle_item);
if (item.getSelected() != null) {
ch.setOnCheckedChangeListener(null);
ch.setVisibility(View.VISIBLE);
ch.setChecked(item.getSelected());
final ArrayAdapter<ContextMenuItem> la = this;
final OnCheckedChangeListener listener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
OnContextMenuClick ca = getClickAdapter(position);
item.setSelected(isChecked);
if (ca != null) {
ca.onContextMenuClick(la, getElementId(position), position, isChecked);
}
}
};
ch.setOnCheckedChangeListener(listener);
ch.setVisibility(View.VISIBLE);
} else if (ch != null) {
ch.setVisibility(View.GONE);
}
}
if (convertView.findViewById(R.id.seekbar) != null) {
SeekBar seekBar = (SeekBar) convertView.findViewById(R.id.seekbar);
if (item.getProgress() != -1) {
seekBar.setProgress(getProgress(position));
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
OnIntegerValueChangedListener listener = getIntegerLister(position);
item.setProgress(progress);
if (listener != null && fromUser) {
listener.onIntegerValueChangedListener(progress);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
seekBar.setVisibility(View.VISIBLE);
} else if (seekBar != null) {
seekBar.setVisibility(View.GONE);
}
}
if (convertView.findViewById(R.id.ProgressBar) != null) {
ProgressBar bar = (ProgressBar) convertView.findViewById(R.id.ProgressBar);
if (item.isLoading()) {
bar.setVisibility(View.VISIBLE);
} else {
bar.setVisibility(View.INVISIBLE);
}
}
String itemDescr = getItemDescr(position);
if (convertView.findViewById(R.id.description) != null) {
((TextView) convertView.findViewById(R.id.description)).setText(itemDescr);
}
return convertView;
}
}
public interface OnContextMenuClick {
//boolean return type needed to desribe if drawer needed to be close or not
@ -77,459 +379,4 @@ public class ContextMenuAdapter {
}
}
private final Context ctx;
private View anchor;
@LayoutRes
private int defaultLayoutId = Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB ?
R.layout.list_menu_item : R.layout.list_menu_item_native;
final TIntArrayList items = new TIntArrayList();
final TIntArrayList isCategory = new TIntArrayList();
final ArrayList<String> itemNames = new ArrayList<String>();
final ArrayList<OnContextMenuClick> checkListeners = new ArrayList<>();
final ArrayList<OnIntegerValueChangedListener> integerListeners = new ArrayList<>();
final TIntArrayList selectedList = new TIntArrayList();
final TIntArrayList progressList = new TIntArrayList();
final TIntArrayList loadingList = new TIntArrayList();
final TIntArrayList layoutIds = new TIntArrayList();
final TIntArrayList iconList = new TIntArrayList();
final TIntArrayList lightIconList = new TIntArrayList();
final TIntArrayList secondaryLightIconList = new TIntArrayList();
final ArrayList<String> itemDescription = new ArrayList<String>();
private List<ApplicationMode> visibleModes = new ArrayList<ApplicationMode>();
private ConfigureMapMenu.OnClickListener changeAppModeListener = null;
//neded to detect whether user opened all modes or not
private BooleanResult allModes = new BooleanResult();
public ContextMenuAdapter(Context ctx, boolean allModes) {
this.ctx = ctx;
this.allModes.setResult(allModes);
}
public ContextMenuAdapter(Context ctx) {
this.ctx = ctx;
}
public void setAnchor(View anchor) {
this.anchor = anchor;
}
public View getAnchor() {
return anchor;
}
public int length() {
return items.size();
}
public int getElementId(int pos) {
return items.get(pos);
}
public OnContextMenuClick getClickAdapter(int i) {
return checkListeners.get(i);
}
public OnIntegerValueChangedListener getIntegerLister(int i) {
return integerListeners.get(i);
}
public String getItemName(int pos) {
return itemNames.get(pos);
}
public String getItemDescr(int pos) {
return itemDescription.get(pos);
}
public void setItemName(int pos, String str) {
itemNames.set(pos, str);
}
public void setItemDescription(int pos, String str) {
itemDescription.set(pos, str);
}
public int getSelection(int pos) {
return selectedList.get(pos);
}
public int getProgress(int pos) {
return progressList.get(pos);
}
public int getLoading(int pos) {
return loadingList.get(pos);
}
public void setSelection(int pos, int s) {
selectedList.set(pos, s);
}
public void setProgress(int pos, int s) {
progressList.set(pos, s);
}
public Drawable getImage(OsmandApplication ctx, int pos, boolean light) {
int lst = iconList.get(pos);
if (lst != 0) {
return ctx.getResources().getDrawable(lst);
}
int lstLight = lightIconList.get(pos);
if (lstLight != 0) {
return ctx.getIconsCache().getIcon(lstLight, light);
}
return null;
}
public Drawable getSecondaryImage(OsmandApplication ctx, int pos, boolean light) {
@DrawableRes
int secondaryDrawableId = secondaryLightIconList.get(pos);
if (secondaryDrawableId != 0) {
return ContextCompat.getDrawable(ctx, secondaryDrawableId);
}
return null;
}
public int getBackgroundColor(Context ctx, boolean holoLight) {
if (holoLight) {
return ctx.getResources().getColor(R.color.bg_color_light);
} else {
return ctx.getResources().getColor(R.color.bg_color_dark);
}
}
public boolean isCategory(int pos) {
return isCategory.get(pos) > 0;
}
public Item item(String name) {
Item i = new Item();
i.id = (name.hashCode() << 4) | items.size();
i.name = name;
return i;
}
public Item item(@StringRes int resId) {
Item i = new Item();
i.id = resId;
i.name = ctx.getString(resId);
return i;
}
public class Item {
@DrawableRes
int icon = 0;
@DrawableRes
int lightIcon = 0;
@DrawableRes
int secondaryLightIcon = 0;
@IdRes
int id;
String name;
int selected = -1;
int progress = -1;
@LayoutRes
int layout = -1;
int loading = -1;
boolean cat;
int pos = -1;
String description = "";
private OnContextMenuClick checkBoxListener;
private OnIntegerValueChangedListener integerListener;
private Item() {
}
public Item icon(@DrawableRes int icon) {
this.icon = icon;
return this;
}
public Item colorIcon(@DrawableRes int icon) {
this.lightIcon = icon;
return this;
}
public Item secondaryIconColor(@DrawableRes int icon) {
this.secondaryLightIcon = icon;
return this;
}
public Item position(int pos) {
this.pos = pos;
return this;
}
public Item selected(int selected) {
this.selected = selected;
return this;
}
public Item progress(int progress) {
this.progress = progress;
return this;
}
public Item loading(int loading) {
this.loading = loading;
return this;
}
public Item layout(@LayoutRes int l) {
this.layout = l;
return this;
}
public Item description(String descr) {
this.description = descr;
return this;
}
public Item listen(OnContextMenuClick l) {
this.checkBoxListener = l;
return this;
}
public Item listenInteger(OnIntegerValueChangedListener l) {
this.integerListener = l;
return this;
}
public void reg() {
if (pos >= items.size() || pos < 0) {
pos = items.size();
}
items.insert(pos, id);
itemNames.add(pos, name);
itemDescription.add(pos, description);
selectedList.insert(pos, selected);
progressList.insert(pos, progress);
loadingList.insert(pos, loading);
layoutIds.insert(pos, layout);
iconList.insert(pos, icon);
lightIconList.insert(pos, lightIcon);
secondaryLightIconList.insert(pos, secondaryLightIcon);
checkListeners.add(pos, checkBoxListener);
integerListeners.add(pos, integerListener);
isCategory.insert(pos, cat ? 1 : 0);
}
public Item setCategory(boolean b) {
cat = b;
return this;
}
public Item name(String name) {
this.name = name;
return this;
}
}
public String[] getItemNames() {
return itemNames.toArray(new String[itemNames.size()]);
}
public void removeItem(int pos) {
items.removeAt(pos);
itemNames.remove(pos);
selectedList.removeAt(pos);
progressList.removeAt(pos);
iconList.removeAt(pos);
lightIconList.removeAt(pos);
secondaryLightIconList.removeAt(pos);
checkListeners.remove(pos);
integerListeners.remove(pos);
isCategory.removeAt(pos);
layoutIds.removeAt(pos);
loadingList.removeAt(pos);
}
public int getLayoutId(int position) {
int l = layoutIds.get(position);
if (l != -1) {
return l;
}
return defaultLayoutId;
}
public void setDefaultLayoutId(int defaultLayoutId) {
this.defaultLayoutId = defaultLayoutId;
}
public void setChangeAppModeListener(ConfigureMapMenu.OnClickListener changeAppModeListener) {
this.changeAppModeListener = changeAppModeListener;
}
public ArrayAdapter<?> createListAdapter(final Activity activity, final boolean holoLight) {
final int layoutId = defaultLayoutId;
final OsmandApplication app = ((OsmandApplication) activity.getApplication());
return new ContextMenuArrayAdapter(activity, layoutId, R.id.title,
getItemNames(), app, holoLight);
}
public class ContextMenuArrayAdapter extends ArrayAdapter<String> {
private Activity activity;
private OsmandApplication app;
private boolean holoLight;
private int layoutId;
public ContextMenuArrayAdapter(Activity context, int resource, int textViewResourceId,
String[] objects, OsmandApplication app, boolean holoLight) {
super(context, resource, textViewResourceId, objects);
activity = context;
this.app = app;
this.holoLight = holoLight;
layoutId = resource;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
// User super class to create the View
Integer lid = getLayoutId(position);
if (lid == R.layout.mode_toggles) {
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>();
return AppModeDialog.prepareAppModeDrawerView(activity, visibleModes, selected, allModes, true, new View.OnClickListener() {
@Override
public void onClick(View view) {
if (selected.size() > 0) {
app.getSettings().APPLICATION_MODE.set(selected.iterator().next());
notifyDataSetChanged();
}
if (changeAppModeListener != null) {
changeAppModeListener.onClick(allModes.getResult());
}
}
});
}
if (convertView == null || (!lid.equals(convertView.getTag()))) {
convertView = activity.getLayoutInflater().inflate(lid, parent, false);
// AndroidUtils.setListItemBackground(ctx, convertView, !holoLight);
convertView.setTag(lid);
}
TextView tv = (TextView) convertView.findViewById(R.id.title);
if (!isCategory(position)) {
AndroidUtils.setTextPrimaryColor(ctx, tv, !holoLight);
}
tv.setText(isCategory(position) ? getItemName(position).toUpperCase() : getItemName(position));
if (layoutId == R.layout.simple_list_menu_item) {
int color = activity.getResources()
.getColor(holoLight ? R.color.icon_color : R.color.dashboard_subheader_text_dark);
Drawable imageId = app.getIconsCache().getPaintedContentIcon(
lightIconList.get(position), color);
float density = activity.getResources().getDisplayMetrics().density;
int paddingInPixels = (int) (24 * density);
int drawableSizeInPixels = (int) (24 * density); // 32
imageId.setBounds(0, 0, drawableSizeInPixels, drawableSizeInPixels);
tv.setCompoundDrawables(imageId, null, null, null);
tv.setCompoundDrawablePadding(paddingInPixels);
} else {
Drawable drawable = getImage(app, position, holoLight);
if (drawable != null) {
((ImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable);
convertView.findViewById(R.id.icon).setVisibility(View.VISIBLE);
} else if (convertView.findViewById(R.id.icon) != null) {
convertView.findViewById(R.id.icon).setVisibility(View.GONE);
}
}
@DrawableRes
int secondaryLightDrawable = secondaryLightIconList.get(position);
if (secondaryLightDrawable != 0) {
int color = ContextCompat.getColor(ctx,
holoLight ? R.color.icon_color : R.color.dashboard_subheader_text_dark);
Drawable drawable = getSecondaryImage(app, position, holoLight);
DrawableCompat.setTint(drawable, color);
ImageView imageView = (ImageView) convertView.findViewById(R.id.secondary_icon);
imageView.setImageDrawable(drawable);
imageView.setVisibility(View.VISIBLE);
} else {
ImageView imageView = (ImageView) convertView.findViewById(R.id.secondary_icon);
if (imageView != null) {
imageView.setVisibility(View.GONE);
}
}
if (isCategory(position)) {
tv.setTypeface(Typeface.DEFAULT_BOLD);
} else {
tv.setTypeface(null);
}
if (convertView.findViewById(R.id.toggle_item) != null) {
final CompoundButton ch = (CompoundButton) convertView.findViewById(R.id.toggle_item);
if (selectedList.get(position) != -1) {
ch.setOnCheckedChangeListener(null);
ch.setVisibility(View.VISIBLE);
ch.setChecked(selectedList.get(position) > 0);
final ArrayAdapter<String> la = this;
final OnCheckedChangeListener listener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
OnContextMenuClick ca = getClickAdapter(position);
selectedList.set(position, isChecked ? 1 : 0);
if (ca != null) {
ca.onContextMenuClick(la, getElementId(position), position, isChecked);
}
}
};
ch.setOnCheckedChangeListener(listener);
ch.setVisibility(View.VISIBLE);
} else if (ch != null) {
ch.setVisibility(View.GONE);
}
}
if (convertView.findViewById(R.id.seekbar) != null) {
SeekBar seekBar = (SeekBar) convertView.findViewById(R.id.seekbar);
if (progressList.get(position) != -1) {
seekBar.setProgress(getProgress(position));
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
OnIntegerValueChangedListener listener = getIntegerLister(position);
progressList.set(position, progress);
if (listener != null && fromUser) {
listener.onIntegerValueChangedListener(progress);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
seekBar.setVisibility(View.VISIBLE);
} else if (seekBar != null) {
seekBar.setVisibility(View.GONE);
}
}
if (convertView.findViewById(R.id.ProgressBar) != null) {
ProgressBar bar = (ProgressBar) convertView.findViewById(R.id.ProgressBar);
if (loadingList.get(position) == 1) {
bar.setVisibility(View.VISIBLE);
} else {
bar.setVisibility(View.INVISIBLE);
}
}
String itemDescr = getItemDescr(position);
if (convertView.findViewById(R.id.description) != null) {
((TextView) convertView.findViewById(R.id.description)).setText(itemDescr);
}
return convertView;
}
}
}

View file

@ -0,0 +1,235 @@
package net.osmand.plus;
import android.content.Context;
import android.support.annotation.DrawableRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
/**
* Created by GaidamakUA on 3/25/16.
*/
public class ContextMenuItem {
@StringRes
private final int titleId;
private String title;
@DrawableRes
private final int icon;
@DrawableRes
private final int lightIcon;
@DrawableRes
private final int secondaryLightIcon;
private Boolean selected;
private int progress;
@LayoutRes
private final int layout;
private boolean loading;
private final boolean category;
private final int pos;
private String description;
private ContextMenuAdapter.OnContextMenuClick checkBoxListener;
private ContextMenuAdapter.OnIntegerValueChangedListener integerListener;
private ContextMenuItem(int titleId, String title, int icon, int lightIcon, int secondaryLightIcon,
Boolean selected, int progress, int layout, boolean loading, boolean category,
int pos, String description, ContextMenuAdapter.OnContextMenuClick checkBoxListener,
ContextMenuAdapter.OnIntegerValueChangedListener integerListener) {
this.titleId = titleId;
this.title = title;
this.icon = icon;
this.lightIcon = lightIcon;
this.secondaryLightIcon = secondaryLightIcon;
this.selected = selected;
this.progress = progress;
this.layout = layout;
this.loading = loading;
this.category = category;
this.pos = pos;
this.description = description;
this.checkBoxListener = checkBoxListener;
this.integerListener = integerListener;
}
public int getTitleId() {
return titleId;
}
public String getTitle() {
return title;
}
public int getIcon() {
return icon;
}
public int getLightIcon() {
return lightIcon;
}
public int getSecondaryLightIcon() {
return secondaryLightIcon;
}
public Boolean getSelected() {
return selected;
}
public int getProgress() {
return progress;
}
public int getLayout() {
return layout;
}
public boolean isLoading() {
return loading;
}
public boolean isCategory() {
return category;
}
public int getPos() {
return pos;
}
public String getDescription() {
return description;
}
public ContextMenuAdapter.OnContextMenuClick getCheckBoxListener() {
return checkBoxListener;
}
public ContextMenuAdapter.OnIntegerValueChangedListener getIntegerListener() {
return integerListener;
}
public void setTitle(String title) {
this.title = title;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public void setProgress(int progress) {
this.progress = progress;
}
public void setLoading(boolean loading) {
this.loading = loading;
}
public void setDescription(String description) {
this.description = description;
}
public void setCheckBoxListener(ContextMenuAdapter.OnContextMenuClick checkBoxListener) {
this.checkBoxListener = checkBoxListener;
}
public void setIntegerListener(ContextMenuAdapter.OnIntegerValueChangedListener integerListener) {
this.integerListener = integerListener;
}
public static ItemBuilder createBuilder(String title) {
return new ItemBuilder().setTitle(title);
}
public static class ItemBuilder {
private int mTitleId;
private String mTitle;
private int mIcon = -1;
private int mLightIcon = -1;
private int mSecondaryLightIcon = -1;
private Boolean mSelected = null;
private int mProgress = -1;
private int mLayout = -1;
private boolean mLoading = false;
private boolean mCat = false;
private int mPos = -1;
private String mDescription = null;
private ContextMenuAdapter.OnContextMenuClick mCheckBoxListener = null;
private ContextMenuAdapter.OnIntegerValueChangedListener mIntegerListener = null;
public ItemBuilder setTitleId(int titleId, @Nullable Context context) {
this.mTitleId = titleId;
if (context != null) {
mTitle = context.getString(titleId);
}
return this;
}
public ItemBuilder setTitle(String title) {
this.mTitle = title;
this.mTitleId = title.hashCode();
return this;
}
public ItemBuilder setIcon(int icon) {
mIcon = icon;
return this;
}
public ItemBuilder setColorIcon(int lightIcon) {
mLightIcon = lightIcon;
return this;
}
public ItemBuilder setSecondaryLightIcon(int secondaryLightIcon) {
mSecondaryLightIcon = secondaryLightIcon;
return this;
}
public ItemBuilder setSelected(boolean selected) {
mSelected = selected;
return this;
}
public ItemBuilder setProgress(int progress) {
mProgress = progress;
return this;
}
public ItemBuilder setLayout(int layout) {
mLayout = layout;
return this;
}
public ItemBuilder setLoading(boolean loading) {
mLoading = loading;
return this;
}
public ItemBuilder setCategory(boolean cat) {
mCat = cat;
return this;
}
public ItemBuilder setPosition(int pos) {
mPos = pos;
return this;
}
public ItemBuilder setDescription(String description) {
mDescription = description;
return this;
}
public ItemBuilder setListener(ContextMenuAdapter.OnContextMenuClick checkBoxListener) {
mCheckBoxListener = checkBoxListener;
return this;
}
public ItemBuilder setIntegerListener(ContextMenuAdapter.OnIntegerValueChangedListener integerListener) {
mIntegerListener = integerListener;
return this;
}
public ContextMenuItem createItem() {
return new ContextMenuItem(mTitleId, mTitle, mIcon, mLightIcon, mSecondaryLightIcon, mSelected, mProgress, mLayout, mLoading, mCat, mPos, mDescription, mCheckBoxListener, mIntegerListener);
}
}
}

View file

@ -602,7 +602,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents,
System.err.println("OnCreate for MapActivity took " + (System.currentTimeMillis() - tm) + " ms");
}
if (!permissionDone) {
if (!permissionDone && !app.getAppInitializer().isFirstTime()) {
if (!permissionAsked) {
if (app.isExternalStorageDirectoryReadOnly()
&& getSupportFragmentManager().findFragmentByTag(DataStoragePlaceDialogFragment.TAG) == null) {

View file

@ -30,6 +30,7 @@ import net.osmand.map.ITileSource;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
@ -279,15 +280,17 @@ public class MapActivityActions implements DialogProvider {
public void contextMenuPoint(final double latitude, final double longitude, final ContextMenuAdapter iadapter, Object selectedObj) {
final ContextMenuAdapter adapter = iadapter == null ? new ContextMenuAdapter(mapActivity) : iadapter;
adapter.item(R.string.context_menu_item_search).colorIcon(R.drawable.ic_action_search_dark).reg();
ContextMenuItem.ItemBuilder itemBuilder = new ContextMenuItem.ItemBuilder();
adapter.addItem(itemBuilder.setTitleId(R.string.context_menu_item_search, mapActivity)
.setColorIcon(R.drawable.ic_action_search_dark).createItem());
if (!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) {
adapter.item(R.string.context_menu_item_directions_from).colorIcon(
R.drawable.ic_action_gdirections_dark).reg();
adapter.addItem(itemBuilder.setTitleId(R.string.context_menu_item_directions_from, mapActivity)
.setColorIcon(R.drawable.ic_action_gdirections_dark).createItem());
}
if (getMyApplication().getTargetPointsHelper().getPointToNavigate() != null &&
(mapActivity.getRoutingHelper().isFollowingMode() || mapActivity.getRoutingHelper().isRoutePlanningMode())) {
adapter.item(R.string.context_menu_item_last_intermediate_point).colorIcon(
R.drawable.ic_action_intermediate).reg();
adapter.addItem(itemBuilder.setTitleId(R.string.context_menu_item_last_intermediate_point, mapActivity)
.setColorIcon(R.drawable.ic_action_intermediate).createItem());
}
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj);
@ -593,8 +596,9 @@ public class MapActivityActions implements DialogProvider {
final OsmandApplication app = mapActivity.getMyApplication();
ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter(app);
optionsMenuHelper.item(R.string.home).colorIcon(R.drawable.map_dashboard)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.home, mapActivity)
.setColorIcon(R.drawable.map_dashboard)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
@ -602,30 +606,33 @@ public class MapActivityActions implements DialogProvider {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
return true;
}
}).reg();
}).createItem());
if (settings.USE_MAP_MARKERS.get()) {
optionsMenuHelper.item(R.string.map_markers).colorIcon(R.drawable.ic_action_flag_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_markers, mapActivity)
.setColorIcon(R.drawable.ic_action_flag_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.MAP_MARKERS);
return false;
}
}).reg();
}).createItem());
} else {
optionsMenuHelper.item(R.string.waypoints).colorIcon(R.drawable.ic_action_intermediate)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.waypoints, mapActivity)
.setColorIcon(R.drawable.ic_action_intermediate)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
return false;
}
}).reg();
}).createItem());
}
optionsMenuHelper.item(R.string.get_directions).colorIcon(R.drawable.ic_action_gdirections_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.get_directions, mapActivity)
.setColorIcon(R.drawable.ic_action_gdirections_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
@ -640,11 +647,11 @@ public class MapActivityActions implements DialogProvider {
}
return true;
}
}).reg();
}).createItem());
// Default actions (Layers, Configure Map screen, Settings, Search, Favorites)
optionsMenuHelper.item(R.string.search_button)
.colorIcon(R.drawable.ic_action_search_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.search_button, mapActivity)
.setColorIcon(R.drawable.ic_action_search_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
@ -659,10 +666,11 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(newIntent);
return true;
}
}).reg();
}).createItem());
optionsMenuHelper.item(R.string.shared_string_my_places).colorIcon(R.drawable.ic_action_fav_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_my_places, mapActivity)
.setColorIcon(R.drawable.ic_action_fav_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
@ -671,38 +679,41 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(newIntent);
return true;
}
}).reg();
}).createItem());
optionsMenuHelper.item(R.string.show_point_options).colorIcon(R.drawable.ic_action_marker_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.show_point_options, mapActivity)
.setColorIcon(R.drawable.ic_action_marker_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
mapActivity.getMapLayers().getContextMenuLayer().showContextMenu(mapView.getLatitude(), mapView.getLongitude(), true);
return true;
}
}).reg();
}).createItem());
optionsMenuHelper.item(R.string.configure_map).colorIcon(R.drawable.ic_action_layers_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.configure_map, mapActivity)
.setColorIcon(R.drawable.ic_action_layers_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP);
return false;
}
}).reg();
}).createItem());
optionsMenuHelper.item(R.string.layer_map_appearance).colorIcon(R.drawable.ic_configure_screen_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_map_appearance, mapActivity)
.setColorIcon(R.drawable.ic_configure_screen_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
MapActivity.clearPrevActivityIntent();
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_SCREEN);
return false;
}
}).reg();
}).createItem());
String d = getString(R.string.index_settings);
if (app.getDownloadThread().getIndexes().isDownloadedFromInternet) {
@ -711,8 +722,9 @@ public class MapActivityActions implements DialogProvider {
d += " (" + updt.size() + ")";
}
}
optionsMenuHelper.item(R.string.index_settings).name(d).colorIcon(R.drawable.ic_type_archive)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.index_settings, null)
.setTitle(d).setColorIcon(R.drawable.ic_type_archive)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
@ -721,11 +733,12 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(newIntent);
return true;
}
}).reg();
}).createItem());
if (Version.isGooglePlayEnabled(app)) {
optionsMenuHelper.item(R.string.osm_live).colorIcon(R.drawable.ic_action_osm_live)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.osm_live, mapActivity)
.setColorIcon(R.drawable.ic_action_osm_live)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
Intent intent = new Intent(mapActivity, OsmLiveActivity.class);
@ -733,11 +746,12 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(intent);
return false;
}
}).reg();
}).createItem());
}
optionsMenuHelper.item(R.string.prefs_plugins).colorIcon(R.drawable.ic_extension_dark)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.prefs_plugins, mapActivity)
.setColorIcon(R.drawable.ic_extension_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
@ -746,11 +760,12 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(newIntent);
return true;
}
}).reg();
}).createItem());
optionsMenuHelper.item(R.string.shared_string_settings).colorIcon(R.drawable.ic_action_settings)
.listen(new OnContextMenuClick() {
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_settings, mapActivity)
.setColorIcon(R.drawable.ic_action_settings)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
final Intent settings = new Intent(mapActivity, getMyApplication().getAppCustomization()
@ -759,9 +774,10 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(settings);
return true;
}
}).reg();
optionsMenuHelper.item(R.string.shared_string_help).colorIcon(R.drawable.ic_action_help)
.listen(new OnContextMenuClick() {
}).createItem());
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_help, mapActivity)
.setColorIcon(R.drawable.ic_action_help)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
Intent intent = new Intent(mapActivity, HelpActivity.class);
@ -769,7 +785,7 @@ public class MapActivityActions implements DialogProvider {
mapActivity.startActivity(intent);
return true;
}
}).reg();
}).createItem());
//////////// Others
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);

View file

@ -14,7 +14,7 @@ import net.osmand.access.AccessibleToast;
import net.osmand.map.ITileSource;
import net.osmand.map.TileSourceManager.TileSourceTemplate;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.Item;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.OsmandApplication;
@ -262,7 +262,9 @@ public class MapActivityLayers {
OsmandApplication app = (OsmandApplication) getApplication();
final PoiFiltersHelper poiFilters = app.getPoiFilters();
final ContextMenuAdapter adapter = new ContextMenuAdapter(activity);
adapter.item(R.string.shared_string_search).colorIcon(R.drawable.ic_action_search_dark).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_search, app)
.setColorIcon(R.drawable.ic_action_search_dark).createItem());
final List<PoiUIFilter> list = new ArrayList<PoiUIFilter>();
list.add(poiFilters.getCustomPOIFilter());
for (PoiUIFilter f : poiFilters.getTopDefinedPoiFilters()) {
@ -301,13 +303,14 @@ public class MapActivityLayers {
private void addFilterToList(final ContextMenuAdapter adapter, final List<PoiUIFilter> list, PoiUIFilter f) {
list.add(f);
Item it = adapter.item(f.getName()).selected(-1);
ContextMenuItem.ItemBuilder builder = new ContextMenuItem.ItemBuilder();
builder.setTitle(f.getName());
if (RenderingIcons.containsBigIcon(f.getIconId())) {
it.icon(RenderingIcons.getBigIconResourceId(f.getIconId()));
builder.setIcon(RenderingIcons.getBigIconResourceId(f.getIconId()));
} else {
it.icon(R.drawable.mx_user_defined);
builder.setIcon(R.drawable.mx_user_defined);
}
it.reg();
adapter.addItem(builder.createItem());
}
public void selectMapLayer(final OsmandMapTileView mapView) {

View file

@ -36,7 +36,7 @@ public class AppModeDialog {
//special method for drawer menu
//needed because if there's more than 4 items - the don't fit in drawer
public static View prepareAppModeDrawerView(Activity a, List<ApplicationMode> visible, final Set<ApplicationMode> selected, ContextMenuAdapter.BooleanResult allModes,
public static View prepareAppModeDrawerView(Activity a, final Set<ApplicationMode> selected, ContextMenuAdapter.BooleanResult allModes,
boolean useMapTheme, final View.OnClickListener onClickListener) {
OsmandSettings settings = ((OsmandApplication) a.getApplication()).getSettings();
final List<ApplicationMode> values = new ArrayList<ApplicationMode>(ApplicationMode.values(settings));

View file

@ -48,6 +48,7 @@ import net.osmand.data.PointDescription;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
@ -590,8 +591,11 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
return true;
}
};
adapter.item(R.string.layer_recordings).selected(SHOW_RECORDINGS.get() ? 1 : 0)
.colorIcon(R.drawable.ic_action_micro_dark).listen(listener).position(12).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_recordings, app)
.setSelected(SHOW_RECORDINGS.get())
.setColorIcon(R.drawable.ic_action_micro_dark)
.setPosition(12)
.setListener(listener).createItem());
}
@Override
@ -600,33 +604,42 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
if (isRecording()) {
return;
}
adapter.item(R.string.recording_context_menu_arecord).colorIcon(R.drawable.ic_action_micro_dark)
.listen(new OnContextMenuClick() {
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_arecord, app)
.setColorIcon(R.drawable.ic_action_micro_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
recordAudio(latitude, longitude, mapActivity);
return true;
}
}).position(6).reg();
adapter.item(R.string.recording_context_menu_vrecord).colorIcon(R.drawable.ic_action_video_dark)
.listen(new OnContextMenuClick() {
})
.setPosition(6)
.createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_vrecord, app)
.setColorIcon(R.drawable.ic_action_video_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
recordVideo(latitude, longitude, mapActivity);
return true;
}
}).position(7).reg();
adapter.item(R.string.recording_context_menu_precord).colorIcon(R.drawable.ic_action_photo_dark)
.listen(new OnContextMenuClick() {
})
.setPosition(7)
.createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_precord, app)
.setColorIcon(R.drawable.ic_action_photo_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
takePhoto(latitude, longitude, mapActivity, false);
return true;
}
}).position(8).reg();
})
.setPosition(8)
.createItem());
}
@Override

View file

@ -6,6 +6,7 @@ import android.widget.ArrayAdapter;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
@ -56,15 +57,17 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
@Override
public void registerOptionsMenuItems(final MapActivity mapActivity, ContextMenuAdapter helper) {
if (Version.isDeveloperVersion(mapActivity.getMyApplication())) {
helper.item(R.string.version_settings).colorIcon(R.drawable.ic_action_gabout_dark)
.listen(new OnContextMenuClick() {
helper.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.version_settings, mapActivity)
.setColorIcon(R.drawable.ic_action_gabout_dark)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
final Intent mapIntent = new Intent(mapActivity, ContributionVersionActivity.class);
mapActivity.startActivityForResult(mapIntent, 0);
return true;
}
}).reg();
}).createItem());
}
}

View file

@ -15,6 +15,7 @@ import net.osmand.core.android.MapRendererContext;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuAdapter.OnRowItemClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
@ -54,16 +55,20 @@ import gnu.trove.list.array.TIntArrayList;
public class ConfigureMapMenu {
private static final Log LOG = PlatformUtil.getLog(ConfigureMapMenu.class);
public interface OnClickListener{
public interface OnClickListener {
public void onClick(boolean result);
};
}
;
private boolean allModes = false;
public ContextMenuAdapter createListAdapter(final MapActivity ma) {
ContextMenuAdapter adapter = new ContextMenuAdapter(ma, allModes);
adapter.setDefaultLayoutId(R.layout.drawer_list_item);
adapter.item(R.string.app_modes_choose).layout(R.layout.mode_toggles).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.app_modes_choose, ma)
.setLayout(R.layout.mode_toggles).createItem());
adapter.setChangeAppModeListener(new OnClickListener() {
@Override
public void onClick(boolean result) {
@ -98,13 +103,13 @@ public class ConfigureMapMenu {
@Override
public boolean onRowItemClick(ArrayAdapter<?> adapter, View view, int itemId, int pos) {
if(itemId == R.string.layer_poi) {
if (itemId == R.string.layer_poi) {
selectPOILayer(ma.getMyApplication().getSettings());
return false;
} else if(itemId == R.string.layer_gpx_layer && cm.getSelection(pos) == 1) {
} else if (itemId == R.string.layer_gpx_layer && cm.getSelection(pos)) {
ma.getMapLayers().showGPXFileLayer(getAlreadySelectedGpx(), ma.getMapView());
return false;
} else {
} else {
return super.onRowItemClick(adapter, view, itemId, pos);
}
}
@ -131,13 +136,13 @@ public class ConfigureMapMenu {
public void onDismiss(DialogInterface dialog) {
boolean areAnyGpxTracksVisible =
ma.getMyApplication().getSelectedGpxHelper().isShowingAnyGpxFiles();
cm.setSelection(pos, areAnyGpxTracksVisible ? 1 : 0);
cm.setSelection(pos, areAnyGpxTracksVisible);
adapter.notifyDataSetChanged();
}
});
}
} else if (itemId == R.string.layer_map) {
if(OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) == null) {
if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) == null) {
Intent intent = new Intent(ma, PluginActivity.class);
intent.putExtra(PluginActivity.EXTRA_PLUGIN_ID, OsmandRasterMapsPlugin.ID);
ma.startActivity(intent);
@ -165,27 +170,44 @@ public class ConfigureMapMenu {
}
}
private void createLayersItems(ContextMenuAdapter adapter , MapActivity activity) {
private void createLayersItems(ContextMenuAdapter adapter, MapActivity activity) {
OsmandApplication app = activity.getMyApplication();
OsmandSettings settings = app.getSettings();
LayerMenuListener l = new LayerMenuListener(activity, adapter);
adapter.item(R.string.shared_string_show).setCategory(true).layout(R.layout.drawer_list_sub_header).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_show, activity)
.setCategory(true).setLayout(R.layout.drawer_list_sub_header).createItem());
// String appMode = " [" + settings.getApplicationMode().toHumanString(view.getApplication()) +"] ";
adapter.item(R.string.layer_poi).selected(settings.SELECTED_POI_FILTER_FOR_MAP.get() != null ? 1 : 0)
.colorIcon(R.drawable.ic_action_info_dark).listen(l).reg();
adapter.item(R.string.layer_amenity_label).selected(settings.SHOW_POI_LABEL.get() ? 1 : 0)
.colorIcon(R.drawable.ic_action_text_dark).listen(l).reg();
adapter.item(R.string.shared_string_favorites).selected(settings.SHOW_FAVORITES.get() ? 1 : 0)
.colorIcon(R.drawable.ic_action_fav_dark).listen(l).reg();
adapter.item(R.string.layer_gpx_layer).selected(
app.getSelectedGpxHelper().isShowingAnyGpxFiles() ? 1 : 0)
.colorIcon(R.drawable.ic_action_polygom_dark)
.listen(l).reg();
adapter.item(R.string.layer_map).colorIcon(R.drawable.ic_world_globe_dark)
.listen(l).reg();
if(TransportRouteHelper.getInstance().routeIsCalculated()){
adapter.item(R.string.layer_transport_route).selected(1)
.colorIcon(R.drawable.ic_action_bus_dark).listen(l).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.layer_poi, activity)
.setSelected(settings.SELECTED_POI_FILTER_FOR_MAP.get() != null)
.setColorIcon(R.drawable.ic_action_info_dark)
.setListener(l).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.layer_amenity_label, activity)
.setSelected(settings.SHOW_POI_LABEL.get())
.setColorIcon(R.drawable.ic_action_text_dark)
.setListener(l).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_favorites, activity)
.setSelected(settings.SHOW_FAVORITES.get())
.setColorIcon(R.drawable.ic_action_fav_dark)
.setListener(l).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.layer_gpx_layer, activity)
.setSelected(app.getSelectedGpxHelper().isShowingAnyGpxFiles())
.setColorIcon(R.drawable.ic_action_polygom_dark)
.setListener(l).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.layer_map, activity)
.setColorIcon(R.drawable.ic_world_globe_dark)
.setListener(l).createItem());
if (TransportRouteHelper.getInstance().routeIsCalculated()) {
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.layer_transport_route, activity)
.setSelected(true)
.setColorIcon(R.drawable.ic_action_bus_dark)
.setListener(l).createItem());
}
OsmandPlugin.registerLayerContextMenu(activity.getMapView(), adapter, activity);
@ -196,205 +218,220 @@ public class ConfigureMapMenu {
activity.getMyApplication().getResourceManager().getRenderer().clearCache();
activity.updateMapSettings();
GPXLayer gpx = activity.getMapView().getLayerByClass(GPXLayer.class);
if(gpx != null) {
if (gpx != null) {
gpx.updateLayerStyle();
}
RouteLayer rte = activity.getMapView().getLayerByClass(RouteLayer.class);
if(rte != null) {
if (rte != null) {
rte.updateLayerStyle();
}
activity.getMapView().refreshMap(true);
}
private void createRenderingAttributeItems(final ContextMenuAdapter adapter, final MapActivity activity) {
adapter.item(R.string.map_widget_map_rendering).setCategory(true).layout(R.layout.drawer_list_sub_header).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_widget_map_rendering, activity)
.setCategory(true)
.setLayout(R.layout.drawer_list_sub_header).createItem());
String descr = getRenderDescr(activity);
adapter.item(R.string.map_widget_renderer).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
bld.setTitle(R.string.renderers);
final OsmandApplication app = activity.getMyApplication();
Collection<String> rendererNames = app.getRendererRegistry().getRendererNames();
final String[] items = rendererNames.toArray(new String[rendererNames.size()]);
final String[] visibleNames = new String[items.length];
int selected = -1;
final String selectedName = app.getRendererRegistry().getCurrentSelectedRenderer().getName();
for (int j = 0; j < items.length; j++) {
if (items[j].equals(selectedName)) {
selected = j;
}
visibleNames[j] = items[j].replace('_', ' ').replace('-', ' ');
}
bld.setSingleChoiceItems(visibleNames, selected, new DialogInterface.OnClickListener() {
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_widget_renderer, activity)
.setListener(new OnContextMenuClick() {
@Override
public void onClick(DialogInterface dialog, int which) {
String renderer = items[which];
RenderingRulesStorage loaded = app.getRendererRegistry().getRenderer(renderer);
if (loaded != null) {
OsmandMapTileView view = activity.getMapView();
view.getSettings().RENDERER.set(renderer);
app.getRendererRegistry().setCurrentSelectedRender(loaded);
refreshMapComplete(activity);
} else {
AccessibleToast.makeText(app, R.string.renderer_load_exception, Toast.LENGTH_SHORT).show();
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
bld.setTitle(R.string.renderers);
final OsmandApplication app = activity.getMyApplication();
Collection<String> rendererNames = app.getRendererRegistry().getRendererNames();
final String[] items = rendererNames.toArray(new String[rendererNames.size()]);
final String[] visibleNames = new String[items.length];
int selected = -1;
final String selectedName = app.getRendererRegistry().getCurrentSelectedRenderer().getName();
for (int j = 0; j < items.length; j++) {
if (items[j].equals(selectedName)) {
selected = j;
}
visibleNames[j] = items[j].replace('_', ' ').replace('-', ' ');
}
adapter.setItemDescription(pos, getRenderDescr(activity));
activity.getDashboard().refreshContent(true);
dialog.dismiss();
}
bld.setSingleChoiceItems(visibleNames, selected, new DialogInterface.OnClickListener() {
});
bld.show();
return false;
}
}).description(descr).layout(R.layout.drawer_list_doubleitem).reg();
adapter.item(R.string.map_widget_day_night).description(getDayNightDescr(activity)).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
bld.setTitle(R.string.daynight);
final String[] items = new String[OsmandSettings.DayNightMode.values().length];
for (int i = 0; i < items.length; i++) {
items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(activity.getMyApplication());
}
int i = view.getSettings().DAYNIGHT_MODE.get().ordinal();
bld.setSingleChoiceItems(items, i, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
view.getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.values()[which]);
refreshMapComplete(activity);
dialog.dismiss();
activity.getDashboard().refreshContent(true);
//adapter.setItemDescription(pos, getDayNightDescr(activity));
//ad.notifyDataSetInvalidated();
}
});
bld.show();
return false;
}
}).layout(R.layout.drawer_list_doubleitem).reg();
adapter.item(R.string.map_magnifier).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
final OsmandSettings.OsmandPreference<Float> mapDensity = view.getSettings().MAP_DENSITY;
final AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
int p = (int) (mapDensity.get() * 100);
final TIntArrayList tlist = new TIntArrayList(new int[] { 33, 50, 75, 100, 150, 200, 300, 400 });
final List<String> values = new ArrayList<String>();
int i = -1;
for (int k = 0; k <= tlist.size(); k++) {
final boolean end = k == tlist.size();
if (i == -1) {
if ((end || p < tlist.get(k))) {
values.add(p + " %");
i = k;
} else if (p == tlist.get(k)) {
i = k;
}
}
if (k < tlist.size()) {
values.add(tlist.get(k) + " %");
}
}
if (values.size() != tlist.size()) {
tlist.insert(i, p);
}
bld.setTitle(R.string.map_magnifier);
bld.setSingleChoiceItems(values.toArray(new String[values.size()]), i,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int p = tlist.get(which);
mapDensity.set(p / 100.0f);
view.setComplexZoom(view.getZoom(), view.getSettingsMapDensity());
MapRendererContext mapContext = NativeCoreContext.getMapRendererContext();
if (mapContext != null) {
mapContext.updateMapSettings();
String renderer = items[which];
RenderingRulesStorage loaded = app.getRendererRegistry().getRenderer(renderer);
if (loaded != null) {
OsmandMapTileView view = activity.getMapView();
view.getSettings().RENDERER.set(renderer);
app.getRendererRegistry().setCurrentSelectedRender(loaded);
refreshMapComplete(activity);
} else {
AccessibleToast.makeText(app, R.string.renderer_load_exception, Toast.LENGTH_SHORT).show();
}
adapter.setItemDescription(pos, String.format("%.0f", 100f * activity.getMyApplication().getSettings().MAP_DENSITY.get()) + " %");
adapter.setItemDescription(pos, getRenderDescr(activity));
activity.getDashboard().refreshContent(true);
dialog.dismiss();
}
});
bld.show();
return false;
}
}).setDescription(descr).setLayout(R.layout.drawer_list_doubleitem).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_widget_day_night, activity)
.setDescription(getDayNightDescr(activity))
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
bld.setTitle(R.string.daynight);
final String[] items = new String[OsmandSettings.DayNightMode.values().length];
for (int i = 0; i < items.length; i++) {
items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(activity.getMyApplication());
}
int i = view.getSettings().DAYNIGHT_MODE.get().ordinal();
bld.setSingleChoiceItems(items, i, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
view.getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.values()[which]);
refreshMapComplete(activity);
dialog.dismiss();
activity.getDashboard().refreshContent(true);
//adapter.setItemDescription(pos, getDayNightDescr(activity));
//ad.notifyDataSetInvalidated();
}
});
bld.show();
return false;
}
}).setLayout(R.layout.drawer_list_doubleitem).createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_magnifier, activity).setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
final OsmandSettings.OsmandPreference<Float> mapDensity = view.getSettings().MAP_DENSITY;
final AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
int p = (int) (mapDensity.get() * 100);
final TIntArrayList tlist = new TIntArrayList(new int[]{33, 50, 75, 100, 150, 200, 300, 400});
final List<String> values = new ArrayList<String>();
int i = -1;
for (int k = 0; k <= tlist.size(); k++) {
final boolean end = k == tlist.size();
if (i == -1) {
if ((end || p < tlist.get(k))) {
values.add(p + " %");
i = k;
} else if (p == tlist.get(k)) {
i = k;
}
}
if (k < tlist.size()) {
values.add(tlist.get(k) + " %");
}
}
if (values.size() != tlist.size()) {
tlist.insert(i, p);
}
bld.setTitle(R.string.map_magnifier);
bld.setSingleChoiceItems(values.toArray(new String[values.size()]), i,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int p = tlist.get(which);
mapDensity.set(p / 100.0f);
view.setComplexZoom(view.getZoom(), view.getSettingsMapDensity());
MapRendererContext mapContext = NativeCoreContext.getMapRendererContext();
if (mapContext != null) {
mapContext.updateMapSettings();
}
adapter.setItemDescription(pos, String.format("%.0f", 100f * activity.getMyApplication().getSettings().MAP_DENSITY.get()) + " %");
ad.notifyDataSetInvalidated();
dialog.dismiss();
}
});
bld.show();
return false;
}
}).setDescription(String.format("%.0f", 100f * activity.getMyApplication().getSettings().MAP_DENSITY.get()) + " %")
.setLayout(R.layout.drawer_list_doubleitem)
.createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.text_size, activity).setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
// test old descr as title
b.setTitle(R.string.text_size);
final Float[] txtValues = new Float[]{0.75f, 1f, 1.25f, 1.5f, 2f, 3f};
int selected = -1;
final String[] txtNames = new String[txtValues.length];
for (int i = 0; i < txtNames.length; i++) {
txtNames[i] = (int) (txtValues[i] * 100) + " %";
if (Math.abs(view.getSettings().TEXT_SCALE.get() - txtValues[i]) < 0.1f) {
selected = i;
}
}
b.setSingleChoiceItems(txtNames, selected, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
view.getSettings().TEXT_SCALE.set(txtValues[which]);
refreshMapComplete(activity);
adapter.setItemDescription(pos, getScale(activity));
ad.notifyDataSetInvalidated();
dialog.dismiss();
}
});
bld.show();
return false;
}
}).description(String.format("%.0f", 100f * activity.getMyApplication().getSettings().MAP_DENSITY.get()) + " %").layout(R.layout.drawer_list_doubleitem).reg();
b.show();
return false;
}
}).setDescription(getScale(activity)).setLayout(R.layout.drawer_list_doubleitem).createItem());
adapter.item(R.string.text_size).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
// test old descr as title
b.setTitle(R.string.text_size);
final Float[] txtValues = new Float[]{0.75f, 1f, 1.25f, 1.5f, 2f, 3f};
int selected = -1;
final String[] txtNames = new String[txtValues.length];
for (int i = 0; i < txtNames.length; i++) {
txtNames[i] = (int) (txtValues[i] * 100) + " %";
if (Math.abs(view.getSettings().TEXT_SCALE.get() - txtValues[i]) < 0.1f) {
selected = i;
}
}
b.setSingleChoiceItems(txtNames, selected, new DialogInterface.OnClickListener() {
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.map_locale, activity).setListener(new OnContextMenuClick() {
@Override
public void onClick(DialogInterface dialog, int which) {
view.getSettings().TEXT_SCALE.set(txtValues[which]);
refreshMapComplete(activity);
adapter.setItemDescription(pos, getScale(activity));
ad.notifyDataSetInvalidated();
dialog.dismiss();
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
// test old descr as title
b.setTitle(R.string.map_preferred_locale);
final String[] txtIds = getSortedMapNamesIds(activity);
final String[] txtValues = getMapNamesValues(activity, txtIds);
int selected = -1;
for (int i = 0; i < txtIds.length; i++) {
if (view.getSettings().MAP_PREFERRED_LOCALE.get().equals(txtIds[i])) {
selected = i;
break;
}
}
b.setSingleChoiceItems(txtValues, selected, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
view.getSettings().MAP_PREFERRED_LOCALE.set(txtIds[which]);
refreshMapComplete(activity);
adapter.setItemDescription(pos, txtIds[which]);
ad.notifyDataSetInvalidated();
dialog.dismiss();
}
});
b.show();
return false;
}
});
b.show();
return false;
}
}).description(getScale(activity)).layout(R.layout.drawer_list_doubleitem).reg();
adapter.item(R.string.map_locale).listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
final OsmandMapTileView view = activity.getMapView();
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
// test old descr as title
b.setTitle(R.string.map_preferred_locale);
final String[] txtIds = getSortedMapNamesIds(activity);
final String[] txtValues = getMapNamesValues(activity, txtIds);
int selected = -1;
for (int i = 0; i < txtIds.length; i++) {
if(view.getSettings().MAP_PREFERRED_LOCALE.get().equals(txtIds[i])) {
selected = i;
break;
}
}
b.setSingleChoiceItems(txtValues, selected, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
view.getSettings().MAP_PREFERRED_LOCALE.set(txtIds[which]);
refreshMapComplete(activity);
adapter.setItemDescription(pos, txtIds[which]);
ad.notifyDataSetInvalidated();
dialog.dismiss();
}
});
b.show();
return false;
}
}).description(activity.getMyApplication().getSettings().MAP_PREFERRED_LOCALE.get()).layout(R.layout.drawer_list_doubleitem).reg();
})
.setDescription(activity.getMyApplication().getSettings().MAP_PREFERRED_LOCALE.get())
.setLayout(R.layout.drawer_list_doubleitem).createItem());
RenderingRulesStorage renderer = activity.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer();
if (renderer != null) {
List<RenderingRuleProperty> customRules = new ArrayList<RenderingRuleProperty>();
for(RenderingRuleProperty p : renderer.PROPS.getCustomRules()) {
if(!RenderingRuleStorageProperties.UI_CATEGORY_HIDDEN.equals(p.getCategory())){
for (RenderingRuleProperty p : renderer.PROPS.getCustomRules()) {
if (!RenderingRuleStorageProperties.UI_CATEGORY_HIDDEN.equals(p.getCategory())) {
customRules.add(p);
}
}
@ -408,29 +445,31 @@ public class ConfigureMapMenu {
createProperties(customRules, R.string.rendering_category_routes, "routes",
adapter, activity);
if(customRules.size() > 0) {
adapter.item(R.string.rendering_category_others).setCategory(true).layout(R.layout.drawer_list_sub_header).reg();
if (customRules.size() > 0) {
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.rendering_category_others, activity).setCategory(true)
.setLayout(R.layout.drawer_list_sub_header).createItem());
createCustomRenderingProperties(adapter, activity, customRules);
}
}
}
public static String[] mapNamesIds = new String[] { "", "en", "als", "af", "ar", "az", "be", "bg", "bn", "bpy", "br", "bs", "ca", "ceb", "cs", "cy", "da", "de", "el", "et", "es", "eu", "fa", "fi", "fr", "fy", "ga", "gl", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "ka", "ko", "ku", "la", "lb", "lt", "lv", "mk", "ml", "mr", "ms", "nds", "new", "nl", "nn", "no", "nv", "os", "pl", "pms", "pt", "ro", "ru", "sh", "sc", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "vi", "vo", "zh" };
public static String[] mapNamesIds = new String[]{"", "en", "als", "af", "ar", "az", "be", "bg", "bn", "bpy", "br", "bs", "ca", "ceb", "cs", "cy", "da", "de", "el", "et", "es", "eu", "fa", "fi", "fr", "fy", "ga", "gl", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "ka", "ko", "ku", "la", "lb", "lt", "lv", "mk", "ml", "mr", "ms", "nds", "new", "nl", "nn", "no", "nv", "os", "pl", "pms", "pt", "ro", "ru", "sh", "sc", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "vi", "vo", "zh"};
public static String[] getSortedMapNamesIds(Context ctx) {
String[] vls = getMapNamesValues(ctx, mapNamesIds);
final Map<String, String> mp = new HashMap<String, String>();
for(int i = 0; i < mapNamesIds.length; i++) {
for (int i = 0; i < mapNamesIds.length; i++) {
mp.put(mapNamesIds[i], vls[i]);
}
ArrayList<String> lst = new ArrayList<String>(mp.keySet());
Collections.sort(lst, new Comparator<String>() {
@Override
public int compare(String lhs, String rhs) {
int i1 = Algorithms.isEmpty(lhs)? 0 : (lhs.equals("en") ? 1 : 2);
int i2 = Algorithms.isEmpty(rhs)? 0 : (rhs.equals("en") ? 1 : 2);
if(i1 != i2) {
int i1 = Algorithms.isEmpty(lhs) ? 0 : (lhs.equals("en") ? 1 : 2);
int i2 = Algorithms.isEmpty(rhs) ? 0 : (rhs.equals("en") ? 1 : 2);
if (i1 != i2) {
return i1 < i2 ? -1 : 1;
}
return mp.get(lhs).compareTo(mp.get(rhs));
@ -441,11 +480,11 @@ public class ConfigureMapMenu {
public static String[] getMapNamesValues(Context ctx, String[] ids) {
String[] translates = new String[ids.length];
for(int i = 0; i < translates.length; i++) {
if(Algorithms.isEmpty(ids[i])) {
for (int i = 0; i < translates.length; i++) {
if (Algorithms.isEmpty(ids[i])) {
translates[i] = ctx.getString(R.string.local_map_names);
} else {
translates[i] = ((OsmandApplication)ctx.getApplicationContext()).getLangTranslation(ids[i]);
translates[i] = ((OsmandApplication) ctx.getApplicationContext()).getLangTranslation(ids[i]);
}
}
@ -453,7 +492,7 @@ public class ConfigureMapMenu {
}
private void createProperties(List<RenderingRuleProperty> customRules, final int strId, String cat,
final ContextMenuAdapter adapter, final MapActivity activity) {
final ContextMenuAdapter adapter, final MapActivity activity) {
final List<RenderingRuleProperty> ps = new ArrayList<RenderingRuleProperty>();
final List<OsmandSettings.CommonPreference<Boolean>> prefs = new ArrayList<OsmandSettings.CommonPreference<Boolean>>();
Iterator<RenderingRuleProperty> it = customRules.iterator();
@ -468,17 +507,20 @@ public class ConfigureMapMenu {
it.remove();
}
}
if(prefs.size() > 0) {
if (prefs.size() > 0) {
final String descr = getDescription(prefs);
adapter.item(strId).description(descr).
layout(R.layout.drawer_list_doubleitem).listen(new OnContextMenuClick() {
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(strId, activity)
.setDescription(descr)
.setLayout(R.layout.drawer_list_doubleitem)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> a, int itemId, int pos, boolean isChecked) {
showPreferencesDialog(adapter, a, pos, activity, activity.getString(strId), ps, prefs);
return false;
}
}).reg();
}).createItem());
// createCustomRenderingProperties(adapter, activity, ps);
}
}
@ -497,7 +539,7 @@ public class ConfigureMapMenu {
}
protected void showPreferencesDialog(final ContextMenuAdapter adapter, final ArrayAdapter<?> a, final int pos, final MapActivity activity,
String category, List<RenderingRuleProperty> ps, final List<CommonPreference<Boolean>> prefs) {
String category, List<RenderingRuleProperty> ps, final List<CommonPreference<Boolean>> prefs) {
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
boolean[] checkedItems = new boolean[prefs.size()];
for (int i = 0; i < prefs.size(); i++) {
@ -509,7 +551,7 @@ public class ConfigureMapMenu {
tempPrefs[i] = prefs.get(i).get();
}
final String[] vals = new String[ps.size()];
for(int i = 0; i < ps.size(); i++) {
for (int i = 0; i < ps.size(); i++) {
RenderingRuleProperty p = ps.get(i);
String propertyName = SettingsActivity.getStringPropertyName(activity, p.getAttrName(),
p.getName());
@ -529,7 +571,7 @@ public class ConfigureMapMenu {
bld.setNegativeButton(R.string.shared_string_cancel, null);
bld.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
public void onClick(DialogInterface dialog, int whichButton) {
for (int i = 0; i < prefs.size(); i++) {
prefs.get(i).set(tempPrefs[i]);
}
@ -537,7 +579,7 @@ public class ConfigureMapMenu {
a.notifyDataSetInvalidated();
refreshMapComplete(activity);
activity.getMapLayers().updateLayers(activity.getMapView());
}
}
});
bld.show();
@ -557,17 +599,17 @@ public class ConfigureMapMenu {
}
protected String getScale(final MapActivity activity) {
int scale = (int)(activity.getMyApplication().getSettings().TEXT_SCALE.get() * 100);
int scale = (int) (activity.getMyApplication().getSettings().TEXT_SCALE.get() * 100);
return scale + " %";
}
private void createCustomRenderingProperties(final ContextMenuAdapter adapter , final MapActivity activity,
List<RenderingRuleProperty> customRules ){
private void createCustomRenderingProperties(final ContextMenuAdapter adapter, final MapActivity activity,
List<RenderingRuleProperty> customRules) {
final OsmandMapTileView view = activity.getMapView();
for (final RenderingRuleProperty p : customRules) {
if (p.getAttrName().equals(RenderingRuleStorageProperties.A_APP_MODE) ||
p.getAttrName().equals(RenderingRuleStorageProperties.A_ENGINE_V1)){
p.getAttrName().equals(RenderingRuleStorageProperties.A_ENGINE_V1)) {
continue;
}
String propertyName = SettingsActivity.getStringPropertyName(view.getContext(), p.getAttrName(),
@ -578,26 +620,29 @@ public class ConfigureMapMenu {
if (p.isBoolean()) {
final OsmandSettings.CommonPreference<Boolean> pref = view.getApplication().getSettings()
.getCustomRenderBooleanProperty(p.getAttrName());
adapter.item(propertyName).listen(new OnContextMenuClick() {
adapter.addItem(ContextMenuItem.createBuilder(propertyName)
.setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
pref.set(!pref.get());
refreshMapComplete(activity);
return false;
}
}).selected(pref.get() ? 1 : 0).reg();
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
pref.set(!pref.get());
refreshMapComplete(activity);
return false;
}
})
.setSelected(pref.get())
.createItem());
} else {
final OsmandSettings.CommonPreference<String> pref = view.getApplication().getSettings()
.getCustomRenderProperty(p.getAttrName());
String descr;
if(!Algorithms.isEmpty(pref.get())) {
if (!Algorithms.isEmpty(pref.get())) {
descr = SettingsActivity.getStringPropertyValue(activity, pref.get());
} else {
descr = SettingsActivity.getStringPropertyValue(view.getContext(),
p.getDefaultValueDescription());
}
adapter.item(propertyName).listen(new OnContextMenuClick() {
adapter.addItem(ContextMenuItem.createBuilder(propertyName).setListener(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(final ArrayAdapter<?> ad, int itemId, final int pos, boolean isChecked) {
@ -614,7 +659,7 @@ public class ConfigureMapMenu {
String[] possibleValuesString = new String[p.getPossibleValues().length + 1];
possibleValuesString[0] = SettingsActivity.getStringPropertyValue(view.getContext(),
p.getDefaultValueDescription());
p.getDefaultValueDescription());
for (int j = 0; j < p.getPossibleValues().length; j++) {
possibleValuesString[j + 1] = SettingsActivity.getStringPropertyValue(view.getContext(),
@ -624,7 +669,7 @@ public class ConfigureMapMenu {
b.setSingleChoiceItems(possibleValuesString, i, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(which == 0) {
if (which == 0) {
pref.set("");
} else {
pref.set(p.getPossibleValues()[which - 1]);
@ -638,7 +683,7 @@ public class ConfigureMapMenu {
b.show();
return false;
}
}).description(descr).layout(R.layout.drawer_list_doubleitem).reg();
}).setDescription(descr).setLayout(R.layout.drawer_list_doubleitem).createItem());
}
}
}

View file

@ -5,6 +5,7 @@ import android.view.View;
import android.widget.ArrayAdapter;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
@ -111,12 +112,17 @@ public class RasterMapMenu {
return false;
}
};
int selectedCode = selected ? 1 : 0;
mapTypeDescr = selected ? mapTypeDescr : mapActivity.getString(R.string.shared_string_none);
contextMenuAdapter.item(toggleActionStringId).listen(l).selected(selectedCode).reg();
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(toggleActionStringId, mapActivity)
.setListener(l)
.setSelected(selected).createItem());
if (selected) {
contextMenuAdapter.item(mapTypeString).listen(l).layout(R.layout.two_line_list_item)
.description(mapTypeDescr).reg();
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(mapTypeString, mapActivity)
.setListener(l)
.setLayout(R.layout.two_line_list_item)
.setDescription(mapTypeDescr).createItem());
ContextMenuAdapter.OnIntegerValueChangedListener integerListener =
new ContextMenuAdapter.OnIntegerValueChangedListener() {
@Override
@ -127,20 +133,25 @@ public class RasterMapMenu {
}
};
// android:max="255" in layout is expected
contextMenuAdapter.item(mapTypeStringTransparency)
.layout(R.layout.progress_list_item)
.colorIcon(R.drawable.ic_action_opacity)
.progress(mapTransparencyPreference.get())
.listen(l)
.listenInteger(integerListener).reg();
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(mapTypeStringTransparency, mapActivity)
.setLayout(R.layout.progress_list_item)
.setColorIcon(R.drawable.ic_action_opacity)
.setProgress(mapTransparencyPreference.get())
.setListener(l)
.setIntegerListener(integerListener).createItem());
if (type == OsmandRasterMapsPlugin.RasterMapType.UNDERLAY) {
contextMenuAdapter.item(R.string.show_polygons).listen(l)
.selected(hidePolygonsPref.get() ? 0 : 1).reg();
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.show_polygons, mapActivity)
.setListener(l)
.setSelected(hidePolygonsPref.get()).createItem());
}
Boolean transparencySwitchState = settings.SHOW_LAYER_TRANSPARENCY_SEEKBAR.get()
&& mapLayers.getMapControlsLayer().isTransparencyBarInitialized();
contextMenuAdapter.item(R.string.show_transparency_seekbar).listen(l)
.selected(transparencySwitchState ? 1 : 0).reg();
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.show_transparency_seekbar, mapActivity)
.setListener(l)
.setSelected(transparencySwitchState).createItem());
}
}

View file

@ -34,6 +34,7 @@ import net.osmand.data.RotatedTileBox;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.Route;
@ -640,7 +641,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
}
@Override
public void populateObjectContextMenu(LatLon latLon, Object o, ContextMenuAdapter adapter) {
public void populateObjectContextMenu(LatLon latLon, Object o, ContextMenuAdapter adapter, MapActivity mapActivity) {
if (o != null && o instanceof WptPt) {
final WptPt p = (WptPt) o;
boolean containsPoint = false;
@ -675,7 +676,10 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
return true;
}
};
adapter.item(R.string.delete_point).colorIcon(R.drawable.ic_action_delete_dark).listen(listener).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.delete_point, mapActivity)
.setColorIcon(R.drawable.ic_action_delete_dark)
.setListener(listener).createItem());
}
}
}

View file

@ -90,11 +90,16 @@ public class DataStoragePlaceDialogFragment extends BottomSheetDialogFragment {
internalStorageDescription.setText(getFreeSpace(internalStorage));
View sharedMemoryRow = view.findViewById(R.id.sharedMemoryRow);
sharedMemoryRow.setOnClickListener(sharedMemoryOnClickListener);
ImageView sharedMemoryImageView = (ImageView) view.findViewById(R.id.sharedMemoryImageView);
sharedMemoryImageView.setImageDrawable(getContentIcon(R.drawable.ic_sdcard));
TextView sharedMemoryDescription = (TextView) view.findViewById(R.id.sharedMemoryDescription);
sharedMemoryDescription.setText(getFreeSpace(sharedStorage));
if (hasExternalStoragePermission && sharedStorage != null) {
sharedMemoryRow.setOnClickListener(sharedMemoryOnClickListener);
ImageView sharedMemoryImageView = (ImageView) view.findViewById(R.id.sharedMemoryImageView);
sharedMemoryImageView.setImageDrawable(getContentIcon(R.drawable.ic_sdcard));
TextView sharedMemoryDescription = (TextView) view.findViewById(R.id.sharedMemoryDescription);
sharedMemoryDescription.setText(getFreeSpace(sharedStorage));
} else {
view.findViewById(R.id.divSharedStorage).setVisibility(View.GONE);
sharedMemoryRow.setVisibility(View.GONE);
}
View memoryStickRow = view.findViewById(R.id.memoryStickRow);
if (hasExternalStoragePermission && externalStorage != null) {
@ -138,7 +143,7 @@ public class DataStoragePlaceDialogFragment extends BottomSheetDialogFragment {
private String getFreeSpace(File dir) {
String sz = "";
if (dir.canRead()) {
if (dir != null && dir.canRead()) {
StatFs fs = new StatFs(dir.getAbsolutePath());
@SuppressWarnings("deprecation")
float size = (float) fs.getAvailableBlocks() * fs.getBlockSize();

View file

@ -40,6 +40,7 @@ import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
@ -200,16 +201,28 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
if (info.getType() == LocalIndexType.MAP_DATA || info.getType() == LocalIndexType.SRTM_DATA ||
info.getType() == LocalIndexType.WIKI_DATA) {
if (!info.isBackupedData()) {
adapter.item(R.string.local_index_mi_backup).listen(listener).position(1).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.local_index_mi_backup, getContext())
.setListener(listener)
.setPosition(1).createItem());
}
}
if (info.isBackupedData()) {
adapter.item(R.string.local_index_mi_restore).listen(listener).position(2).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.local_index_mi_restore, getContext())
.setListener(listener)
.setPosition(2).createItem());
}
if (info.getType() != LocalIndexType.TTS_VOICE_DATA && info.getType() != LocalIndexType.VOICE_DATA) {
adapter.item(R.string.shared_string_rename).listen(listener).position(3).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_rename, getContext())
.setListener(listener)
.setPosition(3).createItem());
}
adapter.item(R.string.shared_string_delete).listen(listener).position(4).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_delete, getContext())
.setListener(listener)
.setPosition(4).createItem());
}
private boolean performBasicOperation(int resId, final LocalIndexInfo info) {
@ -588,16 +601,24 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
return true;
}
};
optionsMenuAdapter.item(R.string.local_index_mi_reload)
.icon(R.drawable.ic_action_refresh_dark)
.listen(listener).position(1).reg();
optionsMenuAdapter.item(R.string.shared_string_delete)
.icon(R.drawable.ic_action_delete_dark)
.listen(listener).position(2).reg();
optionsMenuAdapter.item(R.string.local_index_mi_backup)
.listen(listener).position(3).reg();
optionsMenuAdapter.item(R.string.local_index_mi_restore)
.listen(listener).position(4).reg();
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.local_index_mi_reload,getContext())
.setIcon(R.drawable.ic_action_refresh_dark)
.setListener(listener)
.createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_delete,getContext())
.setIcon(R.drawable.ic_action_delete_dark)
.setListener(listener)
.createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.local_index_mi_backup,getContext())
.setListener(listener)
.createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.local_index_mi_restore,getContext())
.setListener(listener)
.createItem());
// doesn't work correctly
//int max = getResources().getInteger(R.integer.abs__max_action_buttons);
int max = 3;

View file

@ -23,6 +23,7 @@ import net.osmand.CallbackWithObject;
import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
@ -207,8 +208,8 @@ public class GpxUiHelper {
}
s = s.replace('_', ' ');
adapter.item(s).selected(multipleChoice ? 0 : -1)
.colorIcon(R.drawable.ic_action_polygom_dark).reg();
adapter.addItem(ContextMenuItem.createBuilder(s).setSelected(multipleChoice)
.setColorIcon(R.drawable.ic_action_polygom_dark).createItem());
//if there's some selected files - need to mark them as selected
if (selectedGpxList != null) {
@ -223,12 +224,12 @@ public class GpxUiHelper {
final ContextMenuAdapter adapter, int i, String fileName) {
if (i == 0 && showCurrentTrack) {
if (selectedGpxList.contains("")) {
adapter.setSelection(i, 1);
adapter.setSelection(i, true);
}
} else {
for (String file : selectedGpxList) {
if (file.endsWith(fileName)) {
adapter.setSelection(i, 1);
adapter.setSelection(i, true);
break;
}
}
@ -303,15 +304,15 @@ public class GpxUiHelper {
// }
// tv.setCompoundDrawablePadding(padding);
final CheckBox ch = ((CheckBox) v.findViewById(R.id.toggle_item));
if (adapter.getSelection(position) == -1) {
if (adapter.getSelection(position) == null) {
ch.setVisibility(View.INVISIBLE);
} else {
ch.setOnCheckedChangeListener(null);
ch.setChecked(adapter.getSelection(position) > 0);
ch.setChecked(adapter.getSelection(position));
ch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
adapter.setSelection(position, isChecked ? 1 : 0);
adapter.setSelection(position, isChecked);
}
});
}
@ -337,12 +338,12 @@ public class GpxUiHelper {
if (app != null && app.getSelectedGpxHelper() != null) {
app.getSelectedGpxHelper().clearAllGpxFileToShow();
}
if (showCurrentGpx && adapter.getSelection(0) > 0) {
if (showCurrentGpx && adapter.getSelection(0)) {
currentGPX = app.getSavingTrackHelper().getCurrentGpx();
}
List<String> s = new ArrayList<>();
for (int i = (showCurrentGpx ? 1 : 0); i < adapter.length(); i++) {
if (adapter.getSelection(i) > 0) {
if (adapter.getSelection(i)) {
s.add(list.get(i));
}
}
@ -360,7 +361,7 @@ public class GpxUiHelper {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (multipleChoice) {
adapter.setSelection(position, adapter.getSelection(position) > 0 ? 0 : 1);
adapter.setSelection(position, !adapter.getSelection(position));
listAdapter.notifyDataSetInvalidated();
} else {
dlg.dismiss();

View file

@ -555,7 +555,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
public void buttonMorePressed() {
final ContextMenuAdapter menuAdapter = new ContextMenuAdapter(mapActivity);
for (OsmandMapLayer layer : mapActivity.getMapView().getLayers()) {
layer.populateObjectContextMenu(latLon, object, menuAdapter);
layer.populateObjectContextMenu(latLon, object, menuAdapter, mapActivity);
}
mapActivity.getMapActions().contextMenuPoint(latLon.getLatitude(), latLon.getLongitude(), menuAdapter, object);

View file

@ -23,6 +23,7 @@ import net.osmand.Location;
import net.osmand.data.LatLon;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
@ -215,7 +216,8 @@ public class RoutePreferencesMenu {
String selectedValue = mapActivity.getMyApplication().getSettings().VOICE_PROVIDER.get();
entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE;
entries[k] = mapActivity.getResources().getString(R.string.shared_string_do_not_use);
adapter.item(entries[k]).reg();
ContextMenuItem.ItemBuilder itemBuilder = new ContextMenuItem.ItemBuilder();
adapter.addItem(itemBuilder.setTitle(entries[k]).createItem());
if (OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(selectedValue)) {
selected = k;
}
@ -224,7 +226,7 @@ public class RoutePreferencesMenu {
entries[k] = (s.contains("tts") ? mapActivity.getResources().getString(R.string.ttsvoice) + " " : "") +
FileNameTranslationHelper.getVoiceName(mapActivity, s);
entrieValues[k] = s;
adapter.item(entries[k]).reg();
adapter.addItem(itemBuilder.setTitle(entries[k]).createItem());
if (s.equals(selectedValue)) {
selected = k;
}
@ -232,7 +234,7 @@ public class RoutePreferencesMenu {
}
entrieValues[k] = MORE_VALUE;
entries[k] = mapActivity.getResources().getString(R.string.install_more);
adapter.item(entries[k]).reg();
adapter.addItem(itemBuilder.setTitle(entries[k]).createItem());
AlertDialog.Builder bld = new AlertDialog.Builder(mapActivity);
bld.setSingleChoiceItems(entries, selected, new DialogInterface.OnClickListener() {

View file

@ -23,6 +23,7 @@ import net.osmand.ValueHolder;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmAndFormatter;
@ -140,13 +141,17 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
return true;
}
};
adapter.item(R.string.context_menu_item_add_waypoint).colorIcon(R.drawable.ic_action_gnew_label_dark)
.listen(listener).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.context_menu_item_add_waypoint, mapActivity)
.setColorIcon(R.drawable.ic_action_gnew_label_dark)
.setListener(listener).createItem());
if (selectedObj instanceof WptPt) {
WptPt pt = (WptPt) selectedObj;
if (app.getSelectedGpxHelper().getSelectedGPXFile(pt) != null) {
adapter.item(R.string.context_menu_item_edit_waypoint).colorIcon(R.drawable.ic_action_edit_dark)
.listen(listener).reg();
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.context_menu_item_edit_waypoint, mapActivity)
.setColorIcon(R.drawable.ic_action_edit_dark)
.setListener(listener).createItem());
}
}
}

View file

@ -36,6 +36,7 @@ import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
@ -348,12 +349,13 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
return true;
}
};
optionsMenuAdapter.item(R.string.shared_string_show_on_map).icon(R.drawable.ic_show_on_map)
.listen(listener).reg();
optionsMenuAdapter.item(R.string.shared_string_delete)
.icon(R.drawable.ic_action_delete_dark).listen(listener).reg();
optionsMenuAdapter.item(R.string.local_index_mi_reload)
.icon(R.drawable.ic_action_refresh_dark).listen(listener).reg();
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_show_on_map, getActivity())
.setIcon(R.drawable.ic_show_on_map)
.setListener(listener).createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_delete, getActivity())
.setIcon(R.drawable.ic_action_delete_dark).setListener(listener).createItem());
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.local_index_mi_reload, getActivity())
.setIcon(R.drawable.ic_action_refresh_dark).setListener(listener).createItem());
OsmandPlugin.onOptionsMenuActivity(getActivity(), this, optionsMenuAdapter);
for (int j = 0; j < optionsMenuAdapter.length(); j++) {
final MenuItem item;

Some files were not shown because too many files have changed in this diff Show more