Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d73d1cce96
80 changed files with 900 additions and 424 deletions
|
@ -288,5 +288,7 @@
|
|||
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<activity android:name=".liveupdates.LiveUpdatesActivity"/>
|
||||
<receiver android:name="net.osmand.plus.liveupdates.LiveUpdatesAlarmReceiver"/>
|
||||
</application>
|
||||
</manifest>
|
|
@ -50,6 +50,7 @@
|
|||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/editor_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
|
@ -211,6 +212,7 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/description_info_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/left_menu_view_bg">
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?attr/left_menu_view_bg"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
@ -68,6 +68,16 @@
|
|||
android:layout_column="1"
|
||||
android:layout_gravity="right"
|
||||
android:entries="@array/update_frequencies_array"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/updateTimesOfDaySpinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_column="1"
|
||||
android:layout_row="4"
|
||||
android:layout_gravity="right"
|
||||
android:visibility="gone"
|
||||
android:entries="@array/update_times_of_day"/>
|
||||
|
||||
</GridLayout>
|
||||
|
||||
<View
|
||||
|
|
|
@ -298,6 +298,7 @@
|
|||
android:src="@drawable/map_action_fav_dark"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_hor_1"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
@ -313,6 +314,7 @@
|
|||
android:src="@drawable/map_action_flag_dark"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_hor_2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
@ -328,6 +330,7 @@
|
|||
android:src="@drawable/map_action_gshare_dark"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_hor_3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
|
|
@ -208,6 +208,7 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/description_info_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
|
|
|
@ -1282,7 +1282,7 @@ OsmAnd (OSM Automated Navigation Directions) is \\\'n kaart en navigasie toepass
|
|||
|
||||
<string name="rendering_value_brown_name">bruin</string>
|
||||
|
||||
<string name="color_lightblue">ligblou</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1148,9 +1148,9 @@ OsmAnd هو المصدر المفتوح و التي يجري تطويرها بن
|
|||
|
||||
<string name="rendering_value_brown_name">بني</string>
|
||||
|
||||
<string name="color_lightblue">أزرق فاتح</string>
|
||||
|
||||
<string name="color_green">أخضر</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_share_current_session">شارك الجلسة الحالية في المتصفح</string>
|
||||
<string name="hours_ago">ساعة</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources><string name="av_locations">Allugamientos</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="av_locations">Allugamientos</string>
|
||||
<string name="plugin_settings">Complementos</string>
|
||||
<string name="no_updates_available">Nun hai anovamientos disponibles</string>
|
||||
<string name="download_live_updates">Anovamientos en direuto</string>
|
||||
|
|
|
@ -253,9 +253,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">karyčnievy</string>
|
||||
|
||||
<string name="color_lightblue">blakіtny</string>
|
||||
|
||||
<string name="color_green">zialiony</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Źmianіć nalady karystaĺnіka</string>
|
||||
<string name="osmo_edit_color">Vybar kolieru</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources><string name="auto_zoom_none">Без аўтаматычнага маштабаваньня</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="auto_zoom_none">Без аўтаматычнага маштабаваньня</string>
|
||||
<string name="auto_zoom_close">Буйней</string>
|
||||
<string name="auto_zoom_far">Для сярэдняга маштаба</string>
|
||||
<string name="auto_zoom_farthest">Драбней</string>
|
||||
|
@ -1336,7 +1335,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">карычневы</string>
|
||||
|
||||
<string name="color_lightblue">блакітны</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="osb_author_or_password_not_specified">Моля, въведете потребителско име и парола за сайта на OSM</string>
|
||||
<string name="clear_intermediate_points">Изчистване на междинните точки</string>
|
||||
<string name="keep_intermediate_points">Запази междинните точки</string>
|
||||
|
@ -1580,9 +1579,9 @@
|
|||
<string name="osmo_user_name">Потребител</string>
|
||||
<string name="rendering_value_brown_name">кафяв</string>
|
||||
|
||||
<string name="color_lightblue">светло синьо</string>
|
||||
|
||||
<string name="color_green">зелен</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Промяна на свойствата на потребителя</string>
|
||||
<string name="osmo_edit_color">Цвят на показване</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="show_warnings_title">Mostra els missatges d\'avís…</string>
|
||||
<string name="map_widget_fluorescent">Rutes amb fluorescència</string>
|
||||
|
@ -1251,9 +1250,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">marró</string>
|
||||
|
||||
<string name="color_lightblue">blau clar</string>
|
||||
|
||||
<string name="color_green">verd</string>
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Canvia les propietats de l\'usuari</string>
|
||||
<string name="osmo_edit_color">Mostra el color</string>
|
||||
<string name="gpx_file_is_empty">La traça GPX és buida</string>
|
||||
|
@ -1880,7 +1879,7 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="only_download_over_wifi">Baixades només amb WIFI</string>
|
||||
<string name="live_update">Actualitza al moment</string>
|
||||
<string name="update_now">Actualitza ara</string>
|
||||
<string name="route_distance">Distància:</string>
|
||||
<string name="route_distance">Distància:</string>
|
||||
<string name="route_duration">Durada del viatge:</string>
|
||||
<string name="missing_write_external_storage_permission">L\'aplicació no té autorització per utilitzar la memòria SD</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="switch_to_raster_map_to_see">Vektorové mapy toto místo neobsahují. Mapová data můžete stáhnout v Nastaveních (Spravovat mapové soubory), nebo se přepněte na online mapy.</string>
|
||||
<string name="send_files_to_osm">Nahrát GPX soubory do OSM?</string>
|
||||
|
@ -1179,7 +1178,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">hnědá</string>
|
||||
|
||||
<string name="color_lightblue">světle modrá</string>
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Změnit vlastnosti uživatele</string>
|
||||
<string name="osmo_edit_color">Zobrazit barvu</string>
|
||||
|
@ -1860,7 +1859,7 @@
|
|||
<string name="routing_attr_avoid_stairs_name">Vyhnout se schodům</string>
|
||||
<string name="routing_attr_avoid_stairs_description">Vyhnout se schodům</string>
|
||||
<string name="routing_attr_avoid_borders_name">Vyhnout se hraničním přechodům</string>
|
||||
<string name="no_address_determined">Adresa nebyla určena</string>
|
||||
|
||||
<string name="shared_string_near">Nedaleko</string>
|
||||
<string name="shared_string_hide">Skrýt</string>
|
||||
<string name="av_video_quality_low">Nejnižší kvalita</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><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>
|
||||
|
@ -1447,7 +1446,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">Brun</string>
|
||||
|
||||
<string name="color_lightblue">Lyseblå</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -2169,7 +2168,7 @@
|
|||
<string name="routing_attr_avoid_stairs_description">Undgå trapper</string>
|
||||
<string name="routing_attr_avoid_borders_name">Undgå grænseovergang</string>
|
||||
|
||||
<string name="color_purple">Lilla</string>
|
||||
|
||||
<string name="shared_string_hide">Skjul</string>
|
||||
<string name="av_video_quality_low">Laveste kvalitet</string>
|
||||
<string name="av_video_quality_high">Højeste kvalitet</string>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1189,9 +1189,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">καφέ</string>
|
||||
|
||||
<string name="color_lightblue">γαλάζιο</string>
|
||||
|
||||
<string name="color_green">πράσινο</string>
|
||||
|
||||
|
||||
|
||||
<string name="hours_ago">ώρες πριν</string>
|
||||
<string name="minutes_ago">λεπτά πριν</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="rendering_attr_hideHouseNumbers_name">Ocultar números de casa</string>
|
||||
<string name="copying_osmand_file_failed">Falló al copiar archivos</string>
|
||||
|
@ -313,9 +312,9 @@
|
|||
<string name="osmo_edit_color">Mostrar color</string>
|
||||
<string name="osmo_edit_device">Cambiar propiedades de usuario</string>
|
||||
|
||||
<string name="color_blue">azul</string>
|
||||
|
||||
<string name="color_yellow">amarillo</string>
|
||||
|
||||
|
||||
<string name="rendering_value_brown_name">marrón</string>
|
||||
|
||||
<string name="rendering_value_pink_name">rosa</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="layer_map_appearance">Configurar pantalla</string>
|
||||
<string name="show_lanes">Mostrar carriles</string>
|
||||
|
@ -1324,7 +1323,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">marrón</string>
|
||||
|
||||
<string name="color_lightblue">azul claro</string>
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Cambiar propiedades de usuario</string>
|
||||
<string name="osmo_edit_color">Mostrar color</string>
|
||||
|
|
|
@ -1323,9 +1323,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">marroia</string>
|
||||
|
||||
<string name="color_lightblue">urdin argia</string>
|
||||
|
||||
<string name="color_green">berdea</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Aldatu erabiltzailearen propietateak</string>
|
||||
<string name="osmo_edit_color">Erakutsi kolorea</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources><string name="local_osm_changes_backup_failed">پشتیبانگیری از تغییرات OsmAnd ناموفق بود</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="local_osm_changes_backup_failed">پشتیبانگیری از تغییرات OsmAnd ناموفق بود</string>
|
||||
<string name="plugin_distance_point_time">زمان</string>
|
||||
<string name="plugin_distance_point_hdop">دقت</string>
|
||||
<string name="plugin_distance_point_speed">سرعت</string>
|
||||
|
@ -868,7 +867,7 @@
|
|||
|
||||
<string name="download_hillshade_maps">تپه سایه</string>
|
||||
|
||||
<string name="osmand_srtm_long_description_1000_chars">"این افزونه، منحنیهای همتراز را که در نقشههای آفلاین OsmAnd نمایش داده میشوند فراهم میکند. دادههای جهانی (بین 70 درجه شمالی و 70 درجه جنوبی) در این زمینه براساس اندازه گیریهای SRTM (مأموریت توپوگرافی رادار شاتل) و ASTER (رادیومتر انعکاسی و پرتویی حرارتی هوایی پیشرفته)، یک ابزار تصویربرداری پردازنده ترا و ماهواره فوق پیشرفته سیستم نظارتی زمین ناسا مییباشند. ASTER محصول تلاش مشترک میان ناسا، وزارت اقتصاد ژاپن، صنعت و تجارت (متی)، و سیستم های فضایی ژاپن (جی-اسپیس سیستم) است. "</string>
|
||||
<string name="osmand_srtm_long_description_1000_chars">"این افزونه، منحنیهای همتراز را که در نقشههای آفلاین OsmAnd نمایش داده میشوند فراهم میکند. دادههای جهانی (بین 70 درجه شمالی و 70 درجه جنوبی) در این زمینه براساس اندازه گیریهای SRTM (مأموریت توپوگرافی رادار شاتل) و ASTER (رادیومتر انعکاسی و پرتویی حرارتی هوایی پیشرفته)، یک ابزار تصویربرداری پردازنده ترا و ماهواره فوق پیشرفته سیستم نظارتی زمین ناسا مییباشند. ASTER محصول تلاش مشترک میان ناسا، وزارت اقتصاد ژاپن، صنعت و تجارت (متی)، و سیستم های فضایی ژاپن (جی-اسپیس سیستم) است. "</string>
|
||||
<string name="srtm_plugin_description">"این افزونه هم یک لایه خطوط همتراز و هم یک لایه تپه سایه بر روی نقشههای استاندارد OsmAnd اضافه میکند. این قابلیت بسیار به درد قهرمانان، کوهنوردان، جهانگردان و هرکسی که به ساختار زمین علاقمند است میخورد.\nدادههای جهانی (بین ۷۰ درجه شمالی و ۷۰ درجه جنوبی) توسط اندازهگیریهای SRTM (مأموریت رادار توپوگرافی شاتل) و ASTER (تابش حرارتی فضاپایه پیشرفته و رادیومتری انعکاسی)، ایزار تصویربرداری Terra، ماهواره پرچمدار سیستم نظارهگر زمین ناسا انجام شده است. ASTER یک پروژه همکاری مشترک بین ناسا، وزارت اقتصاد ژاپن، وزارت صنعت و بازرگانی و سیستمهای فضایی ژاپن (J-spacesystems) میباشد. "</string>
|
||||
<string name="monitoring_control_start">جی پی ایکس</string>
|
||||
<string name="rendering_attr_noPolygons_description">محو کردن همه عوارض زمین روی نقشه</string>
|
||||
|
@ -1397,7 +1396,7 @@ OsmAnd منبع باز است و فعالانه در حال توسعه است.
|
|||
|
||||
<string name="route_descr_destination">مقصد</string>
|
||||
<string name="create_poi_link_to_osm_doc"> <u>Online OSM</u> map classification with images</string>
|
||||
<string name="app_mode_hiking">پیادهروی</string>
|
||||
<string name="app_mode_hiking">پیادهروی</string>
|
||||
<string name="app_mode_motorcycle">موتورسیکلت</string>
|
||||
<string name="app_mode_boat">قایق</string>
|
||||
<string name="app_mode_aircraft">هواپیما</string>
|
||||
|
@ -1559,9 +1558,9 @@ OsmAnd منبع باز است و فعالانه در حال توسعه است.
|
|||
|
||||
<string name="rendering_value_brown_name">قهوه ای</string>
|
||||
|
||||
<string name="color_lightblue">آبی روشن</string>
|
||||
|
||||
<string name="color_green">سبز</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">تغییر تنظیمات کاربر</string>
|
||||
<string name="osmo_edit_color">نمایش رنگ</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="offline_edition">Modifications hors-ligne</string>
|
||||
<string name="offline_edition_descr">Toujours utiliser l\'édition hors-ligne</string>
|
||||
|
||||
|
@ -1384,7 +1383,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">Brun</string>
|
||||
|
||||
<string name="color_lightblue">Bleu clair</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="fav_point_dublicate_message">O nome do punto favorito xa está usado; foi cambiado a %1$s para evitar os duplicados.</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="fav_point_dublicate_message">O nome do punto favorito xa está usado; foi cambiado a %1$s para evitar os duplicados.</string>
|
||||
<string name="text_size_descr">Configurar o tamaño da letra no mapa.</string>
|
||||
<string name="text_size">Tamaño da letra</string>
|
||||
<string name="traffic_warning_speed_limit">Límite de velocidade</string>
|
||||
|
@ -178,9 +178,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">marrón</string>
|
||||
|
||||
<string name="color_lightblue">azul claro</string>
|
||||
|
||||
<string name="color_green">verde</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Cambiar as propiedades do usuario</string>
|
||||
<string name="osmo_edit_color">Cor da pantalla</string>
|
||||
|
|
|
@ -1228,9 +1228,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">smeđa</string>
|
||||
|
||||
<string name="color_lightblue">svijetloplava</string>
|
||||
|
||||
<string name="color_green">zelena</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_color">Boja prikaza</string>
|
||||
<string name="osmo_expire_group">Istječe u</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="send_files_to_osm">GPX fájl küldése OSM-re?</string>
|
||||
<string name="gpx_visibility_txt">Láthatóság</string>
|
||||
<string name="gpx_tags_txt">Címkék</string>
|
||||
|
@ -1324,7 +1323,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">barna</string>
|
||||
|
||||
<string name="color_lightblue">világoskék</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="use_fluorescent_overlays">Sovrapposizioni fluorescenti</string>
|
||||
<string name="use_fluorescent_overlays_descr">Usa colori fluorescenti per visualizzare tracce e percorsi</string>
|
||||
<string name="offline_edition">Modifiche offline</string>
|
||||
|
@ -1367,7 +1366,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">marrone</string>
|
||||
|
||||
<string name="color_lightblue">blu chiaro</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1452,9 +1452,9 @@ POIの更新は利用できません</string>
|
|||
|
||||
<string name="rendering_value_brown_name">ブラウン</string>
|
||||
|
||||
<string name="color_lightblue">ライトブルー</string>
|
||||
|
||||
<string name="color_green">グリーン</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">ユーザープロパティの変更</string>
|
||||
<string name="osmo_edit_color">表示色</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources><string name="offline_navigation_not_available">OsmAnd-ით ნავიგაცია გათიშულ რეჟიმში დროებით მიუწვდომელია.</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="offline_navigation_not_available">OsmAnd-ით ნავიგაცია გათიშულ რეჟიმში დროებით მიუწვდომელია.</string>
|
||||
<string name="left_side_navigation">მარცხენა ხელით ტარება</string>
|
||||
<string name="left_side_navigation_descr">აირჩიეთ მარცხენა მხარეს საჭის გამომყენებელი ქვეყნებისათვის</string>
|
||||
|
||||
|
|
|
@ -1594,7 +1594,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">갈색</string>
|
||||
|
||||
<string name="color_lightblue">밝은 청색</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="local_indexes_cat_av">زانیاری دەنگ/ڤیدیۆ</string>
|
||||
<string name="stop_routing_confirm">دڵنیای له وەی که ئه ته وێت ناڤیگێشن راگریت</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="starting_point_too_far">Pradžios taškas yra per toli nuo artimiausio kelio.</string>
|
||||
<string name="shared_location">Bendrinta vieta</string>
|
||||
<string name="osmand_parking_warning">Dėmesio</string>
|
||||
|
@ -1397,9 +1396,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">ruda</string>
|
||||
|
||||
<string name="color_lightblue">žydra</string>
|
||||
|
||||
<string name="color_green">žalia</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Pakeisti vartotojo nustatymus</string>
|
||||
<string name="osmo_edit_color">Rodoma spalva</string>
|
||||
|
|
|
@ -1564,7 +1564,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
|
||||
<string name="rendering_value_brown_name">brūns</string>
|
||||
|
||||
<string name="color_lightblue">gaiši zils</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -895,9 +895,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">brun</string>
|
||||
|
||||
<string name="color_lightblue">lyseblå</string>
|
||||
|
||||
<string name="color_green">grønn</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_group_info">Info</string>
|
||||
<string name="osmo_track_interval">Loggeintervall</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="layer_map_appearance">Configureer scherm</string>
|
||||
<string name="show_lanes">Toon rijstroken</string>
|
||||
|
@ -1406,7 +1405,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">bruin</string>
|
||||
|
||||
<string name="color_lightblue">lichtblauw</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">brun</string>
|
||||
|
||||
<string name="color_lightblue">lyseblå</string>
|
||||
|
||||
<string name="color_green">grøn</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Endra brukareigenskapar</string>
|
||||
<string name="osmo_edit_color">Vis fargar</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="use_transparent_map_theme">Przezroczysty styl</string>
|
||||
<string name="native_library_not_supported">To urządzenie nie obsługuje biblioteki renderowania natywnego.</string>
|
||||
|
@ -1396,7 +1395,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">brązowy</string>
|
||||
|
||||
<string name="color_lightblue">jasnoniebieski</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources><string name="shared_string_my_places">Meus locais</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><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>
|
||||
|
@ -466,9 +465,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">marrom</string>
|
||||
|
||||
<string name="color_lightblue">azul claro</string>
|
||||
|
||||
<string name="color_green">verde</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Alterar as propriedades do usuário</string>
|
||||
<string name="osmo_edit_color">Mostrar cor</string>
|
||||
|
|
|
@ -1363,9 +1363,9 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
|
||||
<string name="rendering_value_brown_name">castanho</string>
|
||||
|
||||
<string name="color_lightblue">azul claro</string>
|
||||
|
||||
<string name="color_green">verde</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Mudar propriedades do utilizador</string>
|
||||
<string name="osmo_edit_color">Mostrar cor</string>
|
||||
|
|
|
@ -1332,9 +1332,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">maro</string>
|
||||
|
||||
<string name="color_lightblue">albastru deschis</string>
|
||||
|
||||
<string name="color_green">verde</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Schimbă proprietăți utilizator</string>
|
||||
<string name="osmo_edit_color">Culoare afișare</string>
|
||||
|
|
|
@ -382,7 +382,6 @@
|
|||
<string name="poi_studio">Студия звукозаписи, телестудия</string>
|
||||
<string name="poi_bookmaker">Букмекерская контора</string>
|
||||
<string name="poi_office_religion">Офис религиозной организации</string>
|
||||
<string name="poi_association">Офис общества, ассоциации</string>
|
||||
<string name="poi_financial">Финансовая контора</string>
|
||||
<string name="poi_political_party">Офис политической партии</string>
|
||||
<string name="poi_notary">Нотариус</string>
|
||||
|
@ -918,8 +917,8 @@
|
|||
<string name="poi_wheelchair_no">Недоступно для инвалидных кресел</string>
|
||||
<string name="poi_wheelchair_limited">Инвалидные кресла: ограничено</string>
|
||||
<string name="poi_wholesale">Опт</string>
|
||||
<string name="poi_parking_underground">Подземный(ая)</string>
|
||||
<string name="poi_parking_multi_storey">Многоэтажный(ая)</string>
|
||||
<string name="poi_parking_underground">Тип: подземная</string>
|
||||
<string name="poi_parking_multi_storey">Тип: многоэтажная</string>
|
||||
|
||||
<string name="poi_bicycle_parking_anchors">Закреплённое кольцо</string>
|
||||
<string name="poi_bicycle_parking_stands">Стойка</string>
|
||||
|
@ -1122,7 +1121,7 @@
|
|||
<string name="poi_farmland">Сельскохозяйственные угодья</string>
|
||||
<string name="poi_logging">Вырубка</string>
|
||||
<string name="poi_sand">Песок</string>
|
||||
<string name="poi_village_green">Общественная территория в центре населённого пункта</string>
|
||||
<string name="poi_village_green">Общественная территория</string>
|
||||
<string name="poi_brownfield">Земли под застройку (использованные ранее)</string>
|
||||
<string name="poi_greenfield">Земли под застройку</string>
|
||||
<string name="poi_bunker_silo">Сооружение для хранения силоса</string>
|
||||
|
@ -2545,4 +2544,15 @@
|
|||
|
||||
<string name="poi_billiards">Бильярд</string>
|
||||
|
||||
<string name="poi_microwave_oven_yes">Микроволновая печь: присутствует</string>
|
||||
<string name="poi_microwave_oven_no">Микроволновая печь: отсутствует</string>
|
||||
<string name="poi_water_heater_yes">Водонагреватель: присутствует</string>
|
||||
<string name="poi_water_heater_no">Водонагреватель: отсутствует</string>
|
||||
|
||||
<string name="poi_parking_surface">Тип: на поверхности</string>
|
||||
<string name="poi_parking_garage_boxes">Тип: гаражи</string>
|
||||
<string name="poi_parking_carports">Тип: навес</string>
|
||||
|
||||
<string name="poi_dojo">Додзё</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1251,7 +1251,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">коричневый</string>
|
||||
|
||||
<string name="color_lightblue">голубой</string>
|
||||
|
||||
|
||||
<string name="osmo_create_groups_confirm">Чтобы создавать группы Вы должны быть зарегистрированным пользователем OsMo.</string>
|
||||
<string name="osmo_sign_in">Войти</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="always_center_position_on_map">Ammustra sa positzione semper a su tzentru</string>
|
||||
<string name="voice_pref_title">Boghe</string>
|
||||
<string name="misc_pref_title">Mistura</string>
|
||||
|
@ -537,9 +536,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">castàngiu</string>
|
||||
|
||||
<string name="color_lightblue">blu lepiu</string>
|
||||
|
||||
<string name="color_green">birde</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Muda sas propriedades de s’impitadore</string>
|
||||
<string name="osmo_edit_color">Colore visualizzau</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
|
||||
<string name="recording_context_menu_show">Zobraziť</string>
|
||||
<string name="recording_photo_description">Fotografia %1$s %2$s</string>
|
||||
|
@ -1240,7 +1239,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda,
|
|||
|
||||
<string name="rendering_value_brown_name">hnedá</string>
|
||||
|
||||
<string name="color_lightblue">svetlomodrá</string>
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Zmeniť vlastnosti používateľa</string>
|
||||
<string name="osmo_edit_color">Zobrazovaná farba</string>
|
||||
|
@ -1937,7 +1936,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda,
|
|||
<string name="routing_attr_avoid_stairs_description">Vyhnúť sa schodom</string>
|
||||
<string name="routing_attr_avoid_borders_name">Vyhnúť sa hraničným priechodom</string>
|
||||
|
||||
<string name="color_purple">fialová</string>
|
||||
|
||||
<string name="shared_string_near">Blízko</string>
|
||||
<string name="shared_string_hide">Skryť</string>
|
||||
<string name="av_video_quality_low">Najnižšia kvalita</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="search_button">Poišči</string>
|
||||
<string name="search_activity">Iskanje podatkov</string>
|
||||
|
||||
|
@ -1328,9 +1327,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">rjava</string>
|
||||
|
||||
<string name="color_lightblue">svetlo modra</string>
|
||||
|
||||
<string name="color_green">zelena</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Spremeni nastavitve uporabnika</string>
|
||||
<string name="osmo_edit_color">Barva oznake točke:</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="about_version">Верзија:</string>
|
||||
<string name="shared_string_about">Oko</string>
|
||||
<string name="about_settings_descr">Верзија инфо, лиценце, чланови пројекта</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><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>
|
||||
|
@ -1315,7 +1314,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">brun</string>
|
||||
|
||||
<string name="color_lightblue">ljusblå</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources><string name="close_changeset">Değişiklik listesini kapat</string>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><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>
|
||||
|
@ -1285,9 +1284,9 @@
|
|||
|
||||
<string name="rendering_value_brown_name">kahverengi</string>
|
||||
|
||||
<string name="color_lightblue">açık mavi</string>
|
||||
|
||||
<string name="color_green">yeşil</string>
|
||||
|
||||
|
||||
|
||||
<string name="av_locations_descr">Not yerleri ile GPX dosyası</string>
|
||||
<string name="av_locations">Lokasyonlar</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="asap">Швидко</string>
|
||||
|
||||
<string name="route_roundabout">Круговий рух : %1$d з’їзд</string>
|
||||
|
@ -1406,9 +1405,9 @@ OsmAnd має відкриті сирці і активно розвиваєть
|
|||
|
||||
<string name="rendering_value_brown_name">коричневий</string>
|
||||
|
||||
<string name="color_lightblue">блакитний</string>
|
||||
|
||||
<string name="color_green">зелений</string>
|
||||
|
||||
|
||||
|
||||
<string name="osmo_edit_device">Змінити властивості користувача</string>
|
||||
<string name="osmo_edit_color">Колір</string>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<string name="rendering_attr_roadColors_description">選擇道路的色彩調配:</string>
|
||||
<string name="rendering_attr_roadColors_name">道路的色彩調配</string>
|
||||
<string name="map_widget_show_destination_arrow">顯示目的地方向</string>
|
||||
|
@ -1317,7 +1316,7 @@
|
|||
|
||||
<string name="rendering_value_brown_name">棕色</string>
|
||||
|
||||
<string name="color_lightblue">淺藍色</string>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="primary_text_light">#de000000</color>
|
||||
<color name="secondary_text_light">#8a000000</color>
|
||||
<color name="primary_text_dark">#ffffffff</color>
|
||||
<color name="secondary_text_dark">#b3ffffff</color>
|
||||
|
||||
<color name="audio_video_icon_color">#128a89</color>
|
||||
<color name="created_poi_icon_color">#4caf50</color>
|
||||
<color name="osm_bug_unresolved_icon_color">#d44a4a</color>
|
||||
|
|
|
@ -1163,8 +1163,8 @@
|
|||
<string name="poi_trade_tile">Tile supplies</string>
|
||||
|
||||
<string name="poi_population">Population</string>
|
||||
<string name="poi_parking_underground">Underground</string>
|
||||
<string name="poi_parking_multi_storey">Multi-storey</string>
|
||||
<string name="poi_parking_underground">Type: underground</string>
|
||||
<string name="poi_parking_multi_storey">Type: multi-storey</string>
|
||||
|
||||
<string name="poi_bicycle_parking_anchors">Anchors</string>
|
||||
<string name="poi_bicycle_parking_stands">Stands</string>
|
||||
|
@ -2539,4 +2539,15 @@
|
|||
|
||||
<string name="poi_billiards">Billiards</string>
|
||||
|
||||
<string name="poi_microwave_oven_yes">Microwave oven: yes</string>
|
||||
<string name="poi_microwave_oven_no">Microwave oven: no</string>
|
||||
<string name="poi_water_heater_yes">Water heater: yes</string>
|
||||
<string name="poi_water_heater_no">Water heater: no</string>
|
||||
|
||||
<string name="poi_parking_surface">Type: surface</string>
|
||||
<string name="poi_parking_garage_boxes">Type: garage boxes</string>
|
||||
<string name="poi_parking_carports">Type: carports</string>
|
||||
|
||||
<string name="poi_dojo">Dojo</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
<item>Once a day</item>
|
||||
<item>Weekly</item>
|
||||
</string-array>
|
||||
<string-array name="update_times_of_day">
|
||||
<item>Morning</item>
|
||||
<item>Evening</item>
|
||||
</string-array>
|
||||
<string name="rendering_attr_horseRoutes_name">Horse routes</string>
|
||||
<string name="no_address_found">No address determined</string>
|
||||
<string name="shared_string_near">Near</string>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package net.osmand;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
|
@ -11,6 +9,11 @@ import android.text.format.DateFormat;
|
|||
import android.view.View;
|
||||
import android.view.ViewParent;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AndroidUtils {
|
||||
|
||||
|
@ -77,4 +80,27 @@ public class AndroidUtils {
|
|||
view.setBackgroundDrawable(ctx.getResources().getDrawable(night ? darkResId : lightResId));
|
||||
}
|
||||
}
|
||||
|
||||
public static void setDashButtonBackground(Context ctx, View view, boolean night) {
|
||||
setBackground(ctx, view, night, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
}
|
||||
|
||||
public static void setTextPrimaryColor(Context ctx, TextView textView, boolean night) {
|
||||
textView.setTextColor(night ?
|
||||
ctx.getResources().getColor(R.color.primary_text_dark)
|
||||
: ctx.getResources().getColor(R.color.primary_text_light));
|
||||
}
|
||||
|
||||
public static void setTextSecondaryColor(Context ctx, TextView textView, boolean night) {
|
||||
textView.setTextColor(night ?
|
||||
ctx.getResources().getColor(R.color.secondary_text_dark)
|
||||
: ctx.getResources().getColor(R.color.secondary_text_light));
|
||||
}
|
||||
|
||||
public static void setHintTextSecondaryColor(Context ctx, TextView textView, boolean night) {
|
||||
textView.setHintTextColor(night ?
|
||||
ctx.getResources().getColor(R.color.secondary_text_dark)
|
||||
: ctx.getResources().getColor(R.color.secondary_text_light));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.widget.ImageView;
|
|||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.activities.actions.AppModeDialog;
|
||||
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
||||
|
@ -330,7 +331,7 @@ public class ContextMenuAdapter {
|
|||
Integer lid = getLayoutId(position);
|
||||
if (lid == R.layout.mode_toggles) {
|
||||
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>();
|
||||
return AppModeDialog.prepareAppModeDrawerView(activity, visibleModes, selected, allModes, false, new View.OnClickListener() {
|
||||
return AppModeDialog.prepareAppModeDrawerView(activity, visibleModes, selected, allModes, true, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (selected.size() > 0) {
|
||||
|
@ -348,6 +349,9 @@ public class ContextMenuAdapter {
|
|||
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) {
|
||||
|
|
|
@ -763,6 +763,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents,
|
|||
mapLayers.getMapInfoLayer().recreateControls();
|
||||
}
|
||||
mapLayers.updateLayers(mapView);
|
||||
mapActions.updateDrawerMenu();
|
||||
mapView.setComplexZoom(mapView.getZoom(), mapView.getSettingsMapDensity());
|
||||
app.getDaynightHelper().startSensorIfNeeded(new StateChangedListener<Boolean>() {
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import android.app.Activity;
|
|||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
@ -797,15 +799,19 @@ public class MapActivityActions implements DialogProvider {
|
|||
menu.show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void updateDrawerMenu() {
|
||||
boolean nightMode = getMyApplication().getDaynightHelper().isNightMode();
|
||||
final ListView menuItemsListView = (ListView) mapActivity.findViewById(R.id.menuItems);
|
||||
if (nightMode) {
|
||||
menuItemsListView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_dark));
|
||||
} else {
|
||||
menuItemsListView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_light));
|
||||
}
|
||||
menuItemsListView.setDivider(null);
|
||||
final ContextMenuAdapter contextMenuAdapter = createMainOptionsMenu();
|
||||
contextMenuAdapter.setDefaultLayoutId(R.layout.simple_list_menu_item);
|
||||
final ArrayAdapter<?> simpleListAdapter = contextMenuAdapter.createListAdapter(mapActivity,
|
||||
settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME);
|
||||
!nightMode);
|
||||
menuItemsListView.setAdapter(simpleListAdapter);
|
||||
menuItemsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -1018,7 +1018,11 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
public void takePhoto(final double lat, final double lon, final MapActivity mapActivity) {
|
||||
if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA)
|
||||
== PackageManager.PERMISSION_GRANTED) {
|
||||
if (AV_EXTERNAL_PHOTO_CAM.get()) {
|
||||
takePhotoExternal(lat, lon, mapActivity);
|
||||
} else {
|
||||
takePhotoInternalOrExternal(lat, lon, mapActivity);
|
||||
}
|
||||
} else {
|
||||
actionLat = lat;
|
||||
actionLon = lon;
|
||||
|
|
|
@ -95,7 +95,8 @@ public class DashWaypointsFragment extends DashLocationFragment {
|
|||
LocationPointWrapper ps = allPoints.get(i);
|
||||
View dv = getActivity().getLayoutInflater().inflate(R.layout.divider, null);
|
||||
favorites.addView(dv);
|
||||
View v = WaypointDialogHelper.updateWaypointItemView(false, null, getMyApplication(), getActivity(), null, ps, null);
|
||||
View v = WaypointDialogHelper.updateWaypointItemView(false, null, getMyApplication(),
|
||||
getActivity(), null, ps, null, !getMyApplication().getSettings().isLightContent());
|
||||
favorites.addView(v);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,12 +2,15 @@ package net.osmand.plus.dashboard;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
|
@ -57,9 +60,13 @@ import net.osmand.plus.views.OsmandMapTileView;
|
|||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
@ -124,6 +131,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
private final int[] running = new int[]{-1};
|
||||
private List<LocationPointWrapper> deletedPoints = new ArrayList<>();
|
||||
private Drawable gradientToolbar;
|
||||
boolean nightMode;
|
||||
|
||||
public DashFragmentData[] getFragmentsData() {
|
||||
return fragmentsData;
|
||||
|
@ -136,9 +144,22 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
CONFIGURE_SCREEN,
|
||||
CONFIGURE_MAP,
|
||||
LIST_MENU,
|
||||
ROUTE_SETTINGS,
|
||||
DASHBOARD
|
||||
}
|
||||
|
||||
private Map<DashboardActionButtonType, DashboardActionButton> actionButtons = new HashMap<>();
|
||||
|
||||
public enum DashboardActionButtonType {
|
||||
MY_LOCATION,
|
||||
NAVIGATE
|
||||
}
|
||||
|
||||
private class DashboardActionButton {
|
||||
private Drawable icon;
|
||||
private View.OnClickListener onClickListener;
|
||||
}
|
||||
|
||||
public DashboardOnMap(MapActivity ma) {
|
||||
this.mapActivity = ma;
|
||||
}
|
||||
|
@ -181,7 +202,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
dashboardView.findViewById(R.id.animateContent).setOnClickListener(listener);
|
||||
dashboardView.findViewById(R.id.map_part_dashboard).setOnClickListener(listener);
|
||||
|
||||
initActionButton();
|
||||
initActionButtons();
|
||||
dashboardView.addView(actionButton);
|
||||
}
|
||||
|
||||
|
@ -312,7 +333,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
}
|
||||
|
||||
|
||||
private void initActionButton() {
|
||||
private void initActionButtons() {
|
||||
actionButton = new ImageView(mapActivity);
|
||||
int btnSize = (int) mapActivity.getResources().getDimension(R.dimen.map_button_size);
|
||||
int topPad = (int) mapActivity.getResources().getDimension(R.dimen.dashboard_map_top_padding);
|
||||
|
@ -325,11 +346,13 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
params.gravity = landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT;
|
||||
actionButton.setLayoutParams(params);
|
||||
actionButton.setScaleType(ScaleType.CENTER);
|
||||
actionButton.setImageDrawable(mapActivity.getResources().getDrawable(R.drawable.map_my_location));
|
||||
|
||||
actionButton.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.btn_circle_blue));
|
||||
hideActionButton();
|
||||
actionButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
|
||||
DashboardActionButton myLocationButton = new DashboardActionButton();
|
||||
myLocationButton.icon = mapActivity.getResources().getDrawable(R.drawable.map_my_location);
|
||||
myLocationButton.onClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (getMyApplication().accessibilityEnabled()) {
|
||||
|
@ -339,9 +362,38 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
}
|
||||
hideDashboard();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
DashboardActionButton navigateButton = new DashboardActionButton();
|
||||
navigateButton.icon = mapActivity.getResources().getDrawable(R.drawable.map_start_navigation);
|
||||
navigateButton.onClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
hideDashboard();
|
||||
}
|
||||
};
|
||||
|
||||
actionButtons.put(DashboardActionButtonType.MY_LOCATION, myLocationButton);
|
||||
actionButtons.put(DashboardActionButtonType.NAVIGATE, navigateButton);
|
||||
}
|
||||
|
||||
private void setActionButton(DashboardType type) {
|
||||
DashboardActionButton button = null;
|
||||
|
||||
if (type == DashboardType.DASHBOARD
|
||||
|| type == DashboardType.LIST_MENU
|
||||
|| type == DashboardType.CONFIGURE_SCREEN) {
|
||||
button = actionButtons.get(DashboardActionButtonType.MY_LOCATION);
|
||||
} else if (type == DashboardType.ROUTE_SETTINGS) {
|
||||
button = actionButtons.get(DashboardActionButtonType.NAVIGATE);
|
||||
}
|
||||
|
||||
if (button != null) {
|
||||
actionButton.setImageDrawable(button.icon);
|
||||
actionButton.setOnClickListener(button.onClickListener);
|
||||
}
|
||||
}
|
||||
|
||||
private void hideActionButton() {
|
||||
actionButton.setVisibility(View.GONE);
|
||||
|
@ -403,6 +455,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
if (visible == this.visible && type == visibleType) {
|
||||
return;
|
||||
}
|
||||
nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightMode();
|
||||
this.previousVisibleType = prevItem;
|
||||
this.visible = visible;
|
||||
boolean refresh = this.visibleType == type;
|
||||
|
@ -419,6 +472,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
mapActivity.disableDrawer();
|
||||
dashboardView.setVisibility(View.VISIBLE);
|
||||
if (isActionButtonVisible()) {
|
||||
setActionButton(visibleType);
|
||||
actionButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
hideActionButton();
|
||||
|
@ -444,6 +498,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
updateListAdapter();
|
||||
updateListBackgroundHeight();
|
||||
}
|
||||
applyDayNightMode();
|
||||
}
|
||||
mapActivity.findViewById(R.id.toolbar_back).setVisibility(isBackButtonVisible() ? View.VISIBLE : View.GONE);
|
||||
mapActivity.findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.INVISIBLE);
|
||||
|
@ -466,18 +521,49 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
}
|
||||
}
|
||||
|
||||
private void applyDayNightMode() {
|
||||
if (nightMode) {
|
||||
if (listBackgroundView != null) {
|
||||
listBackgroundView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_dark));
|
||||
} else {
|
||||
listView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_dark));
|
||||
}
|
||||
Drawable d = new ColorDrawable(mapActivity.getResources().getColor(R.color.dashboard_divider_dark));
|
||||
listView.setDivider(d);
|
||||
listView.setDividerHeight(dpToPx(1f));
|
||||
} else {
|
||||
if (listBackgroundView != null) {
|
||||
listBackgroundView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_light));
|
||||
} else {
|
||||
listView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_light));
|
||||
}
|
||||
Drawable d = new ColorDrawable(mapActivity.getResources().getColor(R.color.dashboard_divider_light));
|
||||
listView.setDivider(d);
|
||||
listView.setDividerHeight(dpToPx(1f));
|
||||
}
|
||||
}
|
||||
|
||||
private int dpToPx(float dp) {
|
||||
Resources r = mapActivity.getResources();
|
||||
return (int) TypedValue.applyDimension(
|
||||
COMPLEX_UNIT_DIP,
|
||||
dp,
|
||||
r.getDisplayMetrics()
|
||||
);
|
||||
}
|
||||
|
||||
private void updateListAdapter() {
|
||||
ContextMenuAdapter cm = null;
|
||||
if (DashboardType.WAYPOINTS == visibleType || DashboardType.WAYPOINTS_FLAT == visibleType) {
|
||||
ArrayAdapter<Object> listAdapter = waypointDialogHelper.getWaypointsDrawerAdapter(false, deletedPoints, mapActivity, running,
|
||||
DashboardType.WAYPOINTS_FLAT == visibleType);
|
||||
DashboardType.WAYPOINTS_FLAT == visibleType, nightMode);
|
||||
OnItemClickListener listener = waypointDialogHelper.getDrawerItemClickListener(mapActivity, running,
|
||||
listAdapter);
|
||||
updateListAdapter(listAdapter, listener);
|
||||
} else if (DashboardType.WAYPOINTS_EDIT == visibleType) {
|
||||
deletedPoints.clear();
|
||||
ArrayAdapter<Object> listAdapter = waypointDialogHelper.getWaypointsDrawerAdapter(true, deletedPoints, mapActivity, running,
|
||||
DashboardType.WAYPOINTS_FLAT == visibleType);
|
||||
DashboardType.WAYPOINTS_FLAT == visibleType, nightMode);
|
||||
OnItemClickListener listener = waypointDialogHelper.getDrawerItemClickListener(mapActivity, running,
|
||||
listAdapter);
|
||||
updateListAdapter(listAdapter, listener);
|
||||
|
@ -497,8 +583,12 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
}
|
||||
|
||||
public void updateListAdapter(ContextMenuAdapter cm) {
|
||||
final ArrayAdapter<?> listAdapter = cm.createListAdapter(mapActivity, getMyApplication().getSettings()
|
||||
.isLightContent());
|
||||
boolean nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightMode();
|
||||
if (this.nightMode != nightMode) {
|
||||
this.nightMode = nightMode;
|
||||
applyDayNightMode();
|
||||
}
|
||||
final ArrayAdapter<?> listAdapter = cm.createListAdapter(mapActivity, !nightMode);
|
||||
OnItemClickListener listener = getOptionsMenuOnClickListener(cm, listAdapter);
|
||||
updateListAdapter(listAdapter, listener);
|
||||
}
|
||||
|
@ -765,7 +855,10 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
|
|||
}
|
||||
|
||||
private boolean isActionButtonVisible() {
|
||||
return visibleType == DashboardType.DASHBOARD || visibleType == DashboardType.LIST_MENU || visibleType == DashboardType.CONFIGURE_SCREEN;
|
||||
return visibleType == DashboardType.DASHBOARD
|
||||
|| visibleType == DashboardType.LIST_MENU
|
||||
|| visibleType == DashboardType.ROUTE_SETTINGS
|
||||
|| visibleType == DashboardType.CONFIGURE_SCREEN;
|
||||
}
|
||||
|
||||
private boolean isBackButtonVisible() {
|
||||
|
|
|
@ -39,15 +39,15 @@ public class DownloadValidationManager {
|
|||
return downloadThread;
|
||||
}
|
||||
|
||||
public void startDownload(FragmentActivity activity, IndexItem... items) {
|
||||
downloadFilesWithAllChecks(activity, items);
|
||||
public void startDownload(Context context, IndexItem... items) {
|
||||
downloadFilesWithAllChecks(context, items);
|
||||
}
|
||||
|
||||
public OsmandApplication getMyApplication() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void downloadFilesCheck_3_ValidateSpace(final FragmentActivity activity, final IndexItem... items) {
|
||||
public void downloadFilesCheck_3_ValidateSpace(final Context context, final IndexItem... items) {
|
||||
long szLong = 0;
|
||||
int i = 0;
|
||||
for (IndexItem es : downloadThread.getCurrentDownloadingItems()) {
|
||||
|
@ -62,65 +62,68 @@ public class DownloadValidationManager {
|
|||
// get availabile space
|
||||
double asz = downloadThread.getAvailableSpace();
|
||||
if (asz != -1 && asz > 0 && sz / asz > 0.4) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setMessage(MessageFormat.format(activity.getString(R.string.download_files_question_space), i, sz, asz));
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setMessage(MessageFormat.format(context.getString(R.string.download_files_question_space), i, sz, asz));
|
||||
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
downloadFileCheck_Final_Run(activity, items);
|
||||
downloadFileCheck_Final_Run(context, items);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.shared_string_no, null);
|
||||
builder.show();
|
||||
} else {
|
||||
downloadFileCheck_Final_Run(activity, items);
|
||||
downloadFileCheck_Final_Run(context, items);
|
||||
}
|
||||
}
|
||||
|
||||
private void downloadFileCheck_Final_Run(FragmentActivity activity, IndexItem[] items) {
|
||||
private void downloadFileCheck_Final_Run(Context context, IndexItem[] items) {
|
||||
downloadThread.runDownloadFiles(items);
|
||||
if (activity instanceof DownloadEvents) {
|
||||
((DownloadEvents) activity).downloadInProgress();
|
||||
if (context instanceof DownloadEvents) {
|
||||
((DownloadEvents) context).downloadInProgress();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void downloadFilesWithAllChecks(FragmentActivity activity, IndexItem[] items) {
|
||||
downloadFilesCheck_1_FreeVersion(activity, items);
|
||||
protected void downloadFilesWithAllChecks(Context context, IndexItem[] items) {
|
||||
downloadFilesCheck_1_FreeVersion(context, items);
|
||||
}
|
||||
|
||||
protected void downloadFilesCheck_1_FreeVersion(FragmentActivity activity, IndexItem[] items) {
|
||||
protected void downloadFilesCheck_1_FreeVersion(Context context, IndexItem[] items) {
|
||||
if (Version.isFreeVersion(getMyApplication())) {
|
||||
int total = settings.NUMBER_OF_FREE_DOWNLOADS.get();
|
||||
if (total > MAXIMUM_AVAILABLE_FREE_DOWNLOADS) {
|
||||
if (context instanceof FragmentActivity) {
|
||||
FragmentActivity activity = (FragmentActivity) context;
|
||||
new InstallPaidVersionDialogFragment()
|
||||
.show(activity.getSupportFragmentManager(), InstallPaidVersionDialogFragment.TAG);
|
||||
} else {
|
||||
downloadFilesCheck_2_Internet(activity, items);
|
||||
}
|
||||
} else {
|
||||
downloadFilesCheck_2_Internet(activity, items);
|
||||
downloadFilesCheck_2_Internet(context, items);
|
||||
}
|
||||
} else {
|
||||
downloadFilesCheck_2_Internet(context, items);
|
||||
}
|
||||
}
|
||||
|
||||
protected void downloadFilesCheck_2_Internet(final FragmentActivity activity, final IndexItem[] items) {
|
||||
protected void downloadFilesCheck_2_Internet(final Context context, final IndexItem[] items) {
|
||||
if (!getMyApplication().getSettings().isWifiConnected()) {
|
||||
if (getMyApplication().getSettings().isInternetConnectionAvailable()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setMessage(activity.getString(R.string.download_using_mobile_internet));
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setMessage(context.getString(R.string.download_using_mobile_internet));
|
||||
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
downloadFilesCheck_3_ValidateSpace(activity, items);
|
||||
downloadFilesCheck_3_ValidateSpace(context, items);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.shared_string_no, null);
|
||||
builder.show();
|
||||
} else {
|
||||
AccessibleToast.makeText(activity, R.string.no_index_file_to_download, Toast.LENGTH_LONG).show();
|
||||
AccessibleToast.makeText(context, R.string.no_index_file_to_download, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
downloadFilesCheck_3_ValidateSpace(activity, items);
|
||||
downloadFilesCheck_3_ValidateSpace(context, items);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import android.widget.ImageButton;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.data.FavouritePoint;
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.LocationPoint;
|
||||
import net.osmand.data.PointDescription;
|
||||
|
@ -59,10 +59,12 @@ public class WaypointDialogHelper {
|
|||
}
|
||||
|
||||
public static void updatePointInfoView(final OsmandApplication app, final Activity activity,
|
||||
View localView, final LocationPointWrapper ps, final boolean mapCenter) {
|
||||
View localView, final LocationPointWrapper ps,
|
||||
final boolean mapCenter, final boolean nightMode) {
|
||||
WaypointHelper wh = app.getWaypointHelper();
|
||||
final LocationPoint point = ps.getPoint();
|
||||
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
|
||||
AndroidUtils.setTextPrimaryColor(activity, text, nightMode);
|
||||
TextView textShadow = (TextView) localView.findViewById(R.id.waypoint_text_shadow);
|
||||
localView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -112,7 +114,7 @@ public class WaypointDialogHelper {
|
|||
|
||||
public ArrayAdapter<Object> getWaypointsDrawerAdapter(
|
||||
final boolean edit, final List<LocationPointWrapper> deletedPoints,
|
||||
final MapActivity ctx, final int[] running, final boolean flat) {
|
||||
final MapActivity ctx, final int[] running, final boolean flat, final boolean nightMode) {
|
||||
final List<Object> points;
|
||||
if(flat) {
|
||||
points = new ArrayList<Object>(waypointHelper.getAllPoints());
|
||||
|
@ -130,12 +132,12 @@ public class WaypointDialogHelper {
|
|||
boolean labelView = (getItem(position) instanceof Integer);
|
||||
if (getItem(position) instanceof RadiusItem) {
|
||||
final int type = ((RadiusItem) getItem(position)).type;
|
||||
v = createItemForRadiusProximity(ctx, type, running, position, thisAdapter);
|
||||
v = createItemForRadiusProximity(ctx, type, running, position, thisAdapter, nightMode);
|
||||
} else if (labelView) {
|
||||
v = createItemForCategory(ctx, (Integer) getItem(position), running, position, thisAdapter);
|
||||
v = createItemForCategory(ctx, (Integer) getItem(position), running, position, thisAdapter, nightMode);
|
||||
} else {
|
||||
LocationPointWrapper point = (LocationPointWrapper) getItem(position);
|
||||
v = updateWaypointItemView(edit, deletedPoints, app, ctx, v, point, this);
|
||||
v = updateWaypointItemView(edit, deletedPoints, app, ctx, v, point, this, nightMode);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
@ -148,18 +150,18 @@ public class WaypointDialogHelper {
|
|||
|
||||
public static View updateWaypointItemView(final boolean edit, final List<LocationPointWrapper> deletedPoints,
|
||||
final OsmandApplication app, final Activity ctx, View v, final LocationPointWrapper point,
|
||||
final ArrayAdapter adapter) {
|
||||
final ArrayAdapter adapter, final boolean nightMode) {
|
||||
if (v == null || v.findViewById(R.id.info_close) == null) {
|
||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
||||
}
|
||||
updatePointInfoView(app, ctx, v, point, true);
|
||||
updatePointInfoView(app, ctx, v, point, true, nightMode);
|
||||
View remove = v.findViewById(R.id.info_close);
|
||||
if (!edit) {
|
||||
remove.setVisibility(View.GONE);
|
||||
} else {
|
||||
remove.setVisibility(View.VISIBLE);
|
||||
((ImageButton) remove).setImageDrawable(app.getIconsCache().getContentIcon(
|
||||
R.drawable.ic_action_gremove_dark));
|
||||
R.drawable.ic_action_gremove_dark, !nightMode));
|
||||
remove.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
@ -178,12 +180,13 @@ public class WaypointDialogHelper {
|
|||
|
||||
|
||||
protected View createItemForRadiusProximity(final FragmentActivity ctx, final int type, final int[] running,
|
||||
final int position, final ArrayAdapter<Object> thisAdapter) {
|
||||
final int position, final ArrayAdapter<Object> thisAdapter, boolean nightMode) {
|
||||
View v;
|
||||
IconsCache iconsCache = app.getIconsCache();
|
||||
v = ctx.getLayoutInflater().inflate(R.layout.drawer_list_radius, null);
|
||||
AndroidUtils.setTextPrimaryColor(mapActivity, (TextView) v.findViewById(R.id.title), nightMode);
|
||||
final TextView radius = (TextView) v.findViewById(R.id.description);
|
||||
((ImageView) v.findViewById(R.id.waypoint_icon)).setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_poi_radius_dark));
|
||||
((ImageView) v.findViewById(R.id.waypoint_icon)).setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_poi_radius_dark, !nightMode));
|
||||
radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(type), app));
|
||||
radius.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -196,7 +199,7 @@ public class WaypointDialogHelper {
|
|||
}
|
||||
|
||||
protected View createItemForCategory(final FragmentActivity ctx, final int type, final int[] running,
|
||||
final int position, final ArrayAdapter<Object> thisAdapter) {
|
||||
final int position, final ArrayAdapter<Object> thisAdapter, boolean nightMode) {
|
||||
View v;
|
||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_header, null);
|
||||
final CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item);
|
||||
|
@ -222,6 +225,7 @@ public class WaypointDialogHelper {
|
|||
});
|
||||
|
||||
TextView tv = (TextView) v.findViewById(R.id.header_text);
|
||||
AndroidUtils.setTextPrimaryColor(mapActivity, tv, nightMode);
|
||||
tv.setText(getHeader(type, checked, ctx));
|
||||
v.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
package net.osmand.plus.liveupdates;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.download.DownloadActivityType;
|
||||
import net.osmand.plus.download.DownloadValidationManager;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
import net.osmand.plus.resources.IncrementalChangesManager;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LiveUpdatesAlarmReceiver extends BroadcastReceiver {
|
||||
private static final Log LOG = PlatformUtil.getLog(LiveUpdatesAlarmReceiver.class);
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String localIndexInfo = intent.getAction();
|
||||
new PerformLiveUpdateAsyncTask(context).execute(localIndexInfo);
|
||||
}
|
||||
|
||||
public static class PerformLiveUpdateAsyncTask
|
||||
extends AsyncTask<String, Object, IncrementalChangesManager.IncrementalUpdateList> {
|
||||
private final Context context;
|
||||
|
||||
public PerformLiveUpdateAsyncTask(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
protected void onPreExecute() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IncrementalChangesManager.IncrementalUpdateList doInBackground(String... params) {
|
||||
final OsmandApplication myApplication = (OsmandApplication) context.getApplicationContext();
|
||||
IncrementalChangesManager cm = myApplication.getResourceManager().getChangesManager();
|
||||
return cm.getUpdatesByMonth(params[0]);
|
||||
}
|
||||
|
||||
protected void onPostExecute(IncrementalChangesManager.IncrementalUpdateList result) {
|
||||
if (result.errorMessage != null) {
|
||||
Toast.makeText(context, result.errorMessage, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
List<IncrementalChangesManager.IncrementalUpdate> ll = result.getItemsForUpdate();
|
||||
if (ll.isEmpty()) {
|
||||
Toast.makeText(context, R.string.no_updates_available, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
int i = 0;
|
||||
IndexItem[] is = new IndexItem[ll.size()];
|
||||
for (IncrementalChangesManager.IncrementalUpdate iu : ll) {
|
||||
IndexItem ii = new IndexItem(iu.fileName, "Incremental update", iu.timestamp, iu.sizeText,
|
||||
iu.contentSize, iu.containerSize, DownloadActivityType.LIVE_UPDATES_FILE);
|
||||
is[i++] = ii;
|
||||
}
|
||||
final OsmandApplication application = (OsmandApplication) context.getApplicationContext();
|
||||
DownloadValidationManager downloadValidationManager =
|
||||
new DownloadValidationManager(application);
|
||||
downloadValidationManager.startDownload(context, is);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,7 +36,9 @@ import java.io.File;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class LiveUpdatesFragment extends Fragment {
|
||||
public static final String TITILE = "Live Updates";
|
||||
|
@ -119,22 +121,26 @@ public class LiveUpdatesFragment extends Fragment {
|
|||
}
|
||||
|
||||
public void notifyLiveUpdatesChanged() {
|
||||
Set<LocalIndexInfo> changedSet = new HashSet<>();
|
||||
for (LocalIndexInfo localIndexInfo : dataShouldUpdate) {
|
||||
OsmandSettings.CommonPreference<Boolean> preference =
|
||||
preferenceForLocalIndex(LIVE_UPDATES_ON_POSTFIX, localIndexInfo);
|
||||
if (!preference.get()) {
|
||||
dataShouldUpdate.remove(localIndexInfo);
|
||||
dataShouldNotUpdate.add(localIndexInfo);
|
||||
changedSet.add(localIndexInfo);
|
||||
}
|
||||
}
|
||||
dataShouldUpdate.removeAll(changedSet);
|
||||
dataShouldNotUpdate.addAll(changedSet);
|
||||
changedSet.clear();
|
||||
for (LocalIndexInfo localIndexInfo : dataShouldNotUpdate) {
|
||||
OsmandSettings.CommonPreference<Boolean> preference =
|
||||
preferenceForLocalIndex(LIVE_UPDATES_ON_POSTFIX, localIndexInfo);
|
||||
if (preference.get()) {
|
||||
dataShouldUpdate.add(localIndexInfo);
|
||||
dataShouldNotUpdate.remove(localIndexInfo);
|
||||
changedSet.add(localIndexInfo);
|
||||
}
|
||||
}
|
||||
dataShouldUpdate.addAll(changedSet);
|
||||
dataShouldNotUpdate.removeAll(changedSet);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
@ -263,43 +269,7 @@ public class LiveUpdatesFragment extends Fragment {
|
|||
|
||||
void runLiveUpdate(final LocalIndexInfo info) {
|
||||
final String fnExt = Algorithms.getFileNameWithoutExtension(new File(info.getFileName()));
|
||||
new AsyncTask<Object, Object, IncrementalChangesManager.IncrementalUpdateList>() {
|
||||
|
||||
protected void onPreExecute() {
|
||||
getMyActivity().setSupportProgressBarIndeterminateVisibility(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IncrementalChangesManager.IncrementalUpdateList doInBackground(Object... params) {
|
||||
final OsmandApplication myApplication = getMyActivity().getMyApplication();
|
||||
IncrementalChangesManager cm = myApplication.getResourceManager().getChangesManager();
|
||||
return cm.getUpdatesByMonth(fnExt);
|
||||
}
|
||||
|
||||
protected void onPostExecute(IncrementalChangesManager.IncrementalUpdateList result) {
|
||||
getMyActivity().setSupportProgressBarIndeterminateVisibility(false);
|
||||
if (result.errorMessage != null) {
|
||||
Toast.makeText(getActivity(), result.errorMessage, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
List<IncrementalChangesManager.IncrementalUpdate> ll = result.getItemsForUpdate();
|
||||
if (ll.isEmpty()) {
|
||||
Toast.makeText(getActivity(), R.string.no_updates_available, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
int i = 0;
|
||||
IndexItem[] is = new IndexItem[ll.size()];
|
||||
for (IncrementalChangesManager.IncrementalUpdate iu : ll) {
|
||||
IndexItem ii = new IndexItem(iu.fileName, "Incremental update", iu.timestamp, iu.sizeText,
|
||||
iu.contentSize, iu.containerSize, DownloadActivityType.LIVE_UPDATES_FILE);
|
||||
is[i++] = ii;
|
||||
}
|
||||
getMyActivity().startDownload(is);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}.execute(new Object[]{fnExt});
|
||||
new PerformLiveUpdateAsyncTask(getMyActivity()).execute(new String[]{fnExt});
|
||||
}
|
||||
|
||||
LocalIndexInfo getLocalIndexInfo(int groupPosition, int childPosition) {
|
||||
|
@ -330,7 +300,7 @@ public class LiveUpdatesFragment extends Fragment {
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
final FragmentManager fragmentManager = fragment.getChildFragmentManager();
|
||||
SettingsDialogFragment.createInstance(item).show(fragmentManager, "settings");
|
||||
LiveUpdatesSettingsDialogFragment.createInstance(item).show(fragmentManager, "settings");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -378,4 +348,46 @@ public class LiveUpdatesFragment extends Fragment {
|
|||
adapter.sort();
|
||||
}
|
||||
}
|
||||
|
||||
public static class PerformLiveUpdateAsyncTask
|
||||
extends AsyncTask<String, Object, IncrementalChangesManager.IncrementalUpdateList> {
|
||||
private final AbstractDownloadActivity activity;
|
||||
|
||||
public PerformLiveUpdateAsyncTask(AbstractDownloadActivity activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
protected void onPreExecute() {
|
||||
activity.setSupportProgressBarIndeterminateVisibility(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IncrementalChangesManager.IncrementalUpdateList doInBackground(String... params) {
|
||||
final OsmandApplication myApplication = activity.getMyApplication();
|
||||
IncrementalChangesManager cm = myApplication.getResourceManager().getChangesManager();
|
||||
return cm.getUpdatesByMonth(params[0]);
|
||||
}
|
||||
|
||||
protected void onPostExecute(IncrementalChangesManager.IncrementalUpdateList result) {
|
||||
activity.setSupportProgressBarIndeterminateVisibility(false);
|
||||
if (result.errorMessage != null) {
|
||||
Toast.makeText(activity, result.errorMessage, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
List<IncrementalChangesManager.IncrementalUpdate> ll = result.getItemsForUpdate();
|
||||
if (ll.isEmpty()) {
|
||||
Toast.makeText(activity, R.string.no_updates_available, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
int i = 0;
|
||||
IndexItem[] is = new IndexItem[ll.size()];
|
||||
for (IncrementalChangesManager.IncrementalUpdate iu : ll) {
|
||||
IndexItem ii = new IndexItem(iu.fileName, "Incremental update", iu.timestamp, iu.sizeText,
|
||||
iu.contentSize, iu.containerSize, DownloadActivityType.LIVE_UPDATES_FILE);
|
||||
is[i++] = ii;
|
||||
}
|
||||
activity.startDownload(is);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,201 @@
|
|||
package net.osmand.plus.liveupdates;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.Dialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.LocalIndexInfo;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
||||
public static final String LOCAL_INDEX_INFO = "local_index_info";
|
||||
|
||||
private static final String LOCAL_INDEX = "local_index";
|
||||
private static final int UPDATE_HOURLY = 0;
|
||||
private static final int UPDATE_DAILY = 1;
|
||||
private static final int UPDATE_WEEKLY = 2;
|
||||
private static final String UPDATE_TIMES = "_update_times";
|
||||
private static final String TIME_OF_DAY_TO_UPDATE = "_time_of_day_to_update";
|
||||
private static final int MORNING_UPDATE_TIME = 8;
|
||||
private static final int NIGHT_UPDATE_TIME = 21;
|
||||
private static final int SHIFT = 1000;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
final LocalIndexInfo localIndexInfo = getArguments().getParcelable(LOCAL_INDEX);
|
||||
|
||||
View view = LayoutInflater.from(getActivity())
|
||||
.inflate(R.layout.dialog_live_updates_item_settings, null);
|
||||
final SwitchCompat liveUpdatesSwitch = (SwitchCompat) view.findViewById(R.id.liveUpdatesSwitch);
|
||||
final Spinner updateFrequencySpinner = (Spinner) view.findViewById(R.id.updateFrequencySpinner);
|
||||
final Spinner updateTimesOfDaySpinner = (Spinner) view.findViewById(R.id.updateTimesOfDaySpinner);
|
||||
|
||||
final OsmandSettings.CommonPreference<Boolean> liveUpdatePreference =
|
||||
preferenceForLocalIndex(localIndexInfo);
|
||||
final OsmandSettings.CommonPreference<Integer> updateFrequencePreference =
|
||||
preferenceUpdateTimes(localIndexInfo);
|
||||
final OsmandSettings.CommonPreference<Integer> timeOfDayPreference =
|
||||
preferenceTimeOfDayToUpdate(localIndexInfo);
|
||||
liveUpdatesSwitch.setChecked(liveUpdatePreference.get());
|
||||
|
||||
builder.setView(view)
|
||||
.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final int updateFrequencyInt = updateFrequencySpinner.getSelectedItemPosition();
|
||||
updateFrequencePreference.set(updateFrequencyInt);
|
||||
UpdateFrequencies updateFrequency = UpdateFrequencies.values()[updateFrequencyInt];
|
||||
|
||||
AlarmManager alarmMgr = (AlarmManager) getActivity()
|
||||
.getSystemService(Context.ALARM_SERVICE);
|
||||
Intent intent = new Intent(getActivity(), LiveUpdatesAlarmReceiver.class);
|
||||
final File file = new File(localIndexInfo.getFileName());
|
||||
final String fileName = Algorithms.getFileNameWithoutExtension(file);
|
||||
// intent.putExtra(LOCAL_INDEX_INFO, fileName);
|
||||
intent.setAction(fileName);
|
||||
PendingIntent alarmIntent = PendingIntent.getBroadcast(getActivity(), 0, intent, 0);
|
||||
|
||||
final int timeOfDayInt = updateTimesOfDaySpinner.getSelectedItemPosition();
|
||||
timeOfDayPreference.set(timeOfDayInt);
|
||||
TimesOfDay timeOfDayToUpdate = TimesOfDay.values()[timeOfDayInt];
|
||||
long timeOfFirstUpdate;
|
||||
long updateInterval;
|
||||
switch (updateFrequency) {
|
||||
case HOURLY:
|
||||
timeOfFirstUpdate = System.currentTimeMillis() + SHIFT;
|
||||
updateInterval = AlarmManager.INTERVAL_HOUR;
|
||||
break;
|
||||
case DAILY:
|
||||
timeOfFirstUpdate = getNextUpdateTime(timeOfDayToUpdate);
|
||||
updateInterval = AlarmManager.INTERVAL_DAY;
|
||||
break;
|
||||
case WEEKLY:
|
||||
timeOfFirstUpdate = getNextUpdateTime(timeOfDayToUpdate);
|
||||
updateInterval = AlarmManager.INTERVAL_DAY * 7;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected update frequency:"
|
||||
+ updateFrequency);
|
||||
}
|
||||
|
||||
liveUpdatePreference.set(liveUpdatesSwitch.isChecked());
|
||||
alarmMgr.cancel(alarmIntent);
|
||||
if (liveUpdatesSwitch.isChecked()) {
|
||||
alarmMgr.setInexactRepeating(AlarmManager.RTC,
|
||||
timeOfFirstUpdate, updateInterval, alarmIntent);
|
||||
}
|
||||
getLiveUpdatesFragment().notifyLiveUpdatesChanged();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.shared_string_cancel, null)
|
||||
.setNeutralButton(R.string.update_now, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
getLiveUpdatesFragment().runLiveUpdate(localIndexInfo);
|
||||
}
|
||||
});
|
||||
|
||||
updateFrequencySpinner.setSelection(updateFrequencePreference.get());
|
||||
updateFrequencySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
UpdateFrequencies updateFrequency = UpdateFrequencies.values()[position];
|
||||
switch (updateFrequency) {
|
||||
case HOURLY:
|
||||
updateTimesOfDaySpinner.setVisibility(View.GONE);
|
||||
break;
|
||||
case DAILY:
|
||||
case WEEKLY:
|
||||
updateTimesOfDaySpinner.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
private long getNextUpdateTime(TimesOfDay timeOfDayToUpdate) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if (timeOfDayToUpdate == TimesOfDay.MORNING) {
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, MORNING_UPDATE_TIME);
|
||||
} else if (timeOfDayToUpdate == TimesOfDay.NIGHT) {
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, NIGHT_UPDATE_TIME);
|
||||
}
|
||||
return calendar.getTimeInMillis();
|
||||
}
|
||||
|
||||
private LiveUpdatesFragment getLiveUpdatesFragment() {
|
||||
return (LiveUpdatesFragment) getParentFragment();
|
||||
}
|
||||
|
||||
private OsmandSettings.CommonPreference<Boolean> preferenceForLocalIndex(LocalIndexInfo item) {
|
||||
final String settingId = item.getFileName() + LiveUpdatesFragment.LIVE_UPDATES_ON_POSTFIX;
|
||||
return getSettings().registerBooleanPreference(settingId, false);
|
||||
}
|
||||
|
||||
private OsmandSettings.CommonPreference<Integer> preferenceUpdateTimes(LocalIndexInfo item) {
|
||||
final String settingId = item.getFileName() + UPDATE_TIMES;
|
||||
return getSettings().registerIntPreference(settingId, UpdateFrequencies.HOURLY.ordinal());
|
||||
}
|
||||
|
||||
private OsmandSettings.CommonPreference<Integer> preferenceTimeOfDayToUpdate(LocalIndexInfo item) {
|
||||
final String settingId = item.getFileName() + TIME_OF_DAY_TO_UPDATE;
|
||||
return getSettings().registerIntPreference(settingId, TimesOfDay.NIGHT.ordinal());
|
||||
}
|
||||
|
||||
private OsmandSettings getSettings() {
|
||||
return getMyApplication().getSettings();
|
||||
}
|
||||
|
||||
private OsmandApplication getMyApplication() {
|
||||
return ((OsmandActionBarActivity) this.getActivity()).getMyApplication();
|
||||
}
|
||||
|
||||
public static LiveUpdatesSettingsDialogFragment createInstance(LocalIndexInfo localIndexInfo) {
|
||||
LiveUpdatesSettingsDialogFragment fragment = new LiveUpdatesSettingsDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putParcelable(LOCAL_INDEX, localIndexInfo);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static enum UpdateFrequencies {
|
||||
HOURLY,
|
||||
DAILY,
|
||||
WEEKLY
|
||||
}
|
||||
|
||||
public static enum TimesOfDay {
|
||||
MORNING,
|
||||
NIGHT
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package net.osmand.plus.liveupdates;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.LocalIndexInfo;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
|
||||
public class SettingsDialogFragment extends DialogFragment {
|
||||
public static final String LOCAL_INDEX = "local_index";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
final LocalIndexInfo localIndexInfo = getArguments().getParcelable(LOCAL_INDEX);
|
||||
|
||||
View view = LayoutInflater.from(getActivity())
|
||||
.inflate(R.layout.dialog_live_updates_item_settings, null);
|
||||
final SwitchCompat liveUpdatesSwitch = (SwitchCompat) view.findViewById(R.id.liveUpdatesSwitch);
|
||||
|
||||
final OsmandSettings.CommonPreference<Boolean> liveUpdatePreference =
|
||||
preferenceForLocalIndex(LiveUpdatesFragment.LIVE_UPDATES_ON_POSTFIX, localIndexInfo);
|
||||
liveUpdatesSwitch.setChecked(liveUpdatePreference.get());
|
||||
|
||||
builder.setView(view)
|
||||
.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
liveUpdatePreference.set(liveUpdatesSwitch.isChecked());
|
||||
getLiveUpdatesFragment().notifyLiveUpdatesChanged();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.shared_string_cancel, null)
|
||||
.setNeutralButton(R.string.update_now, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
getLiveUpdatesFragment().runLiveUpdate(localIndexInfo);
|
||||
}
|
||||
});
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
private LiveUpdatesFragment getLiveUpdatesFragment() {
|
||||
return (LiveUpdatesFragment) getParentFragment();
|
||||
}
|
||||
|
||||
private OsmandSettings.CommonPreference<Boolean> preferenceForLocalIndex(String idPostfix,
|
||||
LocalIndexInfo item) {
|
||||
final OsmandApplication myApplication = ((OsmandActionBarActivity) this.getActivity()).getMyApplication();
|
||||
final OsmandSettings settings = myApplication.getSettings();
|
||||
final String settingId = item.getFileName() + idPostfix;
|
||||
return settings.registerBooleanPreference(settingId, false);
|
||||
}
|
||||
|
||||
public static SettingsDialogFragment createInstance(LocalIndexInfo localIndexInfo) {
|
||||
SettingsDialogFragment fragment = new SettingsDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putParcelable(LOCAL_INDEX, localIndexInfo);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package net.osmand.plus.mapcontextmenu;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.TypedValue;
|
||||
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.R;
|
||||
|
@ -15,7 +14,7 @@ public abstract class BaseMenuController {
|
|||
private MapActivity mapActivity;
|
||||
private boolean portraitMode;
|
||||
private boolean largeDevice;
|
||||
private boolean light;
|
||||
private boolean nightMode;
|
||||
|
||||
public BaseMenuController(MapActivity mapActivity) {
|
||||
this.mapActivity = mapActivity;
|
||||
|
@ -25,7 +24,7 @@ public abstract class BaseMenuController {
|
|||
private void init() {
|
||||
portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity);
|
||||
largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity);
|
||||
light = mapActivity.getMyApplication().getSettings().isLightContent();
|
||||
updateNightMode();
|
||||
}
|
||||
|
||||
public MapActivity getMapActivity() {
|
||||
|
@ -38,7 +37,11 @@ public abstract class BaseMenuController {
|
|||
}
|
||||
|
||||
public boolean isLight() {
|
||||
return light;
|
||||
return !nightMode;
|
||||
}
|
||||
|
||||
public void updateNightMode() {
|
||||
nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightMode();
|
||||
}
|
||||
|
||||
public boolean isLandscapeLayout() {
|
||||
|
@ -75,7 +78,7 @@ public abstract class BaseMenuController {
|
|||
}
|
||||
|
||||
protected Drawable getIcon(int iconId) {
|
||||
return getIcon(iconId, R.color.icon_color, R.color.icon_color_light);
|
||||
return getIcon(iconId, isLight() ? R.color.icon_color : R.color.icon_color_light);
|
||||
}
|
||||
|
||||
protected Drawable getIcon(int iconId, int colorId) {
|
||||
|
@ -92,13 +95,4 @@ public abstract class BaseMenuController {
|
|||
IconsCache iconsCache = getMapActivity().getMyApplication().getIconsCache();
|
||||
return iconsCache.getIcon(iconId, isLight() ? colorLightId : colorDarkId);
|
||||
}
|
||||
|
||||
protected int getResIdFromAttribute(final int attr) {
|
||||
if (attr == 0)
|
||||
return 0;
|
||||
final TypedValue typedvalueattr = new TypedValue();
|
||||
getMapActivity().getTheme().resolveAttribute(attr, typedvalueattr, true);
|
||||
return typedvalueattr.resourceId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,16 +7,19 @@ import android.support.v7.app.AlertDialog;
|
|||
import android.support.v7.app.AlertDialog.Builder;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import net.osmand.CallbackWithObject;
|
||||
import net.osmand.StateChangedListener;
|
||||
import net.osmand.data.FavouritePoint;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.ContextMenuAdapter;
|
||||
import net.osmand.plus.TargetPointsHelper;
|
||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||
import net.osmand.plus.GPXUtilities.WptPt;
|
||||
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.TargetPointsHelper;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.GpxUiHelper;
|
||||
import net.osmand.plus.mapcontextmenu.MenuController.MenuState;
|
||||
|
@ -35,7 +38,7 @@ import net.osmand.util.MapUtils;
|
|||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
public class MapContextMenu extends MenuTitleController {
|
||||
public class MapContextMenu extends MenuTitleController implements StateChangedListener<ApplicationMode> {
|
||||
|
||||
private MapActivity mapActivity;
|
||||
private MapMultiSelectionMenu mapMultiSelectionMenu;
|
||||
|
@ -55,6 +58,8 @@ public class MapContextMenu extends MenuTitleController {
|
|||
private LatLon myLocation;
|
||||
private Float heading;
|
||||
private boolean inLocationUpdate = false;
|
||||
private boolean appModeChanged;
|
||||
private boolean appModeListenerAdded;
|
||||
|
||||
private int favActionIconId;
|
||||
|
||||
|
@ -67,6 +72,10 @@ public class MapContextMenu extends MenuTitleController {
|
|||
|
||||
public void setMapActivity(MapActivity mapActivity) {
|
||||
this.mapActivity = mapActivity;
|
||||
if (!appModeListenerAdded) {
|
||||
mapActivity.getMyApplication().getSettings().APPLICATION_MODE.addListener(this);
|
||||
appModeListenerAdded = true;
|
||||
}
|
||||
|
||||
if (mapMultiSelectionMenu == null) {
|
||||
mapMultiSelectionMenu = new MapMultiSelectionMenu(mapActivity);
|
||||
|
@ -199,6 +208,7 @@ public class MapContextMenu extends MenuTitleController {
|
|||
}
|
||||
|
||||
boolean needAcquireMenuController = menuController == null
|
||||
|| appModeChanged
|
||||
|| !update
|
||||
|| this.object == null && object != null
|
||||
|| this.object != null && object == null
|
||||
|
@ -208,6 +218,7 @@ public class MapContextMenu extends MenuTitleController {
|
|||
this.object = object;
|
||||
|
||||
active = true;
|
||||
appModeChanged = false;
|
||||
|
||||
if (needAcquireMenuController) {
|
||||
acquireMenuController();
|
||||
|
@ -232,7 +243,11 @@ public class MapContextMenu extends MenuTitleController {
|
|||
|
||||
public void show() {
|
||||
if (!isVisible()) {
|
||||
if (!MapContextMenuFragment.showInstance(this, mapActivity)) {
|
||||
boolean wasInit = true;
|
||||
if (appModeChanged) {
|
||||
wasInit = init(latLon, pointDescription, object);
|
||||
}
|
||||
if (wasInit && !MapContextMenuFragment.showInstance(this, mapActivity)) {
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
|
@ -295,6 +310,11 @@ public class MapContextMenu extends MenuTitleController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stateChanged(ApplicationMode change) {
|
||||
appModeChanged = active;
|
||||
}
|
||||
|
||||
private void clearSelectedObject(Object object) {
|
||||
if (object != null) {
|
||||
for (OsmandMapLayer l : mapActivity.getMapView().getLayers()) {
|
||||
|
@ -644,6 +664,14 @@ public class MapContextMenu extends MenuTitleController {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isNightMode() {
|
||||
if (menuController != null) {
|
||||
return !menuController.isLight();
|
||||
} else {
|
||||
return mapActivity.getMyApplication().getDaynightHelper().isNightMode();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasHiddenBottomInfo() {
|
||||
return getCurrentMenuState() == MenuState.HEADER_ONLY;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import android.widget.LinearLayout;
|
|||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.QuadPoint;
|
||||
|
@ -90,6 +91,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
private int origMarkerY;
|
||||
private boolean customMapCenter;
|
||||
private boolean moving;
|
||||
private boolean nightMode;
|
||||
|
||||
private float skipHalfScreenStateLimit;
|
||||
|
||||
|
@ -149,6 +151,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
if (!menu.isActive()) {
|
||||
return view;
|
||||
}
|
||||
nightMode = menu.isNightMode();
|
||||
mainView = view.findViewById(R.id.context_menu_main);
|
||||
|
||||
leftTitleButtonController = menu.getLeftTitleButtonController();
|
||||
|
@ -173,7 +176,6 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
}
|
||||
|
||||
IconsCache iconsCache = getMyApplication().getIconsCache();
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
|
||||
// Left title button
|
||||
final Button leftTitleButton = (Button) view.findViewById(R.id.title_button);
|
||||
|
@ -212,7 +214,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
if (titleProgressController != null) {
|
||||
final ImageView progressButton = (ImageView) view.findViewById(R.id.progressButton);
|
||||
progressButton.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark,
|
||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
progressButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -333,6 +335,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
View topShadowView = view.findViewById(R.id.context_menu_top_shadow);
|
||||
topShadowView.setOnTouchListener(slideTouchListener);
|
||||
View topShadowAllView = view.findViewById(R.id.context_menu_top_shadow_all);
|
||||
AndroidUtils.setBackground(getMapActivity(), topShadowAllView, nightMode, R.drawable.bg_map_context_menu_light,
|
||||
R.drawable.bg_map_context_menu_dark);
|
||||
topShadowAllView.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
|
@ -345,6 +349,25 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
buildHeader();
|
||||
|
||||
AndroidUtils.setTextPrimaryColor(getMapActivity(),
|
||||
(TextView) view.findViewById(R.id.context_menu_line1), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(getMapActivity(),
|
||||
(TextView) view.findViewById(R.id.context_menu_line2), nightMode);
|
||||
((Button) view.findViewById(R.id.title_button_top_right))
|
||||
.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue) : getResources().getColor(R.color.osmand_orange));
|
||||
AndroidUtils.setTextSecondaryColor(getMapActivity(),
|
||||
(TextView) view.findViewById(R.id.distance), nightMode);
|
||||
|
||||
((Button) view.findViewById(R.id.title_button))
|
||||
.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue) : getResources().getColor(R.color.osmand_orange));
|
||||
AndroidUtils.setTextSecondaryColor(getMapActivity(),
|
||||
(TextView) view.findViewById(R.id.title_button_right_text), nightMode);
|
||||
((Button) view.findViewById(R.id.title_button_right))
|
||||
.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue) : getResources().getColor(R.color.osmand_orange));
|
||||
|
||||
AndroidUtils.setTextSecondaryColor(getMapActivity(),
|
||||
(TextView) view.findViewById(R.id.progressTitle), nightMode);
|
||||
|
||||
// FAB
|
||||
fabView = (ImageView)view.findViewById(R.id.context_menu_fab_view);
|
||||
if (menu.fabVisible()) {
|
||||
|
@ -363,17 +386,27 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
fabView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!menu.buttonsVisible()) {
|
||||
View buttonsTopBorder = view.findViewById(R.id.buttons_top_border);
|
||||
AndroidUtils.setBackground(getMapActivity(), buttonsTopBorder, nightMode,
|
||||
R.color.dashboard_divider_light, R.color.dashboard_divider_dark);
|
||||
if (!menu.buttonsVisible()) {
|
||||
View buttons = view.findViewById(R.id.context_menu_buttons);
|
||||
buttonsTopBorder.setVisibility(View.GONE);
|
||||
buttons.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
AndroidUtils.setBackground(getMapActivity(), mainView.findViewById(R.id.divider_hor_1), nightMode,
|
||||
R.color.dashboard_divider_light, R.color.dashboard_divider_dark);
|
||||
AndroidUtils.setBackground(getMapActivity(), mainView.findViewById(R.id.divider_hor_2), nightMode,
|
||||
R.color.dashboard_divider_light, R.color.dashboard_divider_dark);
|
||||
AndroidUtils.setBackground(getMapActivity(), mainView.findViewById(R.id.divider_hor_3), nightMode,
|
||||
R.color.dashboard_divider_light, R.color.dashboard_divider_dark);
|
||||
|
||||
// Action buttons
|
||||
final ImageButton buttonFavorite = (ImageButton) view.findViewById(R.id.context_menu_fav_button);
|
||||
buttonFavorite.setImageDrawable(iconsCache.getIcon(menu.getFavActionIconId(),
|
||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
AndroidUtils.setDashButtonBackground(getMapActivity(), buttonFavorite, nightMode);
|
||||
buttonFavorite.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -383,7 +416,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
final ImageButton buttonWaypoint = (ImageButton) view.findViewById(R.id.context_menu_route_button);
|
||||
buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_flag_dark,
|
||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
AndroidUtils.setDashButtonBackground(getMapActivity(), buttonWaypoint, nightMode);
|
||||
buttonWaypoint.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -393,7 +427,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
final ImageButton buttonShare = (ImageButton) view.findViewById(R.id.context_menu_share_button);
|
||||
buttonShare.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_gshare_dark,
|
||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
AndroidUtils.setDashButtonBackground(getMapActivity(), buttonShare, nightMode);
|
||||
buttonShare.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -403,7 +438,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
final ImageButton buttonMore = (ImageButton) view.findViewById(R.id.context_menu_more_button);
|
||||
buttonMore.setImageDrawable(iconsCache.getIcon(R.drawable.map_overflow_menu_white,
|
||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
AndroidUtils.setDashButtonBackground(getMapActivity(), buttonMore, nightMode);
|
||||
buttonMore.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -413,6 +449,11 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
buildBottomView();
|
||||
|
||||
view.findViewById(R.id.context_menu_bottom_scroll).setBackgroundColor(nightMode ?
|
||||
getResources().getColor(R.color.ctx_menu_info_view_bg_dark) : getResources().getColor(R.color.ctx_menu_info_view_bg_light));
|
||||
view.findViewById(R.id.context_menu_bottom_view).setBackgroundColor(nightMode ?
|
||||
getResources().getColor(R.color.ctx_menu_info_view_bg_dark) : getResources().getColor(R.color.ctx_menu_info_view_bg_light));
|
||||
|
||||
getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false);
|
||||
|
||||
return view;
|
||||
|
@ -606,7 +647,6 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
private void buildHeader() {
|
||||
IconsCache iconsCache = getMyApplication().getIconsCache();
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
|
||||
final View iconLayout = view.findViewById(R.id.context_menu_icon_layout);
|
||||
final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);
|
||||
|
@ -617,7 +657,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
iconLayout.setVisibility(View.VISIBLE);
|
||||
} else if (iconId != 0) {
|
||||
iconView.setImageDrawable(iconsCache.getIcon(iconId,
|
||||
light ? R.color.osmand_orange : R.color.osmand_orange_dark));
|
||||
!nightMode ? R.color.osmand_orange : R.color.osmand_orange_dark));
|
||||
iconLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
iconLayout.setVisibility(View.GONE);
|
||||
|
@ -669,10 +709,9 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
public void rebuildMenu() {
|
||||
IconsCache iconsCache = getMyApplication().getIconsCache();
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
final ImageButton buttonFavorite = (ImageButton) view.findViewById(R.id.context_menu_fav_button);
|
||||
buttonFavorite.setImageDrawable(iconsCache.getIcon(menu.getFavActionIconId(),
|
||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||
|
||||
buildHeader();
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class MenuBuilder {
|
|||
protected OsmandApplication app;
|
||||
protected LinkedList<PlainMenuItem> plainMenuItems;
|
||||
private boolean firstRow;
|
||||
private boolean light;
|
||||
protected boolean light;
|
||||
|
||||
public class PlainMenuItem {
|
||||
private int iconId;
|
||||
|
@ -66,6 +66,10 @@ public class MenuBuilder {
|
|||
light = app.getSettings().isLightContent();
|
||||
}
|
||||
|
||||
public void setLight(boolean light) {
|
||||
this.light = light;
|
||||
}
|
||||
|
||||
public void build(View view) {
|
||||
firstRow = true;
|
||||
if (needBuildPlainMenuItems()) {
|
||||
|
|
|
@ -65,6 +65,7 @@ public abstract class MenuController extends BaseMenuController {
|
|||
this.pointDescription = pointDescription;
|
||||
this.builder = builder;
|
||||
this.currentMenuState = getInitialMenuState();
|
||||
this.builder.setLight(isLight());
|
||||
}
|
||||
|
||||
public void build(View rootView) {
|
||||
|
@ -287,7 +288,7 @@ public abstract class MenuController extends BaseMenuController {
|
|||
|
||||
public Drawable getLeftIcon() {
|
||||
if (leftIconId != 0) {
|
||||
return getIcon(leftIconId, getResIdFromAttribute(R.attr.contextMenuButtonColor));
|
||||
return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,6 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
|||
protected void buildRow(final View view, Drawable icon, final String text, final String textPrefix,
|
||||
int textColor, boolean isWiki, boolean isText, boolean needLinks,
|
||||
boolean isPhoneNumber, boolean isUrl) {
|
||||
boolean light = app.getSettings().isLightContent();
|
||||
|
||||
if (!isFirstRow()) {
|
||||
buildRowDivider(view, false);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.osmand.plus.mapcontextmenu.builders;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
@ -49,10 +48,7 @@ public class GpxItemMenuBuilder extends MenuBuilder {
|
|||
int gpxSmallTextMargin = (int) ll.getResources().getDimension(R.dimen.gpx_small_text_margin);
|
||||
float gpxTextSize = ll.getResources().getDimension(R.dimen.default_desc_text_size);
|
||||
|
||||
TypedValue typedValue = new TypedValue();
|
||||
Resources.Theme theme = app.getTheme();
|
||||
theme.resolveAttribute(android.R.attr.textColorSecondary, typedValue, true);
|
||||
int textColor = typedValue.data;
|
||||
int textColor = app.getResources().getColor(light ? R.color.ctx_menu_info_text_light : R.color.ctx_menu_info_text_dark);
|
||||
|
||||
buildIcon(ll, gpxSmallIconMargin, R.drawable.ic_small_point);
|
||||
buildTextView(ll, gpxSmallTextMargin, gpxTextSize, textColor, "" + item.analysis.wptPoints);
|
||||
|
|
|
@ -16,12 +16,14 @@ public abstract class PointEditor {
|
|||
|
||||
private boolean portraitMode;
|
||||
private boolean largeDevice;
|
||||
private boolean nightMode;
|
||||
|
||||
public PointEditor(MapActivity mapActivity) {
|
||||
this.app = mapActivity.getMyApplication();
|
||||
this.mapActivity = mapActivity;
|
||||
portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity);
|
||||
largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity);
|
||||
updateNightMode();
|
||||
}
|
||||
|
||||
public void setMapActivity(MapActivity mapActivity) {
|
||||
|
@ -36,6 +38,14 @@ public abstract class PointEditor {
|
|||
return !portraitMode && !largeDevice;
|
||||
}
|
||||
|
||||
public boolean isLight() {
|
||||
return !nightMode;
|
||||
}
|
||||
|
||||
public void updateNightMode() {
|
||||
nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightMode();
|
||||
}
|
||||
|
||||
public int getSlideInAnimation() {
|
||||
if (isLandscapeLayout()) {
|
||||
return R.anim.slide_in_left;
|
||||
|
|
|
@ -56,6 +56,32 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
|
||||
view = inflater.inflate(R.layout.point_editor_fragment, container, false);
|
||||
|
||||
getEditor().updateNightMode();
|
||||
if (getEditor().isLandscapeLayout()) {
|
||||
AndroidUtils.setBackground(view.getContext(), view, !getEditor().isLight(),
|
||||
R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark);
|
||||
} else {
|
||||
AndroidUtils.setBackground(view.getContext(), view.findViewById(R.id.title_view), !getEditor().isLight(),
|
||||
R.drawable.bg_point_editor_view_light, R.drawable.bg_point_editor_view_dark);
|
||||
}
|
||||
|
||||
View editorScrollView = view.findViewById(R.id.editor_scroll_view);
|
||||
if (editorScrollView != null) {
|
||||
if (getEditor().isLight()) {
|
||||
editorScrollView.setBackgroundColor(getResources().getColor(R.color.ctx_menu_info_view_bg_light));
|
||||
} else {
|
||||
editorScrollView.setBackgroundColor(getResources().getColor(R.color.ctx_menu_info_view_bg_dark));
|
||||
}
|
||||
}
|
||||
View descriptionInfoView = view.findViewById(R.id.description_info_view);
|
||||
if (descriptionInfoView != null) {
|
||||
if (getEditor().isLight()) {
|
||||
descriptionInfoView.setBackgroundColor(getResources().getColor(R.color.ctx_menu_info_view_bg_light));
|
||||
} else {
|
||||
descriptionInfoView.setBackgroundColor(getResources().getColor(R.color.ctx_menu_info_view_bg_dark));
|
||||
}
|
||||
}
|
||||
|
||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
||||
toolbar.setTitle(getToolbarTitle());
|
||||
toolbar.setNavigationIcon(getMyApplication().getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
|
||||
|
@ -99,15 +125,21 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
}
|
||||
|
||||
TextView headerCaption = (TextView) view.findViewById(R.id.header_caption);
|
||||
AndroidUtils.setTextPrimaryColor(view.getContext(), headerCaption, !getEditor().isLight());
|
||||
headerCaption.setText(getHeaderCaption());
|
||||
TextView nameCaption = (TextView) view.findViewById(R.id.name_caption);
|
||||
AndroidUtils.setTextSecondaryColor(view.getContext(), nameCaption, !getEditor().isLight());
|
||||
nameCaption.setText(getNameCaption());
|
||||
TextView categoryCaption = (TextView) view.findViewById(R.id.category_caption);
|
||||
AndroidUtils.setTextSecondaryColor(view.getContext(), categoryCaption, !getEditor().isLight());
|
||||
categoryCaption.setText(getCategoryCaption());
|
||||
|
||||
nameEdit = (EditText) view.findViewById(R.id.name_edit);
|
||||
AndroidUtils.setTextPrimaryColor(view.getContext(), nameEdit, !getEditor().isLight());
|
||||
AndroidUtils.setHintTextSecondaryColor(view.getContext(), nameEdit, !getEditor().isLight());
|
||||
nameEdit.setText(getNameInitValue());
|
||||
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) view.findViewById(R.id.category_edit);
|
||||
AndroidUtils.setTextPrimaryColor(view.getContext(), categoryEdit, !getEditor().isLight());
|
||||
categoryEdit.setText(getCategoryInitValue());
|
||||
categoryEdit.setFocusable(false);
|
||||
categoryEdit.setOnTouchListener(new View.OnTouchListener() {
|
||||
|
@ -124,6 +156,8 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
});
|
||||
|
||||
EditText descriptionEdit = (EditText) view.findViewById(R.id.description_edit);
|
||||
AndroidUtils.setTextPrimaryColor(view.getContext(), descriptionEdit, !getEditor().isLight());
|
||||
AndroidUtils.setHintTextSecondaryColor(view.getContext(), descriptionEdit, !getEditor().isLight());
|
||||
if (getDescriptionInitValue() != null) {
|
||||
descriptionEdit.setText(getDescriptionInitValue());
|
||||
}
|
||||
|
@ -143,9 +177,8 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
|
||||
public Drawable getRowIcon(int iconId) {
|
||||
IconsCache iconsCache = getMyApplication().getIconsCache();
|
||||
boolean light = getMyApplication().getSettings().isLightContent();
|
||||
return iconsCache.getIcon(iconId,
|
||||
light ? R.color.icon_color : R.color.icon_color_light);
|
||||
getEditor().isLight() ? R.color.icon_color : R.color.icon_color_light);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -162,6 +162,7 @@ public class MapMultiSelectionMenu extends BaseMenuController {
|
|||
|
||||
this.latLon = latLon;
|
||||
createCollection(selectedObjects);
|
||||
updateNightMode();
|
||||
MapMultiSelectionMenuFragment.showInstance(getMapActivity());
|
||||
getMapActivity().refreshMap();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import android.widget.ImageView;
|
|||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
|
@ -44,6 +45,13 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi
|
|||
menu = ((MapActivity) getActivity()).getContextMenu().getMultiSelectionMenu();
|
||||
|
||||
view = inflater.inflate(R.layout.menu_obj_selection_fragment, container, false);
|
||||
if (menu.isLandscapeLayout()) {
|
||||
AndroidUtils.setBackground(view.getContext(), view, !menu.isLight(),
|
||||
R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark);
|
||||
} else {
|
||||
AndroidUtils.setBackground(view.getContext(), view, !menu.isLight(),
|
||||
R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
|
||||
}
|
||||
|
||||
ListView listView = (ListView) view.findViewById(R.id.list);
|
||||
listAdapter = createAdapter();
|
||||
|
@ -134,6 +142,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi
|
|||
|
||||
private void buildHeader(View view, MenuObject item, MapActivity mapActivity) {
|
||||
|
||||
AndroidUtils.setBackground(mapActivity, view, !menu.isLight(), R.drawable.expandable_list_item_background_light, R.drawable.expandable_list_item_background_dark);
|
||||
IconsCache iconsCache = mapActivity.getMyApplication().getIconsCache();
|
||||
final View iconLayout = view.findViewById(R.id.context_menu_icon_layout);
|
||||
final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);
|
||||
|
@ -152,10 +161,12 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi
|
|||
|
||||
// Text line 1
|
||||
TextView line1 = (TextView) view.findViewById(R.id.context_menu_line1);
|
||||
AndroidUtils.setTextPrimaryColor(mapActivity, line1, !menu.isLight());
|
||||
line1.setText(item.getTitleStr());
|
||||
|
||||
// Text line 2
|
||||
TextView line2 = (TextView) view.findViewById(R.id.context_menu_line2);
|
||||
AndroidUtils.setTextSecondaryColor(mapActivity, line2, !menu.isLight());
|
||||
line2.setText(item.getTypeStr());
|
||||
Drawable slIcon = item.getTypeIcon();
|
||||
line2.setCompoundDrawablesWithIntrinsicBounds(slIcon, null, null, null);
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.os.Bundle;
|
|||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -120,52 +119,24 @@ public class MapRouteInfoMenuFragment extends Fragment {
|
|||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerBtn3), nightMode,
|
||||
R.color.dashboard_divider_light, R.color.dashboard_divider_dark);
|
||||
|
||||
((TextView) mainView.findViewById(R.id.ViaView)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.primary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.primary_text_light));
|
||||
((TextView) mainView.findViewById(R.id.ViaSubView)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_light));
|
||||
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.ViaView), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.ViaSubView), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.toTitle), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.fromTitle), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.InfoTextView), nightMode);
|
||||
|
||||
((TextView) mainView.findViewById(R.id.toTitle)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_light));
|
||||
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.FromLayout), nightMode);
|
||||
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.ViaLayout), nightMode);
|
||||
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.ToLayout), nightMode);
|
||||
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.Info), nightMode);
|
||||
|
||||
((TextView) mainView.findViewById(R.id.fromTitle)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_light));
|
||||
|
||||
((TextView) mainView.findViewById(R.id.InfoTextView)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_light));
|
||||
|
||||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.FromLayout), nightMode,
|
||||
R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.ViaLayout), nightMode,
|
||||
R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.ToLayout), nightMode,
|
||||
R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.Info), nightMode,
|
||||
R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
|
||||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.Next), nightMode,
|
||||
R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.Prev), nightMode,
|
||||
R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
|
||||
((TextView) mainView.findViewById(R.id.DistanceText)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.primary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.primary_text_light));
|
||||
((TextView) mainView.findViewById(R.id.DistanceTitle)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_light));
|
||||
((TextView) mainView.findViewById(R.id.DurationText)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.primary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.primary_text_light));
|
||||
((TextView) mainView.findViewById(R.id.DurationTitle)).setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_dark)
|
||||
: ContextCompat.getColorStateList(ctx, android.R.color.secondary_text_light));
|
||||
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.Next), nightMode);
|
||||
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.Prev), nightMode);
|
||||
|
||||
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.DistanceText), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.DistanceTitle), nightMode);
|
||||
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.DurationText), nightMode);
|
||||
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.DurationTitle), nightMode);
|
||||
}
|
||||
|
||||
public static boolean showInstance(final MapActivity mapActivity) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.widget.ImageView;
|
|||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.mapcontextmenu.other.ShareMenu.ShareItem;
|
||||
|
@ -40,6 +41,18 @@ public class ShareMenuFragment extends Fragment implements OnItemClickListener {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.share_menu_fragment, container, false);
|
||||
|
||||
View mainView = view.findViewById(R.id.main_view);
|
||||
if (menu.isLandscapeLayout()) {
|
||||
AndroidUtils.setBackground(view.getContext(), mainView, !menu.isLight(),
|
||||
R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark);
|
||||
} else {
|
||||
AndroidUtils.setBackground(view.getContext(), mainView, !menu.isLight(),
|
||||
R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
|
||||
}
|
||||
|
||||
TextView headerCaption = (TextView) view.findViewById(R.id.header_caption);
|
||||
AndroidUtils.setTextSecondaryColor(view.getContext(), headerCaption, !menu.isLight());
|
||||
|
||||
ListView listView = (ListView) view.findViewById(R.id.list);
|
||||
listAdapter = createAdapter();
|
||||
listView.setAdapter(listAdapter);
|
||||
|
@ -88,11 +101,13 @@ public class ShareMenuFragment extends Fragment implements OnItemClickListener {
|
|||
if (v == null) {
|
||||
v = menu.getMapActivity().getLayoutInflater().inflate(R.layout.share_list_item, null);
|
||||
}
|
||||
AndroidUtils.setBackground(v.getContext(), v, !menu.isLight(), R.drawable.expandable_list_item_background_light, R.drawable.expandable_list_item_background_dark);
|
||||
final ShareItem item = getItem(position);
|
||||
ImageView icon = (ImageView) v.findViewById(R.id.icon);
|
||||
icon.setImageDrawable(menu.getMapActivity().getMyApplication()
|
||||
.getIconsCache().getContentIcon(item.getIconResourceId()));
|
||||
.getIconsCache().getContentIcon(item.getIconResourceId(), menu.isLight()));
|
||||
TextView name = (TextView) v.findViewById(R.id.name);
|
||||
AndroidUtils.setTextPrimaryColor(v.getContext(), name, !menu.isLight());
|
||||
name.setText(getContext().getText(item.getTitleResourceId()));
|
||||
return v;
|
||||
}
|
||||
|
|
|
@ -255,8 +255,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
TextView routeGoButton = (TextView) main.findViewById(R.id.map_go_route_button);
|
||||
routeGoButton.setCompoundDrawablesWithIntrinsicBounds(app.getIconsCache().getIcon(R.drawable.map_start_navigation, R.color.color_myloc_distance), null, null, null);
|
||||
routeGoButton.setText(mapActivity.getString(R.string.shared_string_go));
|
||||
routeGoButton.setTextColor(nightMode ?
|
||||
ContextCompat.getColorStateList(mapActivity, android.R.color.secondary_text_dark) : ContextCompat.getColorStateList(mapActivity, android.R.color.secondary_text_light));
|
||||
AndroidUtils.setTextSecondaryColor(mapActivity, routeGoButton, nightMode);
|
||||
AndroidUtils.setBackground(mapActivity, routeGoButton, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
|
||||
routeGoButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -321,7 +321,7 @@ public class MapInfoWidgetsFactory {
|
|||
boolean updated = updateVisibility(waypointInfoBar, true);
|
||||
// pass top bar to make it clickable
|
||||
WaypointDialogHelper.updatePointInfoView(map.getMyApplication(), map, topBar,
|
||||
pnt, true);
|
||||
pnt, true, !map.getMyApplication().getSettings().isLightContent());
|
||||
if (updated || changed) {
|
||||
ImageView all = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_more);
|
||||
ImageView remove = (ImageView) waypointInfoBar.findViewById(R.id.waypoint_close);
|
||||
|
|
Loading…
Reference in a new issue