This commit is contained in:
GaidamakUA 2016-01-13 10:13:09 +02:00
commit eb4048c6f6
31 changed files with 557 additions and 132 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -99,7 +99,6 @@
android:clickable="false"
android:scaleType="center"
android:src="@drawable/ic_flat_list_dark"
android:tag="DragIcon"
android:visibility="gone"/>
</LinearLayout>

View file

@ -2623,4 +2623,23 @@
<string name="poi_official_name">Officielle navn</string>
<string name="poi_seamark_dyke">Sømærke dige</string>
<string name="poi_dolphin">Delfin</string>
<string name="poi_forestry_compartment">Vejskilt: skovbrugshytte</string>
<string name="poi_forestry_allotment">Vejskilt: skovbrug tildeling</string>
<string name="poi_inscription_n">Inskription: N</string>
<string name="poi_inscription_nw">Inskription: NV</string>
<string name="poi_inscription_w">Inskription: V</string>
<string name="poi_inscription_sw">Inskription: SV</string>
<string name="poi_inscription_s">Inskription: S</string>
<string name="poi_inscription_se">Inskription: SØ</string>
<string name="poi_inscription_e">Inskription: Ø</string>
<string name="poi_inscription_ne">Inskription: NØ</string>
<string name="poi_construction_yes">Under opførelse</string>
<string name="poi_atm_yes">Hæveautomat: ja</string>
<string name="poi_atm_no">Hæveautomat: nej</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="srtm_paid_version_msg">Overvej at købe Højdekurve udvidelsen (\'Contour lines\') på Google Play for at støtte den videre udvikling.</string>
<string name="av_def_action_video">Optag video</string>
<string name="av_def_action_audio">Optag audio</string>
@ -2224,4 +2225,6 @@
<string name="item_deleted">Emne slettet</string>
<string name="n_items_deleted">Emner slettet</string>
<string name="shared_string_undo_all">FORTRYD ALLE</string>
</resources>
<string name="rendering_attr_hideIcons_name">Skjul IP ikoner</string>
<string name="switch_start_finish">Byt rundt på startpunkt &amp; destination</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="no_address_found">Keine Adresse bekannt</string>
<string name="shared_string_near">Nähe</string>
<string name="regions">Regionen</string>
@ -1995,4 +1996,6 @@
<string name="shared_string_type">Typ</string>
<string name="starting_point">Startpunkt</string>
<string name="shared_string_undo_all">Alles rückgängig machen</string>
</resources>
<string name="rendering_attr_hideIcons_name">Symbole ausblenden</string>
<string name="switch_start_finish">Startpunkt und Ziel vertauschen</string>
</resources>

View file

@ -2596,4 +2596,22 @@
<string name="poi_official_name">Nombre oficial</string>
<string name="poi_seamark_dyke">Dique náutico</string>
<string name="poi_dolphin">Duque de alba (náutico)</string>
<string name="poi_forestry_compartment">Cartel: Compartimento forestal</string>
<string name="poi_forestry_allotment">Cartel: Parcela forestal</string>
<string name="poi_inscription_n">Inscripción: N</string>
<string name="poi_inscription_nw">Inscripción: NO</string>
<string name="poi_inscription_w">Inscripción: O</string>
<string name="poi_inscription_sw">Inscripción: SO</string>
<string name="poi_inscription_s">Inscripción: S</string>
<string name="poi_inscription_se">Inscripción: SE</string>
<string name="poi_inscription_e">Inscripción: E</string>
<string name="poi_inscription_ne">Inscripción: NE</string>
<string name="poi_construction_yes">En construcción</string>
<string name="poi_atm_yes">Con cajero automático</string>
<string name="poi_atm_no">Sin cajero automático</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="rendering_attr_hideHouseNumbers_name">Ocultar números de casa</string>
<string name="copying_osmand_file_failed">Falló al copiar archivos</string>
@ -2044,4 +2045,6 @@
<string name="item_deleted">Elemento borrado</string>
<string name="n_items_deleted">elementos borrados</string>
<string name="shared_string_undo_all">DESHACER TODO</string>
</resources>
<string name="rendering_attr_hideIcons_name">Ocultar iconos</string>
<string name="switch_start_finish">Cambiar inicio y final</string>
</resources>

View file

@ -2600,4 +2600,20 @@
<string name="poi_official_name">Nombre oficial</string>
</resources>
<string name="poi_seamark_dyke">Señal ďe Dique</string>
<string name="poi_dolphin">Delfín</string>
<string name="poi_inscription_n">Inscripción: N</string>
<string name="poi_inscription_nw">Inscripción: NO</string>
<string name="poi_inscription_w">Inscripción: O</string>
<string name="poi_inscription_sw">Inscripción: SO</string>
<string name="poi_inscription_s">Inscripción: S</string>
<string name="poi_inscription_se">Inscripción: SE</string>
<string name="poi_inscription_e">Inscripción: E</string>
<string name="poi_inscription_ne">Inscripción: NE</string>
<string name="poi_construction_yes">En construcción</string>
<string name="poi_atm_no">Cajero automático: no</string>
<string name="poi_atm_yes">Cajero automático: sí</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="offline_edition">Modifications hors-ligne</string>
<string name="offline_edition_descr">Toujours utiliser l\'édition hors-ligne</string>
@ -2110,4 +2111,6 @@
<string name="rec_split_storage_size">Taille de l\'espace de stockage</string>
<string name="rec_split_storage_size_desc">Espace maximum alloué pour tous les enregistrements</string>
<string name="shared_string_type">Type</string>
</resources>
<string name="switch_start_finish">Inverser Départ et Destination</string>
<string name="rendering_attr_hideIcons_name">Masquer les icônes de PI</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="layer_map_appearance">Configureer scherm</string>
<string name="show_lanes">Toon rijstroken</string>
@ -2162,4 +2163,6 @@
<string name="item_deleted">Item verwijderd</string>
<string name="n_items_deleted">items verwijderd</string>
<string name="shared_string_undo_all">Alles terugzetten</string>
</resources>
<string name="rendering_attr_hideIcons_name">Verberg iconen</string>
<string name="switch_start_finish">Verwissel start en einde</string>
</resources>

View file

@ -2591,4 +2591,22 @@
<string name="poi_official_name">Nome oficial</string>
</resources>
<string name="poi_seamark_dyke">Dique náutico</string>
<string name="poi_inscription_n">Inscrição: N</string>
<string name="poi_inscription_nw">Inscrição: NO</string>
<string name="poi_inscription_w">Inscrição: O</string>
<string name="poi_inscription_sw">Inscrição: SO</string>
<string name="poi_inscription_s">Inscrição: S</string>
<string name="poi_inscription_se">Inscrição: SE</string>
<string name="poi_inscription_e">Inscrição: E</string>
<string name="poi_inscription_ne">Inscrição: NE</string>
<string name="poi_construction_yes">Em construção</string>
<string name="poi_atm_yes">ATM: sim</string>
<string name="poi_atm_no">ATM: não</string>
<string name="poi_forestry_compartment">Pôster: compartimento florestal</string>
<string name="poi_forestry_allotment">Pôster: loteamento florestal</string>
<string name="poi_dolphin">Dolphin (náutico)</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="shared_string_my_places">Meus locais</string>
<?xml version='1.0' encoding='utf-8'?>
<resources><string name="shared_string_my_places">Meus locais</string>
<string name="days_behind">dias atrás</string>
<string name="watch">Ver</string>
<string name="rendering_attr_pisteGrooming_name">Pista de preparação</string>
@ -1990,4 +1991,6 @@
<string name="item_deleted">Item apagado</string>
<string name="n_items_deleted">itens apagados</string>
<string name="shared_string_undo_all">DESFAZER TUDO</string>
</resources>
<string name="rendering_attr_hideIcons_name">Ocultar ícones</string>
<string name="switch_start_finish">Alternar iniciar e finalizar</string>
</resources>

View file

@ -875,7 +875,6 @@
<string name="poi_gallery">Художественная галерея</string>
<string name="poi_ski_resort">Горнолыжный курорт</string>
<string name="poi_recreation_ground">Площадка для игр</string>
<string name="poi_dyke">Насыпь</string>
<string name="poi_payment_terminal">Платежный терминал</string>
<string name="poi_opening_hours">Часы работы</string>
@ -2571,4 +2570,21 @@
<string name="poi_official_name">Официальное имя</string>
<string name="poi_dyke">Насыпь для сдерживания потока воды</string>
<string name="poi_forestry_compartment">Указатель: квартальный столб</string>
<string name="poi_forestry_allotment">Указатель: деляночный столб</string>
<string name="poi_inscription_n">Надпись:С</string>
<string name="poi_inscription_nw">Надпись:СВ</string>
<string name="poi_inscription_w">Надпись:В</string>
<string name="poi_inscription_sw">Надпись:ЮВ</string>
<string name="poi_inscription_s">Надпись:Ю</string>
<string name="poi_inscription_se">Надпись:ЮЗ</string>
<string name="poi_inscription_e">Надпись:З</string>
<string name="poi_inscription_ne">Надпись:СЗ</string>
<string name="poi_construction_yes">В процессе строительства</string>
<string name="poi_atm_yes">С банкоматом</string>
<string name="poi_atm_no">Без банкомата</string>
</resources>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<string name="rendering_attr_hideIcons_name">Скрыть значки</string>
<string name="rendering_attr_horseRoutes_name">Конные маршруты</string>
<string name="av_video_quality_low">Низкое качество</string>
<string name="av_video_quality_high">Высокое качество</string>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="about_version">Верзија:</string>
<string name="shared_string_about">Oko</string>
<string name="about_settings_descr">Верзија инфо, лиценце, чланови пројекта</string>
@ -977,4 +978,95 @@
<string name="release_2_2">" • Ново сучеље осетљиво на положај тапкања по карти или другим површима\n\n • Приказ карте се сада покреће непосредно осим ако је означено „Приказуј полетника при покретању“\n\n • Подешава се која карта и како се приказује у полетнику\n\n • Премошћава се полетник ако Вам се више свиђа управљање програмом изборником\n\n • За преузимање карата, области се могу непосредно изабрати тапкањем по светској карти\n\n • Претрага тачака занимања сада подржава одређеније упите\n\n • Побољшане су могућности тачака занимања и уређивања ОСМ-а\n\n • Прерађен је склоп преузимања карата и његово сучеље\n\n и још којешта... "</string>
<string name="hillshade_layer_disabled">Слој сенчења падина је онемогућен</string>
<string name="traffic_warning_hazard"/>
</resources>
<string name="lang_al">Албански</string>
<string name="lang_ar">Арапски</string>
<string name="lang_eu">Баскијски</string>
<string name="lang_be">Белоруски</string>
<string name="lang_bg">Бугарски</string>
<string name="lang_hr">Хрватски</string>
<string name="lang_cs">Чешки</string>
<string name="lang_da">Дански</string>
<string name="lang_fi">Фински</string>
<string name="lang_fr">Француски</string>
<string name="lang_de">Германски</string>
<string name="lang_el">Грчки</string>
<string name="lang_hu">Мађарски</string>
<string name="lang_id">Индонезијски</string>
<string name="lang_it">Италијански</string>
<string name="lang_ja">Јапански</string>
<string name="lang_ko">Корејски</string>
<string name="lang_no">Норвешки</string>
<string name="lang_fa">Персијски</string>
<string name="lang_pl">Пољски</string>
<string name="lang_pt">Португалски</string>
<string name="lang_ro">Румунски</string>
<string name="lang_ru">Руски</string>
<string name="lang_sk">Словачки</string>
<string name="lang_es">Шпански</string>
<string name="lang_sv">Шведски</string>
<string name="lang_tr">Турски</string>
<string name="lang_uk">Украјински</string>
<string name="lang_vi">Вијетнамски</string>
<string name="index_name_canada">Северна Америка - Канада</string>
<string name="index_name_italy">Европа - Италија</string>
<string name="index_name_gb">Европа - Велика Британија</string>
<string name="calculate_osmand_route_without_internet">Рачунај одсечак стазе Османда без приступа мрежи</string>
<string name="gpx_option_calculate_first_last_segment">Рачунај од првог до последњег осдечка стазе Османда</string>
<string name="use_displayed_track_for_navigation">Да ли желите приказ стазе за навођење?</string>
<string name="select_gpx">Изаберите ГПИкс…</string>
<string name="routing_attr_avoid_toll_description">Избегавај путеве са наплатним станицама</string>
<string name="routing_attr_avoid_toll_name">Избегавај путеве са наплатним станицама</string>
<string name="routing_attr_avoid_unpaved_name">Избегавај неасвалтиране путеве</string>
<string name="routing_attr_avoid_unpaved_description">Избегавај неасвалтиране путеве</string>
<string name="maps_define_edit">Одреди/уреди…</string>
<string name="switch_start_finish">Замени полазну и циљну тачку</string>
<string name="rendering_attr_hideIcons_name">Сакриј иконице</string>
<string name="select_month_and_country">Означи месец и државу</string>
<string name="weekly">Седмично</string>
<string name="cancel_route">Откажи путању</string>
<string name="accessibility_options">Могућности приступачности</string>
<string name="map_widget_gps_info">Подаци ГПС-а</string>
<string name="index_name_openmaps">Отворене карте ЕУ-а</string>
<string name="local_indexes_cat_av">Подаци звука/видеа</string>
<string name="clear_dest_confirm">Да ли сигурно желите да очистите тачку одредишта (и пролазна одредишта)?</string>
<string name="precise_routing_mode_descr">Омогући рачунање тачних путања без грешака. Радња је ограничена даљином и спора.</string>
<string name="precise_routing_mode">Тачно рачунање путања (споро)</string>
<string name="srtm_paid_version_msg">Молим, размислите о куповини Линија обриса из продавнице ради давања подршке даљем развоју програма.</string>
<string name="av_def_action_choose">Означи на захтев</string>
<string name="av_video_format_descr">Изаберите облик излазног снимка</string>
<string name="av_video_format">Облик излазног снимка</string>
<string name="av_use_external_recorder_descr">Користи склопног снимача за видео</string>
<string name="av_use_external_recorder">Користи склопног снимача видеа</string>
<string name="av_use_external_camera_descr">Користи склопни програм за слике</string>
<string name="av_use_external_camera">Користи програм камере</string>
<string name="recording_is_recorded">Звук/видео је снимљен. Зауставите снимање притиском на справицу ЗВ-а</string>
<string name="recording_playing">Изводи се одређени звучни запис\n%1$s</string>
<string name="recording_open_external_player">Отвори програм спољног извођача</string>
<string name="recording_can_not_be_played">Снимак се не може извести</string>
<string name="recording_description">Снимам %1$s %3$s %2$s</string>
<string name="audionotes_location_not_defined">Положај за придруживање белешци и даље није одређен. „Користи положај …“ за придруживање белешке одређеном положају</string>
<string name="index_srtm_parts">делови</string>
<string name="rendering_attr_alpineHiking_description">Приказуј путеве према лествици САЦ-а</string>
<string name="rendering_attr_hikingRoutesOSMC_description">Приказуј путеве према путањама ОСМЦ-а</string>
<string name="rendering_attr_showRoadMaps_description">Одредите када ће се приказивати само путне карте:</string>
<string name="rendering_attr_showRoadMaps_name">Само путне карте</string>
<string name="safe_mode_description">Покрени програм у безбедном начину рада (користећи спорији Андроидов код уместо бржег програмског).</string>
<string name="safe_mode">Безбедни начин рада</string>
<string name="native_library_not_running">Програм је у безбедном начину рада (онемогућава се у поставкама).</string>
<string name="rendering_attr_roadColors_description">Изаберите образац боја путева:</string>
<string name="rendering_attr_roadColors_name">Образац боја путева</string>
<string name="enable_plugin_monitoring_services">Омогућите прикључак снимања путовања ради коришћења услуга бележења (бележење ГПИксом, праћење положаја на мрежи)</string>
<string name="non_optimal_route_calculation">Рачунај могућу приближну путању за велике раздаљине</string>
<string name="gps_not_available">Молим, омогућите ГПС у поставкама</string>
<string name="map_widget_monitoring_services">Услуге бележења путање</string>
<string name="no_route">Нема пута</string>
<string name="arrived_at_intermediate_point">Стигли сте на пролазно одредиште</string>
<string name="context_menu_item_intermediate_point">Додај као пролазно одредиште</string>
<string name="map_widget_intermediate_distance">Пролазно одредиште</string>
<string name="ending_point_too_far">Завршна тачка је предалеко од најближег пута.</string>
<string name="btn_advanced_mode">Напредни начин рада…</string>
<string name="use_compass_navigation">Користи компас</string>
<string name="use_compass_navigation_descr">Користи компас када правац није препознат на други начин</string>
<string name="avoid_motorway">Избегавај путеве за моторна возила</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="screen_is_locked">För att låsa upp skärmen tryck på låsikonen</string>
<string name="ChooseCountry">Välj land</string>
<string name="choose_city">Välj stad</string>
@ -2063,4 +2064,5 @@
<string name="item_deleted">post raderad</string>
<string name="n_items_deleted">poster raderade</string>
<string name="shared_string_undo_all">ÅNGRA ALLA</string>
</resources>
<string name="rendering_attr_hideIcons_name">Dölj ikonerna</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="close_changeset">Değişiklik listesini kapat</string>
<?xml version='1.0' encoding='utf-8'?>
<resources><string name="close_changeset">Değişiklik listesini kapat</string>
<string name="zxing_barcode_scanner_not_found">ZXing Barcode Scanner uygulaması kurulu değil. Uygulama marketinde aramak ister misiniz?</string>
<string name="rendering_attr_roadColors_description">Yol renk şemasını seç:</string>
<string name="rendering_attr_roadColors_name">Yol renk şeması</string>
@ -1327,7 +1328,7 @@
<string name="routing_attr_avoid_shuttle_train_name">Mekik treninden kaçın</string>
<string name="local_indexes_cat_wiki">Vikipedi</string>
<string name="osm_edit_context_menu_delete">OSM Düzeltmesini Sil</string>
<string name="osm_edit_context_menu_delete">OSM düzeltmesini sil</string>
<string name="rendering_value_walkingRoutesScopeOSMC_name">Rota kapsamına göre Boyama</string>
<string name="shared_string_logoff">Çıkış yap</string>
<string name="application_dir_change_warning3">OsmAnd\'ın verileri ayrıca yeni hedefe de kopyalamasını ister misiniz?</string>
@ -2030,4 +2031,4 @@
<string name="shared_string_undo_all">UNDO TÜM</string>
<string name="shared_string_type">Tip</string>
<string name="starting_point">Başlangıç noktası</string>
</resources>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="rendering_attr_roadColors_description">選擇道路的色彩調配:</string>
<string name="rendering_attr_roadColors_name">道路的色彩調配</string>
<string name="map_widget_show_destination_arrow">顯示目的地方向</string>
@ -2070,4 +2071,6 @@
<string name="item_deleted">項目已刪除</string>
<string name="n_items_deleted">項目已刪除</string>
<string name="shared_string_undo_all">全部取消</string>
</resources>
<string name="rendering_attr_hideIcons_name">隱藏圖示</string>
<string name="switch_start_finish">切換開始以及結束</string>
</resources>

View file

@ -953,7 +953,7 @@
<string name="poi_daymark">Daymark</string>
<string name="poi_distance_mark">Distance mark</string>
<string name="poi_dry_dock">Dry dock</string>
<string name="poi_dyke">Dyke</string>
<string name="poi_seamark_dyke">Seamark dyke</string>
<string name="poi_floating_dock">Floating dock</string>
<string name="poi_fog_signal">Fog signal</string>
<string name="poi_harbour_basin">Harbour basin</string>
@ -2566,4 +2566,22 @@
<string name="poi_official_name">Official name</string>
<string name="poi_dyke">Dyke</string>
<string name="poi_dolphin">Dolphin</string>
<string name="poi_forestry_compartment">Signpost: forestry compartment</string>
<string name="poi_forestry_allotment">Signpost: forestry allotment</string>
<string name="poi_inscription_n">Inscription:N</string>
<string name="poi_inscription_nw">Inscription:NW</string>
<string name="poi_inscription_w">Inscription:W</string>
<string name="poi_inscription_sw">Inscription:SW</string>
<string name="poi_inscription_s">Inscription:S</string>
<string name="poi_inscription_se">Inscription:SE</string>
<string name="poi_inscription_e">Inscription:E</string>
<string name="poi_inscription_ne">Inscription:NE</string>
<string name="poi_construction_yes">Under construction</string>
<string name="poi_atm_yes">Atm: yes</string>
<string name="poi_atm_no">Atm: no</string>
</resources>

View file

@ -9,6 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="switch_start_finish">Reverse starting point &amp; destination</string>
<string name="rendering_attr_hideIcons_name">Hide POI icons</string>
<string name="item_deleted">Item deleted</string>
<string name="n_items_deleted">items deleted</string>
<string name="shared_string_undo_all">UNDO ALL</string>

View file

@ -86,7 +86,7 @@ public class MapActivityActions implements DialogProvider {
routingHelper = mapActivity.getMyApplication().getRoutingHelper();
}
/*
public void addAsWaypoint(double latitude, double longitude, PointDescription pd) {
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
boolean destination = (targets.getPointToNavigate() == null);
@ -97,7 +97,8 @@ public class MapActivityActions implements DialogProvider {
openIntermediateEditPointsDialog();
}
*/
public void addAsTarget(double latitude, double longitude, PointDescription pd) {
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
targets.navigateToPoint(new LatLon(latitude, longitude), true, targets.getIntermediatePoints().size() + 1,
@ -736,9 +737,11 @@ public class MapActivityActions implements DialogProvider {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
}
/*
public void openIntermediateEditPointsDialog() {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS_EDIT);
}
*/
public void openRoutePreferencesDialog() {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.ROUTE_PREFERENCES);
@ -758,6 +761,7 @@ public class MapActivityActions implements DialogProvider {
settings.LAST_ROUTING_APPLICATION_MODE = settings.APPLICATION_MODE.get();
settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get());
mapActivity.updateApplicationModeSettings();
mapActivity.getDashboard().clearDeletedPoints();
}
public AlertDialog stopNavigationActionConfirm() {

View file

@ -96,7 +96,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
View dv = getActivity().getLayoutInflater().inflate(R.layout.divider, null);
favorites.addView(dv);
View v = WaypointDialogHelper.updateWaypointItemView(false, null, getMyApplication(),
getActivity(), null, ps, null, !getMyApplication().getSettings().isLightContent(), true);
getActivity(), null, null, ps, null, !getMyApplication().getSettings().isLightContent(), true);
favorites.addView(v);
}

View file

@ -54,6 +54,7 @@ import net.osmand.plus.dialogs.ConfigureMapMenu;
import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.WaypointDialogHelper;
import net.osmand.plus.helpers.WaypointDialogHelper.PointDeleteCallback;
import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper;
import net.osmand.plus.mapcontextmenu.other.RoutePreferencesMenu;
import net.osmand.plus.mapcontextmenu.other.RoutePreferencesMenu.LocalRoutingParameter;
@ -79,7 +80,8 @@ import static android.util.TypedValue.COMPLEX_UNIT_DIP;
/**
*/
public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicListViewCallbacks, IRouteInformationListener {
public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicListViewCallbacks,
IRouteInformationListener, PointDeleteCallback {
private static final org.apache.commons.logging.Log LOG =
PlatformUtil.getLog(DashboardOnMap.class);
private static final String TAG = "DashboardOnMap";
@ -149,7 +151,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
public enum DashboardType {
WAYPOINTS,
WAYPOINTS_FLAT,
WAYPOINTS_EDIT,
CONFIGURE_SCREEN,
CONFIGURE_MAP,
LIST_MENU,
@ -178,6 +179,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
public void createDashboardView() {
baseColor = mapActivity.getResources().getColor(R.color.osmand_orange) & 0x00ffffff;
waypointDialogHelper = new WaypointDialogHelper(mapActivity);
waypointDialogHelper.setPointDeleteCallback(this);
landscape = !AndroidUiHelper.isOrientationPortrait(mapActivity);
dashboardView = (FrameLayout) mapActivity.findViewById(R.id.dashboard);
final View.OnClickListener listener = new View.OnClickListener() {
@ -202,7 +204,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
@Override
public boolean canDismiss(int position) {
boolean res = false;
if (listAdapter instanceof StableArrayAdapter) {
if (visibleType == DashboardType.WAYPOINTS && listAdapter instanceof StableArrayAdapter) {
List<Object> activeObjects = ((StableArrayAdapter) listAdapter).getActiveObjects();
Object obj = listAdapter.getItem(position);
res = activeObjects.contains(obj);
@ -232,7 +234,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
stableAdapter = null;
activeObjPos = 0;
}
return new Undoable() {
@Override
public void undo() {
@ -242,7 +243,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
stableAdapter.getObjects().add(position, item);
stableAdapter.getActiveObjects().add(activeObjPos, item);
stableAdapter.refreshData();
onItemsSwapped(stableAdapter.getActiveObjects());
}
}
@ -380,7 +380,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
//
// @Override
// public void onClick(View v) {
mapActivity.getMyApplication().getWaypointHelper().removeVisibleLocationPoint(deletedPoints);
// mapActivity.getMyApplication().getWaypointHelper().removeVisibleLocationPoint(deletedPoints);
// hideDashboard();
// }
// });
@ -473,7 +473,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
button = actionButtons.get(DashboardActionButtonType.MY_LOCATION);
} else if (type == DashboardType.ROUTE_PREFERENCES) {
button = actionButtons.get(DashboardActionButtonType.NAVIGATE);
} else if (type == DashboardType.WAYPOINTS || type == DashboardType.WAYPOINTS_EDIT || type == DashboardType.WAYPOINTS_FLAT) {
} else if (type == DashboardType.WAYPOINTS || type == DashboardType.WAYPOINTS_FLAT) {
boolean routePlanningMode = false;
RoutingHelper rh = mapActivity.getRoutingHelper();
if (rh.isRoutePlanningMode()) {
@ -679,13 +679,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
dynamicListView.setActiveItemsList(listAdapter.getActiveObjects());
updateListAdapter(listAdapter, listener);
} else if (DashboardType.WAYPOINTS_EDIT == visibleType) {
deletedPoints.clear();
ArrayAdapter<Object> listAdapter = waypointDialogHelper.getWaypointsDrawerAdapter(true, deletedPoints, mapActivity, running,
DashboardType.WAYPOINTS_FLAT == visibleType, nightMode);
OnItemClickListener listener = waypointDialogHelper.getDrawerItemClickListener(mapActivity, running,
listAdapter);
updateListAdapter(listAdapter, listener);
} else {
if (DashboardType.CONFIGURE_SCREEN == visibleType) {
@ -718,8 +711,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
}
public void refreshContent(boolean force) {
if (visibleType == DashboardType.WAYPOINTS || visibleType == DashboardType.WAYPOINTS_EDIT
|| force) {
if (visibleType == DashboardType.WAYPOINTS || force) {
updateListAdapter();
} else if (visibleType == DashboardType.CONFIGURE_MAP || visibleType == DashboardType.ROUTE_PREFERENCES) {
int index = listView.getFirstVisiblePosition();
@ -981,7 +973,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
private boolean isActionButtonVisible() {
return visibleType == DashboardType.DASHBOARD
|| visibleType == DashboardType.WAYPOINTS
|| visibleType == DashboardType.WAYPOINTS_EDIT
|| visibleType == DashboardType.WAYPOINTS_FLAT
|| visibleType == DashboardType.LIST_MENU
|| visibleType == DashboardType.ROUTE_PREFERENCES
@ -1132,6 +1123,10 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
transaction.show(frag).commit();
}
public void clearDeletedPoints() {
deletedPoints.clear();
}
View getParentView() {
return dashboardView;
}
@ -1167,7 +1162,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
getMyApplication().runInUIThread(new Runnable() {
@Override
public void run() {
if (visibleType == DashboardType.WAYPOINTS) {
if (visibleType == DashboardType.WAYPOINTS || visibleType == DashboardType.WAYPOINTS_FLAT) {
List<TargetPoint> allTargets = new ArrayList<>();
if (items != null) {
for (Object obj : items) {
@ -1223,4 +1218,11 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
swipeDismissListener.discardUndo();
}
}
@Override
public void deleteWaypoint(int position) {
if (swipeDismissListener != null) {
swipeDismissListener.delete(position);
}
}
}

View file

@ -1,17 +1,19 @@
package net.osmand.plus.helpers;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.Shape;
import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@ -23,6 +25,7 @@ import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.Location;
import net.osmand.TspAnt;
import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon;
import net.osmand.data.LocationPoint;
@ -30,11 +33,13 @@ import net.osmand.data.PointDescription;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.IntermediatePointsDialog;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper;
import net.osmand.plus.poi.PoiUIFilter;
import net.osmand.plus.views.controls.DynamicListView.DragIcon;
import net.osmand.plus.views.controls.ListDividerShape;
import net.osmand.plus.views.controls.StableArrayAdapter;
import net.osmand.util.Algorithms;
@ -49,7 +54,14 @@ public class WaypointDialogHelper {
private MapActivity mapActivity;
private OsmandApplication app;
private WaypointHelper waypointHelper;
private PointDeleteCallback dCallback;
private boolean flat;
private List<LocationPointWrapper> deletedPoints;
public interface PointDeleteCallback {
void deleteWaypoint(int position);
}
private static class RadiusItem {
int type;
@ -59,6 +71,10 @@ public class WaypointDialogHelper {
}
}
public void setPointDeleteCallback(PointDeleteCallback callback) {
this.dCallback = callback;
}
public WaypointDialogHelper(MapActivity mapActivity) {
this.app = mapActivity.getMyApplication();
waypointHelper = this.app.getWaypointHelper();
@ -114,7 +130,7 @@ public class WaypointDialogHelper {
case WaypointHelper.FAVORITES:
FavouritePoint favPoint = (FavouritePoint) ps.point;
pointDescription = favPoint.getCategory();
pointDescription = Algorithms.isEmpty(favPoint.getCategory()) ? activity.getResources().getString(R.string.shared_string_favorites) : favPoint.getCategory();
break;
}
}
@ -154,6 +170,16 @@ public class WaypointDialogHelper {
// 0);
}
private List<Object> getPoints() {
final List<Object> points;
if (flat) {
points = new ArrayList<Object>(waypointHelper.getAllPoints());
} else {
points = getStandardPoints();
}
return points;
}
private List<Object> getActivePoints(List<Object> points) {
List<Object> activePoints = new ArrayList<>();
for (Object p : points) {
@ -250,14 +276,14 @@ public class WaypointDialogHelper {
final boolean edit, final List<LocationPointWrapper> deletedPoints,
final MapActivity ctx, final int[] running, final boolean flat, final boolean nightMode) {
final List<Object> points;
if (flat) {
points = new ArrayList<Object>(waypointHelper.getAllPoints());
} else {
points = getPoints();
}
this.flat = flat;
this.deletedPoints = deletedPoints;
final List<Object> points = getPoints();
List<Object> activePoints = getActivePoints(points);
final WaypointDialogHelper helper = this;
return new StableArrayAdapter(ctx,
R.layout.waypoint_reached, R.id.title, points, activePoints) {
@ -306,7 +332,7 @@ public class WaypointDialogHelper {
v = ctx.getLayoutInflater().inflate(R.layout.card_bottom_divider, null);
} else if (obj instanceof LocationPointWrapper) {
LocationPointWrapper point = (LocationPointWrapper) obj;
v = updateWaypointItemView(edit, deletedPoints, app, ctx, v, point, this,
v = updateWaypointItemView(edit, deletedPoints, app, ctx, helper, v, point, this,
nightMode, flat);
AndroidUtils.setListItemBackground(mapActivity, v, nightMode);
}
@ -317,7 +343,8 @@ public class WaypointDialogHelper {
public static View updateWaypointItemView(final boolean edit, final List<LocationPointWrapper> deletedPoints,
final OsmandApplication app, final Activity ctx, View v,
final OsmandApplication app, final Activity ctx,
final WaypointDialogHelper helper, View v,
final LocationPointWrapper point,
final ArrayAdapter adapter, final boolean nightMode,
final boolean flat) {
@ -325,9 +352,9 @@ public class WaypointDialogHelper {
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
}
updatePointInfoView(app, ctx, v, point, true, nightMode, edit);
View more = v.findViewById(R.id.all_points);
View move = v.findViewById(R.id.info_move);
View remove = v.findViewById(R.id.info_close);
final View more = v.findViewById(R.id.all_points);
final View move = v.findViewById(R.id.info_move);
final View remove = v.findViewById(R.id.info_close);
if (!edit) {
remove.setVisibility(View.GONE);
move.setVisibility(View.GONE);
@ -342,8 +369,31 @@ public class WaypointDialogHelper {
more.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//hideDashboard();
IntermediatePointsDialog.openIntermediatePointsDialog(ctx, app, true);
final PopupMenu optionsMenu = new PopupMenu(ctx, more);
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
MenuItem item;
item = optionsMenu.getMenu().add(
R.string.intermediate_items_sort_by_distance).setIcon(app.getIconsCache().
getContentIcon(R.drawable.ic_sort_waypoint_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
// sort door-to-door
sortAllTargets(app, ctx);
return true;
}
});
item = optionsMenu.getMenu().add(
R.string.switch_start_finish).setIcon(app.getIconsCache().
getContentIcon(R.drawable.ic_action_undo_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
// switch start & finish
return true;
}
});
optionsMenu.show();
}
});
} else {
@ -351,7 +401,26 @@ public class WaypointDialogHelper {
move.setVisibility(View.VISIBLE);
more.setVisibility(View.GONE);
((ImageView) move).setImageDrawable(app.getIconsCache().getContentIcon(
R.drawable.ic_flat_list_dark, !nightMode));
R.drawable.ic_action_reorder, !nightMode));
move.setTag(new DragIcon() {
@Override
public void onClick() {
final PopupMenu optionsMenu = new PopupMenu(ctx, move);
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
MenuItem item;
item = optionsMenu.getMenu().add(
R.string.shared_string_delete).setIcon(app.getIconsCache().
getContentIcon(R.drawable.ic_action_remove_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
deletePoint(app, adapter, helper, point, deletedPoints, true);
return true;
}
});
optionsMenu.show();
}
});
}
} else {
remove.setVisibility(View.VISIBLE);
@ -362,22 +431,45 @@ public class WaypointDialogHelper {
remove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ArrayList<LocationPointWrapper> arr = new ArrayList<>();
arr.add(point);
app.getWaypointHelper().removeVisibleLocationPoint(arr);
deletedPoints.add(point);
if (adapter != null) {
adapter.setNotifyOnChange(false);
adapter.remove(point);
adapter.notifyDataSetChanged();
}
deletePoint(app, adapter, helper, point, deletedPoints, true);
}
});
}
return v;
}
public static void deletePoint(final OsmandApplication app, final ArrayAdapter adapter,
final WaypointDialogHelper helper,
final Object item,
final List<LocationPointWrapper> deletedPoints,
final boolean needCallback) {
if (item instanceof LocationPointWrapper && adapter != null) {
LocationPointWrapper point = (LocationPointWrapper) item;
if (point.type == WaypointHelper.TARGETS && adapter instanceof StableArrayAdapter) {
StableArrayAdapter stableAdapter = (StableArrayAdapter) adapter;
if (helper != null && helper.dCallback != null && needCallback) {
helper.dCallback.deleteWaypoint(stableAdapter.getPosition(item));
}
} else {
ArrayList<LocationPointWrapper> arr = new ArrayList<>();
arr.add(point);
app.getWaypointHelper().removeVisibleLocationPoint(arr);
deletedPoints.add(point);
adapter.setNotifyOnChange(false);
adapter.remove(point);
if (adapter instanceof StableArrayAdapter) {
StableArrayAdapter stableAdapter = (StableArrayAdapter) adapter;
stableAdapter.getObjects().remove(item);
stableAdapter.refreshData();
}
adapter.notifyDataSetChanged();
}
}
}
protected View createItemForRadiusProximity(final FragmentActivity ctx, final int type, final int[] running,
final int position, final ArrayAdapter<Object> thisAdapter, boolean nightMode) {
@ -569,6 +661,8 @@ public class WaypointDialogHelper {
}
public void reloadListAdapter(ArrayAdapter<Object> listAdapter) {
mapActivity.getMyApplication().getWaypointHelper().removeVisibleLocationPoint(deletedPoints);
listAdapter.setNotifyOnChange(false);
listAdapter.clear();
List<Object> points = getPoints();
@ -603,8 +697,8 @@ public class WaypointDialogHelper {
return str;
}
protected List<Object> getPoints() {
final List<Object> points = new ArrayList<Object>();
protected List<Object> getStandardPoints() {
final List<Object> points = new ArrayList<>();
boolean rc = waypointHelper.isRouteCalculated();
for (int i = 0; i < WaypointHelper.MAX; i++) {
List<LocationPointWrapper> tp = waypointHelper.getWaypoints(i);
@ -702,4 +796,88 @@ public class WaypointDialogHelper {
*/
}
public static void sortAllTargets(final OsmandApplication app, final Activity activity) {
new AsyncTask<Void, Void, int[]>() {
ProgressDialog dlg = null;
long startDialogTime = 0;
List<TargetPoint> intermediates;
protected void onPreExecute() {
startDialogTime = System.currentTimeMillis();
dlg = new ProgressDialog(activity);
dlg.setTitle("");
dlg.setMessage(activity.getResources().getString(R.string.intermediate_items_sort_by_distance));
dlg.show();
}
protected int[] doInBackground(Void[] params) {
TargetPointsHelper targets = app.getTargetPointsHelper();
intermediates = targets.getIntermediatePointsWithTarget();
Location cll = app.getLocationProvider().getLastKnownLocation();
ArrayList<TargetPoint> lt = new ArrayList<>(intermediates);
TargetPoint start;
if (cll != null) {
LatLon ll = new LatLon(cll.getLatitude(), cll.getLongitude());
start = TargetPoint.create(ll, null);
} else if (app.getTargetPointsHelper().getPointToStart() != null) {
TargetPoint ps = app.getTargetPointsHelper().getPointToStart();
LatLon ll = new LatLon(ps.getLatitude(), ps.getLongitude());
start = TargetPoint.create(ll, null);
} else {
start = lt.get(0);
}
TargetPoint end = lt.remove(lt.size() - 1);
ArrayList<LatLon> al = new ArrayList<>();
for (TargetPoint p : lt) {
al.add(p.point);
}
return new TspAnt().readGraph(al, start.point, end.point).solve();
}
protected void onPostExecute(int[] result) {
if (dlg != null) {
long t = System.currentTimeMillis();
if (t - startDialogTime < 500) {
app.runInUIThread(new Runnable() {
@Override
public void run() {
dlg.dismiss();
}
}, 500 - (t - startDialogTime));
} else {
dlg.dismiss();
}
}
List<TargetPoint> alocs = new ArrayList<>();
for (int i : result) {
if (i > 0) {
TargetPoint loc = intermediates.get(i - 1);
alocs.add(loc);
}
}
intermediates.clear();
intermediates.addAll(alocs);
TargetPointsHelper targets = app.getTargetPointsHelper();
List<TargetPoint> cur = targets.getIntermediatePointsWithTarget();
boolean eq = true;
for (int j = 0; j < cur.size() && j < intermediates.size(); j++) {
if (cur.get(j) != intermediates.get(j)) {
eq = false;
break;
}
}
if (!eq) {
targets.reorderAllTargetPoints(intermediates, true);
}
}
}.execute();
}
}

View file

@ -12,7 +12,6 @@ import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.util.TypedValue;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@ -45,6 +44,7 @@ import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.controls.SingleTapConfirm;
import net.osmand.util.Algorithms;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
@ -98,41 +98,6 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
private int screenOrientation;
private class SingleTapConfirm implements OnGestureListener {
@Override
public boolean onDown(MotionEvent e) {
return false;
}
@Override
public void onShowPress(MotionEvent e) {
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
return true;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
return false;
}
@Override
public void onLongPress(MotionEvent e) {
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return false;
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,

View file

@ -32,6 +32,8 @@ import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
@ -46,7 +48,6 @@ import java.util.List;
public class DynamicListView extends ObservableListView {
public final String TAG_DRAG_ICON = "DragIcon";
protected final int SMOOTH_SCROLL_AMOUNT_AT_EDGE = 15;
protected final int MOVE_DURATION = 150;
@ -82,6 +83,13 @@ public class DynamicListView extends ObservableListView {
private boolean mIsWaitingForScrollFinish = false;
private int mScrollState = OnScrollListener.SCROLL_STATE_IDLE;
private GestureDetector singleTapDetector;
private DragIcon tag;
public interface DragIcon {
void onClick();
}
public DynamicListView(Context context) {
super(context);
init(context);
@ -101,6 +109,7 @@ public class DynamicListView extends ObservableListView {
setOnScrollListener(mScrollListener);
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
mSmoothScrollAmountAtEdge = (int) (SMOOTH_SCROLL_AMOUNT_AT_EDGE / metrics.density);
singleTapDetector = new GestureDetector(context, new SingleTapConfirm());
}
public void setDynamicListViewCallbacks(DynamicListViewCallbacks callbacks) {
@ -249,7 +258,7 @@ public class DynamicListView extends ObservableListView {
// Draw dividers
StableArrayAdapter stableAdapter = getStableAdapter();
if (stableAdapter != null && stableAdapter.hasDividers()) {
if (getDivider() == null && stableAdapter != null && stableAdapter.hasDividers()) {
List<Drawable> dividers = stableAdapter.getDividers();
final int count = getChildCount();
@ -296,20 +305,28 @@ public class DynamicListView extends ObservableListView {
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
if (singleTapDetector.onTouchEvent(event)) {
if (tag != null) {
tag.onClick();
}
touchEventsCancelled();
return true;
}
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
if (!mCellIsMobile && mHoverCell == null) {
mDownX = (int) event.getX();
mDownY = (int) event.getY();
mActivePointerId = event.getPointerId(0);
// Find the view that the user pressed their finger down on.
View v = findViewAtPositionWithTag(getRootView(), (int) event.getRawX(), (int) event.getRawY(), TAG_DRAG_ICON);
View v = findViewAtPositionWithDragIconTag(getRootView(), (int) event.getRawX(), (int) event.getRawY());
// If the view contains a tag set to "DragIcon", it means that the user wants to
// If the view contains a tag set to "DragIcon" class, it means that the user wants to
// reorder the list item.
if ((v != null) && (v.getTag() != null) && (v.getTag().equals(TAG_DRAG_ICON))) {
if ((v != null) && (v.getTag() != null) && (v.getTag() instanceof DragIcon)) {
mDownX = (int) event.getX();
mDownY = (int) event.getY();
mActivePointerId = event.getPointerId(0);
mTotalOffset = 0;
tag = (DragIcon) v.getTag();
int position = pointToPosition(mDownX, mDownY);
if (position != INVALID_POSITION) {
@ -564,6 +581,7 @@ public class DynamicListView extends ObservableListView {
mBelowItemId = INVALID_ID;
setAllVisible();
mHoverCell = null;
tag = null;
setEnabled(true);
invalidate();
processSwapped();
@ -718,7 +736,7 @@ public class DynamicListView extends ObservableListView {
* @param y The Y location to be tested.
* @return Returns the most inner view that contains the XY coordinate or null if no view could be found.
*/
private View findViewAtPositionWithTag(View v, int x, int y, String tag) {
private View findViewAtPositionWithDragIconTag(View v, int x, int y) {
View vXY = null;
if (v instanceof ViewGroup) {
@ -732,9 +750,9 @@ public class DynamicListView extends ObservableListView {
if ((x >= loc[0] && (x <= (loc[0] + c.getWidth()))) && (y >= loc[1] && (y <= (loc[1] + c.getHeight())))) {
vXY = c;
View viewAtPosition = findViewAtPositionWithTag(c, x, y, tag);
View viewAtPosition = findViewAtPositionWithDragIconTag(c, x, y);
if ((viewAtPosition != null) && (viewAtPosition.getTag() != null) && viewAtPosition.getTag().equals(tag)) {
if ((viewAtPosition != null) && (viewAtPosition.getTag() != null) && viewAtPosition.getTag() instanceof DragIcon) {
vXY = viewAtPosition;
break;
}

View file

@ -0,0 +1,37 @@
package net.osmand.plus.views.controls;
import android.view.GestureDetector;
import android.view.MotionEvent;
public class SingleTapConfirm implements GestureDetector.OnGestureListener {
@Override
public boolean onDown(MotionEvent e) {
return false;
}
@Override
public void onShowPress(MotionEvent e) {
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
return true;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
return false;
}
@Override
public void onLongPress(MotionEvent e) {
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return false;
}
}

View file

@ -472,20 +472,18 @@ public class SwipeDismissListViewTouchListener implements View.OnTouchListener {
* Delete the list item at the specified position. This will animate the item sliding out of the
* list and then collapsing until it vanished (same as if the user slides out an item).
* <p/>
* NOTE: If you are using list headers, be aware, that the position argument must take care of
* them. Meaning 0 references the first list header. So if you want to delete the first list
* item, you have to pass the number of list headers as {@code position}. Most of the times
* that shouldn't be a problem, since you most probably will evaluate the position which should
* be deleted in a way, that respects the list headers.
*/
public void delete(int position) {
if (mCallbacks == null) {
throw new IllegalStateException("You must set an OnDismissCallback, before deleting items.");
}
if (position < 0 || position >= mListView.getCount()) {
throw new IndexOutOfBoundsException(String.format("Tried to delete item %d. #items in list: %d", position, mListView.getCount()));
int pos = position + mListView.getHeaderViewsCount();
if (pos < 0 || pos >= mListView.getCount()) {
throw new IndexOutOfBoundsException(String.format("Tried to delete item %d. #items in list: %d", pos, mListView.getCount()));
}
View childView = mListView.getChildAt(position - mListView.getFirstVisiblePosition());
View childView = mListView.getChildAt(pos - mListView.getFirstVisiblePosition());
View view = null;
if (mSwipingLayout > 0) {
view = childView.findViewById(mSwipingLayout);