Merge branch 'master' of github.com:osmandapp/Osmand
This commit is contained in:
commit
45b0a8a75f
51 changed files with 681 additions and 230 deletions
|
@ -110,7 +110,7 @@
|
|||
android:gravity="center"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/DownloadButton"
|
||||
android:id="@+id/downloadButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_weight="1"
|
||||
|
@ -120,7 +120,7 @@
|
|||
android:textColor="?attr/pstsTextColor"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/WikiButton"
|
||||
android:id="@+id/wikiButton"
|
||||
android:layout_width="@dimen/list_item_height"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:scaleType="centerInside"
|
||||
|
|
246
OsmAnd/res/layout/point_editor_fragment_land.xml
Normal file
246
OsmAnd/res/layout/point_editor_fragment_land.xml
Normal file
|
@ -0,0 +1,246 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/point_edit_layout"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||
android:background="?attr/pstsTabBackground"
|
||||
android:minHeight="@dimen/dashboard_map_toolbar"
|
||||
android:theme="?attr/toolbar_theme"
|
||||
app:contentInsetLeft="72dp"
|
||||
app:contentInsetStart="72dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete_button"
|
||||
android:layout_width="?attr/actionBarSize"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_action_delete_dark"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/save_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:background="@android:color/transparent"
|
||||
android:text="@string/shared_string_save"/>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/bg_point_editor_view"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/header_caption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="Point info"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/name_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_building_number"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name_caption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:text="@string/favourites_edit_dialog_name"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/name_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textColorHint="?android:textColorSecondary"
|
||||
android:inputType="text"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/category_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_building_number"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/category_caption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:text="@string/favourites_edit_dialog_name"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
<net.osmand.plus.widgets.AutoCompleteTextViewEx
|
||||
android:id="@+id/category_edit"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginLeft="8dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/description_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_note_dark"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/description_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:maxLines="8"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textColorHint="?android:textColorSecondary"
|
||||
android:inputType="textMultiLine"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
|
@ -15,7 +15,7 @@
|
|||
android:paddingLeft="@dimen/list_content_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftIcon"
|
||||
android:id="@+id/leftImageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
@ -52,7 +52,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/rightIcon"
|
||||
android:id="@+id/rightImageButton"
|
||||
android:layout_width="@dimen/list_item_height"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
|
|
@ -736,7 +736,7 @@
|
|||
<string name="favorite_home_category">Дом</string>
|
||||
<string name="favorite_friends_category">Сябры</string>
|
||||
<string name="favorite_places_category">Месцы</string>
|
||||
<string name="favorite_default_category">Іншае</string>
|
||||
<string name="shared_string_others">Іншае</string>
|
||||
<string name="favourites_edit_dialog_name">Назва</string>
|
||||
<string name="favourites_edit_dialog_category">Катэгорыя</string>
|
||||
<string name="shared_string_no_thanks">Не, дзякуй</string>
|
||||
|
@ -1459,7 +1459,7 @@
|
|||
<string name="osmo_mode_on">Спыніць сэсыю OsMo</string>
|
||||
<string name="osmo_mode_off">Запусьціць сэсыю OSMo</string>
|
||||
|
||||
<string name="share_fav_subject">Выбранае адаслана праз OsmAnd</string>
|
||||
<string name="share_fav_subject">Упадабанае адаслана праз OsmAnd</string>
|
||||
<string name="use_points_as_intermediates">Разлічыць маршрут паміж кропкамі</string>
|
||||
<string name="tip_recent_changes_1_8_alpha">Зьмены ў 1.8:
|
||||
* Разьлік маршруту паміж маршрутнымі пунктамі GPX-сьледу
|
||||
|
@ -2080,14 +2080,14 @@
|
|||
<string name="add_opening_hours">Дадаць гадзіны працы</string>
|
||||
<string name="poi_dialog_poi_type">Тып POI</string>
|
||||
<string name="please_specify_poi_type">Калі ласка, пазначце тып POI.</string>
|
||||
<string name="av_locations_descr">Gpx-файл з мецазнаходжаньнем заўваг</string>
|
||||
<string name="av_locations_descr">GPX-файл зь мецазнаходжаньнем заўваг</string>
|
||||
<string name="av_locations">Месцазнаходжаньні</string>
|
||||
<string name="number_of_rows_in_dash">Колькасьць радкоў на галоўным экране %1$s</string>
|
||||
<string name="tag_poi_amenity">грамадзкі аб\'ект</string>
|
||||
<string name="poi_action_delete">выдаліць</string>
|
||||
<string name="working_days">Працоўныя дні</string>
|
||||
<string name="recent_places">Нядаўнія месцы</string>
|
||||
<string name="favourites">Упадабанае</string>
|
||||
<string name="favourites">Упадабаныя</string>
|
||||
<string name="saved_at_time">Пасьпяхова захаваны ў: %1$s</string>
|
||||
<string name="show_gpx">Паказаць GPX</string>
|
||||
<string name="poi_deleted_localy">POI будуць выдаленыя, як толькі вы загрузіце вашы зьмены</string>
|
||||
|
@ -2103,4 +2103,7 @@
|
|||
<string name="roads">Дарогі</string>
|
||||
<string name="favourites_edit_dialog_title">Зьвесткі пра ўпадабанае</string>
|
||||
<string name="favourites_context_menu_add">Дадаць упадабанае</string>
|
||||
<string name="shared_string_trip_recording">Запіс падарожжа</string>
|
||||
<string name="shared_string_navigation">Навігацыя</string>
|
||||
<string name="osmand_running_in_background">Працуе ў фоне</string>
|
||||
</resources>
|
||||
|
|
|
@ -947,7 +947,7 @@ OsmAnd е с отворен код и активно да се развива.
|
|||
<string name="favorite_home_category">Дом</string>
|
||||
<string name="favorite_friends_category">Приятели</string>
|
||||
<string name="favorite_places_category">Места</string>
|
||||
<string name="favorite_default_category">Други</string>
|
||||
<string name="shared_string_others">Други</string>
|
||||
<string name="favourites_edit_dialog_name">Име</string>
|
||||
<string name="favourites_edit_dialog_category">Категория</string>
|
||||
<string name="shared_string_no_thanks">Не, благодаря</string>
|
||||
|
|
|
@ -302,7 +302,7 @@
|
|||
<string name="favourites_delete_multiple_succesful">S\'ha suprimit amb èxit el(s) punt(s) preferit(s).</string>
|
||||
<string name="favorite_friends_category">Amics</string>
|
||||
<string name="favorite_places_category">Llocs</string>
|
||||
<string name="favorite_default_category">Altres</string>
|
||||
<string name="shared_string_others">Altres</string>
|
||||
<string name="favourites_edit_dialog_name">Nom</string>
|
||||
<string name="favourites_edit_dialog_category">Categoria</string>
|
||||
|
||||
|
@ -2131,4 +2131,7 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="unsaved_changes_will_be_lost">Es perdran tots els canvis no desats. Voleu continuar?</string>
|
||||
<string name="downloads_left_template">%1$s baixades pendents</string>
|
||||
<string name="roads">Carreteres</string>
|
||||
</resources>
|
||||
<string name="shared_string_trip_recording">Enregistrament de trajectes</string>
|
||||
<string name="shared_string_navigation">Navegació</string>
|
||||
<string name="osmand_running_in_background">Execució en procés de fons</string>
|
||||
</resources>
|
||||
|
|
|
@ -253,7 +253,7 @@
|
|||
<string name="favorite_home_category">Doma</string>
|
||||
<string name="favorite_friends_category">Přátelé</string>
|
||||
<string name="favorite_places_category">Místa</string>
|
||||
<string name="favorite_default_category">Ostatní</string>
|
||||
<string name="shared_string_others">Ostatní</string>
|
||||
<string name="shared_string_no_thanks">Není potřeba</string>
|
||||
<string name="basemap_missing">Chybí základní mapa světa. Prosím stáhněte ji pro správnou funkci programu.</string>
|
||||
<string name="vector_data_missing">Na SD kartě nejsou uložena žádná offline data. Prosím stáhněte je pro použití map v offline módu.</string>
|
||||
|
|
|
@ -554,7 +554,7 @@
|
|||
<string name="favorite_home_category">Hjem</string>
|
||||
<string name="favorite_friends_category">Venner</string>
|
||||
<string name="favorite_places_category">Steder</string>
|
||||
<string name="favorite_default_category">Andre</string>
|
||||
<string name="shared_string_others">Andre</string>
|
||||
<string name="favourites_edit_dialog_name">Navn</string>
|
||||
<string name="favourites_edit_dialog_category">Kategori</string>
|
||||
<string name="shared_string_no_thanks">Nej tak</string>
|
||||
|
@ -2138,6 +2138,9 @@
|
|||
<string name="simulate_your_location_descr">Simuler ved brug af optaget GPX eller beregnet rute</string>
|
||||
<string name="downloads_left_template">%1$s filhentninger tilbage</string>
|
||||
<string name="roads">Veje</string>
|
||||
<string name="favourites_edit_dialog_title">Favorit information</string>
|
||||
<string name="favourites_edit_dialog_title">Favoritinformation</string>
|
||||
<string name="favourites_context_menu_add">Tilføj favorit</string>
|
||||
<string name="shared_string_trip_recording">Optag ture</string>
|
||||
<string name="shared_string_navigation">Navigation</string>
|
||||
<string name="osmand_running_in_background">Kører i baggrunden</string>
|
||||
</resources>
|
||||
|
|
|
@ -619,7 +619,7 @@
|
|||
<string name="favorite_home_category">Zu Hause</string>
|
||||
<string name="favorite_friends_category">Freunde</string>
|
||||
<string name="favorite_places_category">Sehenswertes</string>
|
||||
<string name="favorite_default_category">Andere</string>
|
||||
<string name="shared_string_others">Andere</string>
|
||||
<string name="favourites_edit_dialog_name">Name</string>
|
||||
<string name="favourites_edit_dialog_category">Kategorie</string>
|
||||
<string name="shared_string_no_thanks">Nicht verwendet</string>
|
||||
|
|
|
@ -1434,7 +1434,7 @@
|
|||
<string name="favorite_home_category">Inicio</string>
|
||||
<string name="favorite_friends_category">Amigos</string>
|
||||
<string name="favorite_places_category">Lugares</string>
|
||||
<string name="favorite_default_category">Otros</string>
|
||||
<string name="shared_string_others">Otros</string>
|
||||
<string name="favourites_edit_dialog_name">Nombre</string>
|
||||
<string name="favourites_edit_dialog_category">Categoría</string>
|
||||
<string name="shared_string_no_thanks">No, gracias</string>
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
<string name="favorite_home_category">Inicio</string>
|
||||
<string name="favorite_friends_category">Amigos</string>
|
||||
<string name="favorite_places_category">Lugares</string>
|
||||
<string name="favorite_default_category">Otros</string>
|
||||
<string name="shared_string_others">Otros</string>
|
||||
<string name="favourites_edit_dialog_name">Nombre</string>
|
||||
<string name="favourites_edit_dialog_category">Categoría</string>
|
||||
<string name="shared_string_no_thanks">No, gracias</string>
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
<string name="favorite_home_category">Koti</string>
|
||||
<string name="favorite_friends_category">Ystävät</string>
|
||||
<string name="favorite_places_category">Paikat</string>
|
||||
<string name="favorite_default_category">Muut</string>
|
||||
<string name="shared_string_others">Muut</string>
|
||||
<string name="favourites_edit_dialog_name">Nimi</string>
|
||||
<string name="favourites_edit_dialog_category">Kategoria</string>
|
||||
<string name="shared_string_no_thanks">Ei kiitos</string>
|
||||
|
@ -894,4 +894,5 @@
|
|||
<string name="shared_string_show_details">Näytä tiedot</string>
|
||||
<string name="layer_amenity_label">POI-nimet</string>
|
||||
<string name="context_menu_item_directions_to">Navigoi kohteeseen</string>
|
||||
<string name="interrupt_music">Keskeytä musiikki</string>
|
||||
</resources>
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
<string name="favorite_home_category">Domicile</string>
|
||||
<string name="favorite_friends_category">Amis</string>
|
||||
<string name="favorite_places_category">Lieux</string>
|
||||
<string name="favorite_default_category">Autres</string>
|
||||
<string name="shared_string_others">Autres</string>
|
||||
<string name="shared_string_no_thanks">Pas nécessaire</string>
|
||||
<string name="basemap_missing">La carte mondiale de base est absente (couvrant le monde entier à faible zoom). Pensez à télécharger World_basemap_x.obf pour avoir un environnement complet.</string>
|
||||
<string name="vector_data_missing">Il n\'y a pas de cartes (\'hors-ligne\') sur la carte SD. Pensez à en télécharger pour utiliser OsmAnd hors-ligne.</string>
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
<string name="favorite_home_category">Család</string>
|
||||
<string name="favorite_friends_category">Barátok</string>
|
||||
<string name="favorite_places_category">Helyek</string>
|
||||
<string name="favorite_default_category">Egyéb</string>
|
||||
<string name="shared_string_others">Egyéb</string>
|
||||
<string name="favourites_edit_dialog_name">Név</string>
|
||||
<string name="favourites_edit_dialog_category">Kategória</string>
|
||||
<string name="shared_string_no_thanks">Nem szükséges</string>
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
<string name="favorite_home_category">Casa</string>
|
||||
<string name="favorite_friends_category">Amici</string>
|
||||
<string name="favorite_places_category">Luoghi</string>
|
||||
<string name="favorite_default_category">Altro</string>
|
||||
<string name="shared_string_others">Altro</string>
|
||||
<string name="shared_string_no_thanks">No, grazie</string>
|
||||
<string name="basemap_missing">La mappa di base del mondo (ricopre l\'intero mondo per zoom bassi) è mancante. Puoi scaricare World_basemap_x.obf per un sistema completo.</string>
|
||||
<string name="vector_data_missing">Mancano i dati (\'offline\') nella scheda SD. Ti consigliamo di scaricarli per poter usare le mappe offline.</string>
|
||||
|
@ -2140,7 +2140,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
|
|||
<string name="rendering_value_boldOutline_name">Contorno in grassetto</string>
|
||||
<string name="traffic_warning_hazard">Pericolo</string>
|
||||
<string name="dahboard_options_dialog_title">Configura il pannello di controllo</string>
|
||||
<string name="shared_string_card_was_hidden">La carta era nascosta</string>
|
||||
<string name="shared_string_card_was_hidden">La scheda è stata nascosta</string>
|
||||
<string name="shared_string_undo">Annulla azione</string>
|
||||
<string name="shared_string_skip">Salta</string>
|
||||
<string name="app_name_osmand">OsmAnd</string>
|
||||
|
@ -2158,14 +2158,14 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
|
|||
<string name="closing_at">Chiude alle</string>
|
||||
<string name="av_locations_descr">File GPX con note locali</string>
|
||||
<string name="av_locations">Località</string>
|
||||
<string name="tag_poi_name">Nome</string>
|
||||
<string name="tag_poi_name">nome</string>
|
||||
<string name="tag_poi_amenity">amenità</string>
|
||||
<string name="contact_info">Informazioni di contatto</string>
|
||||
<string name="description">Descrizione</string>
|
||||
<string name="add_opening_hours">Aggiungi orari di apertura</string>
|
||||
<string name="poi_dialog_poi_type">Tipo di PDI</string>
|
||||
<string name="number_of_rows_in_dash">Numero di righe del cruscotto %1$s</string>
|
||||
<string name="please_specify_poi_type">Per favore specifica il tipo si PDI.</string>
|
||||
<string name="please_specify_poi_type">Per favore specifica il tipo di PDI.</string>
|
||||
<string name="poi_action_delete">elimina</string>
|
||||
<string name="working_days">Giorni lavorativi</string>
|
||||
<string name="recent_places">Luoghi recenti</string>
|
||||
|
@ -2184,4 +2184,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
|
|||
<string name="favourites_edit_dialog_title">Informazioni preferite</string>
|
||||
<string name="favourites_context_menu_add">Aggiungi preferito</string>
|
||||
<string name="roads">Strade</string>
|
||||
</resources>
|
||||
<string name="shared_string_trip_recording">Registrazione viaggio</string>
|
||||
<string name="shared_string_navigation">Navigazione</string>
|
||||
<string name="osmand_running_in_background">Avviato in backgroung</string>
|
||||
</resources>
|
||||
|
|
|
@ -1236,7 +1236,7 @@ POIの更新は利用できません</string>
|
|||
<string name="favorite_home_category">自宅</string>
|
||||
<string name="favorite_friends_category">友人宅</string>
|
||||
<string name="favorite_places_category">場所</string>
|
||||
<string name="favorite_default_category">その他</string>
|
||||
<string name="shared_string_others">その他</string>
|
||||
<string name="favourites_edit_dialog_name">名前</string>
|
||||
<string name="favourites_edit_dialog_category">カテゴリー</string>
|
||||
<string name="shared_string_no_thanks">必要ありません</string>
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
<string name="favorite_home_category">집</string>
|
||||
<string name="favorite_friends_category">친구</string>
|
||||
<string name="favorite_places_category">장소</string>
|
||||
<string name="favorite_default_category">기타</string>
|
||||
<string name="shared_string_others">기타</string>
|
||||
|
||||
<string name="favourites_edit_dialog_name">이름</string>
|
||||
<string name="favourites_edit_dialog_category">카테고리</string>
|
||||
|
|
|
@ -369,7 +369,7 @@
|
|||
<string name="favorite_home_category">Namai</string>
|
||||
<string name="favorite_friends_category">Draugai</string>
|
||||
<string name="favorite_places_category">Vietos</string>
|
||||
<string name="favorite_default_category">Kitos</string>
|
||||
<string name="shared_string_others">Kitos</string>
|
||||
<string name="favourites_edit_dialog_name">Pavadinimas</string>
|
||||
<string name="favourites_edit_dialog_category">Kategorija</string>
|
||||
<string name="shared_string_no_thanks">Ačiū, ne</string>
|
||||
|
|
|
@ -239,7 +239,7 @@
|
|||
<string name="favorite_home_category">Mājas</string>
|
||||
<string name="favorite_friends_category">Draugi</string>
|
||||
<string name="favorite_places_category">Vietas</string>
|
||||
<string name="favorite_default_category">Pārējais</string>
|
||||
<string name="shared_string_others">Pārējais</string>
|
||||
<string name="favourites_edit_dialog_name">Nosaukums</string>
|
||||
<string name="favourites_edit_dialog_category">Kategorija</string>
|
||||
<string name="shared_string_no_thanks">Nē, paldies</string>
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
<string name="favorite_home_category">घर</string>
|
||||
<string name="favorite_friends_category">मित्र</string>
|
||||
<string name="favorite_places_category">ठिकाणे</string>
|
||||
<string name="favorite_default_category">इतर</string>
|
||||
<string name="shared_string_others">इतर</string>
|
||||
<string name="favourites_edit_dialog_name">नाव</string>
|
||||
<string name="favourites_edit_dialog_category">वर्गीकरण</string>
|
||||
<string name="shared_string_no_thanks">नाही, धन्यवाद</string>
|
||||
|
|
|
@ -895,10 +895,10 @@
|
|||
<string name="poi_cutline">Tablica wyjaśniająca</string>
|
||||
<string name="poi_tree">Drzewo</string>
|
||||
<string name="poi_kent_carriage_gap">Bramka (szerokość powozu)</string>
|
||||
<string name="poi_icn_ref">Sieć węzłów międzynarodowej sieci rowerowej</string>
|
||||
<string name="poi_ncn_ref">Sieć węzłów krajowej sieci rowerowej</string>
|
||||
<string name="poi_rcn_ref">Sieć węzłów regionalnej sieci rowerowej</string>
|
||||
<string name="poi_lcn_ref">Sieć węzłów lokalnej sieci rowerowej</string>
|
||||
<string name="poi_icn_ref">Międzynarodowa trasa rowerowa</string>
|
||||
<string name="poi_ncn_ref">Krajowa trasa rowerowa</string>
|
||||
<string name="poi_rcn_ref">Regionalna trasa rowerowa</string>
|
||||
<string name="poi_lcn_ref">Lokalna trasa rowerowa</string>
|
||||
<string name="poi_iwn_ref">Sieć węzłów międzynarodowej sieci pieszej</string>
|
||||
<string name="poi_nwn_ref">Sieć węzłów krajowej sieci pieszej</string>
|
||||
<string name="poi_rwn_ref">Sieć węzłów regionalnej sieci pieszej</string>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<string name="favorite_home_category">Dom</string>
|
||||
<string name="favorite_friends_category">Znajomi</string>
|
||||
<string name="favorite_places_category">Miejsca</string>
|
||||
<string name="favorite_default_category">Inne</string>
|
||||
<string name="shared_string_others">Inne</string>
|
||||
<string name="shared_string_no_thanks">Niepotrzebne</string>
|
||||
<string name="basemap_missing">Podstawowa mapa świata jest niezainstalowana. Pobierz plik World_basemap_x.obf.</string>
|
||||
<string name="vector_data_missing">Brak danych (\'offline\') w urządzeniu na karcie SD. Musisz je najpierw pobrać, by używać map offline.</string>
|
||||
|
@ -2241,4 +2241,9 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
|
|||
<string name="address_unknown">Adres nie jest jeszcze znany</string>
|
||||
<string name="unsaved_changes_will_be_lost">Wszelkie niezapisane zmiany zostaną utracone. Kontynuować?</string>
|
||||
<string name="are_you_sure">Czy na pewno?</string>
|
||||
</resources>
|
||||
<string name="shared_string_navigation">Nawigacja</string>
|
||||
<string name="osmand_running_in_background">Uruchomiona w tle</string>
|
||||
<string name="simulate_your_location_stop_descr">Zatrzymaj symulację pozycji</string>
|
||||
<string name="favourites_context_menu_add">Dodaj do ulubionych</string>
|
||||
<string name="roads">Drogi</string>
|
||||
</resources>
|
||||
|
|
|
@ -1263,7 +1263,7 @@
|
|||
<string name="favorite_delete_multiple">Você apagará %1$d favorito(s) e %2$d grupo(s) favorito(s). Continuar?</string>
|
||||
<string name="favorite_friends_category">Amigos</string>
|
||||
<string name="favorite_places_category">Lugares</string>
|
||||
<string name="favorite_default_category">Outros</string>
|
||||
<string name="shared_string_others">Outros</string>
|
||||
<string name="favourites_edit_dialog_name">Nome</string>
|
||||
<string name="favourites_edit_dialog_category">Categoria</string>
|
||||
<string name="shared_string_no_thanks">Não, obrigado</string>
|
||||
|
|
|
@ -301,7 +301,7 @@
|
|||
<string name="favorite_home_category">Дом</string>
|
||||
<string name="favorite_friends_category">Друзья</string>
|
||||
<string name="favorite_places_category">Места</string>
|
||||
<string name="favorite_default_category">Другое</string>
|
||||
<string name="shared_string_others">Другое</string>
|
||||
<string name="shared_string_no_thanks">Не нужно</string>
|
||||
<string name="basemap_missing">Отсутствует базовая карта, покрывающая весь мир на мелком масштабе. Пожалуйста загрузите World_basemap_x.obf для полноценный работы приложения.</string>
|
||||
<string name="vector_data_missing">Локальные данные отсутствуют на SD-карте. Пожалуйста, загрузите их для того, чтобы использовать приложение без Интернета.</string>
|
||||
|
|
|
@ -1151,7 +1151,7 @@
|
|||
<string name="favorite_home_category">Domo</string>
|
||||
<string name="favorite_friends_category">Amigos</string>
|
||||
<string name="favorite_places_category">Logos</string>
|
||||
<string name="favorite_default_category">Àteru</string>
|
||||
<string name="shared_string_others">Àteru</string>
|
||||
<string name="favourites_edit_dialog_name">Nùmene</string>
|
||||
<string name="favourites_edit_dialog_category">Categoria</string>
|
||||
<string name="shared_string_no_thanks">No, gràtzias</string>
|
||||
|
|
|
@ -347,7 +347,7 @@
|
|||
<string name="favorite_home_category">Doma</string>
|
||||
<string name="favorite_friends_category">Priatelia</string>
|
||||
<string name="favorite_places_category">Miesta</string>
|
||||
<string name="favorite_default_category">Iné</string>
|
||||
<string name="shared_string_others">Iné</string>
|
||||
<string name="shared_string_no_thanks">Netreba</string>
|
||||
<string name="basemap_missing">Chýba základná mapa sveta(World Basemap). Prosím, zvážte jej stiahnutie pre správnu funkčnosť.</string>
|
||||
<string name="vector_data_missing">Na SD karte chýbajú offline údaje. Prosím, zvážte ich stiahnutie pre použitie máp bez internetu.</string>
|
||||
|
|
|
@ -508,7 +508,7 @@
|
|||
<string name="favorite_friends_category">Naslovi prijateljev</string>
|
||||
<string name="favourites_edit_dialog_name">Naziv</string>
|
||||
<string name="favourites_edit_dialog_category">Skupina</string>
|
||||
<string name="favorite_default_category">Druge točke</string>
|
||||
<string name="shared_string_others">Druge točke</string>
|
||||
<string name="favorite_home_category">Domači naslovi</string>
|
||||
<string name="favorite_places_category">Priljubljeni kraji</string>
|
||||
<string name="favorite_delete_multiple">Izbrisane bodo priljubljene točke (%1$d) in skupine (%2$d). Ali ste prepričani, da želite nadaljevati?</string>
|
||||
|
@ -1990,4 +1990,9 @@
|
|||
<string name="unsaved_changes_will_be_lost">Vse neshranjene spremembe bodo izgubljene. Ali želite nadaljevati?</string>
|
||||
<string name="downloads_left_template">%1$s prejemov v vrsti</string>
|
||||
<string name="roads">Poti</string>
|
||||
</resources>
|
||||
<string name="shared_string_trip_recording">Beleženje poti</string>
|
||||
<string name="shared_string_navigation">Navigacija</string>
|
||||
<string name="osmand_running_in_background">Delovanje v ozadju</string>
|
||||
<string name="favourites_edit_dialog_title">Podrobnosti o točki</string>
|
||||
<string name="favourites_context_menu_add">Dodaj priljubljeno</string>
|
||||
</resources>
|
||||
|
|
|
@ -273,7 +273,7 @@
|
|||
<string name="favourites_delete_multiple_succesful">Омиљена тачка(е) је успешно избрисана.</string>
|
||||
<string name="favorite_friends_category">Пријатељи</string>
|
||||
<string name="favorite_places_category">Места</string>
|
||||
<string name="favorite_default_category">Остало</string>
|
||||
<string name="shared_string_others">Остало</string>
|
||||
<string name="favourites_edit_dialog_name">Име</string>
|
||||
<string name="favourites_edit_dialog_category">Врста</string>
|
||||
<string name="shared_string_no_thanks">Не, хвала</string>
|
||||
|
|
|
@ -434,7 +434,7 @@
|
|||
<string name="favorite_home_category">Hem</string>
|
||||
<string name="favorite_friends_category">Vänner</string>
|
||||
<string name="favorite_places_category">Platser</string>
|
||||
<string name="favorite_default_category">Annat</string>
|
||||
<string name="shared_string_others">Annat</string>
|
||||
<string name="favourites_edit_dialog_name">Namn</string>
|
||||
<string name="favourites_edit_dialog_category">Kategori</string>
|
||||
<string name="shared_string_no_thanks">Nej, tack</string>
|
||||
|
|
|
@ -66,7 +66,7 @@ Translator: Le Viet Thanh; email: lethanhx2k@gmail.com --><resources>
|
|||
<string name="favorite_home_category">Nhà</string>
|
||||
<string name="favorite_friends_category">Bạn bè</string>
|
||||
<string name="favorite_places_category">Địa điểm</string>
|
||||
<string name="favorite_default_category">Khác</string>
|
||||
<string name="shared_string_others">Khác</string>
|
||||
|
||||
<string name="shared_string_no_thanks">Không cần</string>
|
||||
<string name="basemap_missing">Bản đồ nền (bao phủ toàn bộ thế giới ở tỉ lệ xem nhỏ) bị thiếu. Hãy tải về tập tin World_basemap_x.obf để bổ sung đầy đủ.</string>
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
|
||||
<string name="bg_service_sleep_mode_off">運行\n 應用程式在背景運轉</string>
|
||||
<string name="bg_service_sleep_mode_on">停止\n 在背景運轉</string>
|
||||
<string name="bg_service_sleep_mode_on">停止\n在背景執行</string>
|
||||
<string name="gps_wakeup_interval">GPS 喚醒間隔:%s</string>
|
||||
<string name="int_continuosly">繼續</string>
|
||||
<string name="screen_is_locked">要解鎖螢幕,按下鎖圖示</string>
|
||||
|
@ -427,7 +427,7 @@
|
|||
<string name="favorite_home_category">住家</string>
|
||||
<string name="favorite_friends_category">朋友</string>
|
||||
<string name="favorite_places_category">地點</string>
|
||||
<string name="favorite_default_category">其它</string>
|
||||
<string name="shared_string_others">其它</string>
|
||||
<string name="favourites_edit_dialog_name">名稱</string>
|
||||
<string name="favourites_edit_dialog_category">類別</string>
|
||||
<string name="shared_string_no_thanks">不需要,謝謝</string>
|
||||
|
@ -2119,4 +2119,7 @@
|
|||
<string name="favourites_edit_dialog_title">我的最愛資訊</string>
|
||||
<string name="favourites_context_menu_add">增加到我的最愛</string>
|
||||
<string name="roads">道路</string>
|
||||
</resources>
|
||||
<string name="shared_string_trip_recording">旅程錄製</string>
|
||||
<string name="shared_string_navigation">導航</string>
|
||||
<string name="osmand_running_in_background">在背景執行</string>
|
||||
</resources>
|
||||
|
|
|
@ -1483,7 +1483,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
<string name="favorite_home_category">Home</string>
|
||||
<string name="favorite_friends_category">Friends</string>
|
||||
<string name="favorite_places_category">Places</string>
|
||||
<string name="favorite_default_category">Others</string>
|
||||
<string name="shared_string_others">Others</string>
|
||||
<string name="favourites_edit_dialog_name">Name</string>
|
||||
<string name="favourites_edit_dialog_category">Category</string>
|
||||
<string name="shared_string_no_thanks">No, thanks</string>
|
||||
|
|
|
@ -27,6 +27,16 @@ public class FavouritePoint implements Serializable, LocationPoint {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public FavouritePoint(FavouritePoint favouritePoint) {
|
||||
this.latitude = favouritePoint.latitude;
|
||||
this.longitude = favouritePoint.longitude;
|
||||
this.category = favouritePoint.category;
|
||||
this.name = favouritePoint.name;
|
||||
this.color = favouritePoint.color;
|
||||
this.description = favouritePoint.description;
|
||||
this.visible = favouritePoint.visible;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
|
|
@ -559,7 +559,7 @@ public class FavouritesDbHelper {
|
|||
addEmptyCategory(context.getString(R.string.favorite_home_category));
|
||||
addEmptyCategory(context.getString(R.string.favorite_friends_category));
|
||||
addEmptyCategory(context.getString(R.string.favorite_places_category));
|
||||
addEmptyCategory(context.getString(R.string.favorite_default_category));
|
||||
addEmptyCategory(context.getString(R.string.shared_string_others));
|
||||
}
|
||||
|
||||
private FavoriteGroup getOrCreateGroup(FavouritePoint p, int defColor) {
|
||||
|
|
|
@ -142,7 +142,7 @@ public class DownloadActivity extends BaseDownloadActivity {
|
|||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.DownloadButton).setOnClickListener(new View.OnClickListener() {
|
||||
findViewById(R.id.downloadButton).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -150,7 +150,7 @@ public class DownloadActivity extends BaseDownloadActivity {
|
|||
}
|
||||
|
||||
});
|
||||
findViewById(R.id.WikiButton).setOnClickListener(new View.OnClickListener() {
|
||||
findViewById(R.id.wikiButton).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -423,7 +423,7 @@ public class DownloadActivity extends BaseDownloadActivity {
|
|||
} else {
|
||||
BasicProgressAsyncTask<?, ?, ?> task = DownloadActivity.downloadListIndexThread.getCurrentRunningTask();
|
||||
boolean running = task instanceof DownloadIndexesThread.DownloadIndexesAsyncTask;
|
||||
((Button) findViewById(R.id.DownloadButton)).setEnabled(!running);
|
||||
((Button) findViewById(R.id.downloadButton)).setEnabled(!running);
|
||||
String text;
|
||||
int downloads = DownloadActivity.downloadListIndexThread.getDownloads();
|
||||
if (!running) {
|
||||
|
@ -441,9 +441,9 @@ public class DownloadActivity extends BaseDownloadActivity {
|
|||
text += " (" + (excessLimit ? "! " : "") + getString(R.string.files_limit, left).toLowerCase() + ")";
|
||||
}
|
||||
}
|
||||
((Button) findViewById(R.id.DownloadButton)).setText(text);
|
||||
((Button) findViewById(R.id.downloadButton)).setText(text);
|
||||
List<IndexItem> wikipediaItems = getWikipediaItems();
|
||||
findViewById(R.id.WikiButton).setVisibility(wikipediaItems.size() == 0 ? View.GONE : View.VISIBLE);
|
||||
findViewById(R.id.wikiButton).setVisibility(wikipediaItems.size() == 0 ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
for (WeakReference<Fragment> ref : fragList) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package net.osmand.plus.download;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.IndexConstants;
|
||||
|
@ -24,34 +26,53 @@ import java.util.Map;
|
|||
|
||||
import static net.osmand.IndexConstants.BINARY_MAP_INDEX_EXT;
|
||||
|
||||
public class DownloadActivityType {
|
||||
public class DownloadActivityType implements Parcelable {
|
||||
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||
private static Map<String, DownloadActivityType> byTag = new HashMap<String, DownloadActivityType>();
|
||||
private static Map<String, DownloadActivityType> byTag = new HashMap<>();
|
||||
|
||||
public static final DownloadActivityType NORMAL_FILE = new DownloadActivityType(R.string.download_regular_maps, "map");
|
||||
public static final DownloadActivityType VOICE_FILE = new DownloadActivityType(R.string.voices, "voice");
|
||||
public static final DownloadActivityType VOICE_FILE =
|
||||
new DownloadActivityType(R.string.voices, R.drawable.ic_action_volume_up, "voice");
|
||||
public static final DownloadActivityType ROADS_FILE = new DownloadActivityType(R.string.download_roads_only_maps, "road_map");
|
||||
public static final DownloadActivityType SRTM_COUNTRY_FILE = new DownloadActivityType(R.string.download_srtm_maps, "srtm_map");
|
||||
public static final DownloadActivityType HILLSHADE_FILE = new DownloadActivityType(R.string.download_hillshade_maps, "hillshade");
|
||||
public static final DownloadActivityType WIKIPEDIA_FILE = new DownloadActivityType(R.string.download_wikipedia_maps, "wikimap");
|
||||
public static final DownloadActivityType SRTM_COUNTRY_FILE =
|
||||
new DownloadActivityType(R.string.download_srtm_maps,
|
||||
R.drawable.ic_plugin_srtm, "srtm_map");
|
||||
public static final DownloadActivityType HILLSHADE_FILE =
|
||||
new DownloadActivityType(R.string.download_hillshade_maps,
|
||||
R.drawable.ic_action_hillshade_dark, "hillshade");
|
||||
public static final DownloadActivityType WIKIPEDIA_FILE =
|
||||
new DownloadActivityType(R.string.download_wikipedia_maps,
|
||||
R.drawable.ic_world_globe_dark, "wikimap");
|
||||
public static final DownloadActivityType LIVE_UPDATES_FILE = new DownloadActivityType(R.string.download_live_updates, "live_updates");
|
||||
private int resource;
|
||||
private String[] tags;
|
||||
private final int stringResource;
|
||||
private final int iconResource;
|
||||
|
||||
public DownloadActivityType(int resource, String... tags) {
|
||||
this.resource = resource;
|
||||
this.tags = tags;
|
||||
for(String st : tags) {
|
||||
byTag.put(st, this);
|
||||
}
|
||||
private String tag;
|
||||
|
||||
public DownloadActivityType(int stringResource, int iconResource, String tag) {
|
||||
this.stringResource = stringResource;
|
||||
this.tag = tag;
|
||||
byTag.put(tag, this);
|
||||
this.iconResource = iconResource;
|
||||
}
|
||||
|
||||
public int getResource(){
|
||||
return resource;
|
||||
public DownloadActivityType(int stringResource, String tag) {
|
||||
this.stringResource = stringResource;
|
||||
this.tag = tag;
|
||||
byTag.put(tag, this);
|
||||
iconResource = R.drawable.ic_map;
|
||||
}
|
||||
|
||||
public int getStringResource(){
|
||||
return stringResource;
|
||||
}
|
||||
|
||||
public int getIconResource() {
|
||||
return iconResource;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tags[0];
|
||||
return tag;
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,7 +87,7 @@ public class DownloadActivityType {
|
|||
}
|
||||
|
||||
public String getString(Context c) {
|
||||
return c.getString(resource);
|
||||
return c.getString(stringResource);
|
||||
}
|
||||
|
||||
public static DownloadActivityType getIndexType(String tagName) {
|
||||
|
@ -230,9 +251,8 @@ public class DownloadActivityType {
|
|||
}
|
||||
|
||||
public String getVisibleName(IndexItem indexItem, Context ctx, OsmandRegions osmandRegions) {
|
||||
String fileName = indexItem.fileName;
|
||||
|
||||
if (this == VOICE_FILE) {
|
||||
String fileName = indexItem.fileName;
|
||||
if (fileName.endsWith(IndexConstants.VOICE_INDEX_EXT_ZIP)) {
|
||||
return FileNameTranslationHelper.getVoiceName(ctx, getBasename(indexItem));
|
||||
} else if (fileName.endsWith(IndexConstants.TTSVOICE_INDEX_EXT_ZIP)) {
|
||||
|
@ -244,9 +264,9 @@ public class DownloadActivityType {
|
|||
if (bn.endsWith(FileNameTranslationHelper.WIKI_NAME)){
|
||||
return FileNameTranslationHelper.getWikiName(ctx,bn);
|
||||
}
|
||||
if (bn.startsWith(FileNameTranslationHelper.HILL_SHADE)){
|
||||
return FileNameTranslationHelper.getHillShadeName(ctx, osmandRegions, bn);
|
||||
}
|
||||
// if (this == HILLSHADE_FILE){
|
||||
// return FileNameTranslationHelper.getHillShadeName(ctx, osmandRegions, bn);
|
||||
// }
|
||||
final String lc = bn.toLowerCase();
|
||||
String std = FileNameTranslationHelper.getStandardMapName(ctx, lc);
|
||||
if (std != null) {
|
||||
|
@ -271,8 +291,7 @@ public class DownloadActivityType {
|
|||
if (l == -1) {
|
||||
l = fileName.length();
|
||||
}
|
||||
String s = fileName.substring(0, l);
|
||||
return s;
|
||||
return fileName.substring(0, l);
|
||||
} else if (this == HILLSHADE_FILE) {
|
||||
return fileName.replace('_', ' ');
|
||||
} else if (this == LIVE_UPDATES_FILE) {
|
||||
|
@ -314,16 +333,19 @@ public class DownloadActivityType {
|
|||
if (fileName.endsWith(IndexConstants.EXTRA_ZIP_EXT)) {
|
||||
return fileName.substring(0, fileName.length() - IndexConstants.EXTRA_ZIP_EXT.length());
|
||||
}
|
||||
if (this == HILLSHADE_FILE) {
|
||||
return fileName.substring(0, fileName.length() - IndexConstants.SQLITE_EXT.length())
|
||||
.replace(FileNameTranslationHelper.HILL_SHADE, "");
|
||||
}
|
||||
if (fileName.endsWith(IndexConstants.SQLITE_EXT)) {
|
||||
return fileName.substring(0, fileName.length() - IndexConstants.SQLITE_EXT.length()).replace('_', ' ');
|
||||
return fileName.substring(0, fileName.length() - IndexConstants.SQLITE_EXT.length());
|
||||
}
|
||||
if (this == VOICE_FILE) {
|
||||
int l = fileName.lastIndexOf('_');
|
||||
if (l == -1) {
|
||||
l = fileName.length();
|
||||
}
|
||||
String s = fileName.substring(0, l);
|
||||
return s;
|
||||
return fileName.substring(0, l);
|
||||
}
|
||||
if (this == LIVE_UPDATES_FILE) {
|
||||
if(fileName.indexOf('.') > 0){
|
||||
|
@ -340,6 +362,32 @@ public class DownloadActivityType {
|
|||
return fileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.stringResource);
|
||||
dest.writeInt(this.iconResource);
|
||||
dest.writeString(this.tag);
|
||||
}
|
||||
|
||||
protected DownloadActivityType(Parcel in) {
|
||||
this.stringResource = in.readInt();
|
||||
this.iconResource = in.readInt();
|
||||
this.tag = in.readString();
|
||||
byTag.put(tag, this);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<DownloadActivityType> CREATOR = new Parcelable.Creator<DownloadActivityType>() {
|
||||
public DownloadActivityType createFromParcel(Parcel source) {
|
||||
return new DownloadActivityType(source);
|
||||
}
|
||||
|
||||
public DownloadActivityType[] newArray(int size) {
|
||||
return new DownloadActivityType[size];
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package net.osmand.plus.download;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import net.osmand.IndexConstants;
|
||||
|
@ -18,7 +20,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class IndexItem implements Comparable<IndexItem>, HasName {
|
||||
public class IndexItem implements Comparable<IndexItem>, HasName, Parcelable {
|
||||
private static final Log log = PlatformUtil.getLog(IndexItem.class);
|
||||
|
||||
String description;
|
||||
|
@ -114,9 +116,9 @@ public class IndexItem implements Comparable<IndexItem>, HasName {
|
|||
|
||||
@Override
|
||||
public int compareTo(@NonNull IndexItem another) {
|
||||
if(another == null) {
|
||||
return -1;
|
||||
}
|
||||
// if(another == null) {
|
||||
// return -1;
|
||||
// }
|
||||
return getFileName().compareTo(another.getFileName());
|
||||
}
|
||||
|
||||
|
@ -146,7 +148,7 @@ public class IndexItem implements Comparable<IndexItem>, HasName {
|
|||
|
||||
@Override
|
||||
public String getName() {
|
||||
return initializedName;
|
||||
return initializedName + " must be fixed";
|
||||
}
|
||||
|
||||
public void setName(String initializedName) {
|
||||
|
@ -166,4 +168,44 @@ public class IndexItem implements Comparable<IndexItem>, HasName {
|
|||
", extra=" + extra +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.description);
|
||||
dest.writeString(this.fileName);
|
||||
dest.writeString(this.size);
|
||||
dest.writeLong(this.timestamp);
|
||||
dest.writeLong(this.contentSize);
|
||||
dest.writeLong(this.containerSize);
|
||||
dest.writeParcelable(this.type, flags);
|
||||
dest.writeByte(extra ? (byte) 1 : (byte) 0);
|
||||
dest.writeString(this.initializedName);
|
||||
}
|
||||
|
||||
protected IndexItem(Parcel in) {
|
||||
this.description = in.readString();
|
||||
this.fileName = in.readString();
|
||||
this.size = in.readString();
|
||||
this.timestamp = in.readLong();
|
||||
this.contentSize = in.readLong();
|
||||
this.containerSize = in.readLong();
|
||||
this.type = in.readParcelable(DownloadActivityType.class.getClassLoader());
|
||||
this.extra = in.readByte() != 0;
|
||||
this.initializedName = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<IndexItem> CREATOR = new Parcelable.Creator<IndexItem>() {
|
||||
public IndexItem createFromParcel(Parcel source) {
|
||||
return new IndexItem(source);
|
||||
}
|
||||
|
||||
public IndexItem[] newArray(int size) {
|
||||
return new IndexItem[size];
|
||||
}
|
||||
};
|
||||
}
|
|
@ -40,7 +40,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment {
|
|||
private OsmandRegions osmandRegions;
|
||||
private java.text.DateFormat format;
|
||||
private UpdateIndexAdapter listAdapter;
|
||||
List<IndexItem> indexItems = new ArrayList<IndexItem>();
|
||||
List<IndexItem> indexItems = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -233,7 +233,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment {
|
|||
private void filterExisting() {
|
||||
final Map<String, String> listAlreadyDownloaded = DownloadActivity.downloadListIndexThread.getDownloadedIndexFileNames();
|
||||
|
||||
final List<IndexItem> filtered = new ArrayList<IndexItem>();
|
||||
final List<IndexItem> filtered = new ArrayList<>();
|
||||
for (IndexItem fileItem : listAdapter.getIndexFiles()) {
|
||||
if (fileItem.isAlreadyDownloaded(listAlreadyDownloaded)) {
|
||||
filtered.add(fileItem);
|
||||
|
@ -329,7 +329,7 @@ public class UpdatesIndexFragment extends OsmAndListFragment {
|
|||
}
|
||||
|
||||
private String getMapDescription(IndexItem item){
|
||||
String typeName = getTypeName(item, item.getType().getResource());
|
||||
String typeName = getTypeName(item, item.getType().getStringResource());
|
||||
String date = item.getDate(format);
|
||||
String size = item.getSizeDescription(getActivity());
|
||||
return typeName + " " + date + " " + size;
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.osmand.OsmAndCollator;
|
|||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.map.OsmandRegions;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.download.DownloadActivityType;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
|
@ -133,8 +132,12 @@ public class IndexItemCategoryWithSubcat implements Comparable<IndexItemCategory
|
|||
}
|
||||
}
|
||||
|
||||
if (i.getType() == DownloadActivityType.VOICE_FILE) {
|
||||
category.items.add(i);
|
||||
} else {
|
||||
IndexItemCategoryWithSubcat region;
|
||||
region = cats.get(i.getBasename());
|
||||
// TODO remove
|
||||
final String visibleName = i.getVisibleName(ctx, ctx.getRegions());
|
||||
i.setName(visibleName);
|
||||
if (region == null) {
|
||||
|
@ -145,34 +148,48 @@ public class IndexItemCategoryWithSubcat implements Comparable<IndexItemCategory
|
|||
category.subcats.add(region);
|
||||
}
|
||||
region.items.add(i);
|
||||
|
||||
if (i.getType() == DownloadActivityType.NORMAL_FILE) {
|
||||
region.types.add(R.string.shared_string_map);
|
||||
if (i.getType() == DownloadActivityType.NORMAL_FILE
|
||||
|| i.getType() == DownloadActivityType.WIKIPEDIA_FILE
|
||||
|| i.getType() == DownloadActivityType.SRTM_COUNTRY_FILE
|
||||
|| i.getType() == DownloadActivityType.HILLSHADE_FILE) {
|
||||
category.types.add(i.getType().getStringResource());
|
||||
region.types.add(i.getType().getStringResource());
|
||||
}
|
||||
if (i.getType() == DownloadActivityType.WIKIPEDIA_FILE) {
|
||||
region.types.add(R.string.shared_string_wikipedia);
|
||||
}
|
||||
if (i.getType() == DownloadActivityType.ROADS_FILE) {
|
||||
region.types.add(R.string.roads);
|
||||
}
|
||||
|
||||
final CategoryStaticData parent = category.categoryStaticData.getParent();
|
||||
}
|
||||
final Collator collator = OsmAndCollator.primaryCollator();
|
||||
for (IndexItemCategoryWithSubcat ct : mainList) {
|
||||
for (IndexItemCategoryWithSubcat category : mainList) {
|
||||
final OsmandRegions osmandRegions = ctx.getResourceManager().getOsmandRegions();
|
||||
Collections.sort(ct.items, new Comparator<IndexItem>() {
|
||||
@Override
|
||||
public int compare(IndexItem lhs, IndexItem rhs) {
|
||||
return collator.compare(lhs.getVisibleName(ctx, osmandRegions),
|
||||
rhs.getVisibleName(ctx, osmandRegions));
|
||||
}
|
||||
});
|
||||
sortIndexItemCategoryWithSybcat(category, ctx, osmandRegions, collator);
|
||||
}
|
||||
Collections.sort(mainList);
|
||||
return mainList;
|
||||
}
|
||||
|
||||
private static void sortIndexItemCategoryWithSybcat(final IndexItemCategoryWithSubcat category,
|
||||
final OsmandApplication context,
|
||||
final OsmandRegions osmandRegions,
|
||||
final Collator collator) {
|
||||
if (category.subcats.size() > 0) {
|
||||
Collections.sort(category.subcats, new Comparator<IndexItemCategoryWithSubcat>() {
|
||||
@Override
|
||||
public int compare(IndexItemCategoryWithSubcat lhs, IndexItemCategoryWithSubcat rhs) {
|
||||
return collator.compare(lhs.getName(), rhs.getName());
|
||||
}
|
||||
});
|
||||
for (IndexItemCategoryWithSubcat subcat : category.subcats) {
|
||||
sortIndexItemCategoryWithSybcat(subcat, context, osmandRegions, collator);
|
||||
}
|
||||
}
|
||||
Collections.sort(category.items, new Comparator<IndexItem>() {
|
||||
@Override
|
||||
public int compare(IndexItem lhs, IndexItem rhs) {
|
||||
return collator.compare(lhs.getVisibleName(context, osmandRegions),
|
||||
rhs.getVisibleName(context, osmandRegions));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return categoryStaticData.getName();
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.osmand.PlatformUtil;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.download.DownloadActivity;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
import net.osmand.plus.helpers.HasName;
|
||||
|
||||
|
@ -57,12 +58,12 @@ public class MapsInCategoryFragment extends DialogFragment {
|
|||
|
||||
public void onCategorySelected(@NonNull IndexItemCategoryWithSubcat category) {
|
||||
LOG.debug("onCategorySelected()");
|
||||
getChildFragmentManager().beginTransaction().replace(R.id.fragmentContainer,
|
||||
SubcategoriesFragment.createInstance(category)).addToBackStack(null).commit();
|
||||
createInstance(category).show(getChildFragmentManager(), TAG);
|
||||
}
|
||||
|
||||
public void onIndexItemSelected(@NonNull IndexItem indexItem) {
|
||||
LOG.debug("onIndexItemSelected()");
|
||||
((DownloadActivity) getActivity()).startDownload(indexItem);
|
||||
}
|
||||
|
||||
public static MapsInCategoryFragment createInstance(
|
||||
|
|
|
@ -14,7 +14,6 @@ import android.view.MenuInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
|
@ -55,13 +54,6 @@ public class NewLocalIndexesFragment extends OsmAndListFragment {
|
|||
ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
mAdapter = new CategoriesAdapter(getActivity(), getMyApplication());
|
||||
listView.setAdapter(mAdapter);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
LOG.debug("onItemClick()");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
View header = inflater.inflate(R.layout.local_index_fragment_header, listView, false);
|
||||
initMemoryConsumedCard(header);
|
||||
|
@ -116,7 +108,6 @@ public class NewLocalIndexesFragment extends OsmAndListFragment {
|
|||
fragmentTransaction.addToBackStack(null);
|
||||
MapsInCategoryFragment.createInstance(mAdapter.getItem(position-1))
|
||||
.show(fragmentTransaction, MapsInCategoryFragment.TAG);
|
||||
LOG.debug("onListItemClick()");
|
||||
}
|
||||
|
||||
private DownloadActivity getDownloadActivity() {
|
||||
|
@ -124,7 +115,6 @@ public class NewLocalIndexesFragment extends OsmAndListFragment {
|
|||
}
|
||||
|
||||
public void onCategorizationFinished(List<IndexItem> filtered, List<IndexItemCategoryWithSubcat> cats) {
|
||||
LOG.debug("cats=" + cats);
|
||||
mAdapter.clear();
|
||||
mAdapter.addAll(cats);
|
||||
}
|
||||
|
|
|
@ -16,17 +16,16 @@ import android.widget.ListView;
|
|||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.download.DownloadActivity;
|
||||
import net.osmand.plus.download.DownloadActivityType;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
import net.osmand.plus.helpers.HasName;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class SubcategoriesFragment extends Fragment {
|
||||
private static final Log LOG = PlatformUtil.getLog(SubcategoriesFragment.class);
|
||||
private static final String CATEGORY = "category";
|
||||
|
@ -38,21 +37,14 @@ public class SubcategoriesFragment extends Fragment {
|
|||
assert category != null;
|
||||
|
||||
ListView listView = new ListView(getActivity());
|
||||
final MapFilesAdapter mAdapter = new MapFilesAdapter(getActivity(),
|
||||
((OsmandApplication) getActivity().getApplication()).getIconsCache());
|
||||
final OsmandApplication application = (OsmandApplication) getActivity().getApplication();
|
||||
final MapFilesAdapter mAdapter = new MapFilesAdapter(getActivity());
|
||||
listView.setAdapter(mAdapter);
|
||||
mAdapter.addAll(category.items);
|
||||
mAdapter.addAll(category.subcats);
|
||||
mAdapter.sort(new Comparator<HasName>() {
|
||||
@Override
|
||||
public int compare(HasName lhs, HasName rhs) {
|
||||
return lhs.getName().compareTo(rhs.getName());
|
||||
}
|
||||
});
|
||||
|
||||
View freeVersionBanner = inflater.inflate(R.layout.free_version_banner, listView, false);
|
||||
final OsmandSettings settings =
|
||||
((OsmandApplication) getActivity().getApplication()).getSettings();
|
||||
final OsmandSettings settings = application.getSettings();
|
||||
DownloadsUiInitHelper.initFreeVersionBanner(freeVersionBanner, settings, getResources());
|
||||
listView.addHeaderView(freeVersionBanner);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
@ -83,12 +75,8 @@ public class SubcategoriesFragment extends Fragment {
|
|||
|
||||
|
||||
private static class MapFilesAdapter extends ArrayAdapter<HasName> {
|
||||
|
||||
private final IconsCache iconsCache;
|
||||
|
||||
public MapFilesAdapter(Context context, IconsCache iconsCache) {
|
||||
public MapFilesAdapter(Context context) {
|
||||
super(context, R.layout.two_line_with_images_list_item);
|
||||
this.iconsCache = iconsCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,40 +85,21 @@ public class SubcategoriesFragment extends Fragment {
|
|||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.two_line_with_images_list_item, parent, false);
|
||||
viewHolder = new ViewHolder();
|
||||
viewHolder.nameTextView = (TextView) convertView.findViewById(R.id.name);
|
||||
viewHolder.descrTextView = (TextView) convertView.findViewById(R.id.description);
|
||||
viewHolder.leftImageView = (ImageView) convertView.findViewById(R.id.leftIcon);
|
||||
viewHolder.rightImageView = (ImageView) convertView.findViewById(R.id.rightIcon);
|
||||
viewHolder = new ViewHolder(convertView);
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
HasName item = getItem(position);
|
||||
if (item instanceof IndexItemCategoryWithSubcat) {
|
||||
IndexItemCategoryWithSubcat category = (IndexItemCategoryWithSubcat) item;
|
||||
viewHolder.nameTextView.setText(category.getName());
|
||||
if (category.types.size() > 0) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Resources resources = getContext().getResources();
|
||||
for (Integer mapType : category.types) {
|
||||
stringBuilder.append(resources.getString(mapType));
|
||||
stringBuilder.append(", ");
|
||||
}
|
||||
LOG.debug("stringBuilder=" + stringBuilder);
|
||||
stringBuilder.delete(stringBuilder.capacity() - 3, stringBuilder.capacity());
|
||||
viewHolder.descrTextView.setText(stringBuilder.toString());
|
||||
viewHolder.bindCategory((IndexItemCategoryWithSubcat) item,
|
||||
(DownloadActivity)getContext());
|
||||
} else if (item instanceof IndexItem) {
|
||||
viewHolder.bindIndexItem((IndexItem) item, (DownloadActivity) getContext());
|
||||
} else {
|
||||
// TODO replace with string constant
|
||||
viewHolder.descrTextView.setText("Others");
|
||||
throw new IllegalArgumentException("Item must be of type IndexItem or " +
|
||||
"IndexItemCategory but is of type:" + item.getClass());
|
||||
}
|
||||
LOG.debug("category.types=" + category.types);
|
||||
} else {
|
||||
viewHolder.nameTextView.setText(item.getName());
|
||||
// TODO replace with real values
|
||||
viewHolder.descrTextView.setText("Temp values");
|
||||
}
|
||||
viewHolder.leftImageView.setImageDrawable(iconsCache.getContentIcon(R.drawable.ic_map));
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
@ -138,7 +107,45 @@ public class SubcategoriesFragment extends Fragment {
|
|||
TextView nameTextView;
|
||||
TextView descrTextView;
|
||||
ImageView leftImageView;
|
||||
ImageView rightImageView;
|
||||
ImageView rightImageButton;
|
||||
|
||||
public ViewHolder(View convertView) {
|
||||
nameTextView = (TextView) convertView.findViewById(R.id.name);
|
||||
descrTextView = (TextView) convertView.findViewById(R.id.description);
|
||||
leftImageView = (ImageView) convertView.findViewById(R.id.leftImageView);
|
||||
rightImageButton = (ImageView) convertView.findViewById(R.id.rightImageButton);
|
||||
}
|
||||
|
||||
public void bindIndexItem(IndexItem indexItem, DownloadActivity context) {
|
||||
if (indexItem.getType() == DownloadActivityType.VOICE_FILE) {
|
||||
nameTextView.setText(indexItem.getVisibleName(context,
|
||||
context.getMyApplication().getRegions()));
|
||||
} else {
|
||||
nameTextView.setText(indexItem.getType().getString(context));
|
||||
}
|
||||
descrTextView.setText(indexItem.getSizeDescription(context));
|
||||
leftImageView.setImageDrawable(context.getMyApplication()
|
||||
.getIconsCache().getContentIcon(indexItem.getType().getIconResource()));
|
||||
}
|
||||
|
||||
public void bindCategory(IndexItemCategoryWithSubcat category,
|
||||
DownloadActivity context) {
|
||||
nameTextView.setText(category.getName());
|
||||
if (category.types.size() > 0) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Resources resources = context.getResources();
|
||||
for (Integer mapType : category.types) {
|
||||
stringBuilder.append(resources.getString(mapType));
|
||||
stringBuilder.append(", ");
|
||||
}
|
||||
stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.capacity());
|
||||
descrTextView.setText(stringBuilder.toString());
|
||||
} else {
|
||||
descrTextView.setText(R.string.shared_string_others);
|
||||
}
|
||||
leftImageView.setImageDrawable(context.getMyApplication()
|
||||
.getIconsCache().getContentIcon(R.drawable.ic_map));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package net.osmand.plus.helpers;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.map.OsmandRegions;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
|
@ -12,9 +16,9 @@ import java.lang.reflect.Field;
|
|||
* on 07.07.2014.
|
||||
*/
|
||||
public class FileNameTranslationHelper {
|
||||
|
||||
private static final Log LOG = PlatformUtil.getLog(FileNameTranslationHelper.class);
|
||||
public static final String WIKI_NAME = "_wiki";
|
||||
public static final String HILL_SHADE = "Hillshade";
|
||||
public static final String HILL_SHADE = "Hillshade_";
|
||||
|
||||
public static String getFileName(Context ctx, OsmandRegions regions, String fileName) {
|
||||
String basename = getBasename(fileName);
|
||||
|
@ -51,10 +55,8 @@ public class FileNameTranslationHelper {
|
|||
}
|
||||
|
||||
public static String getHillShadeName(Context ctx, OsmandRegions regions, String basename) {
|
||||
String intermName = basename.replace(HILL_SHADE,"");
|
||||
String hillsh = ctx.getString(R.string.download_hillshade_item) + " ";
|
||||
|
||||
String locName = regions.getLocaleName(intermName.trim().replace(" ", "_"));
|
||||
String locName = regions.getLocaleName(basename.trim());
|
||||
return hillsh + locName;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.osmand.plus.helpers;
|
||||
|
||||
public interface HasName {
|
||||
@Deprecated
|
||||
String getName();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.app.Activity;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.Log;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.ResultMatcher;
|
||||
|
@ -52,7 +53,7 @@ public class MapContextMenu {
|
|||
private static final String KEY_CTX_MENU_STREET_STR = "key_ctx_menu_street_str";
|
||||
|
||||
public boolean isMenuVisible() {
|
||||
return mapActivity.getSupportFragmentManager().findFragmentByTag("MapContextMenuFragment") != null;
|
||||
return findMenuFragment() != null;
|
||||
}
|
||||
|
||||
public PointDescription getPointDescription() {
|
||||
|
@ -107,9 +108,10 @@ public class MapContextMenu {
|
|||
|
||||
public void hide() {
|
||||
MapContextMenuFragment fragment = findMenuFragment();
|
||||
if (fragment != null)
|
||||
if (fragment != null) {
|
||||
fragment.dismissMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean needStreetName() {
|
||||
boolean res = object != null || Algorithms.isEmpty(pointDescription.getName());
|
||||
|
@ -138,12 +140,13 @@ public class MapContextMenu {
|
|||
}
|
||||
|
||||
private MapContextMenuFragment findMenuFragment() {
|
||||
Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag("MapContextMenuFragment");
|
||||
if (fragment != null)
|
||||
return (MapContextMenuFragment)fragment;
|
||||
else
|
||||
Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(MapContextMenuFragment.TAG);
|
||||
if (fragment != null) {
|
||||
return (MapContextMenuFragment) fragment;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int getLeftIconId() {
|
||||
return leftIconId;
|
||||
|
@ -335,8 +338,11 @@ public class MapContextMenu {
|
|||
|
||||
public void saveMenuState(Bundle bundle) {
|
||||
if (object != null) {
|
||||
if (object instanceof Amenity)
|
||||
bundle.putSerializable(KEY_CTX_MENU_OBJECT, (Amenity)object);
|
||||
if (object instanceof Amenity) {
|
||||
bundle.putSerializable(KEY_CTX_MENU_OBJECT, (Amenity) object);
|
||||
} else if (object instanceof FavouritePoint) {
|
||||
bundle.putSerializable(KEY_CTX_MENU_OBJECT, (FavouritePoint) object);
|
||||
}
|
||||
}
|
||||
bundle.putSerializable(KEY_CTX_MENU_POINT_DESC, pointDescription);
|
||||
bundle.putSerializable(KEY_CTX_MENU_NAME_STR, nameStr);
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
import android.view.GestureDetector;
|
||||
|
@ -511,7 +512,7 @@ public class MapContextMenuFragment extends Fragment {
|
|||
public void dismissMenu() {
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity != null) {
|
||||
activity.getSupportFragmentManager().popBackStack();
|
||||
activity.getSupportFragmentManager().popBackStack(TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -540,8 +541,8 @@ public class MapContextMenuFragment extends Fragment {
|
|||
MapContextMenuFragment fragment = new MapContextMenuFragment();
|
||||
mapActivity.getSupportFragmentManager().beginTransaction()
|
||||
.setCustomAnimations(slideInAnim, slideOutAnim, slideInAnim, slideOutAnim)
|
||||
.add(R.id.fragmentContainer, fragment, "MapContextMenuFragment")
|
||||
.addToBackStack(null).commit();
|
||||
.add(R.id.fragmentContainer, fragment, TAG)
|
||||
.addToBackStack(TAG).commit();
|
||||
}
|
||||
|
||||
private MapContextMenu getCtxMenu() {
|
||||
|
|
|
@ -11,7 +11,8 @@ public class FavoritePointEditor extends PointEditor {
|
|||
|
||||
private FavouritePoint favorite;
|
||||
|
||||
public static final String FRAGMENT_NAME = "FavoritePointEditorFragment";
|
||||
public static final String TAG = "FavoritePointEditorFragment";
|
||||
private static final String KEY_CTX_EDIT_FAV_OBJECT = "key_ctx_edit_fav_object";
|
||||
|
||||
public FavoritePointEditor(OsmandApplication app, MapActivity mapActivity) {
|
||||
super(app, mapActivity);
|
||||
|
@ -19,17 +20,21 @@ public class FavoritePointEditor extends PointEditor {
|
|||
|
||||
@Override
|
||||
public void saveState(Bundle bundle) {
|
||||
bundle.putSerializable(KEY_CTX_EDIT_FAV_OBJECT, favorite);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreState(Bundle bundle) {
|
||||
|
||||
Object object = bundle.getSerializable(KEY_CTX_EDIT_FAV_OBJECT);
|
||||
if (object != null) {
|
||||
favorite = (FavouritePoint)object;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFragmentName() {
|
||||
return FRAGMENT_NAME;
|
||||
public String getFragmentTag() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
public FavouritePoint getFavorite() {
|
||||
|
|
|
@ -6,8 +6,10 @@ import android.content.DialogInterface;
|
|||
import android.content.res.Resources;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import net.osmand.data.FavouritePoint;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.plus.FavouritesDbHelper;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
|
@ -28,6 +30,11 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
|
|||
super.onAttach(activity);
|
||||
helper = getMyApplication().getFavorites();
|
||||
editor = getMapActivity().getFavoritePointEditor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
favorite = editor.getFavorite();
|
||||
}
|
||||
|
||||
|
@ -53,7 +60,7 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
|
|||
FavoritePointEditorFragment fragment = new FavoritePointEditorFragment();
|
||||
mapActivity.getSupportFragmentManager().beginTransaction()
|
||||
//.setCustomAnimations(slideInAnim, slideOutAnim, slideInAnim, slideOutAnim)
|
||||
.add(R.id.fragmentContainer, fragment, editor.getFragmentName())
|
||||
.add(R.id.fragmentContainer, fragment, editor.getFragmentTag())
|
||||
.addToBackStack(null).commit();
|
||||
}
|
||||
|
||||
|
@ -82,30 +89,31 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
|
|||
builder.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (editor.isNew()) {
|
||||
doAddFavorite(point.getName(), point.getCategory(), point.getDescription());
|
||||
} else {
|
||||
helper.editFavouriteName(favorite, point.getName(), point.getCategory(), point.getDescription());
|
||||
}
|
||||
getMapActivity().getMapView().refreshMap(true);
|
||||
if (needDismiss) {
|
||||
dismiss(true);
|
||||
}
|
||||
doSave(favorite, point.getName(), point.getCategory(), point.getDescription(), needDismiss);
|
||||
}
|
||||
});
|
||||
builder.create().show();
|
||||
} else {
|
||||
doSave(favorite, point.getName(), point.getCategory(), point.getDescription(), needDismiss);
|
||||
}
|
||||
saved = true;
|
||||
}
|
||||
|
||||
private void doSave(FavouritePoint favorite, String name, String category, String description, boolean needDismiss) {
|
||||
if (editor.isNew()) {
|
||||
doAddFavorite(point.getName(), point.getCategory(), point.getDescription());
|
||||
doAddFavorite(name, category, description);
|
||||
} else {
|
||||
helper.editFavouriteName(favorite, point.getName(), point.getCategory(), point.getDescription());
|
||||
helper.editFavouriteName(favorite, name, category, description);
|
||||
}
|
||||
getMapActivity().getMapView().refreshMap(true);
|
||||
if (needDismiss) {
|
||||
dismiss(true);
|
||||
dismiss(false);
|
||||
}
|
||||
}
|
||||
saved = true;
|
||||
|
||||
PointDescription pointDescription = favorite.getPointDescription();
|
||||
pointDescription.setLat(favorite.getLatitude());
|
||||
pointDescription.setLon(favorite.getLongitude());
|
||||
getMapActivity().getContextMenu().show(pointDescription, new FavouritePoint(favorite));
|
||||
}
|
||||
|
||||
private void doAddFavorite(String name, String category, String description) {
|
||||
|
|
|
@ -13,7 +13,6 @@ public abstract class PointEditor {
|
|||
protected OsmandApplication app;
|
||||
protected final MapActivity mapActivity;
|
||||
|
||||
protected Object object;
|
||||
protected boolean isNew;
|
||||
|
||||
private boolean portraitMode;
|
||||
|
@ -53,10 +52,10 @@ public abstract class PointEditor {
|
|||
public abstract void saveState(Bundle bundle);
|
||||
public abstract void restoreState(Bundle bundle);
|
||||
|
||||
public abstract String getFragmentName();
|
||||
public abstract String getFragmentTag();
|
||||
|
||||
public void hide() {
|
||||
Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(getFragmentName());
|
||||
Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(getFragmentTag());
|
||||
if (fragment != null)
|
||||
((PointEditorFragment)fragment).dismiss();
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package net.osmand.plus.mapcontextmenu.editors;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -14,8 +17,11 @@ import android.view.ViewGroup;
|
|||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.plus.FavouritesDbHelper;
|
||||
|
@ -23,11 +29,14 @@ import net.osmand.plus.IconsCache;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.widgets.AutoCompleteTextViewEx;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
|
||||
|
||||
public abstract class PointEditorFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
|
@ -36,16 +45,26 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
getEditor().saveState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (savedInstanceState != null)
|
||||
getEditor().restoreState(savedInstanceState);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
if (savedInstanceState != null)
|
||||
getEditor().restoreState(savedInstanceState);
|
||||
|
||||
View view = inflater.inflate(R.layout.point_editor_fragment, container, false);
|
||||
getActivity().findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.INVISIBLE);
|
||||
|
||||
View view;
|
||||
if (getEditor().isLandscapeLayout()) {
|
||||
view = inflater.inflate(R.layout.point_editor_fragment_land, container, false);
|
||||
} else {
|
||||
view = inflater.inflate(R.layout.point_editor_fragment, container, false);
|
||||
}
|
||||
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));
|
||||
|
@ -128,6 +147,8 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
save(false);
|
||||
}
|
||||
super.onDestroyView();
|
||||
|
||||
getActivity().findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
protected void savePressed() {
|
||||
|
@ -212,4 +233,20 @@ public abstract class PointEditorFragment extends Fragment {
|
|||
return Algorithms.isEmpty(res) ? null : res;
|
||||
}
|
||||
|
||||
// Utils
|
||||
private int getScreenHeight() {
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
return dm.heightPixels;
|
||||
}
|
||||
|
||||
private int dpToPx(float dp) {
|
||||
Resources r = getActivity().getResources();
|
||||
return (int) TypedValue.applyDimension(
|
||||
COMPLEX_UNIT_DIP,
|
||||
dp,
|
||||
r.getDisplayMetrics()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package net.osmand.plus.mapcontextmenu.editors.dialogs;
|
||||
|
||||
public class CategoryDialogs {
|
||||
|
||||
}
|
Loading…
Reference in a new issue