Merge branch 'master' of ssh://github.com/osmandapp/Osmand into aidl_new_version
This commit is contained in:
commit
43a98a1d77
56 changed files with 3164 additions and 596 deletions
|
@ -707,6 +707,10 @@ public class OsmandRegions {
|
|||
|
||||
public BinaryMapDataObject getSmallestBinaryMapDataObjectAt(LatLon latLon) throws IOException {
|
||||
List<BinaryMapDataObject> mapDataObjects = getBinaryMapDataObjectsAt(latLon);
|
||||
return getSmallestBinaryMapDataObjectAt(mapDataObjects);
|
||||
}
|
||||
|
||||
public BinaryMapDataObject getSmallestBinaryMapDataObjectAt(List<BinaryMapDataObject> mapDataObjects) {
|
||||
BinaryMapDataObject res = null;
|
||||
double smallestArea = -1;
|
||||
for (BinaryMapDataObject o : mapDataObjects) {
|
||||
|
|
13
OsmAnd/res/drawable/bg_top_menu_dark.xml
Normal file
13
OsmAnd/res/drawable/bg_top_menu_dark.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<nine-patch android:src="@drawable/bg_shadow_dialogtop_portrait" />
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/list_background_color_dark" />
|
||||
<corners android:bottomRightRadius="3dp"
|
||||
android:bottomLeftRadius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
13
OsmAnd/res/drawable/bg_top_menu_light.xml
Normal file
13
OsmAnd/res/drawable/bg_top_menu_light.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<nine-patch android:src="@drawable/bg_shadow_dialogtop_portrait" />
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/list_background_color_light" />
|
||||
<corners android:bottomRightRadius="3dp"
|
||||
android:bottomLeftRadius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<nine-patch android:src="@drawable/bg_shadow_dialogtop_landscape"/>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/list_background_color_dark"/>
|
||||
<corners android:bottomRightRadius="3dp"
|
||||
android:bottomLeftRadius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<nine-patch android:src="@drawable/bg_shadow_dialogtop_landscape"/>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/list_background_color_light"/>
|
||||
<corners android:bottomRightRadius="3dp"
|
||||
android:bottomLeftRadius="3dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -606,6 +606,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
37
OsmAnd/res/layout/bottom_sheet_change_data_storage.xml
Normal file
37
OsmAnd/res/layout/bottom_sheet_change_data_storage.xml
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding_half" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding" />
|
||||
|
||||
<include android:id="@+id/btnDontMove"
|
||||
layout="@layout/bottom_sheet_dialog_button_big" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding_half" />
|
||||
|
||||
<include android:id="@+id/btnMove"
|
||||
layout="@layout/bottom_sheet_dialog_button_big" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding_half" />
|
||||
|
||||
<include android:id="@+id/btnClose"
|
||||
layout="@layout/bottom_sheet_dialog_button_big" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding" />
|
||||
|
||||
</LinearLayout>
|
28
OsmAnd/res/layout/bottom_sheet_dialog_button_big.xml
Normal file
28
OsmAnd/res/layout/bottom_sheet_dialog_button_big.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_sheet_cancel_button_height">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/button_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/content_padding_small"
|
||||
android:paddingRight="@dimen/content_padding_small"
|
||||
android:gravity="center_vertical|start"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="Button" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||
android:background="@android:drawable/list_selector_background"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/button_icon"
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="@dimen/standard_icon_size"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:tint="?attr/active_color_basic"
|
||||
tools:visibility="visible"
|
||||
android:src="@drawable/ic_action_plus"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="top"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/button_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
android:textColor="?attr/active_color_basic"
|
||||
tools:text="Some title" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
64
OsmAnd/res/layout/bottom_sheet_select_folder.xml
Normal file
64
OsmAnd/res/layout/bottom_sheet_select_folder.xml
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:id="@+id/edit_text_otfb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dialog_button_ex_height"
|
||||
android:layout_marginTop="@dimen/text_margin_small"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
app:labelText="@string/enter_path_to_folder"
|
||||
app:primaryColor="?android:textColorPrimary"
|
||||
app:secondaryColor="?android:textColorSecondary">
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="Folder path ... " />
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/subHeaderPadding"
|
||||
android:layout_marginBottom="@dimen/content_padding"
|
||||
android:ellipsize="end"
|
||||
android:linksClickable="true"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"
|
||||
tools:text="EditText description" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="@dimen/content_padding_half"
|
||||
android:background="?attr/divider_color" />
|
||||
|
||||
<include
|
||||
android:id="@+id/button"
|
||||
layout="@layout/bottom_sheet_item_btn_with_icon_and_text" />
|
||||
|
||||
</LinearLayout>
|
122
OsmAnd/res/layout/data_storage_list_item.xml
Normal file
122
OsmAnd/res/layout/data_storage_list_item.xml
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/selectable_list_item"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:paddingTop="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="@dimen/standard_icon_size"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/mm_storage_tank"
|
||||
tools:tint="?attr/default_icon_color"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="Internal application memory"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
tools:text="Free 1,34 • 14,6 / 16 Gb"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RadioButton
|
||||
android:id="@android:id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:background="@null"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/secondPart"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="@dimen/standard_icon_size"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="invisible"
|
||||
android:src="@drawable/mm_storage_tank"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/additionalDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
tools:text="@string/internal_app_storage_description" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding">
|
||||
|
||||
<View
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/list_divider"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
82
OsmAnd/res/layout/download_detailed_map_widget.xml
Normal file
82
OsmAnd/res/layout/download_detailed_map_widget.xml
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/download_map_widget_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/list_background_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginRight="@dimen/list_content_padding"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/list_content_padding"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="@string/download_detailed_map" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/fileSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/active_color_basic"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:paddingTop="@dimen/text_margin_small"
|
||||
android:paddingBottom="@dimen/text_margin_small"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="139 MB" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/card_content_padding_large"
|
||||
android:src="@drawable/img_download" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/text_margin_small"
|
||||
android:layout_marginBottom="@dimen/content_padding_small">
|
||||
|
||||
<include
|
||||
android:id="@+id/btnClose"
|
||||
layout="@layout/bottom_sheet_dialog_button" />
|
||||
|
||||
<View
|
||||
android:id="@+id/buttons_divider"
|
||||
android:layout_width="@dimen/content_padding"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<include
|
||||
android:id="@+id/btnDownload"
|
||||
layout="@layout/bottom_sheet_dialog_button" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -383,7 +383,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"/>
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/widget_top_bar_shadow"
|
||||
|
|
|
@ -2434,7 +2434,7 @@
|
|||
<string name="poi_vacuum_cleaner_no">Без пыласоса</string>
|
||||
<string name="poi_amenity_vacuum_cleaner">Пыласос</string>
|
||||
<string name="poi_sport_free_flying">Вольны палёт (спорт)</string>
|
||||
<string name="poi_bicycle_repair_station">Стойка для рамонту ровараў</string>
|
||||
<string name="poi_bicycle_repair_station">Стойка для рамонту ровараў; стойка для самастойнага рамонту ровараў</string>
|
||||
<string name="poi_water_tap">Вадаправодны кран</string>
|
||||
<string name="poi_button_operated_yes">Уключаецца кнопкай: так</string>
|
||||
<string name="poi_button_operated_no">Уключаецца кнопкай: не</string>
|
||||
|
|
|
@ -518,7 +518,7 @@
|
|||
<string name="amenity_type_osmwiki">Вікіпедыя (пазасеціўная)</string>
|
||||
<string name="amenity_type_user_defined">Вызначанае карыстальнікам</string>
|
||||
<string name="fav_export_confirmation">Файл з экспартаванымі ўлюбёнымі ўжо існуе. Замяніць яго\?</string>
|
||||
<string name="profile_settings">Налады профіля</string>
|
||||
<string name="profile_settings">Налады профілю</string>
|
||||
<string name="routing_settings">Навігацыя</string>
|
||||
<string name="routing_settings_descr">Вызначыць параметры навігацыі.</string>
|
||||
<string name="global_settings">Агульныя налады</string>
|
||||
|
@ -1913,7 +1913,7 @@
|
|||
<string name="osm_live_thanks">Дзякуй вам за падтрымку OsmAnd!
|
||||
\nКаб актываваць усе новыя функцыі, неабходна перазапусціць OsmAnd.</string>
|
||||
<string name="osm_live_region_desc">Частка вашага ахвяравання будзе накіроўвацца OSM-карыстальнікам, якія ўнеслі змены ў мапу гэтага рэгіёна.</string>
|
||||
<string name="upload_osm_note_description">Адаслаць вашую OSM-нататку ананімна альбо праз свой профіль OpenStreetMap.org.</string>
|
||||
<string name="upload_osm_note_description">Запампаваць вашую OSM-нататку ананімна альбо праз свой профіль OpenStreetMap.org.</string>
|
||||
<string name="upload_osm_note">Адаслаць OSM-нататку</string>
|
||||
<string name="report">Справаздача</string>
|
||||
<string name="shared_string_move_up">Перамясціць ↑</string>
|
||||
|
@ -2488,7 +2488,7 @@
|
|||
<string name="add_point_before">Дадаць пункт перад</string>
|
||||
<string name="add_point_after">Дадаць пункт пасля</string>
|
||||
<string name="shared_string_options">Параметры</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd злучыць пункты з маршрутам для абранага профіля.</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd злучыць пункты з маршрутам для абранага профілю.</string>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Захаваць пункты як пункты маршруту ці як лінію.</string>
|
||||
<string name="choose_navigation_type">Абраць профіль навігацыі</string>
|
||||
<string name="add_route_points">Дадаць пункты маршруту</string>
|
||||
|
@ -3048,7 +3048,7 @@
|
|||
<string name="coordinates_widget">Віджэт каардынат</string>
|
||||
<string name="app_mode_offroad">Бездарожжа</string>
|
||||
<string name="edit_profile_setup_title">Наладзіць профіль</string>
|
||||
<string name="edit_profile_setup_subtitle">У кожнага профіля свае налады</string>
|
||||
<string name="edit_profile_setup_subtitle">У кожнага профілю свае налады</string>
|
||||
<string name="turn_screen_on_time_descr">Вызначце час, цягам якога экран уключыцца.</string>
|
||||
<string name="turn_screen_on_sensor">Выкарыстоўваць датчык адлегласці</string>
|
||||
<string name="turn_screen_on_sensor_descr">Правядзіце рукой па верхняй частцы экрана, каб уключыць яго падчас навігацыі.</string>
|
||||
|
@ -3067,9 +3067,9 @@
|
|||
<string name="app_mode_ufo">НЛА</string>
|
||||
<string name="precision_hdop_and_vdop">Дакладнасць па гарызанталі: %1$s, па вертыкалі: %2$s</string>
|
||||
<string name="precision_hdop">Дакладнасць па гарызанталі: %s</string>
|
||||
<string name="edit_profile_setup_map_subtitle">Абярыце прадвызначаныя параметры мапы для профіля</string>
|
||||
<string name="edit_profile_screen_options_subtitle">Абярыце прадвызначаныя параметры экрана для профіля</string>
|
||||
<string name="edit_profile_nav_settings_subtitle">Абярыце прадвызначаныя налады навігацыі для профіля</string>
|
||||
<string name="edit_profile_setup_map_subtitle">Абярыце прадвызначаныя параметры мапы для профілю</string>
|
||||
<string name="edit_profile_screen_options_subtitle">Абярыце прадвызначаныя параметры экрана для профілю</string>
|
||||
<string name="edit_profile_nav_settings_subtitle">Абярыце прадвызначаныя налады навігацыі для профілю</string>
|
||||
<string name="routing_attr_max_num_changes_description">Вызначце максімальную колькасць змен</string>
|
||||
<string name="routing_attr_max_num_changes_name">Колькасць змен</string>
|
||||
<string name="rate_dialog_descr">Калі ласка, выдаткуйце нам 30 секунд, пакінце водгук і ацаніце нашу працу на Google Play.</string>
|
||||
|
@ -3107,7 +3107,7 @@
|
|||
<string name="settings_privacy_and_security_desc">Абярыце, якімі данымі вы будзеце дзяліцца з намі</string>
|
||||
<string name="shared_string_no_thank_you">Не, дзякуй</string>
|
||||
<string name="shared_string_allow">Дазволіць</string>
|
||||
<string name="profile_name_hint">Назва профіля</string>
|
||||
<string name="profile_name_hint">Назва профілю</string>
|
||||
<string name="nav_type_hint">Тып навігацыі</string>
|
||||
<string name="app_mode_taxi">Таксі</string>
|
||||
<string name="app_mode_shuttle_bus">Рэйсавы аўтобус</string>
|
||||
|
@ -3126,9 +3126,9 @@
|
|||
<string name="profile_type_descr_string">Тып: %s</string>
|
||||
<string name="profile_type_base_string">Базавы профіль</string>
|
||||
<string name="profile_alert_need_routing_type_title">Абярыце тып навігацыі</string>
|
||||
<string name="profile_alert_need_routing_type_msg">Калі ласка, абярыце тып навігацыі для новага профіля праграмы</string>
|
||||
<string name="profile_alert_need_profile_name_title">Увядзіце назву профіля</string>
|
||||
<string name="profile_alert_need_profile_name_msg">Назва профіля не можа быць пустой!</string>
|
||||
<string name="profile_alert_need_routing_type_msg">Калі ласка, абярыце тып навігацыі для новага профілю дадатку</string>
|
||||
<string name="profile_alert_need_profile_name_title">Увядзіце назву профілю</string>
|
||||
<string name="profile_alert_need_profile_name_msg">Назва профілю не можа быць пустой!</string>
|
||||
<string name="profile_alert_duplicate_name_title">Дублікат назвы</string>
|
||||
<string name="profile_alert_duplicate_name_msg">Ужо ёсць профіль з такой назвай</string>
|
||||
<string name="profile_alert_cant_delete_base">Вы не можаце выдаліць базавыя профілі OsmAnd</string>
|
||||
|
@ -3146,8 +3146,8 @@
|
|||
<string name="routing_profile_broutrer">BRouter (па-за сецівам)</string>
|
||||
<string name="custom_routing">Адвольны профіль маршрутызацыі</string>
|
||||
<string name="special_routing_type">Адмысловая маршрутызацыя</string>
|
||||
<string name="application_profiles_descr">Абярыце профілі, што будуць бачныя ў праграме.</string>
|
||||
<string name="application_profiles">Профілі праграмы</string>
|
||||
<string name="application_profiles_descr">Абярыце профілі, што будуць бачныя ў дадатку.</string>
|
||||
<string name="application_profiles">Профілі дадатку</string>
|
||||
<string name="routing_attr_piste_type_skitour_name">Лыжныя туры</string>
|
||||
<string name="routing_attr_piste_type_skitour_description">Трасы для гарналыжных тураў.</string>
|
||||
<string name="routing_attr_piste_type_sled_name">Санкі</string>
|
||||
|
@ -3195,10 +3195,10 @@
|
|||
<string name="get_discount_second_part">пасля %1$s</string>
|
||||
<string name="cancel_subscription">Скасаваць падпіску</string>
|
||||
<string name="price_and_discount">%1$s • Эканомія %2$s</string>
|
||||
<string name="configure_profile_info">Усе пададзеныя ніжэй налады датычацца толькі абранага профіля.</string>
|
||||
<string name="configure_profile_info">Усе пададзеныя ніжэй налады датычацца толькі абранага профілю.</string>
|
||||
<string name="utm_format_descr">OsmAnd выкарыстоўвае фармат UTM Standard, які падобны, але не ідэнтычны фармату UTM Nato.</string>
|
||||
<string name="shared_string_example">Прыклад</string>
|
||||
<string name="configure_profile">Налады профіля</string>
|
||||
<string name="configure_profile">Налады профілю</string>
|
||||
<string name="switch_profile">Змяніць профіль</string>
|
||||
<string name="logcat_buffer">Буфер logcat</string>
|
||||
<string name="navigate_point_format_utm">UTM Standard</string>
|
||||
|
@ -3207,7 +3207,7 @@
|
|||
<string name="pref_selected_by_default_for_profiles">Параметр прадвызначана абраны для профіляў: %s</string>
|
||||
<string name="change_default_settings">Змяніць прадвызначаныя налады</string>
|
||||
<string name="discard_changes">Адкінуць змены</string>
|
||||
<string name="apply_to_current_profile">Ужыць да бягучага профіля %1$s</string>
|
||||
<string name="apply_to_current_profile">Ужыць да бягучага профілю %1$s</string>
|
||||
<string name="apply_to_all_profiles">Ужыць да ўсіх профіляў</string>
|
||||
<string name="start_up_message_pref">Паведамленне падчас запуску</string>
|
||||
<string name="analytics_pref_title">Аналітыка</string>
|
||||
|
@ -3259,7 +3259,7 @@
|
|||
<string name="lang_oc">Аксітанская</string>
|
||||
<string name="app_mode_pickup_truck">Пікап</string>
|
||||
<string name="turn_screen_on_info">Паказваць мапу падчас навігацыі па-над заблакаваным экранам.</string>
|
||||
<string name="route_parameters_info">Гэтыя налады ўплываюць на пабудову маршруту. Ужываюцца толькі да абранага профіля: %1$s.</string>
|
||||
<string name="route_parameters_info">Гэтыя налады ўплываюць на пабудову маршруту. Ужываюцца толькі да абранага профілю: %1$s.</string>
|
||||
<string name="wake_time">Час абуджэння</string>
|
||||
<string name="units_and_formats">Адзінкі вымярэння і фарматы</string>
|
||||
<string name="appearance">Выгляд</string>
|
||||
|
@ -3275,7 +3275,7 @@
|
|||
<string name="manage_profiles">Кіраванне профілямі дадатку…</string>
|
||||
<string name="osmand_settings_descr">Уплывае на ўвесь дадатак</string>
|
||||
<string name="osmand_settings">Налады OsmAnd</string>
|
||||
<string name="copy_from_other_profile">Скапіяваць з іншага профіля</string>
|
||||
<string name="copy_from_other_profile">Скапіяваць з іншага профілю</string>
|
||||
<string name="turn_screen_on">Уключыць экран</string>
|
||||
<string name="map_during_navigation_info">Мапа падчас навігацыі</string>
|
||||
<string name="map_during_navigation">Мапа падчас навігацыі</string>
|
||||
|
@ -3288,4 +3288,5 @@
|
|||
<string name="screen_alerts">Экранныя апавяшчэнні</string>
|
||||
<string name="route_parameters_descr">Наладзіць параметры маршруту</string>
|
||||
<string name="route_parameters">Параметры маршруту</string>
|
||||
<string name="shared_string_by_default">Прадвызначана</string>
|
||||
</resources>
|
|
@ -3266,4 +3266,5 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="plugins_settings">Configuració del connector</string>
|
||||
<string name="shared_string_by_default">Predeterminat</string>
|
||||
<string name="download_detaile_map">Baixeu el mapa detallat %s per veure aquesta àrea.</string>
|
||||
<string name="route_parameters">Paràmetres de la ruta</string>
|
||||
</resources>
|
|
@ -3263,7 +3263,7 @@ Repræsenterer område: %1$s x %2$s</string>
|
|||
<string name="wake_time">Vågnetid</string>
|
||||
<string name="units_and_formats">Enheder & formater</string>
|
||||
<string name="appearance">Udseende</string>
|
||||
<string name="map_look_descr">ikoner, moduler</string>
|
||||
<string name="map_look_descr">Kortets udseende</string>
|
||||
<string name="map_look">Kortets udseende</string>
|
||||
<string name="list_of_installed_plugins">Liste over installerede udvidelser</string>
|
||||
<string name="configure_navigation">Konfigurer navigation</string>
|
||||
|
@ -3297,4 +3297,5 @@ Repræsenterer område: %1$s x %2$s</string>
|
|||
<string name="plugins_settings">Udvidelsesindstillinger</string>
|
||||
<string name="shared_string_by_default">Som standard</string>
|
||||
<string name="download_detaile_map">Hent detaljeret %s kort, for at se området.</string>
|
||||
<string name="download_detailed_map">Hent detaljeret %s kort, for at se området.</string>
|
||||
</resources>
|
|
@ -2335,7 +2335,7 @@
|
|||
<string name="poi_water_tap">Akvokrano</string>
|
||||
<string name="poi_button_operated_yes">Butonprema: jes</string>
|
||||
<string name="poi_button_operated_no">Butonprema: ne</string>
|
||||
<string name="poi_bicycle_repair_station">Bicikla mem-riparejo</string>
|
||||
<string name="poi_bicycle_repair_station">Bicikla mem-riparejo;memriparejo bicikla;riparejo bicikla;pumpilo bicikla;aerpumpilo bicikla</string>
|
||||
<string name="poi_sport_free_flying">Aersportoj</string>
|
||||
<string name="poi_free_flying_site_takeoff">elteriĝejo</string>
|
||||
<string name="poi_free_flying_site_landing">surteriĝejo</string>
|
||||
|
@ -3712,4 +3712,10 @@
|
|||
<string name="poi_disabled_designated">destinita</string>
|
||||
<string name="poi_cellar_entrance">Enirejo al kelo</string>
|
||||
<string name="poi_health_food">Saniga manĝaĵo</string>
|
||||
<string name="poi_craft_builder">Oficejo de konstruisto</string>
|
||||
<string name="poi_craft_distillery">Alkohol-distilejo</string>
|
||||
<string name="poi_craft_joiner">Laborejo de lignaĵisto</string>
|
||||
<string name="poi_craft_floorer">Oficejo de plank‑metisto</string>
|
||||
<string name="poi_craft_bakery">Bakejo (ne vendejo)</string>
|
||||
<string name="poi_craft_cabinet_maker">Laborejo de meblisto</string>
|
||||
</resources>
|
|
@ -3271,4 +3271,5 @@ Indikas lokon: %1$s x %2$s"</string>
|
|||
<string name="application_profile_changed">Profilo de aplikaĵo ŝanĝita al “%s”</string>
|
||||
<string name="logcat_buffer">Bufro logcat</string>
|
||||
<string name="plugins_settings">Agordoj pri kromprogramo</string>
|
||||
<string name="shared_string_by_default">Implicite</string>
|
||||
</resources>
|
|
@ -1011,7 +1011,7 @@
|
|||
<string name="vector_data_missing">برای استفاده از نقشههای آفلاین، دادههای «آفلاین» را دانلود کنید.</string>
|
||||
<string name="local_index_gpx_info_show">"
|
||||
\n
|
||||
\nبرای دسترسی به گزینهها طولانی لمس کنید"</string>
|
||||
\nبرای گزینهها طولانی لمس کنید"</string>
|
||||
<string name="local_index_items_backuped">%1$d مورد از %2$d مورد غیرفعال شد.</string>
|
||||
<string name="local_index_items_deleted">%1$d مورد از %2$d مورد حذف شد.</string>
|
||||
<string name="local_index_items_restored">%1$d مورد از %2$d مورد فعال شد.</string>
|
||||
|
@ -3304,7 +3304,7 @@
|
|||
<string name="utm_format_descr">OsmAnd از قالب UTM Standard استفاده میکند که مشابه (اما نه یکسان) با قالب UTM Nato است.</string>
|
||||
<string name="apply_to_current_profile">بهکارگیری برای پروفایل کنونی: %1$s</string>
|
||||
<string name="apply_to_all_profiles">بهکارگیری برای همهٔ پروفایلها</string>
|
||||
<string name="map_look_descr">نمادها، ابزارکها</string>
|
||||
<string name="map_look_descr">ظاهر نقشه</string>
|
||||
<string name="general_settings_profile_descr">پوستهٔ برنامه، یکاها، منطقه</string>
|
||||
<string name="configure_profile">پیکربندی پروفایل</string>
|
||||
<string name="voice_announces_info">پیامهای گفتاری فقط در هنگام ناوبری پخش میشود.</string>
|
||||
|
@ -3332,4 +3332,5 @@
|
|||
<string name="logcat_buffer">بافر لاگکت</string>
|
||||
<string name="shared_string_by_default">بهطور پیشفرض</string>
|
||||
<string name="download_detaile_map">برای دیدن این منطقه، نقشهٔ باجزئیات %s را دانلود کنید.</string>
|
||||
<string name="download_detailed_map">برای دیدن این منطقه، نقشهٔ باجزئیات %s را دانلود کنید.</string>
|
||||
</resources>
|
|
@ -3246,7 +3246,7 @@ représentant la zone : %1$s x %2$s</string>
|
|||
<string name="turn_screen_on_info">Afficher la carte sur l\'écran de verrouillage pendant la navigation.</string>
|
||||
<string name="route_parameters_info">Ces paramètres influencent le calcul de l\'itinéraire et s\'appliqueront au profil : %1$s.</string>
|
||||
<string name="wake_time">Heure de réveil</string>
|
||||
<string name="map_look_descr">icônes, gadgets</string>
|
||||
<string name="map_look_descr">Apparence de la carte</string>
|
||||
<string name="map_look">Apparence de la carte</string>
|
||||
<string name="general_settings_profile_descr">Thème de l\'application, unités, région</string>
|
||||
<string name="reset_to_default">Restaurer les valeurs par défaut</string>
|
||||
|
@ -3259,4 +3259,5 @@ représentant la zone : %1$s x %2$s</string>
|
|||
<string name="get_discount_title">Payez %1$d %2$s et gagnez %3$s.</string>
|
||||
<string name="shared_string_by_default">Par défaut</string>
|
||||
<string name="download_detaile_map">Téléchargez la carte détaillée de %s pour voir cette zone.</string>
|
||||
<string name="download_detailed_map">Télécharger la carte détaillée %s pour voir cette zone.</string>
|
||||
</resources>
|
|
@ -900,8 +900,8 @@
|
|||
<string name="map_text_size">Tamaño do tipo de letra do mapa</string>
|
||||
<string name="trace_rendering">Información de fallo de renderizado</string>
|
||||
<string name="trace_rendering_descr">Amosar rendemento do renderizado.</string>
|
||||
<string name="installing_new_resources">Estasen a desempaquetar datos novos…</string>
|
||||
<string name="internet_connection_required_for_online_route">Hai un servizo de navegación con conexión seleccionadoo, mais non hai ningunha conexión á Internet.</string>
|
||||
<string name="installing_new_resources">Estanse a desempaquetar datos novos…</string>
|
||||
<string name="internet_connection_required_for_online_route">Hai un servizo de navegación con conexión seleccionado, mais non hai ningunha conexión á Internet.</string>
|
||||
<string name="tts_language_not_supported_title">Esta lingua non está dispoñíbel</string>
|
||||
<string name="tts_language_not_supported">A lingua elixida non está dispoñíbel no motor TTS (texto lido) do Android. Desexa procurar outro motor do TTS na Google Play\? Se non, tense que emprega-la lingua do TTS predeterminado.</string>
|
||||
<string name="tts_missing_language_data_title">faltan datos</string>
|
||||
|
|
|
@ -3227,7 +3227,7 @@
|
|||
<string name="wake_time">זמן התעוררות</string>
|
||||
<string name="units_and_formats">יחידות ותבניות</string>
|
||||
<string name="appearance">מראה</string>
|
||||
<string name="map_look_descr">סמלים, וידג׳טים</string>
|
||||
<string name="map_look_descr">מראה המפה</string>
|
||||
<string name="map_look">מראה המפה</string>
|
||||
<string name="list_of_installed_plugins">רשימת התוספים המותקנים</string>
|
||||
<string name="configure_navigation">הגדרת ניווט</string>
|
||||
|
@ -3276,4 +3276,5 @@
|
|||
<string name="shared_string_by_default">כבררת מחדל</string>
|
||||
<string name="plugins_settings">הגדרות תוסף</string>
|
||||
<string name="download_detaile_map">הורדת המפה המפורטת %s, כדי לצפות באזור זה.</string>
|
||||
<string name="download_detailed_map">הורדת מפת %s מפורטת כדי לצפות באזור הזה.</string>
|
||||
</resources>
|
|
@ -2311,7 +2311,7 @@
|
|||
<string name="poi_surface_dirt">Yfirborð: mold</string>
|
||||
<string name="poi_service_bicycle_second_hand_yes">Sala á notuðum reiðhjólum</string>
|
||||
<string name="poi_service_bicycle_second_hand_no">Sala á notuðum reiðhjólum: nei</string>
|
||||
<string name="poi_bicycle_repair_station">Stöð til að gera sjálf við reiðhjól</string>
|
||||
<string name="poi_bicycle_repair_station">Reiðhjólaviðgerðastöð;Stöð til að gera sjálf við reiðhjól</string>
|
||||
<string name="poi_note">Athugasemd</string>
|
||||
<string name="poi_model_aerodrome">Módelflugsvæði</string>
|
||||
<string name="poi_historic_milestone">Sögulegur kílómetrasteinn</string>
|
||||
|
@ -3704,10 +3704,10 @@
|
|||
<string name="poi_disabled_designated">Sérstakt</string>
|
||||
<string name="poi_cellar_entrance">Kjallarainngangur</string>
|
||||
<string name="poi_health_food">Heilsufæði</string>
|
||||
<string name="poi_craft_builder"></string>
|
||||
<string name="poi_craft_distillery"></string>
|
||||
<string name="poi_craft_joiner"></string>
|
||||
<string name="poi_craft_floorer"></string>
|
||||
<string name="poi_craft_bakery"></string>
|
||||
<string name="poi_craft_cabinet_maker"></string>
|
||||
<string name="poi_craft_builder">Byggingafyrirtæki</string>
|
||||
<string name="poi_craft_distillery">Eimingarstöð</string>
|
||||
<string name="poi_craft_joiner">Trésmíði</string>
|
||||
<string name="poi_craft_floorer">Gólflagnafyrirtæki</string>
|
||||
<string name="poi_craft_bakery">Bökunarfyrirtæki</string>
|
||||
<string name="poi_craft_cabinet_maker">Skápasmíði</string>
|
||||
</resources>
|
|
@ -2919,8 +2919,8 @@ Stendur fyrir svæði: %1$s x %2$s</string>
|
|||
<string name="routeInfo_surface_name">Yfirborð</string>
|
||||
<string name="routeInfo_smoothness_name">Áferð</string>
|
||||
<string name="routeInfo_steepness_name">Bratti</string>
|
||||
<string name="add_home">Bæta við heima</string>
|
||||
<string name="add_work">Bæta við vinnu</string>
|
||||
<string name="add_home">Bæta við \"Heim\"</string>
|
||||
<string name="add_work">Bæta við \"Vinna\"</string>
|
||||
<string name="work_button">Vinna</string>
|
||||
<string name="previous_route">Fyrri leið</string>
|
||||
<string name="add_destination_query">Bættu fyrst við áfangastað</string>
|
||||
|
@ -3272,7 +3272,7 @@ Stendur fyrir svæði: %1$s x %2$s</string>
|
|||
<string name="wake_time">Vökutími</string>
|
||||
<string name="units_and_formats">Einingar og snið þeirra</string>
|
||||
<string name="appearance">Útlit</string>
|
||||
<string name="map_look_descr">táknmyndir, viðmótshlutar (widgets)</string>
|
||||
<string name="map_look_descr">Útlit landakorts</string>
|
||||
<string name="map_look">Útlit korts</string>
|
||||
<string name="list_of_installed_plugins">Listi yfir uppsettar viðbætur</string>
|
||||
<string name="configure_navigation">Stilla leiðsögn</string>
|
||||
|
@ -3304,4 +3304,5 @@ Stendur fyrir svæði: %1$s x %2$s</string>
|
|||
<string name="plugins_settings">Stillingar á forritsviðbót</string>
|
||||
<string name="shared_string_by_default">Sjálfgefið</string>
|
||||
<string name="download_detaile_map">Sæktu nákvæma %s kortið til að skoða þetta svæði.</string>
|
||||
<string name="download_detailed_map">Sæktu nákvæma %s kortið til að skoða þetta svæði.</string>
|
||||
</resources>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="card_content_padding_large">42dp</dimen>
|
||||
<dimen name="map_trans_seek_size">120dp</dimen>
|
||||
<dimen name="map_widget_text_size">35sp</dimen>
|
||||
<dimen name="map_top_widget_text_size">33sp</dimen>
|
||||
|
|
|
@ -2059,7 +2059,7 @@ kas tiks pievienots jūsu Kategorijas sadaļai.</string>
|
|||
<string name="lang_sr_latn">Serbu (latīņu)</string>
|
||||
<string name="lang_zh_hk">Ķīniešu (Honkongas)</string>
|
||||
<string name="rendering_attr_hideWaterPolygons_name">Nerādīt ūdenstilpnes</string>
|
||||
<string name="navigate_point_olc">Atvērt Lokācijas Kodu (OLC)</string>
|
||||
<string name="navigate_point_olc">Atvērtais Lokācijas Kods (OLC)</string>
|
||||
<string name="navigate_point_olc_info_invalid">Nepareizs OLC
|
||||
</string>
|
||||
<string name="navigate_point_olc_info_short">Nepilnīgs OLC
|
||||
|
@ -2199,14 +2199,14 @@ Apraksta laukumu: %1$s x %2$s</string>
|
|||
<string name="lang_ber">Berberu</string>
|
||||
<string name="quick_action_osmbugs_show">Rādīt OSM piezīmes</string>
|
||||
<string name="quick_action_osmbugs_hide">Nerādīt OSM piezīmes</string>
|
||||
<string name="quick_action_showhide_osmbugs_descr">Nospiežot pogu, tiks rādītas vai slēptas OEM piezīmes uz kartes.</string>
|
||||
<string name="quick_action_showhide_osmbugs_descr">Nospiežot darbības pogu, tiek rādītas vai slēptas OEM piezīmes uz kartes.</string>
|
||||
<string name="sorted_by_distance">Sakārtots pēc distances</string>
|
||||
<string name="search_favorites">Izlases meklēšana</string>
|
||||
<string name="search_favorites">Meklēt Izlasē</string>
|
||||
<string name="hillshade_menu_download_descr">Lai attēlotu reljefa griezumu kartē, ir nepieciešams lejupielādēt reljefa virsklāja karti šim reğionam.</string>
|
||||
<string name="hillshade_purchase_header">Lai attēlotu reljefa griezumu kartē, ir nepieciešams iegādāties un instalēt Kontūrlīniju spraudni</string>
|
||||
<string name="srtm_menu_download_descr">Lai redzētu kontūrlīnijas uz kartes, nepieciešams lejupielādēt kontūrlīniju karti šim reğionam.</string>
|
||||
<string name="srtm_menu_download_descr">"Lejupielādējiet \"Kontūrlīnijas\" karti šim reğionam."</string>
|
||||
<string name="shared_string_plugin">Spraudnis</string>
|
||||
<string name="srtm_purchase_header">Lai redzētu kontūrlīnijas kartē, ir nepieciešams nopirkt un instalēt Kontūrlīniju spraudni</string>
|
||||
<string name="srtm_purchase_header">Lai redzētu kontūrlīnijas uz kartes, jums ir nepieciešams nopirkt un instalēt \"Kontūrlīniju\" spraudni</string>
|
||||
<string name="srtm_color_scheme">Krāsu shēma</string>
|
||||
<string name="routing_attr_allow_private_name">Privātās teritorijas</string>
|
||||
<string name="favorite_group_name">Nosaukums</string>
|
||||
|
@ -2224,21 +2224,21 @@ Apraksta laukumu: %1$s x %2$s</string>
|
|||
<string name="select_postcode">Izvēlieties pasta kodu</string>
|
||||
<string name="quick_action_auto_zoom">Kartes automātiskā tālummaiņa iesl/izsl</string>
|
||||
<string name="driving_region_automatic">Automātiski</string>
|
||||
<string name="private_access_routing_req">Galamērķis atrodas privātā teritorijā. Vai atļaut maršrutā iekļaut ierobežotas pieejamības ceļus?</string>
|
||||
<string name="private_access_routing_req">Galamērķis atrodas privātas teritorijas vietā. Vai iekļaut maršrutā ierobežotas piekļuves ceļus\?</string>
|
||||
<string name="restart_search">Meklēt atkārtoti</string>
|
||||
<string name="increase_search_radius">Paplašināt meklēšanas rādiusu</string>
|
||||
<string name="nothing_found">Neko neatradu :(</string>
|
||||
<string name="nothing_found">Neko neatrada</string>
|
||||
<string name="nothing_found_descr">Meklējiet pēc cita vārda vai palieliniet meklēšanas rādiusu.</string>
|
||||
<string name="quick_action_showhide_osmbugs_title">Rādīt/nerādīt OSM piezīmes</string>
|
||||
<string name="routing_attr_allow_private_description">Atļaut piekļūšanu privātajām teritorijām.</string>
|
||||
<string name="animate_my_location_desc">Maršruta gaitā rādīt kustīgu animāciju manā atrašanās vietā.</string>
|
||||
<string name="quick_action_auto_zoom_desc">Spiežot darbības pogu, tiks ieslēgta vai izslēgta automātiskā kartes mērogošana, atkarībā no kustības ātruma.</string>
|
||||
<string name="animate_my_location_desc">Maršruta gaitā iespējot kartes pagriešanas animāciju no manas atrašanās vietas.</string>
|
||||
<string name="quick_action_auto_zoom_desc">Darbības pogas nospiešana ieslēdz vai izslēdz kartes auto mērogošanu pēc kustības ātruma.</string>
|
||||
<string name="quick_action_add_destination">Pievienot mērķi</string>
|
||||
<string name="quick_action_replace_destination">Nomainīt mērķi</string>
|
||||
<string name="quick_action_add_first_intermediate">Pievienot pirmo starppunktu</string>
|
||||
<string name="quick_action_add_destination_desc">Spiežot darbības pogu, kartes centrā tiks izveidots jauns galamērķis, bet iepriekšējais galamērķis tiks pārveidots par pēdējo starppunktu.</string>
|
||||
<string name="quick_action_replace_destination_desc">"Spiežot darbības pogu, nomainīsies mērķis uz pašreizējo ekrāna centra punktu."</string>
|
||||
<string name="quick_action_add_first_intermediate_desc">Spiežot darbības pogu, tiks pievienots pirmais starppunkts ekrāna centrā.</string>
|
||||
<string name="quick_action_add_destination_desc">Spiežot šo darbības pogu, ekrāna centrs kļūst par galamērķi, bet iepriekš izvēlētais galamērķis par pēdējo starppunktu.</string>
|
||||
<string name="quick_action_replace_destination_desc">"Spiežot šo darbības pogu, ekrāna centrs kļūst par jauno galamērķi, nomainot iepriekšējo (ja tāds bija)."</string>
|
||||
<string name="quick_action_add_first_intermediate_desc">Spiežot šo darbības pogu, ekrāna centrs kļūst par pirmo starppunku maršrutā.</string>
|
||||
<string name="no_overlay">Nav virsklāja</string>
|
||||
<string name="no_underlay">Nav apakšklāja</string>
|
||||
<string name="subscribe_email_error">Kļūda</string>
|
||||
|
@ -2411,17 +2411,15 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
\n OsmAnd ir atvērtā koda un aktīvā izstrādē esoša lietotne. Ikviens var piedalīties tā veidošanā, ziņojot par kļūdām, uzlabojot tulkojumus vai kodējot jaunas iespējas. Projekts atrodas patstāvīgā mijiedarbībā starp izstrādātājiem un lietotnes lietotājiem. Tāpat arī projekta progress balstās uz finansiālajiem ziedojumiem aplikācijas kodēšanai un jauno iespēju testēšanai
|
||||
\n</string>
|
||||
<string name="shared_string_add_photos">Pievienot fotogrāfijas</string>
|
||||
<string name="mapillary_action_descr">Pievienojiet savus ielas līmeņa skatus ar Mapillary.</string>
|
||||
<string name="mapillary_action_descr">Pievienojiet savus šīs vietas ielas līmeņa skatus caur Mapillary.</string>
|
||||
<string name="mapillary_widget">Mapillary logrīks</string>
|
||||
<string name="mapillary_widget_descr">Ātrā piekļuve Mapillary.</string>
|
||||
<string name="mapillary_widget_descr">Ļauj ātri piekļūt Mapillary.</string>
|
||||
<string name="mapillary_descr">Tiešsaistes ielas līmeņa fotoattēli ikvienam. Atklājiet vietas, kopīgojiet, iemūžiniet pasauli.</string>
|
||||
<string name="mapillary">Mapillary</string>
|
||||
<string name="open_mapillary">Atvērt Mapillary</string>
|
||||
<string name="shared_string_install">Instalēt</string>
|
||||
<string name="improve_coverage_mapillary">Uzlabot bilžu pārklājumu ar Mapillary</string>
|
||||
<string name="improve_coverage_install_mapillary_desc">Uzņemiet vienu vai vairākus fotoattēlus un pievienojiet vietām uz kartes.
|
||||
\n
|
||||
\nLai to darītu, instalējiet Mapillary aplikāciju no Google Play.</string>
|
||||
<string name="improve_coverage_install_mapillary_desc">Instalējiet Mapillary, lai pievienotu vienu vai vairākas forogrāfijas uz šīs vietas kartē.</string>
|
||||
<string name="online_photos">Tiešsaistes fotoattēli</string>
|
||||
<string name="no_photos_descr">Mums nav fotogrāfiju šai vietai.</string>
|
||||
<string name="plugin_mapillary_descr">Ielas līmeņa fotoattēli ikvienam - atklājiet vietas, kopīgojiet, iemūžiniet pasauli.</string>
|
||||
|
@ -2433,13 +2431,13 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
<string name="none_point_error">Lūdzu pievienojiet vismaz vienu punktu.</string>
|
||||
<string name="enter_gpx_name">GPX faila vārds:</string>
|
||||
<string name="show_on_map_after_saving">Pēc saglabāšanas rādīt uz kartes</string>
|
||||
<string name="quick_action_resume_pause_navigation">Atsākt/pauzēt navigāciju</string>
|
||||
<string name="quick_action_resume_pause_navigation">Pauzēt/atsākt navigāciju</string>
|
||||
<string name="quick_action_resume_pause_navigation_descr">Pieskarieties pogai, lai nopauzētu vai atsāktu navigāciju.</string>
|
||||
<string name="quick_action_show_navigation_finish_dialog">Rādīt Navigācija pabeigta dialogu</string>
|
||||
<string name="quick_action_start_stop_navigation">Sākt/apturēt navigāciju</string>
|
||||
<string name="quick_action_start_stop_navigation_descr">Pieskarieties šai pogai, lai sāktu vai apturētu navigācijas norādes.</string>
|
||||
<string name="store_tracks_in_monthly_directories">Saglabāt treka ierakstus mēneša mapēs</string>
|
||||
<string name="store_tracks_in_monthly_directories_descrp">Ierakstītie treki tiks saglabāti apakšmapēs pēc mēneša datuma (piemēram, 2017-01).</string>
|
||||
<string name="store_tracks_in_monthly_directories_descrp">Saglabā Ierakstītos trekus apakš-mapēs pēc mēneša datuma (piemēram, 2017-01).</string>
|
||||
<string name="map_widget_ruler_control">Rādiusa lineāls</string>
|
||||
<string name="wrong_input">Nepareiza ievade</string>
|
||||
<string name="enter_new_name">Ievadiet jaunu vārdu</string>
|
||||
|
@ -2485,7 +2483,7 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
<string name="date_added">Pēc datuma</string>
|
||||
<string name="order_by">Kārtot pēc:</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd apvienos punktus ar maršrutiem izvēlētajam profilam.</string>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Jūs varat saglabāt punktus vai nu kā maršruta punktus vai kā līniju.</string>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Saglabā punktus kā maršruta punktus vai kā līniju.</string>
|
||||
<string name="measurement_tool_action_bar">Pārlūkojiet karti un pievienojiet punktus</string>
|
||||
<string name="measurement_tool">Mērīt attālumu</string>
|
||||
<string name="tap_on_map_to_hide_interface_descr">Pieskāriens uz kartes ieslēdz pogas un logrīkus.</string>
|
||||
|
@ -2512,7 +2510,7 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
<string name="move_all_to_history">Pārvietot visu uz vēsturi</string>
|
||||
<string name="show_direction">Distances indikācija</string>
|
||||
<string name="sort_by">Kārtot pēc</string>
|
||||
<string name="do_not_use_animations">Nelietot animāciju</string>
|
||||
<string name="do_not_use_animations">Nelietot animācijas</string>
|
||||
<string name="do_not_use_animations_descr">Neanimēt darbības uz ekrāna.</string>
|
||||
<string name="keep_showing_on_map">Turpināt rādīt uz kartes</string>
|
||||
<string name="exit_without_saving">Aizvērt bez saglabāšanas?</string>
|
||||
|
@ -2529,15 +2527,15 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
<string name="shared_string_reload">Pārlādēt</string>
|
||||
<string name="mapillary_menu_descr_tile_cache">Atjaunot flīzes, lai redzētu aktuālos datus.</string>
|
||||
<string name="mapillary_menu_title_tile_cache">Bilžu kešatmiņa</string>
|
||||
<string name="wrong_user_name">Nepareizs lietotājvārds!</string>
|
||||
<string name="wrong_user_name">Nepareizs lietotājvārds</string>
|
||||
<string name="shared_string_to">Līdz</string>
|
||||
<string name="mapillary_menu_date_from">No</string>
|
||||
<string name="mapillary_menu_descr_dates">Skatīt bildes, kas pievienotas noteiktā laikaposmā.</string>
|
||||
<string name="mapillary_menu_title_dates">Datumi</string>
|
||||
<string name="mapillary_menu_descr_dates">Skatīt bildes pēc datuma</string>
|
||||
<string name="mapillary_menu_title_dates">Datums</string>
|
||||
<string name="mapillary_menu_edit_text_hint">Ievadiet lietotājvārdu</string>
|
||||
<string name="mapillary_menu_descr_username">Skatīt bildes, kuras pievienojis konkrēts lietotājs.</string>
|
||||
<string name="mapillary_menu_descr_username">Skatīt lietotāja bildes</string>
|
||||
<string name="mapillary_menu_title_username">Lietotājvārds</string>
|
||||
<string name="mapillary_menu_filter_description">Jūs varat filtrēt bildes pēc lietotāja vai datuma. Filtri tiek lietoti tikai tuvos mērogos.</string>
|
||||
<string name="mapillary_menu_filter_description">"Filtrē bildes pēc iesūtītāja, datuma vai tipa. Filtri darbojas tikai tuvos mērogos."</string>
|
||||
<string name="distance_moving">Distance ir koriģēta</string>
|
||||
<string name="rendering_value_darkyellow_name">Tumši dzeltens</string>
|
||||
<string name="rendering_value_translucent_pink_name">Caurspīdīgs rozā</string>
|
||||
|
@ -2638,7 +2636,7 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
<string name="point_deleted">Punkts %1$s izdzēsts</string>
|
||||
<string name="shared_string_world">Pasaule</string>
|
||||
<string name="send_search_query_description">Mēs nosūtīsim jūsu meklēšanas pieprasījumu: <b>\"%1$s\"</b>, kā arī atrašanās vietas datus. <br/>
|
||||
<br/>" Personīgā informācija netiek iekļauta, šie dati tiek izmantoti vienīgi meklēšanas algoritma uzlabošanai. "<br/>
|
||||
<br/>" Personīgā informācija netiks iekļauta, šie dati tiks izmantoti vienīgi meklēšanas algoritma uzlabošanai. "<br/>
|
||||
</string>
|
||||
<string name="send_search_query">Sūtīt meklēšanas pieprasījumu\?</string>
|
||||
<string name="thank_you_for_feedback">Paldies par Jūsu atsauksmi</string>
|
||||
|
@ -3145,4 +3143,83 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
|
|||
<string name="routing_attr_difficulty_preference_description">Dot priekšroku izvēlētajai grūtības pakāpei, lai arī vieglāki un grūtāki maršruti joprojām ir iespējami, ja tie ir pietiekami īsi.</string>
|
||||
<string name="routing_attr_freeride_policy_name">Beztrases</string>
|
||||
<string name="routing_attr_freeride_policy_description">Brīvā stila un beztrases ir neoficiālie maršruti un pārejas. Parasti neiebraukti un oficiāli netiek neuzturēti. Brauciet tikai uz savu risku.</string>
|
||||
<string name="release_3_3_7">• Rāda laiku starp pārsēšanām sabiedriskajā transportā
|
||||
\n
|
||||
\n • Izlabota lietotāja saskarsme maršruta detaļās
|
||||
\n
|
||||
\n • Salabota tumšā tēma Norādījumu izvēlnē un Maršruta Detaļās
|
||||
\n
|
||||
\n • Rāda azimutu iekš Mērīt Attālumu
|
||||
\n
|
||||
\n</string>
|
||||
<string name="release_3_4">"• Lietotnes profili: veidojiet personisku profilu savām vajadzībām, izvēlieties ikonu un krāsu
|
||||
\n
|
||||
\n • Tagad mainiet katra profila noklusējumus un min/max ātrumus
|
||||
\n
|
||||
\n • pievienots tekošo koordināšu logrīks
|
||||
\n
|
||||
\n • Pievienota opcija rādīt kompasu un rādiusa lineālu uz kartes
|
||||
\n
|
||||
\n • Salabota treka logošana fonā
|
||||
\n
|
||||
\n • Uzlabota karšu lejupielāde fonā
|
||||
\n
|
||||
\n • Atgriezta \"ieslēgt ekrānu\" opcija
|
||||
\n
|
||||
\n • Salabota Vikipēdijas valodas izvēlne
|
||||
\n
|
||||
\n • Salabota kompasa pogas darbība navigācijas laikā
|
||||
\n
|
||||
\n • Citi kļūdu labojumi
|
||||
\n
|
||||
\n"</string>
|
||||
<string name="configure_profile_info">Visi zemāk esošie iestatījumi attiecas tikai uz izvēlēto profilu.</string>
|
||||
<string name="utm_format_descr">OsmAnd lieto UTM standarta formātu, kas ir līdzīgs, bet ne vienāds ar UTM NATO formātu.</string>
|
||||
<string name="shared_string_example">Piemērs</string>
|
||||
<string name="navigate_point_format_utm">UTM standarts</string>
|
||||
<string name="navigate_point_format_olc">Open Location Code</string>
|
||||
<string name="coordinates_format_info">Izvēlētais formāts tiks piemērots visās lietotnes sadaļās.</string>
|
||||
<string name="pref_selected_by_default_for_profiles">Iestatījums ir izvēlēts kā noklusētais sekojošiem profiliem: %s</string>
|
||||
<string name="change_default_settings">Mainīt noklusētos iestatījumus</string>
|
||||
<string name="discard_changes">Atcelt izmaiņas</string>
|
||||
<string name="apply_to_current_profile">Pielietot %1$s profilam</string>
|
||||
<string name="apply_to_all_profiles">Pielietot visiem profiliem</string>
|
||||
<string name="start_up_message_pref">Startēšanas ziņa</string>
|
||||
<string name="analytics_pref_title">Analītika</string>
|
||||
<string name="turn_screen_on_info">Navigācijas laikā rādīt karti bloķēšanas ekrānā.</string>
|
||||
<string name="route_parameters_info">Šie parametri ietekmēs maršruta izveidošanu. Tiks piemēroti tikai izvēlētajam profilam: %1$s.</string>
|
||||
<string name="wake_time">Pamošanās laiks</string>
|
||||
<string name="units_and_formats">Mērvienības un formāti</string>
|
||||
<string name="appearance">Izskats</string>
|
||||
<string name="map_look_descr">Ikonas, logrīki</string>
|
||||
<string name="map_look">Kartes skats</string>
|
||||
<string name="list_of_installed_plugins">Instalēto spraudņu saraksts</string>
|
||||
<string name="configure_navigation">Konfigurēt navigāciju</string>
|
||||
<string name="general_settings_profile_descr">Lietotnes tēma, mērvienības, reģions</string>
|
||||
<string name="configure_profile">Iestatīt profilu</string>
|
||||
<string name="screen_alerts_descr">Tiks rādīti paziņojumi navigācijas laikā ekrāna apakšā kreisajā pusē.</string>
|
||||
<string name="switch_profile">Mainīt profilu</string>
|
||||
<string name="language_and_output">Valoda un izvade</string>
|
||||
<string name="reset_to_default">Atiestatīt uz noklusējumiem</string>
|
||||
<string name="manage_profiles_descr">Veidot, importēt un labot profilus</string>
|
||||
<string name="manage_profiles">Pārvaldīt lietotnes profilus…</string>
|
||||
<string name="osmand_settings_descr">Ietekmē visu aplikāciju</string>
|
||||
<string name="osmand_settings">OsmAnd iestatījumi</string>
|
||||
<string name="copy_from_other_profile">Kopēt no cita profila</string>
|
||||
<string name="turn_screen_on">Ieslēgt ekrānu</string>
|
||||
<string name="map_during_navigation_info">Karte navigācijas laikā</string>
|
||||
<string name="map_during_navigation">Karte navigācijas laikā</string>
|
||||
<string name="shared_string_other">Citi</string>
|
||||
<string name="vehicle_parameters_descr">Svars, augstums, ātrums</string>
|
||||
<string name="vehicle_parameters">Transportlīdzekļa parametri</string>
|
||||
<string name="voice_announces_info">Balss uzvednes tiek atskaņotas tikai navigācijas laikā.</string>
|
||||
<string name="voice_announces_descr">Navigācijas instrukcijas un uzvednes</string>
|
||||
<string name="voice_announces">Balss uzvednes</string>
|
||||
<string name="screen_alerts">Ekrāna paziņojumi</string>
|
||||
<string name="route_parameters_descr">Konfigurēt maršruta parametrus</string>
|
||||
<string name="route_parameters">Maršruta parametri</string>
|
||||
<string name="application_profile_changed">Lietotnes profils nomainīts uz \"%s\"</string>
|
||||
<string name="logcat_buffer">Logcat buferis</string>
|
||||
<string name="plugins_settings">Spraudņu iestatījumi</string>
|
||||
<string name="shared_string_by_default">Pēc noklusējuma</string>
|
||||
</resources>
|
|
@ -3296,4 +3296,6 @@ Reprezentuje obszar: %1$s x %2$s</string>
|
|||
<string name="get_discount_title">Uzyskaj %1$d %2$s taniej o %3$s.</string>
|
||||
<string name="language_and_output">Język i wyjście</string>
|
||||
<string name="plugins_settings">Ustawienia wtyczki</string>
|
||||
<string name="shared_string_by_default">Domyślnie</string>
|
||||
<string name="download_detailed_map">Pobierz szczegółową mapę %S, aby zobaczyć ten obszar.</string>
|
||||
</resources>
|
|
@ -2604,7 +2604,7 @@
|
|||
<string name="poi_outdoor_seating_filter_yes">Sim</string>
|
||||
<string name="poi_service_bicycle_charging_yes">Cobrança: sim</string>
|
||||
<string name="poi_service_bicycle_charging_no">Cobrança: não</string>
|
||||
<string name="poi_bicycle_repair_station">Estação de auto-reparo de bicicletas</string>
|
||||
<string name="poi_bicycle_repair_station">Estação de reparação de bicicletas</string>
|
||||
<string name="poi_shower_filter_yes">Sim</string>
|
||||
<string name="poi_health_specialty_palliative_medicine_yes">Medicina paliativa</string>
|
||||
<string name="poi_sport_free_flying">Voo livre (esporte)</string>
|
||||
|
@ -3719,10 +3719,10 @@
|
|||
<string name="poi_hgv_destination">Destino</string>
|
||||
<string name="poi_cellar_entrance">Entrada da adega</string>
|
||||
<string name="poi_health_food">Alimentação saudável</string>
|
||||
<string name="poi_craft_builder"></string>
|
||||
<string name="poi_craft_distillery"></string>
|
||||
<string name="poi_craft_joiner"></string>
|
||||
<string name="poi_craft_floorer"></string>
|
||||
<string name="poi_craft_bakery"></string>
|
||||
<string name="poi_craft_cabinet_maker"></string>
|
||||
<string name="poi_craft_builder">Construtora</string>
|
||||
<string name="poi_craft_distillery">Destilaria</string>
|
||||
<string name="poi_craft_joiner">Marceneiro</string>
|
||||
<string name="poi_craft_floorer">Assentador de piso</string>
|
||||
<string name="poi_craft_bakery">Padaria</string>
|
||||
<string name="poi_craft_cabinet_maker">Marceneiro</string>
|
||||
</resources>
|
|
@ -782,7 +782,7 @@ Pôr do Sol: %2$s</string>
|
|||
<string name="osmand_parking_minutes">Minutos</string>
|
||||
<string name="osmand_parking_position_description_add_time">O carro foi estacionado em</string>
|
||||
<string name="index_settings">Gerenciar mapas</string>
|
||||
<string name="context_menu_item_search">Pesquisar nas proximidades</string>
|
||||
<string name="context_menu_item_search">Pesquisar entorno</string>
|
||||
<string name="local_index_descr_title">Gerenciar mapas.</string>
|
||||
<string name="show_point_options">Usar posição…</string>
|
||||
<string name="only_show">Exibir rota</string>
|
||||
|
@ -1365,7 +1365,7 @@ Pôr do Sol: %2$s</string>
|
|||
<string name="route_tsll">Vire levemente à esquerda e siga</string>
|
||||
<string name="search_poi_location">Aguardando sinal…</string>
|
||||
<string name="search_near_map">Pesquisar próximo ao centro do mapa</string>
|
||||
<string name="search_nearby">Pesquisar nas proximidades</string>
|
||||
<string name="search_nearby">Pesquisar entorno</string>
|
||||
<string name="map_orientation_default">Mesma do aparelho</string>
|
||||
<string name="map_orientation_portrait">Vertical</string>
|
||||
<string name="map_orientation_landscape">Horizontal</string>
|
||||
|
@ -3248,7 +3248,7 @@ Pôr do Sol: %2$s</string>
|
|||
<string name="wake_time">Tempo de despertar</string>
|
||||
<string name="units_and_formats">Unidades e formatos</string>
|
||||
<string name="appearance">Aparência</string>
|
||||
<string name="map_look_descr">Ícones, widgets</string>
|
||||
<string name="map_look_descr">Aparência do mapa</string>
|
||||
<string name="map_look">Aparência do mapa</string>
|
||||
<string name="list_of_installed_plugins">Lista de plugins instalados</string>
|
||||
<string name="configure_navigation">Configurar navegação</string>
|
||||
|
@ -3277,4 +3277,5 @@ Pôr do Sol: %2$s</string>
|
|||
<string name="shared_string_by_default">Pré-definido</string>
|
||||
<string name="plugins_settings">Configurações do plugin</string>
|
||||
<string name="download_detaile_map">Faça o download do mapa %s detalhado, para visualizar esta área.</string>
|
||||
<string name="download_detailed_map">Faça o download do mapa %s detalhado, para visualizar esta área.</string>
|
||||
</resources>
|
|
@ -3247,7 +3247,7 @@
|
|||
<string name="map_during_navigation_info">Карта во время навигации</string>
|
||||
<string name="map_during_navigation">Карта во время навигации</string>
|
||||
<string name="vehicle_parameters_descr">Вес, высота, скорость</string>
|
||||
<string name="vehicle_parameters">Параметры автомобиля</string>
|
||||
<string name="vehicle_parameters">Параметры транспортного средства</string>
|
||||
<string name="voice_announces_info">Голосовые объявления воспроизводятся только во время навигации.</string>
|
||||
<string name="voice_announces_descr">Навигационные инструкции и объявления</string>
|
||||
<string name="voice_announces">Голосовые объявления</string>
|
||||
|
|
|
@ -3216,4 +3216,67 @@ Zodpovedá oblasti: %1$s x %2$s</string>
|
|||
<string name="get_discount_second_part">potom %@</string>
|
||||
<string name="cancel_subscription">Zrušiť predplatné</string>
|
||||
<string name="price_and_discount">%1$s • Ušetrite %2$s</string>
|
||||
<string name="day">Deň</string>
|
||||
<string name="days_2_4">Dni</string>
|
||||
<string name="days_5">Dní</string>
|
||||
<string name="week">Týždeň</string>
|
||||
<string name="weeks_2_4">Týždne</string>
|
||||
<string name="weeks_5">Týždňov</string>
|
||||
<string name="month">Mesiac</string>
|
||||
<string name="months_2_4">Mesiace</string>
|
||||
<string name="months_5">Mesiacov</string>
|
||||
<string name="year">Rok</string>
|
||||
<string name="years_2_4">Roky</string>
|
||||
<string name="years_5">Rokov</string>
|
||||
<string name="months_3">Tri mesiace</string>
|
||||
<string name="configure_profile_info">Všetky nasledovné nastavenia ovplyvnia len zvolený profil.</string>
|
||||
<string name="utm_format_descr">OsmAnd používa formát UTM Standard, ktorý je podobný ale nie identický s formátom UTM Nato.</string>
|
||||
<string name="shared_string_example">Príklad</string>
|
||||
<string name="navigate_point_format_utm">UTM Standard</string>
|
||||
<string name="navigate_point_format_olc">Open Location Code</string>
|
||||
<string name="coordinates_format_info">Zvolený formát bude použitý na všetkých miestach aplikácie.</string>
|
||||
<string name="pref_selected_by_default_for_profiles">Toto nastavenie bude predvolené v profiloch: %s</string>
|
||||
<string name="change_default_settings">Zmeniť predvolené nastavenia</string>
|
||||
<string name="discard_changes">Zahodiť zmeny</string>
|
||||
<string name="apply_to_current_profile">Použiť na aktuálny profil %1$s</string>
|
||||
<string name="apply_to_all_profiles">Použiť na všetky profily</string>
|
||||
<string name="start_up_message_pref">Správa po spustení</string>
|
||||
<string name="analytics_pref_title">Analýzy</string>
|
||||
<string name="turn_screen_on_info">Zobraziť mapu počas navigácie nad zamknutou obrazovkou.</string>
|
||||
<string name="route_parameters_info">Tieto nastavenia ovplyvnia tvorbu trasy. Použijú sa len na zvolený profil: %1$s.</string>
|
||||
<string name="wake_time">Čas zobudenia</string>
|
||||
<string name="units_and_formats">Jednotky & formáty</string>
|
||||
<string name="appearance">Zobrazenie</string>
|
||||
<string name="map_look_descr">Zobrazenie mapy</string>
|
||||
<string name="map_look">Vzhľad mapy</string>
|
||||
<string name="list_of_installed_plugins">Zoznam nainštalovaných modulov</string>
|
||||
<string name="configure_navigation">Nastaviť navigáciu</string>
|
||||
<string name="general_settings_profile_descr">Vzhľad aplikácie, jednotky, oblasť</string>
|
||||
<string name="configure_profile">Nastaviť profil</string>
|
||||
<string name="screen_alerts_descr">Varovania budú zobrazené počas navigácie v ľavom dolnom rohu obrazovky.</string>
|
||||
<string name="switch_profile">Prepnúť profil</string>
|
||||
<string name="language_and_output">Jazyk a výstup</string>
|
||||
<string name="reset_to_default">Obnoviť do základného nastavenia</string>
|
||||
<string name="manage_profiles_descr">Vytvoriť, importovať, upraviť profily</string>
|
||||
<string name="manage_profiles">Spravovať profily aplikácie…</string>
|
||||
<string name="osmand_settings_descr">Ovplyvní celú aplikáciu</string>
|
||||
<string name="osmand_settings">Nastavenia OsmAnd</string>
|
||||
<string name="copy_from_other_profile">Kopírovať z iného profilu</string>
|
||||
<string name="turn_screen_on">Zapnúť obrazovku</string>
|
||||
<string name="map_during_navigation_info">Mapa počas navigácie</string>
|
||||
<string name="map_during_navigation">Mapa počas navigácie</string>
|
||||
<string name="shared_string_other">Iné</string>
|
||||
<string name="vehicle_parameters_descr">Hmotnosť, výška, rýchlosť</string>
|
||||
<string name="vehicle_parameters">Parametre vozidla</string>
|
||||
<string name="voice_announces_info">Hlasové oznámenia sú prehrávané len počas navigácie.</string>
|
||||
<string name="voice_announces_descr">Navigačné pokyny a oznámenia</string>
|
||||
<string name="voice_announces">Hlasové oznámenia</string>
|
||||
<string name="screen_alerts">Varovania na obrazovke</string>
|
||||
<string name="route_parameters_descr">Nastaviť parametre trasy</string>
|
||||
<string name="route_parameters">Parametre trasy</string>
|
||||
<string name="application_profile_changed">Profil aplikáce sa zmenil na \"%s\"</string>
|
||||
<string name="logcat_buffer">Zásobník logcat</string>
|
||||
<string name="plugins_settings">Nastavenia modulu</string>
|
||||
<string name="shared_string_by_default">Predvolene</string>
|
||||
<string name="download_detailed_map">Pre zobrazenie tejto oblasti si stiahnite podrobnú mapu %s.</string>
|
||||
</resources>
|
|
@ -1111,4 +1111,85 @@
|
|||
<string name="poi_glacier_type">Buzul tipi</string>
|
||||
<string name="poi_checkpoint_type">Kontrol noktası tipi</string>
|
||||
<string name="poi_bulk_purchase">Toplu satın alma</string>
|
||||
<string name="poi_landfill_waste_nuclear">Nükleer atık</string>
|
||||
<string name="poi_brownfield">Terkedilmiş endüstriyel bölge</string>
|
||||
<string name="poi_leisure_track">Spor pisti</string>
|
||||
<string name="poi_sport_multi">Çoklu spor</string>
|
||||
<string name="poi_denomination_serbian_orthodox">Sırp ortodoks</string>
|
||||
<string name="poi_spring">Kaynak</string>
|
||||
<string name="poi_casino">Kumarhane</string>
|
||||
<string name="poi_fast_food">Fast food</string>
|
||||
<string name="poi_drinking_water">İçme suyu</string>
|
||||
<string name="poi_craft_basket_maker">Sepet yapıcı</string>
|
||||
<string name="poi_craft_beekeeper">Arıcı</string>
|
||||
<string name="poi_craft_locksmith">Çilingir</string>
|
||||
<string name="poi_craft_key_cutter">Anahtarcı</string>
|
||||
<string name="poi_craft_optician">Gözlükçü</string>
|
||||
<string name="poi_craft_roofer">Çatı ustası</string>
|
||||
<string name="poi_laundry">Çamaşırhane</string>
|
||||
<string name="poi_shower">Duş</string>
|
||||
<string name="poi_sauna">Sauna</string>
|
||||
<string name="poi_bay">Koy</string>
|
||||
<string name="poi_fjord">Fiyort</string>
|
||||
<string name="poi_reef">Resif</string>
|
||||
<string name="poi_valley">Vadi</string>
|
||||
<string name="poi_islet">Adacık</string>
|
||||
<string name="poi_anchorage">Demirleme yeri</string>
|
||||
<string name="poi_anchor_berth">Çapa rıhtımı</string>
|
||||
<string name="poi_buoy_lateral">Yanal şamandıra</string>
|
||||
<string name="poi_floating_dock">Yüzer iskele</string>
|
||||
<string name="poi_fog_signal">Sis sinyali</string>
|
||||
<string name="poi_harbour_basin">Liman havzası</string>
|
||||
<string name="poi_seamark_harbour">Liman</string>
|
||||
<string name="poi_signal_station_traffic">Sinyal istasyonu, trafik</string>
|
||||
<string name="poi_signal_station_warning">Sinyal istasyonu, uyarı</string>
|
||||
<string name="poi_aerialway_pylon">Havai kaldırma direği</string>
|
||||
<string name="poi_power_pole">Elektrik direği</string>
|
||||
<string name="poi_cooling_tower">Soğutma kulesi</string>
|
||||
<string name="poi_ford_stepping_stones">Basamak-taşlı köprü</string>
|
||||
<string name="poi_commercial">Ticari arazi</string>
|
||||
<string name="poi_retail">Perakende kullanım amaçlı arazi</string>
|
||||
<string name="poi_paediatrics">Pediatri</string>
|
||||
<string name="poi_internet_access_yes">İnternet erişimi: evet</string>
|
||||
<string name="poi_internet_access_no">İnternet erişimi: hayır</string>
|
||||
<string name="poi_internet_access_fee_yes">İnternet erişimi - ücretli</string>
|
||||
<string name="poi_internet_access_fee_no">İnternet erişimi - ücretsiz</string>
|
||||
<string name="poi_aeroway_fuel">Uçak yakıtı istasyonu</string>
|
||||
<string name="poi_historic_aircraft">Tarihi uçak</string>
|
||||
<string name="poi_honey">Bal dükkanı</string>
|
||||
<string name="poi_fuel_91ul">91UL yakıt</string>
|
||||
<string name="poi_fuel_100ll">100LL yakıt</string>
|
||||
<string name="poi_fuel_adblue">AdBlue yakıt</string>
|
||||
<string name="poi_fuel_wood">Yakıt: odun</string>
|
||||
<string name="poi_fuel_charcoal">Yakıt: odun kömürü</string>
|
||||
<string name="poi_fuel_coal">Yakıt: kömür</string>
|
||||
<string name="poi_escape_lane">Kaçış şeridi</string>
|
||||
<string name="poi_club_freemasonry">Mason Köşkü</string>
|
||||
<string name="poi_club_sailing">Yelken kulübü</string>
|
||||
<string name="poi_club_scout">İzci kulübü</string>
|
||||
<string name="poi_fuel_autogas">Otogaz</string>
|
||||
<string name="poi_fuel_jeta1">Jet A-1 yakıtı</string>
|
||||
<string name="poi_ice_hockey">Buz hokeyi</string>
|
||||
<string name="poi_religion">Dini ürünler</string>
|
||||
<string name="poi_spices">Baharat dükkanı</string>
|
||||
<string name="poi_shop_craft">Sanat ve el sanatları tedarik mağazası</string>
|
||||
<string name="poi_waterway_fuel">Tekneler için benzin istasyonu</string>
|
||||
<string name="poi_emergency_infrastructure">Acil durum altyapısı</string>
|
||||
<string name="poi_lock_basin">Kilit havzası</string>
|
||||
<string name="poi_atm">ATM</string>
|
||||
<string name="poi_substation_type">Tür</string>
|
||||
<string name="poi_books_type">Kitaplar</string>
|
||||
<string name="poi_denotation">Anlam</string>
|
||||
<string name="poi_rtsa_scale_filter">Zorluk kategorisi</string>
|
||||
<string name="poi_climbing_crag_filter">Tırmanma kayalığı</string>
|
||||
<string name="poi_climbing_crag">Evet</string>
|
||||
<string name="poi_historic_tank">Tarihi tank</string>
|
||||
<string name="poi_snowmobile_filter">Kar aracı erişimi</string>
|
||||
<string name="poi_access_bus">Otobüs erişimi</string>
|
||||
<string name="poi_access_caravan">Karavan erişimi</string>
|
||||
<string name="poi_access_motorhome">Motokaravan erişimi</string>
|
||||
<string name="poi_access_trailer">Treyler erişimi</string>
|
||||
<string name="poi_access_motorcycle">Motosiklet erişimi</string>
|
||||
<string name="poi_access_moped">Moped erişimi</string>
|
||||
<string name="poi_access_disabled">Engelli erişimi</string>
|
||||
</resources>
|
File diff suppressed because it is too large
Load diff
|
@ -2177,7 +2177,7 @@
|
|||
<string name="poi_payment_oyster_yes">Oyster</string>
|
||||
<string name="poi_toilets_yes">Так</string>
|
||||
<string name="poi_resource_salt">Сіль</string>
|
||||
<string name="poi_bicycle_repair_station">Стійка для самостійного ремонту велосипедів</string>
|
||||
<string name="poi_bicycle_repair_station">Стійка для ремонту / самостійного ремонту велосипедів</string>
|
||||
<string name="poi_clothes_costumes">Карнавальні костюми</string>
|
||||
<string name="poi_futsal">Міні-футбол</string>
|
||||
<string name="poi_free_flying_guest_guidelines_no">Інструкції для гостей: немає</string>
|
||||
|
@ -3594,5 +3594,5 @@
|
|||
<string name="poi_source_biomass">Джерело енергії: біомаса</string>
|
||||
<string name="poi_snowmobile_filter">Доступ для снігоходів</string>
|
||||
<string name="poi_access_bus">Доступ для автобусів</string>
|
||||
<string name="poi_access_caravan">Доступ для будинків на колесах</string>
|
||||
<string name="poi_access_caravan">Доступ для автопричепів</string>
|
||||
</resources>
|
|
@ -1923,7 +1923,7 @@
|
|||
<string name="osm_live_not_active">Не активний</string>
|
||||
<string name="osm_live_enter_email">Будь ласка, введіть дійсну електронну адресу</string>
|
||||
<string name="osm_live_subscription_settings">Налаштування підписки</string>
|
||||
<string name="select_map_marker">Виберіть позначку</string>
|
||||
<string name="select_map_marker">Оберіть позначку на мапі</string>
|
||||
<string name="upload_anonymously">Вивантажено анонімно</string>
|
||||
<string name="show_transparency_seekbar">Показати прозору пошукову панель</string>
|
||||
<string name="report">Звіт</string>
|
||||
|
@ -3303,4 +3303,5 @@
|
|||
<string name="voice_announces_descr">Інструкції і попередження при навігації</string>
|
||||
<string name="logcat_buffer">Буфер logcat</string>
|
||||
<string name="plugins_settings">Налаштування втулка</string>
|
||||
<string name="shared_string_by_default">Типово</string>
|
||||
</resources>
|
|
@ -3279,4 +3279,5 @@
|
|||
<string name="application_profile_changed">應用程式設定檔變更為「%s」</string>
|
||||
<string name="logcat_buffer">Logcat 緩衝</string>
|
||||
<string name="plugins_settings">外掛程式設定</string>
|
||||
<string name="shared_string_by_default">預設值</string>
|
||||
</resources>
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="card_content_padding_large">28dp</dimen>
|
||||
<dimen name="contex_menu_top_shadow_height">16dp</dimen>
|
||||
<dimen name="dialog_button_ex_height">60dp</dimen>
|
||||
<dimen name="dialog_button_ex_min_width">72dp</dimen>
|
||||
|
|
|
@ -11,6 +11,35 @@
|
|||
Thx - Hardy
|
||||
|
||||
-->
|
||||
<string name="change_data_storage_full_description">Move OsmAnd data files to the new destination?\n%1$s > %2$s</string>
|
||||
<string name="data_storage_preference_summary">%1$s • Used %2$s GB</string>
|
||||
<string name="data_storage_space_description">Free %1$s • %2$s / %3$s GB</string>
|
||||
<string name="enter_path_to_folder">Enter path to the folder</string>
|
||||
<string name="shared_string_select_folder">Select folder</string>
|
||||
<string name="paste_Osmand_data_folder_path">Paste path to the folder with OsmAnd data</string>
|
||||
<string name="change_osmand_data_folder_question">Change OsmAnd data folder?</string>
|
||||
<string name="move_maps_to_new_destination">Move to the new destination</string>
|
||||
<string name="internal_app_storage_description">Internal storage, hiden from user and other apps, so no one except OsmAnd can’t get access to your data</string>
|
||||
<string name="change_data_storage_folder">Change data storage folder</string>
|
||||
<string name="rendering_attr_piste_type_snow_park_name">Snow park</string>
|
||||
<string name="rendering_attr_piste_type_sleigh_name">Sleigh</string>
|
||||
<string name="rendering_attr_piste_type_sled_name">Sled</string>
|
||||
<string name="rendering_attr_piste_type_hike_name">Hike</string>
|
||||
<string name="rendering_attr_piste_type_connection_name">Connection</string>
|
||||
<string name="rendering_attr_piste_type_skitour_name">Skitour</string>
|
||||
<string name="rendering_attr_piste_type_downhill_name">Downhill</string>
|
||||
<string name="rendering_attr_piste_type_nordic_name">Nordic</string>
|
||||
<string name="routeInfo_piste_type_name">Piste type</string>
|
||||
<string name="rendering_attr_piste_difficulty_novice_name">Novice</string>
|
||||
<string name="rendering_attr_piste_difficulty_easy_name">Easy</string>
|
||||
<string name="rendering_attr_piste_difficulty_intermediate_name">Intermediate</string>
|
||||
<string name="rendering_attr_piste_difficulty_advanced_name">Advanced</string>
|
||||
<string name="rendering_attr_piste_difficulty_expert_name">Expert</string>
|
||||
<string name="rendering_attr_piste_difficulty_freeride_name">Freeride</string>
|
||||
<string name="rendering_attr_piste_difficulty_extreme_name">Extreme</string>
|
||||
<string name="rendering_attr_piste_difficulty_undefined_name">Undefined</string>
|
||||
<string name="routeInfo_piste_difficulty_name">Piste difficulty</string>
|
||||
<string name="download_detailed_map">Download detailed %s map, to view this area.</string>
|
||||
<string name="shared_string_by_default">By default</string>
|
||||
<string name="plugins_settings">Plugin settings</string>
|
||||
<string name="logcat_buffer">Logcat buffer</string>
|
||||
|
|
10
OsmAnd/res/xml/data_storage.xml
Normal file
10
OsmAnd/res/xml/data_storage.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/application_dir">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="application_profiles"
|
||||
android:layout="@layout/preference_category_with_descr"
|
||||
android:title="@string/change_data_storage_folder" />
|
||||
|
||||
</PreferenceScreen>
|
|
@ -21,6 +21,7 @@
|
|||
android:layout="@layout/preference_with_descr"
|
||||
android:persistent="false"
|
||||
android:title="@string/application_dir"
|
||||
app:fragment="net.osmand.plus.settings.DataStorageFragment"
|
||||
tools:icon="@drawable/ic_action_folder" />
|
||||
|
||||
<Preference
|
||||
|
|
|
@ -22,6 +22,7 @@ import android.net.Uri;
|
|||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.os.StatFs;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
|
@ -587,6 +588,28 @@ public class AndroidUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static float getFreeSpaceGb(File dir) {
|
||||
if (dir.canRead()) {
|
||||
StatFs fs = new StatFs(dir.getAbsolutePath());
|
||||
return (float) (fs.getBlockSize()) * fs.getAvailableBlocks() / (1 << 30);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static float getTotalSpaceGb(File dir) {
|
||||
if (dir.canRead()) {
|
||||
return (float) (dir.getTotalSpace()) / (1 << 30);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static float getUsedSpaceGb(File dir) {
|
||||
if (dir.canRead()) {
|
||||
return getTotalSpaceGb(dir) - getFreeSpaceGb(dir);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static CharSequence getStyledString(CharSequence baseString, CharSequence stringToInsertAndStyle,
|
||||
CharacterStyle baseStyle, CharacterStyle replaceStyle) {
|
||||
int indexOfPlaceholder = baseString.toString().indexOf(STRING_PLACEHOLDER);
|
||||
|
|
|
@ -39,6 +39,7 @@ public class UiUtilities {
|
|||
private static final int ORIENTATION_90 = 3;
|
||||
private static final int ORIENTATION_270 = 1;
|
||||
private static final int ORIENTATION_180 = 2;
|
||||
private static final int INVALID_ID = -1;
|
||||
|
||||
public enum DialogButtonType {
|
||||
PRIMARY,
|
||||
|
@ -324,35 +325,49 @@ public class UiUtilities {
|
|||
}
|
||||
|
||||
public static void setupDialogButton(boolean nightMode, View buttonView, DialogButtonType buttonType, CharSequence buttonText) {
|
||||
setupDialogButton(nightMode, buttonView, buttonType, buttonText, INVALID_ID);
|
||||
}
|
||||
|
||||
public static void setupDialogButton(boolean nightMode, View buttonView, DialogButtonType buttonType, CharSequence buttonText, int iconResId) {
|
||||
Context ctx = buttonView.getContext();
|
||||
TextViewEx buttonTextView = (TextViewEx) buttonView.findViewById(R.id.button_text);
|
||||
boolean v21 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
|
||||
View buttonContainer = buttonView.findViewById(R.id.button_container);
|
||||
int textAndIconColorResId = INVALID_ID;
|
||||
switch (buttonType) {
|
||||
case PRIMARY:
|
||||
if (v21) {
|
||||
AndroidUtils.setBackground(ctx, buttonContainer, nightMode, R.drawable.ripple_solid_light, R.drawable.ripple_solid_dark);
|
||||
}
|
||||
AndroidUtils.setBackground(ctx, buttonView, nightMode, R.drawable.dlg_btn_primary_light, R.drawable.dlg_btn_primary_dark);
|
||||
buttonTextView.setTextColor(ContextCompat.getColorStateList(ctx, nightMode ? R.color.dlg_btn_primary_text_dark : R.color.dlg_btn_primary_text_light));
|
||||
textAndIconColorResId = nightMode ? R.color.dlg_btn_primary_text_dark : R.color.dlg_btn_primary_text_light;
|
||||
break;
|
||||
case SECONDARY:
|
||||
if (v21) {
|
||||
AndroidUtils.setBackground(ctx, buttonContainer, nightMode, R.drawable.ripple_solid_light, R.drawable.ripple_solid_dark);
|
||||
}
|
||||
AndroidUtils.setBackground(ctx, buttonView, nightMode, R.drawable.dlg_btn_secondary_light, R.drawable.dlg_btn_secondary_dark);
|
||||
buttonTextView.setTextColor(ContextCompat.getColorStateList(ctx, nightMode ? R.color.dlg_btn_secondary_text_dark : R.color.dlg_btn_secondary_text_light));
|
||||
textAndIconColorResId = nightMode ? R.color.dlg_btn_secondary_text_dark : R.color.dlg_btn_secondary_text_light;
|
||||
break;
|
||||
case STROKED:
|
||||
if (v21) {
|
||||
AndroidUtils.setBackground(ctx, buttonContainer, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||
}
|
||||
AndroidUtils.setBackground(ctx, buttonView, nightMode, R.drawable.dlg_btn_stroked_light, R.drawable.dlg_btn_stroked_dark);
|
||||
buttonTextView.setTextColor(ContextCompat.getColorStateList(ctx, nightMode ? R.color.dlg_btn_secondary_text_dark : R.color.dlg_btn_secondary_text_light));
|
||||
textAndIconColorResId = nightMode ? R.color.dlg_btn_secondary_text_dark : R.color.dlg_btn_secondary_text_light;
|
||||
break;
|
||||
}
|
||||
buttonTextView.setText(buttonText);
|
||||
buttonTextView.setEnabled(buttonView.isEnabled());
|
||||
if (textAndIconColorResId != INVALID_ID) {
|
||||
ColorStateList colorStateList = ContextCompat.getColorStateList(ctx, textAndIconColorResId);
|
||||
buttonTextView.setText(buttonText);
|
||||
buttonTextView.setTextColor(colorStateList);
|
||||
buttonTextView.setEnabled(buttonView.isEnabled());
|
||||
if (iconResId != INVALID_ID) {
|
||||
Drawable icon = tintDrawable(ContextCompat.getDrawable(ctx, iconResId), ContextCompat.getColor(ctx, textAndIconColorResId));
|
||||
buttonTextView.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
|
||||
buttonTextView.setCompoundDrawablePadding(AndroidUtils.dpToPx(ctx, ctx.getResources().getDimension(R.dimen.content_padding_half)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Context getThemedContext(Context context, boolean nightMode) {
|
||||
|
|
|
@ -973,9 +973,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
}
|
||||
int color = TopToolbarController.NO_COLOR;
|
||||
boolean mapControlsVisible = findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
|
||||
boolean topToolbarVisible = getMapLayers().getMapInfoLayer().isTopToolbarViewVisible();
|
||||
boolean night = app.getDaynightHelper().isNightModeForMapControls();
|
||||
TopToolbarController toolbarController = getMapLayers().getMapInfoLayer().getTopToolbarController();
|
||||
if (toolbarController != null && mapControlsVisible) {
|
||||
if (toolbarController != null && mapControlsVisible && topToolbarVisible) {
|
||||
color = toolbarController.getStatusBarColor(this, night);
|
||||
}
|
||||
if (color == TopToolbarController.NO_COLOR) {
|
||||
|
@ -2265,23 +2266,30 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
return mapInfoLayer.hasTopToolbar();
|
||||
}
|
||||
|
||||
public TopToolbarController getTopToolbarController(TopToolbarControllerType type) {
|
||||
public TopToolbarController getTopToolbarController(@NonNull TopToolbarControllerType type) {
|
||||
MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
|
||||
return mapInfoLayer.getTopToolbarController(type);
|
||||
}
|
||||
|
||||
public void showTopToolbar(TopToolbarController controller) {
|
||||
public void showTopToolbar(@NonNull TopToolbarController controller) {
|
||||
MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
|
||||
mapInfoLayer.addTopToolbarController(controller);
|
||||
updateStatusBarColor();
|
||||
}
|
||||
|
||||
public void hideTopToolbar(TopToolbarController controller) {
|
||||
public void hideTopToolbar(@NonNull TopToolbarController controller) {
|
||||
MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
|
||||
mapInfoLayer.removeTopToolbarController(controller);
|
||||
updateStatusBarColor();
|
||||
}
|
||||
|
||||
public void hideTopToolbar(@NonNull TopToolbarControllerType type) {
|
||||
TopToolbarController controller = getTopToolbarController(type);
|
||||
if (controller != null) {
|
||||
hideTopToolbar(controller);
|
||||
}
|
||||
}
|
||||
|
||||
public void registerActivityResultListener(ActivityResultListener listener) {
|
||||
activityResultListeners.add(listener);
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ public class MapActivityLayers {
|
|||
mapVectorLayer = new MapVectorLayer(mapTileLayer, false);
|
||||
mapView.addLayer(mapVectorLayer, 0.5f);
|
||||
|
||||
downloadedRegionsLayer = new DownloadedRegionsLayer();
|
||||
downloadedRegionsLayer = new DownloadedRegionsLayer(activity);
|
||||
mapView.addLayer(downloadedRegionsLayer, 0.5f);
|
||||
|
||||
// 0.9 gpx layer
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
package net.osmand.plus.download.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.download.DownloadValidationManager;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController;
|
||||
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarControllerType;
|
||||
import net.osmand.plus.widgets.style.CustomTypefaceSpan;
|
||||
|
||||
public class DownloadMapToolbarController extends TopToolbarController {
|
||||
|
||||
private MapActivity mapActivity;
|
||||
private DownloadValidationManager downloadValidationManager;
|
||||
|
||||
private boolean nightMode;
|
||||
|
||||
private View btnClose;
|
||||
private View btnDownload;
|
||||
private TextView tvDescription;
|
||||
private TextView tvSize;
|
||||
|
||||
private IndexItem indexItem;
|
||||
private String regionName;
|
||||
|
||||
private static String lastProcessedRegionName;
|
||||
|
||||
public DownloadMapToolbarController(@NonNull MapActivity mapActivity, @NonNull IndexItem indexItem, @NonNull String regionName) {
|
||||
super(TopToolbarControllerType.DOWNLOAD_MAP);
|
||||
this.mapActivity = mapActivity;
|
||||
this.indexItem = indexItem;
|
||||
this.regionName = regionName;
|
||||
|
||||
OsmandApplication app = mapActivity.getMyApplication();
|
||||
downloadValidationManager = new DownloadValidationManager(app);
|
||||
nightMode = app.getDaynightHelper().isNightModeForMapControls();
|
||||
int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
View mainView = View.inflate(new ContextThemeWrapper(mapActivity, themeRes), R.layout.download_detailed_map_widget, null);
|
||||
|
||||
if (!AndroidUiHelper.isOrientationPortrait(mapActivity)) {
|
||||
mainView.setBackgroundResource(getLandscapeBottomSidesBgResId());
|
||||
} else {
|
||||
mainView.setBackgroundResource(getPortraitBgResId());
|
||||
}
|
||||
|
||||
tvDescription = mainView.findViewById(R.id.description);
|
||||
tvSize = mainView.findViewById(R.id.fileSize);
|
||||
btnClose = mainView.findViewById(R.id.btnClose);
|
||||
btnDownload = mainView.findViewById(R.id.btnDownload);
|
||||
|
||||
UiUtilities.setupDialogButton(nightMode, btnClose, UiUtilities.DialogButtonType.SECONDARY, mapActivity.getString(R.string.shared_string_close));
|
||||
UiUtilities.setupDialogButton(nightMode, btnDownload, UiUtilities.DialogButtonType.PRIMARY, mapActivity.getString(R.string.shared_string_download));
|
||||
|
||||
refreshView();
|
||||
|
||||
setBottomView(mainView);
|
||||
setTopViewVisible(false);
|
||||
setShadowViewVisible(false);
|
||||
}
|
||||
|
||||
public static String getLastProcessedRegionName() {
|
||||
return lastProcessedRegionName;
|
||||
}
|
||||
|
||||
public IndexItem getIndexItem() {
|
||||
return indexItem;
|
||||
}
|
||||
|
||||
public String getRegionName() {
|
||||
return regionName;
|
||||
}
|
||||
|
||||
private void refreshView() {
|
||||
if (regionName != null) {
|
||||
String descriptionText = String.format(mapActivity.getString(R.string.download_detailed_map), regionName);
|
||||
int startIndex = descriptionText.indexOf(regionName);
|
||||
int endIndex = startIndex + regionName.length();
|
||||
|
||||
SpannableStringBuilder description = new SpannableStringBuilder(descriptionText);
|
||||
Typeface typeface = FontCache.getRobotoMedium(mapActivity);
|
||||
description.setSpan(new CustomTypefaceSpan(typeface), startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
tvDescription.setText(description);
|
||||
}
|
||||
|
||||
if (indexItem != null) {
|
||||
String size = indexItem.getSizeDescription(mapActivity);
|
||||
tvSize.setText(size);
|
||||
|
||||
btnDownload.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
downloadValidationManager.startDownload(mapActivity, indexItem);
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
btnClose.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void dismiss() {
|
||||
lastProcessedRegionName = regionName;
|
||||
mapActivity.hideTopToolbar(DownloadMapToolbarController.this);
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
private int getPortraitBgResId() {
|
||||
return nightMode ? R.drawable.bg_top_menu_dark : R.drawable.bg_top_menu_light;
|
||||
}
|
||||
|
||||
@DrawableRes
|
||||
private int getLandscapeBottomSidesBgResId() {
|
||||
return nightMode ? R.drawable.bg_top_sheet_bottom_sides_landscape_dark : R.drawable.bg_top_sheet_bottom_sides_landscape_light;
|
||||
}
|
||||
}
|
|
@ -93,7 +93,8 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
VOICE_ANNOUNCES(VoiceAnnouncesFragment.class.getName(), true, R.xml.voice_announces, R.layout.profile_preference_toolbar_with_switch),
|
||||
VEHICLE_PARAMETERS(VehicleParametersFragment.class.getName(), true, R.xml.vehicle_parameters, R.layout.profile_preference_toolbar),
|
||||
MAP_DURING_NAVIGATION(MapDuringNavigationFragment.class.getName(), true, R.xml.map_during_navigation, R.layout.profile_preference_toolbar),
|
||||
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch);
|
||||
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch),
|
||||
DATA_STORAGE(DataStorageFragment.class.getName(), false, R.xml.data_storage, R.layout.global_preference_toolbar);
|
||||
|
||||
public final String fragmentName;
|
||||
public final boolean profileDependent;
|
||||
|
|
566
OsmAnd/src/net/osmand/plus/settings/DataStorageFragment.java
Normal file
566
OsmAnd/src/net/osmand/plus/settings/DataStorageFragment.java
Normal file
|
@ -0,0 +1,566 @@
|
|||
package net.osmand.plus.settings;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.ProgressImplementation;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
import net.osmand.plus.download.DownloadActivity;
|
||||
import net.osmand.plus.settings.bottomsheets.ChangeDataStorageBottomSheet;
|
||||
import net.osmand.plus.settings.bottomsheets.SelectFolderBottomSheet;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import static net.osmand.plus.settings.DataStorageItemsHolder.INTERNAL_STORAGE;
|
||||
import static net.osmand.plus.settings.DataStorageItemsHolder.MANUALLY_SPECIFIED;
|
||||
import static net.osmand.plus.settings.bottomsheets.ChangeDataStorageBottomSheet.CHOSEN_DIRECTORY;
|
||||
import static net.osmand.plus.settings.bottomsheets.ChangeDataStorageBottomSheet.MOVE_DATA;
|
||||
import static net.osmand.plus.settings.bottomsheets.SelectFolderBottomSheet.PATH_CHANGED;
|
||||
import static net.osmand.plus.settings.bottomsheets.SelectFolderBottomSheet.NEW_PATH;
|
||||
|
||||
public class DataStorageFragment extends BaseSettingsFragment {
|
||||
|
||||
private final static String CHANGE_DIRECTORY_BUTTON = "change_directory";
|
||||
|
||||
private ArrayList<DataStorageMenuItem> menuItems;
|
||||
private ArrayList<CheckBoxPreference> dataStorageRadioButtonsGroup;
|
||||
private Preference changeButton;
|
||||
private DataStorageMenuItem currentDataStorage;
|
||||
private String tmpManuallySpecifiedPath;
|
||||
private DataStorageItemsHolder itemsHolder;
|
||||
|
||||
private OsmandApplication app;
|
||||
private OsmandActionBarActivity activity;
|
||||
private OsmandSettings settings;
|
||||
|
||||
@Override
|
||||
protected void setupPreferences() {
|
||||
app = getMyApplication();
|
||||
activity = getMyActivity();
|
||||
PreferenceScreen screen = getPreferenceScreen();
|
||||
|
||||
if (screen == null || app == null || activity == null) {
|
||||
return;
|
||||
}
|
||||
settings = app.getSettings();
|
||||
|
||||
itemsHolder = DataStorageItemsHolder.refreshInfo(app);
|
||||
menuItems = itemsHolder.getStorageItems();
|
||||
dataStorageRadioButtonsGroup = new ArrayList<>();
|
||||
|
||||
for (DataStorageMenuItem item : menuItems) {
|
||||
CheckBoxPreference preference = new CheckBoxPreference(activity);
|
||||
preference.setKey(item.getKey());
|
||||
preference.setTitle(item.getTitle());
|
||||
preference.setLayoutResource(R.layout.data_storage_list_item);
|
||||
screen.addPreference(preference);
|
||||
dataStorageRadioButtonsGroup.add(preference);
|
||||
}
|
||||
|
||||
currentDataStorage = itemsHolder.getCurrentStorage();
|
||||
|
||||
changeButton = new Preference(app);
|
||||
changeButton.setKey(CHANGE_DIRECTORY_BUTTON);
|
||||
changeButton.setLayoutResource(R.layout.bottom_sheet_item_btn_with_icon_and_text);
|
||||
screen.addPreference(changeButton);
|
||||
|
||||
updateView(currentDataStorage.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
if (CHANGE_DIRECTORY_BUTTON.equals(preference.getKey())) {
|
||||
showFolderSelectionDialog();
|
||||
return false;
|
||||
}
|
||||
return super.onPreferenceClick(preference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
super.onPreferenceChange(preference, newValue);
|
||||
|
||||
if (newValue instanceof Bundle) {
|
||||
//results from BottomSheets
|
||||
Bundle resultData = (Bundle) newValue;
|
||||
if (resultData.containsKey(ChangeDataStorageBottomSheet.TAG)) {
|
||||
boolean moveMaps = resultData.getBoolean(MOVE_DATA);
|
||||
DataStorageMenuItem newDataStorage = resultData.getParcelable(CHOSEN_DIRECTORY);
|
||||
if (newDataStorage != null) {
|
||||
if (tmpManuallySpecifiedPath != null) {
|
||||
String directory = tmpManuallySpecifiedPath;
|
||||
tmpManuallySpecifiedPath = null;
|
||||
newDataStorage.setDirectory(directory);
|
||||
}
|
||||
if (moveMaps) {
|
||||
moveData(currentDataStorage, newDataStorage);
|
||||
} else {
|
||||
confirm(app, activity, newDataStorage, false);
|
||||
}
|
||||
}
|
||||
} else if (resultData.containsKey(SelectFolderBottomSheet.TAG)) {
|
||||
boolean pathChanged = resultData.getBoolean(PATH_CHANGED);
|
||||
if (pathChanged) {
|
||||
tmpManuallySpecifiedPath = resultData.getString(NEW_PATH);
|
||||
if (tmpManuallySpecifiedPath != null) {
|
||||
DataStorageMenuItem manuallySpecified = null;
|
||||
try {
|
||||
manuallySpecified = (DataStorageMenuItem) itemsHolder.getManuallySpecified().clone();
|
||||
manuallySpecified.setDirectory(tmpManuallySpecifiedPath);
|
||||
} catch (CloneNotSupportedException e) {
|
||||
return false;
|
||||
}
|
||||
ChangeDataStorageBottomSheet.showInstance(getFragmentManager(), MANUALLY_SPECIFIED,
|
||||
currentDataStorage, manuallySpecified, this, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//show necessary dialog
|
||||
String key = preference.getKey();
|
||||
if (key != null) {
|
||||
DataStorageMenuItem newDataStorage = itemsHolder.getStorage(key);
|
||||
if (newDataStorage != null) {
|
||||
if (!currentDataStorage.getKey().equals(newDataStorage.getKey())) {
|
||||
if (newDataStorage.getType() == OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT
|
||||
&& !DownloadActivity.hasPermissionToWriteExternalStorage(activity)) {
|
||||
ActivityCompat.requestPermissions(activity,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
DownloadActivity.PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
|
||||
} else if (key.equals(MANUALLY_SPECIFIED)) {
|
||||
showFolderSelectionDialog();
|
||||
} else {
|
||||
ChangeDataStorageBottomSheet.showInstance(getFragmentManager(), key,
|
||||
currentDataStorage, newDataStorage, DataStorageFragment.this, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {
|
||||
super.onBindPreferenceViewHolder(preference, holder);
|
||||
String key = preference.getKey();
|
||||
if (key == null) {
|
||||
return;
|
||||
}
|
||||
View itemView = holder.itemView;
|
||||
if (preference instanceof CheckBoxPreference) {
|
||||
DataStorageMenuItem item = itemsHolder.getStorage(key);
|
||||
if (item != null) {
|
||||
TextView tvTitle = itemView.findViewById(android.R.id.title);
|
||||
TextView tvSummary = itemView.findViewById(R.id.summary);
|
||||
TextView tvAdditionalDescription = itemView.findViewById(R.id.additionalDescription);
|
||||
ImageView ivIcon = itemView.findViewById(R.id.icon);
|
||||
View divider = itemView.findViewById(R.id.divider);
|
||||
View secondPart = itemView.findViewById(R.id.secondPart);
|
||||
|
||||
tvTitle.setText(item.getTitle());
|
||||
String currentKey = item.getKey();
|
||||
boolean isCurrent = currentDataStorage.getKey().equals(currentKey);
|
||||
|
||||
int defaultIconColor = isNightMode() ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
|
||||
int chosenIconColor = isNightMode() ? R.color.icon_color_osmand_dark : R.color.icon_color_osmand_light;
|
||||
Drawable icon = app.getUIUtilities().getIcon(item.getIconResId(),
|
||||
isCurrent ? chosenIconColor : defaultIconColor);
|
||||
ivIcon.setImageDrawable(icon);
|
||||
|
||||
if (currentKey.equals(MANUALLY_SPECIFIED)) {
|
||||
tvSummary.setText(item.getDirectory());
|
||||
secondPart.setVisibility(View.GONE);
|
||||
tvAdditionalDescription.setVisibility(View.GONE);
|
||||
divider.setVisibility(View.GONE);
|
||||
} else {
|
||||
tvAdditionalDescription.setVisibility(View.VISIBLE);
|
||||
divider.setVisibility(View.VISIBLE);
|
||||
secondPart.setVisibility(View.VISIBLE);
|
||||
String space = getSpaceDescription(item.getDirectory());
|
||||
tvSummary.setText(space);
|
||||
if (currentKey.equals(INTERNAL_STORAGE)) {
|
||||
tvAdditionalDescription.setText(item.getDescription());
|
||||
} else {
|
||||
tvAdditionalDescription.setText(item.getDirectory());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (key.equals(CHANGE_DIRECTORY_BUTTON)) {
|
||||
ImageView icon = itemView.findViewById(R.id.button_icon);
|
||||
TextView title = itemView.findViewById(R.id.button_text);
|
||||
int colorResId = isNightMode() ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
|
||||
int color = ContextCompat.getColor(app, colorResId);
|
||||
Drawable drawable = UiUtilities.getColoredSelectableDrawable(app, color, 0.3f);
|
||||
AndroidUtils.setBackground(itemView, drawable);
|
||||
icon.setVisibility(View.INVISIBLE);
|
||||
title.setText(R.string.shared_string_change);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateView(String key) {
|
||||
//selection set up
|
||||
for (CheckBoxPreference preference : dataStorageRadioButtonsGroup) {
|
||||
String preferenceKey = preference.getKey();
|
||||
boolean checked = preferenceKey != null && preferenceKey.equals(key);
|
||||
preference.setChecked(checked);
|
||||
}
|
||||
boolean visible = key.equals(MANUALLY_SPECIFIED);
|
||||
changeButton.setVisible(visible);
|
||||
}
|
||||
|
||||
private void showFolderSelectionDialog() {
|
||||
DataStorageMenuItem manuallySpecified = itemsHolder.getManuallySpecified();
|
||||
if (manuallySpecified != null) {
|
||||
SelectFolderBottomSheet.showInstance(getFragmentManager(), manuallySpecified.getKey(),
|
||||
manuallySpecified.getDirectory(), DataStorageFragment.this,
|
||||
getString(R.string.storage_directory_manual), getString(R.string.paste_Osmand_data_folder_path),
|
||||
getString(R.string.shared_string_select_folder), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void moveData(final DataStorageMenuItem currentStorage, final DataStorageMenuItem newStorage) {
|
||||
File fromDirectory = new File(currentStorage.getDirectory());
|
||||
File toDirectory = new File(newStorage.getDirectory());
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
MoveFilesToDifferentDirectory task = new MoveFilesToDifferentDirectory(activity, fromDirectory, toDirectory) {
|
||||
|
||||
private MessageFormat formatMb = new MessageFormat("{0, number,##.#} MB", Locale.US);
|
||||
|
||||
@NonNull
|
||||
private String getFormattedSize(long sizeBytes) {
|
||||
int size = (int) ((sizeBytes + 512) >> 10);
|
||||
if (size >= 0) {
|
||||
if (size > 100) {
|
||||
return formatMb.format(new Object[]{(float) size / (1 << 10)});
|
||||
} else {
|
||||
return size + " kB";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private void showResultsDialog() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Context ctx = activity.get();
|
||||
if (ctx == null) {
|
||||
return;
|
||||
}
|
||||
int moved = getMovedCount();
|
||||
int copied = getCopiedCount();
|
||||
int failed = getFailedCount();
|
||||
sb.append(ctx.getString(R.string.files_moved, moved, getFormattedSize(getMovedSize()))).append("\n");
|
||||
if (copied > 0) {
|
||||
sb.append(ctx.getString(R.string.files_copied, copied, getFormattedSize(getCopiedSize()))).append("\n");
|
||||
}
|
||||
if (failed > 0) {
|
||||
sb.append(ctx.getString(R.string.files_failed, failed, getFormattedSize(getFailedSize()))).append("\n");
|
||||
}
|
||||
if (copied > 0 || failed > 0) {
|
||||
int count = copied + failed;
|
||||
sb.append(ctx.getString(R.string.files_present, count, getFormattedSize(getCopiedSize() + getFailedSize()), newStorage.getDirectory()));
|
||||
}
|
||||
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
|
||||
bld.setMessage(sb.toString());
|
||||
bld.setPositiveButton(R.string.shared_string_restart, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
confirm(app, activity.get(), newStorage, true);
|
||||
}
|
||||
});
|
||||
bld.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
super.onPostExecute(result);
|
||||
OsmandActionBarActivity a = this.activity.get();
|
||||
if (a == null) {
|
||||
return;
|
||||
}
|
||||
OsmandApplication app = a.getMyApplication();
|
||||
if (result) {
|
||||
app.getResourceManager().resetStoreDirectory();
|
||||
// immediately proceed with change (to not loose where maps are currently located)
|
||||
if (getCopiedCount() > 0 || getFailedCount() > 0) {
|
||||
showResultsDialog();
|
||||
} else {
|
||||
confirm(app, a, newStorage, false);
|
||||
}
|
||||
} else {
|
||||
showResultsDialog();
|
||||
Toast.makeText(a, R.string.copying_osmand_file_failed,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
|
||||
private void confirm(OsmandApplication app, OsmandActionBarActivity activity, DataStorageMenuItem newStorageDirectory, boolean silentRestart) {
|
||||
String newDirectory = newStorageDirectory.getDirectory();
|
||||
int type = newStorageDirectory.getType();
|
||||
File newDirectoryFile = new File(newDirectory);
|
||||
boolean wr = OsmandSettings.isWritable(newDirectoryFile);
|
||||
if (wr) {
|
||||
app.setExternalStorageDirectory(type, newDirectory);
|
||||
reloadData();
|
||||
if (silentRestart) {
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
} else {
|
||||
app.restartApp(activity);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(activity, R.string.specified_directiory_not_writeable,
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
updateAllSettings();
|
||||
}
|
||||
|
||||
private String getSpaceDescription(String path) {
|
||||
File dir = new File(path);
|
||||
File dirParent = dir.getParentFile();
|
||||
while (!dir.exists() && dirParent != null) {
|
||||
dir = dir.getParentFile();
|
||||
dirParent = dir.getParentFile();
|
||||
}
|
||||
if (dir.exists()) {
|
||||
DecimalFormat formatter = new DecimalFormat("#.##");
|
||||
return String.format(getString(R.string.data_storage_space_description),
|
||||
formatter.format(AndroidUtils.getFreeSpaceGb(dir)),
|
||||
formatter.format(AndroidUtils.getUsedSpaceGb(dir)),
|
||||
formatter.format(AndroidUtils.getTotalSpaceGb(dir)));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected void reloadData() {
|
||||
new ReloadData(activity, getMyApplication()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
|
||||
}
|
||||
|
||||
public static class MoveFilesToDifferentDirectory extends AsyncTask<Void, Void, Boolean> {
|
||||
|
||||
protected WeakReference<OsmandActionBarActivity> activity;
|
||||
private WeakReference<Context> context;
|
||||
private File from;
|
||||
private File to;
|
||||
protected ProgressImplementation progress;
|
||||
private Runnable runOnSuccess;
|
||||
private int movedCount;
|
||||
private long movedSize;
|
||||
private int copiedCount;
|
||||
private long copiedSize;
|
||||
private int failedCount;
|
||||
private long failedSize;
|
||||
|
||||
public MoveFilesToDifferentDirectory(OsmandActionBarActivity activity, File from, File to) {
|
||||
this.activity = new WeakReference<>(activity);
|
||||
this.context = new WeakReference<>((Context) activity);
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public void setRunOnSuccess(Runnable runOnSuccess) {
|
||||
this.runOnSuccess = runOnSuccess;
|
||||
}
|
||||
|
||||
public int getMovedCount() {
|
||||
return movedCount;
|
||||
}
|
||||
|
||||
public int getCopiedCount() {
|
||||
return copiedCount;
|
||||
}
|
||||
|
||||
public int getFailedCount() {
|
||||
return failedCount;
|
||||
}
|
||||
|
||||
public long getMovedSize() {
|
||||
return movedSize;
|
||||
}
|
||||
|
||||
public long getCopiedSize() {
|
||||
return copiedSize;
|
||||
}
|
||||
|
||||
public long getFailedSize() {
|
||||
return failedSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
Context ctx = context.get();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
movedCount = 0;
|
||||
copiedCount = 0;
|
||||
failedCount = 0;
|
||||
progress = ProgressImplementation.createProgressDialog(
|
||||
ctx, ctx.getString(R.string.copying_osmand_files),
|
||||
ctx.getString(R.string.copying_osmand_files_descr, to.getPath()),
|
||||
ProgressDialog.STYLE_HORIZONTAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
Context ctx = context.get();
|
||||
if (ctx == null) {
|
||||
return;
|
||||
}
|
||||
if (result != null) {
|
||||
if (result.booleanValue() && runOnSuccess != null) {
|
||||
runOnSuccess.run();
|
||||
} else if (!result.booleanValue()) {
|
||||
Toast.makeText(ctx, R.string.shared_string_io_error, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (progress.getDialog().isShowing()) {
|
||||
progress.getDialog().dismiss();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//ignored
|
||||
}
|
||||
}
|
||||
|
||||
private void movingFiles(File f, File t, int depth) throws IOException {
|
||||
Context ctx = context.get();
|
||||
if (ctx == null) {
|
||||
return;
|
||||
}
|
||||
if (depth <= 2) {
|
||||
progress.startTask(ctx.getString(R.string.copying_osmand_one_file_descr, t.getName()), -1);
|
||||
}
|
||||
if (f.isDirectory()) {
|
||||
t.mkdirs();
|
||||
File[] lf = f.listFiles();
|
||||
if (lf != null) {
|
||||
for (int i = 0; i < lf.length; i++) {
|
||||
if (lf[i] != null) {
|
||||
movingFiles(lf[i], new File(t, lf[i].getName()), depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
f.delete();
|
||||
} else if (f.isFile()) {
|
||||
if (t.exists()) {
|
||||
Algorithms.removeAllFiles(t);
|
||||
}
|
||||
boolean rnm = false;
|
||||
long fileSize = f.length();
|
||||
try {
|
||||
rnm = f.renameTo(t);
|
||||
movedCount++;
|
||||
movedSize += fileSize;
|
||||
} catch (RuntimeException e) {
|
||||
}
|
||||
if (!rnm) {
|
||||
FileInputStream fin = new FileInputStream(f);
|
||||
FileOutputStream fout = new FileOutputStream(t);
|
||||
try {
|
||||
progress.startTask(ctx.getString(R.string.copying_osmand_one_file_descr, t.getName()), (int) (f.length() / 1024));
|
||||
Algorithms.streamCopy(fin, fout, progress, 1024);
|
||||
copiedCount++;
|
||||
copiedSize += fileSize;
|
||||
} catch (IOException e) {
|
||||
failedCount++;
|
||||
failedSize += fileSize;
|
||||
} finally {
|
||||
fin.close();
|
||||
fout.close();
|
||||
}
|
||||
f.delete();
|
||||
}
|
||||
}
|
||||
if (depth <= 2) {
|
||||
progress.finishTask();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... params) {
|
||||
to.mkdirs();
|
||||
try {
|
||||
movingFiles(from, to, 0);
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class ReloadData extends AsyncTask<Void, Void, Boolean> {
|
||||
private WeakReference<Context> ctx;
|
||||
protected ProgressImplementation progress;
|
||||
private OsmandApplication app;
|
||||
|
||||
public ReloadData(Context ctx, OsmandApplication app) {
|
||||
this.ctx = new WeakReference<>(ctx);
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
Context c = ctx.get();
|
||||
if (c == null) {
|
||||
return;
|
||||
}
|
||||
progress = ProgressImplementation.createProgressDialog(c, c.getString(R.string.loading_data),
|
||||
c.getString(R.string.loading_data), ProgressDialog.STYLE_HORIZONTAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean result) {
|
||||
try {
|
||||
if (progress.getDialog().isShowing()) {
|
||||
progress.getDialog().dismiss();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//ignored
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... params) {
|
||||
app.getResourceManager().reloadIndexes(progress, new ArrayList<String>());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
200
OsmAnd/src/net/osmand/plus/settings/DataStorageItemsHolder.java
Normal file
200
OsmAnd/src/net/osmand/plus/settings/DataStorageItemsHolder.java
Normal file
|
@ -0,0 +1,200 @@
|
|||
package net.osmand.plus.settings;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
import net.osmand.ValueHolder;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DataStorageItemsHolder {
|
||||
public final static String INTERNAL_STORAGE = "internal_storage";
|
||||
public final static String EXTERNAL_STORAGE = "external_storage";
|
||||
public final static String SHARED_STORAGE = "shared_storage";
|
||||
public final static String MULTIUSER_STORAGE = "multiuser_storage";
|
||||
public final static String MANUALLY_SPECIFIED = "manually_specified";
|
||||
|
||||
private ArrayList<DataStorageMenuItem> menuItems;
|
||||
private DataStorageMenuItem currentDataStorage;
|
||||
private DataStorageMenuItem manuallySpecified;
|
||||
|
||||
private int currentStorageType;
|
||||
private String currentStoragePath;
|
||||
|
||||
private OsmandApplication app;
|
||||
private OsmandSettings settings;
|
||||
|
||||
private DataStorageItemsHolder(OsmandApplication app) {
|
||||
this.app = app;
|
||||
this.settings = app.getSettings();
|
||||
prepareData();
|
||||
}
|
||||
|
||||
public static DataStorageItemsHolder refreshInfo(OsmandApplication app) {
|
||||
return new DataStorageItemsHolder(app);
|
||||
}
|
||||
|
||||
private void prepareData() {
|
||||
|
||||
if (app == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings.getExternalStorageDirectoryTypeV19() >= 0) {
|
||||
currentStorageType = settings.getExternalStorageDirectoryTypeV19();
|
||||
} else {
|
||||
ValueHolder<Integer> vh = new ValueHolder<Integer>();
|
||||
if (vh.value != null && vh.value >= 0) {
|
||||
currentStorageType = vh.value;
|
||||
} else {
|
||||
currentStorageType = 0;
|
||||
}
|
||||
}
|
||||
currentStoragePath = settings.getExternalStorageDirectory().getAbsolutePath();
|
||||
|
||||
menuItems = new ArrayList<>();
|
||||
|
||||
String path;
|
||||
File dir;
|
||||
int iconId;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
|
||||
//internal storage
|
||||
path = settings.getInternalAppPath().getAbsolutePath();
|
||||
dir = new File(path);
|
||||
iconId = R.drawable.ic_action_phone;
|
||||
|
||||
DataStorageMenuItem internalStorageItem = DataStorageMenuItem.builder()
|
||||
.buildKey(INTERNAL_STORAGE)
|
||||
.buildTitle(getString(R.string.storage_directory_internal_app))
|
||||
.buildDirectory(path)
|
||||
.buildDescription(getString(R.string.internal_app_storage_description))
|
||||
.buildType(OsmandSettings.EXTERNAL_STORAGE_TYPE_INTERNAL_FILE)
|
||||
.buildIconResId(iconId)
|
||||
.build();
|
||||
addItem(internalStorageItem);
|
||||
|
||||
//shared_storage
|
||||
dir = settings.getDefaultInternalStorage();
|
||||
path = dir.getAbsolutePath();
|
||||
iconId = R.drawable.ic_action_phone;
|
||||
|
||||
DataStorageMenuItem sharedStorageItem = DataStorageMenuItem.builder()
|
||||
.buildKey(SHARED_STORAGE)
|
||||
.buildTitle(getString(R.string.storage_directory_shared))
|
||||
.buildDirectory(path)
|
||||
.buildType(OsmandSettings.EXTERNAL_STORAGE_TYPE_DEFAULT)
|
||||
.buildIconResId(iconId)
|
||||
.build();
|
||||
addItem(sharedStorageItem);
|
||||
|
||||
//external storage
|
||||
File[] externals = app.getExternalFilesDirs(null);
|
||||
if (externals != null) {
|
||||
int i = 0;
|
||||
for (File external : externals) {
|
||||
if (external != null) {
|
||||
++i;
|
||||
dir = external;
|
||||
path = dir.getAbsolutePath();
|
||||
iconId = getIconForStorageType(dir);
|
||||
DataStorageMenuItem externalStorageItem = DataStorageMenuItem.builder()
|
||||
.buildKey(EXTERNAL_STORAGE + i)
|
||||
.buildTitle(getString(R.string.storage_directory_external) + " " + i)
|
||||
.buildDirectory(path)
|
||||
.buildType(OsmandSettings.EXTERNAL_STORAGE_TYPE_EXTERNAL_FILE)
|
||||
.buildIconResId(iconId)
|
||||
.build();
|
||||
addItem(externalStorageItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//multi user storage
|
||||
File[] obbDirs = app.getObbDirs();
|
||||
if (obbDirs != null) {
|
||||
int i = 0;
|
||||
for (File obb : obbDirs) {
|
||||
if (obb != null) {
|
||||
++i;
|
||||
dir = obb;
|
||||
path = dir.getAbsolutePath();
|
||||
iconId = getIconForStorageType(dir);
|
||||
DataStorageMenuItem multiuserStorageItem = DataStorageMenuItem.builder()
|
||||
.buildKey(MULTIUSER_STORAGE + i)
|
||||
.buildTitle(getString(R.string.storage_directory_multiuser) + " " + i)
|
||||
.buildDirectory(path)
|
||||
.buildType(OsmandSettings.EXTERNAL_STORAGE_TYPE_OBB)
|
||||
.buildIconResId(iconId)
|
||||
.build();
|
||||
addItem(multiuserStorageItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//manually specified storage
|
||||
manuallySpecified = DataStorageMenuItem.builder()
|
||||
.buildKey(MANUALLY_SPECIFIED)
|
||||
.buildTitle(getString(R.string.storage_directory_manual))
|
||||
.buildDirectory(currentStoragePath)
|
||||
.buildType(OsmandSettings.EXTERNAL_STORAGE_TYPE_SPECIFIED)
|
||||
.buildIconResId(R.drawable.ic_action_folder)
|
||||
.build();
|
||||
menuItems.add(manuallySpecified);
|
||||
|
||||
if (currentDataStorage == null) {
|
||||
currentDataStorage = manuallySpecified;
|
||||
}
|
||||
}
|
||||
|
||||
private String getString(int resId) {
|
||||
return app.getString(resId);
|
||||
}
|
||||
|
||||
public ArrayList<DataStorageMenuItem> getStorageItems() {
|
||||
return menuItems;
|
||||
}
|
||||
|
||||
private int getIconForStorageType(File dir) {
|
||||
return R.drawable.ic_action_folder;
|
||||
}
|
||||
|
||||
public DataStorageMenuItem getCurrentStorage() {
|
||||
return currentDataStorage;
|
||||
}
|
||||
|
||||
private void addItem(DataStorageMenuItem item) {
|
||||
if (currentStorageType == item.getType() && currentStoragePath.equals(item.getDirectory())) {
|
||||
currentDataStorage = item;
|
||||
}
|
||||
menuItems.add(item);
|
||||
}
|
||||
|
||||
public DataStorageMenuItem getManuallySpecified() {
|
||||
return manuallySpecified;
|
||||
}
|
||||
|
||||
public DataStorageMenuItem getStorage(String key) {
|
||||
if (menuItems != null && key != null) {
|
||||
for (DataStorageMenuItem menuItem : menuItems) {
|
||||
if (key.equals(menuItem.getKey())) {
|
||||
return menuItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getCurrentType() {
|
||||
return currentStorageType;
|
||||
}
|
||||
|
||||
public String getCurrentPath() {
|
||||
return currentStoragePath;
|
||||
}
|
||||
}
|
169
OsmAnd/src/net/osmand/plus/settings/DataStorageMenuItem.java
Normal file
169
OsmAnd/src/net/osmand/plus/settings/DataStorageMenuItem.java
Normal file
|
@ -0,0 +1,169 @@
|
|||
package net.osmand.plus.settings;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.IdRes;
|
||||
|
||||
public class DataStorageMenuItem implements Parcelable, Cloneable {
|
||||
|
||||
private String key;
|
||||
private int type;
|
||||
private String title;
|
||||
private String description;
|
||||
private String directory;
|
||||
@IdRes
|
||||
private int iconResId;
|
||||
|
||||
private DataStorageMenuItem(String key, int type, String title, String description,
|
||||
String directory, int iconResId) {
|
||||
this.key = key;
|
||||
this.type = type;
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.directory = directory;
|
||||
this.iconResId = iconResId;
|
||||
}
|
||||
|
||||
private DataStorageMenuItem(Parcel in) {
|
||||
key = in.readString();
|
||||
type = in.readInt();
|
||||
title = in.readString();
|
||||
description = in.readString();
|
||||
directory = in.readString();
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getDirectory() {
|
||||
return directory;
|
||||
}
|
||||
|
||||
public int getIconResId() {
|
||||
return iconResId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setDirectory(String directory) {
|
||||
this.directory = directory;
|
||||
}
|
||||
|
||||
public void setIconResId(int iconResId) {
|
||||
this.iconResId = iconResId;
|
||||
}
|
||||
|
||||
public static DataStorageMenuItemBuilder builder() {
|
||||
return new DataStorageMenuItemBuilder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(key);
|
||||
dest.writeInt(type);
|
||||
dest.writeString(title);
|
||||
dest.writeString(description);
|
||||
dest.writeString(directory);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<DataStorageMenuItem> CREATOR = new Parcelable.Creator<DataStorageMenuItem>() {
|
||||
|
||||
@Override
|
||||
public DataStorageMenuItem createFromParcel(Parcel source) {
|
||||
return new DataStorageMenuItem(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataStorageMenuItem[] newArray(int size) {
|
||||
return new DataStorageMenuItem[size];
|
||||
}
|
||||
};
|
||||
|
||||
public static class DataStorageMenuItemBuilder {
|
||||
private String key;
|
||||
private int type;
|
||||
private String title;
|
||||
private String description;
|
||||
private String directory;
|
||||
@IdRes
|
||||
private int iconResId;
|
||||
|
||||
public DataStorageMenuItemBuilder buildKey(String key) {
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataStorageMenuItemBuilder buildType(int type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataStorageMenuItemBuilder buildTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataStorageMenuItemBuilder buildDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataStorageMenuItemBuilder buildDirectory(String directory) {
|
||||
this.directory = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataStorageMenuItemBuilder buildIconResId(int iconResId) {
|
||||
this.iconResId = iconResId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataStorageMenuItem build() {
|
||||
return new DataStorageMenuItem(key, type, title, description, directory, iconResId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
return DataStorageMenuItem.builder()
|
||||
.buildKey(this.key)
|
||||
.buildTitle(this.title)
|
||||
.buildDescription(this.description)
|
||||
.buildDirectory(this.directory)
|
||||
.buildType(this.type)
|
||||
.buildIconResId(this.iconResId)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import android.support.v7.preference.Preference;
|
|||
import android.support.v7.preference.SwitchPreferenceCompat;
|
||||
import android.util.Pair;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
|
@ -16,6 +17,9 @@ import net.osmand.plus.dialogs.SendAnalyticsBottomSheetDialogFragment;
|
|||
import net.osmand.plus.settings.preferences.ListPreferenceEx;
|
||||
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
|
||||
public class GlobalSettingsFragment extends BaseSettingsFragment implements SendAnalyticsBottomSheetDialogFragment.OnSendAnalyticsPrefsUpdate, OnPreferenceChanged {
|
||||
|
||||
|
@ -137,6 +141,14 @@ public class GlobalSettingsFragment extends BaseSettingsFragment implements Send
|
|||
Preference externalStorageDir = (Preference) findPreference(OsmandSettings.EXTERNAL_STORAGE_DIR);
|
||||
externalStorageDir.setIcon(getContentIcon(R.drawable.ic_action_folder));
|
||||
|
||||
DataStorageItemsHolder holder = DataStorageItemsHolder.refreshInfo(app);
|
||||
DataStorageMenuItem currentStorage = holder.getCurrentStorage();
|
||||
File dir = new File(currentStorage.getDirectory());
|
||||
DecimalFormat formatter = new DecimalFormat("#.##");
|
||||
String summary = String.format(getString(R.string.data_storage_preference_summary),
|
||||
currentStorage.getTitle(),
|
||||
formatter.format(AndroidUtils.getUsedSpaceGb(dir)));
|
||||
externalStorageDir.setSummary(summary);
|
||||
}
|
||||
|
||||
private void setupSendAnonymousDataPref() {
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
package net.osmand.plus.settings.bottomsheets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
||||
import net.osmand.plus.settings.BaseSettingsFragment;
|
||||
import net.osmand.plus.settings.DataStorageMenuItem;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static net.osmand.plus.settings.DataStorageItemsHolder.MANUALLY_SPECIFIED;
|
||||
|
||||
public class ChangeDataStorageBottomSheet extends BasePreferenceBottomSheet {
|
||||
|
||||
public static final String TAG = "ChangeDataStorageBottomSheet";
|
||||
|
||||
private static final Log LOG = PlatformUtil.getLog(ChangeDataStorageBottomSheet.class);
|
||||
|
||||
private final static String CURRENT_DIRECTORY = "current_directory";
|
||||
private final static String NEW_DIRECTORY = "new_directory";
|
||||
|
||||
public final static String MOVE_DATA = "move_data";
|
||||
public final static String CHOSEN_DIRECTORY = "chosen_storage";
|
||||
|
||||
private DataStorageMenuItem currentDirectory;
|
||||
private DataStorageMenuItem newDirectory;
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
|
||||
Context ctx = getContext();
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
currentDirectory = savedInstanceState.getParcelable(CURRENT_DIRECTORY);
|
||||
newDirectory = savedInstanceState.getParcelable(NEW_DIRECTORY);
|
||||
}
|
||||
|
||||
if (ctx == null || currentDirectory == null || newDirectory == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
items.add(new TitleItem(getString(R.string.change_osmand_data_folder_question)));
|
||||
|
||||
int textColorPrimary = nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light;
|
||||
int activeColor = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
|
||||
CharSequence desc = null;
|
||||
|
||||
File currentStorageFile = new File(currentDirectory.getDirectory());
|
||||
if ((!OsmandSettings.isWritable(currentStorageFile))) {
|
||||
desc = String.format(getString(R.string.android_19_location_disabled), currentStorageFile.getAbsoluteFile());
|
||||
} else {
|
||||
String from = currentDirectory.getKey().equals(MANUALLY_SPECIFIED) ? currentDirectory.getDirectory() : currentDirectory.getTitle();
|
||||
String to = newDirectory.getKey().equals(MANUALLY_SPECIFIED) ? newDirectory.getDirectory() : newDirectory.getTitle();
|
||||
String fullDescription = String.format(getString(R.string.change_data_storage_full_description), from, to);
|
||||
SpannableStringBuilder coloredDescription = new SpannableStringBuilder(
|
||||
fullDescription);
|
||||
int startIndexFrom = fullDescription.indexOf(from);
|
||||
int endIndexFrom = startIndexFrom + from.length();
|
||||
int startIndexTo = fullDescription.indexOf(to);
|
||||
int endIndexTo = startIndexTo + to.length();
|
||||
coloredDescription.setSpan(new ForegroundColorSpan(
|
||||
ContextCompat.getColor(ctx, activeColor)),
|
||||
startIndexFrom, endIndexFrom, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
coloredDescription.setSpan(new ForegroundColorSpan(
|
||||
ContextCompat.getColor(ctx, activeColor)),
|
||||
startIndexTo, endIndexTo, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
desc = coloredDescription;
|
||||
}
|
||||
BottomSheetItemWithDescription description = (BottomSheetItemWithDescription) new BottomSheetItemWithDescription.Builder()
|
||||
.setDescription(desc)
|
||||
.setDescriptionColorId(textColorPrimary)
|
||||
.setLayoutId(R.layout.bottom_sheet_item_description_long)
|
||||
.create();
|
||||
items.add(description);
|
||||
|
||||
//buttons
|
||||
View mainView = View.inflate(ctx, R.layout.bottom_sheet_change_data_storage, null);
|
||||
|
||||
View btnDontMoveView = mainView.findViewById(R.id.btnDontMove);
|
||||
btnDontMoveView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
positiveButtonsClick(false);
|
||||
}
|
||||
});
|
||||
UiUtilities.setupDialogButton(nightMode, btnDontMoveView, UiUtilities.DialogButtonType.SECONDARY, getString(R.string.dont_move_maps), currentDirectory.getIconResId());
|
||||
|
||||
View btnMoveView = mainView.findViewById(R.id.btnMove);
|
||||
btnMoveView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
positiveButtonsClick(true);
|
||||
}
|
||||
});
|
||||
UiUtilities.setupDialogButton(nightMode, btnMoveView, UiUtilities.DialogButtonType.PRIMARY, getString(R.string.move_maps_to_new_destination), R.drawable.ic_action_folder_move);
|
||||
|
||||
View btnCloseView = mainView.findViewById(R.id.btnClose);
|
||||
btnCloseView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
UiUtilities.setupDialogButton(nightMode, btnCloseView, UiUtilities.DialogButtonType.SECONDARY, getString(R.string.shared_string_cancel), R.drawable.ic_action_undo_dark);
|
||||
|
||||
BaseBottomSheetItem baseItem = new BaseBottomSheetItem.Builder()
|
||||
.setCustomView(mainView)
|
||||
.create();
|
||||
items.add(baseItem);
|
||||
}
|
||||
|
||||
public void setCurrentDirectory(DataStorageMenuItem currentDirectory) {
|
||||
this.currentDirectory = currentDirectory;
|
||||
}
|
||||
|
||||
public void setNewDirectory(DataStorageMenuItem newDirectory) {
|
||||
this.newDirectory = newDirectory;
|
||||
}
|
||||
|
||||
private void positiveButtonsClick(boolean moveData) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(TAG, true);
|
||||
bundle.putParcelable(CHOSEN_DIRECTORY, newDirectory);
|
||||
bundle.putBoolean(MOVE_DATA, moveData);
|
||||
Fragment fragment = getTargetFragment();
|
||||
if (fragment instanceof BaseSettingsFragment) {
|
||||
((BaseSettingsFragment) fragment).onPreferenceChange(getPreference(), bundle);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putParcelable(CURRENT_DIRECTORY, currentDirectory);
|
||||
outState.putParcelable(NEW_DIRECTORY, newDirectory);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hideButtonsContainer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean showInstance(FragmentManager fm, String prefId, DataStorageMenuItem currentDirectory,
|
||||
DataStorageMenuItem newDirectory, Fragment target, boolean usedOnMap) {
|
||||
try {
|
||||
if (fm.findFragmentByTag(TAG) == null) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString(PREFERENCE_ID, prefId);
|
||||
|
||||
ChangeDataStorageBottomSheet fragment = new ChangeDataStorageBottomSheet();
|
||||
fragment.setCurrentDirectory(currentDirectory);
|
||||
fragment.setNewDirectory(newDirectory);
|
||||
fragment.setTargetFragment(target, 0);
|
||||
fragment.setUsedOnMap(usedOnMap);
|
||||
fragment.show(fm, TAG);
|
||||
return true;
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error(e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,198 @@
|
|||
package net.osmand.plus.settings.bottomsheets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
||||
import net.osmand.plus.settings.BaseSettingsFragment;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
|
||||
public class SelectFolderBottomSheet extends BasePreferenceBottomSheet {
|
||||
|
||||
public static final String TAG = "SelectFolderBottomSheet";
|
||||
private static final Log LOG = PlatformUtil.getLog(SelectFolderBottomSheet.class);
|
||||
private static final int CHOOSE_FOLDER_REQUEST_CODE = 0;
|
||||
|
||||
private static final String EDIT_TEXT_PREFERENCE_KEY = "edit_text_preference_key";
|
||||
private static final String DIALOG_TITLE = "dialog_title";
|
||||
private static final String DESCRIPTION = "description";
|
||||
private static final String BTN_TITLE = "btn_title";
|
||||
private static final String ET_WAS_FOCUSED = "edit_text_was_focused";
|
||||
public static final String NEW_PATH = "path";
|
||||
public static final String PATH_CHANGED = "changed";
|
||||
|
||||
private EditText editText;
|
||||
|
||||
private String currentPath;
|
||||
private String dialogTitle;
|
||||
private String btnTitle;
|
||||
private String description;
|
||||
private boolean etWasFocused;
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
final Context ctx = getContext();
|
||||
|
||||
String text = null;
|
||||
if (savedInstanceState != null) {
|
||||
String folderPath = savedInstanceState.getString(NEW_PATH);
|
||||
if (folderPath != null) {
|
||||
currentPath = folderPath;
|
||||
}
|
||||
text = savedInstanceState.getString(EDIT_TEXT_PREFERENCE_KEY);
|
||||
dialogTitle = savedInstanceState.getString(DIALOG_TITLE);
|
||||
description = savedInstanceState.getString(DESCRIPTION);
|
||||
btnTitle = savedInstanceState.getString(BTN_TITLE);
|
||||
etWasFocused = savedInstanceState.getBoolean(ET_WAS_FOCUSED);
|
||||
}
|
||||
|
||||
if (ctx == null || currentPath == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (dialogTitle != null) {
|
||||
items.add(new TitleItem(dialogTitle));
|
||||
}
|
||||
|
||||
View mainView = View.inflate(ctx, R.layout.bottom_sheet_select_folder, null);
|
||||
|
||||
TextView tvDescription = mainView.findViewById(R.id.description);
|
||||
TextView tvBtnTitle = mainView.findViewById(R.id.title);
|
||||
editText = mainView.findViewById(R.id.text);
|
||||
|
||||
View divider = mainView.findViewById(R.id.divider);
|
||||
View btnOpenChoseDialog = mainView.findViewById(R.id.button);
|
||||
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// if (btnTitle != null) {
|
||||
// tvBtnTitle.setText(btnTitle);
|
||||
// int colorResId = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
|
||||
// int color = ContextCompat.getColor(ctx, colorResId);
|
||||
// Drawable drawable = UiUtilities.getColoredSelectableDrawable(ctx, color, 0.3f);
|
||||
// AndroidUtils.setBackground(btnOpenChoseDialog, drawable);
|
||||
// btnOpenChoseDialog.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// openDocumentTree();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
divider.setVisibility(GONE);
|
||||
btnOpenChoseDialog.setVisibility(GONE);
|
||||
// }
|
||||
|
||||
if (text != null) {
|
||||
editText.setText(text);
|
||||
}
|
||||
|
||||
if (description != null) {
|
||||
tvDescription.setText(description);
|
||||
}
|
||||
|
||||
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (hasFocus && !etWasFocused) {
|
||||
etWasFocused = true;
|
||||
editText.setText(currentPath);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
BaseBottomSheetItem baseItem = new BaseBottomSheetItem.Builder()
|
||||
.setCustomView(mainView)
|
||||
.create();
|
||||
items.add(baseItem);
|
||||
|
||||
}
|
||||
|
||||
public static boolean showInstance(FragmentManager fm, String prefId, String currentPath, Fragment target,
|
||||
String dialogTitle, String description, String btnTitle, boolean usedOnMap) {
|
||||
try {
|
||||
if (fm.findFragmentByTag(TAG) == null) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString(PREFERENCE_ID, prefId);
|
||||
|
||||
SelectFolderBottomSheet fragment = new SelectFolderBottomSheet();
|
||||
fragment.setCurrentPath(currentPath);
|
||||
fragment.setTargetFragment(target, 0);
|
||||
fragment.setDialogTitle(dialogTitle);
|
||||
fragment.setDescription(description);
|
||||
fragment.setBtnTitle(btnTitle);
|
||||
fragment.setUsedOnMap(usedOnMap);
|
||||
fragment.show(fm, TAG);
|
||||
}
|
||||
return true;
|
||||
} catch (RuntimeException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDismissButtonTextId() {
|
||||
return R.string.shared_string_close;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRightBottomButtonTextId() {
|
||||
return R.string.shared_string_apply;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRightBottomButtonClick() {
|
||||
Fragment fragment = getTargetFragment();
|
||||
if (fragment instanceof BaseSettingsFragment) {
|
||||
String newPath = editText.getText().toString();
|
||||
if (!newPath.equals("")) {
|
||||
boolean pathChanged = !newPath.equals(currentPath);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(TAG, true);
|
||||
bundle.putString(NEW_PATH, newPath);
|
||||
bundle.putBoolean(PATH_CHANGED, pathChanged);
|
||||
((BaseSettingsFragment) fragment).onPreferenceChange(getPreference(), bundle);
|
||||
}
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putString(EDIT_TEXT_PREFERENCE_KEY, editText.getText().toString());
|
||||
outState.putString(NEW_PATH, currentPath);
|
||||
outState.putString(DIALOG_TITLE, dialogTitle);
|
||||
outState.putString(DESCRIPTION, description);
|
||||
outState.putString(BTN_TITLE, btnTitle);
|
||||
outState.putBoolean(ET_WAS_FOCUSED, etWasFocused);
|
||||
}
|
||||
|
||||
public void setCurrentPath(String currentPath) {
|
||||
this.currentPath = currentPath;
|
||||
}
|
||||
|
||||
public void setDialogTitle(String dialogTitle) {
|
||||
this.dialogTitle = dialogTitle;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setBtnTitle(String btnTitle) {
|
||||
this.btnTitle = btnTitle;
|
||||
}
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@ import android.graphics.Paint.Join;
|
|||
import android.graphics.Paint.Style;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.PointF;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.TextPaint;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.WindowManager;
|
||||
|
@ -26,12 +27,16 @@ import net.osmand.plus.activities.LocalIndexHelper;
|
|||
import net.osmand.plus.activities.LocalIndexInfo;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.download.DownloadActivityType;
|
||||
import net.osmand.plus.download.DownloadIndexesThread;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
import net.osmand.plus.download.ui.DownloadMapToolbarController;
|
||||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
import net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider;
|
||||
import net.osmand.plus.views.ContextMenuLayer.IContextMenuProviderSelection;
|
||||
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController;
|
||||
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarControllerType;
|
||||
import net.osmand.util.Algorithms;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
|
@ -50,6 +55,7 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
private static final int ZOOM_THRESHOLD = 2;
|
||||
|
||||
private OsmandApplication app;
|
||||
private MapActivity mapActivity;
|
||||
private OsmandMapTileView view;
|
||||
private Paint paintDownloaded;
|
||||
private Path pathDownloaded;
|
||||
|
@ -73,6 +79,8 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
private static int ZOOM_TO_SHOW_BORDERS = 7;
|
||||
private static int ZOOM_TO_SHOW_SELECTION_ST = 3;
|
||||
private static int ZOOM_TO_SHOW_SELECTION = 8;
|
||||
private static int ZOOM_MIN_TO_SHOW_DOWNLOAD_DIALOG = 9;
|
||||
private static int ZOOM_MAX_TO_SHOW_DOWNLOAD_DIALOG = 11;
|
||||
|
||||
public static class DownloadMapObject {
|
||||
private BinaryMapDataObject dataObject;
|
||||
|
@ -105,6 +113,10 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
}
|
||||
}
|
||||
|
||||
public DownloadedRegionsLayer(@NonNull MapActivity mapActivity) {
|
||||
this.mapActivity = mapActivity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initLayer(final OsmandMapTileView view) {
|
||||
this.view = view;
|
||||
|
@ -180,6 +192,8 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
if(zoom < ZOOM_TO_SHOW_SELECTION_ST) {
|
||||
return;
|
||||
}
|
||||
//make sure no maps are loaded for the location
|
||||
checkMapToDownload(zoom, data.results);
|
||||
// draw objects
|
||||
if (osmandRegions.isInitialized() && zoom >= ZOOM_TO_SHOW_SELECTION_ST && zoom < ZOOM_TO_SHOW_SELECTION) {
|
||||
final List<BinaryMapDataObject> currentObjects = new LinkedList<>();
|
||||
|
@ -217,6 +231,88 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
}
|
||||
}
|
||||
|
||||
private void checkMapToDownload(int zoom, List<BinaryMapDataObject> currentObjects) {
|
||||
if (zoom >= ZOOM_MIN_TO_SHOW_DOWNLOAD_DIALOG && zoom <= ZOOM_MAX_TO_SHOW_DOWNLOAD_DIALOG
|
||||
&& currentObjects != null) {
|
||||
WorldRegion regionData;
|
||||
int cx = view.getCurrentRotatedTileBox().getCenter31X();
|
||||
int cy = view.getCurrentRotatedTileBox().getCenter31Y();
|
||||
for (int i = 0; i < currentObjects.size(); i++) {
|
||||
final BinaryMapDataObject o = currentObjects.get(i);
|
||||
if (!osmandRegions.contain(o, cx, cy)) {
|
||||
continue;
|
||||
}
|
||||
String fullName = osmandRegions.getFullName(o);
|
||||
regionData = osmandRegions.getRegionData(fullName);
|
||||
if (regionData != null && regionData.isRegionMapDownload()) {
|
||||
String regionDownloadName = regionData.getRegionDownloadName();
|
||||
if (regionDownloadName != null && checkIfObjectDownloaded(regionDownloadName)) {
|
||||
hideDownloadMapToolbar();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IndexItem indexItem = null;
|
||||
String name = null;
|
||||
BinaryMapDataObject smallestRegion = app.getRegions().getSmallestBinaryMapDataObjectAt(currentObjects);
|
||||
if (smallestRegion != null) {
|
||||
String fullName = osmandRegions.getFullName(smallestRegion);
|
||||
regionData = osmandRegions.getRegionData(fullName);
|
||||
|
||||
DownloadIndexesThread downloadThread = app.getDownloadThread();
|
||||
List<IndexItem> indexItems = downloadThread.getIndexes().getIndexItems(regionData);
|
||||
if (indexItems.size() == 0) {
|
||||
if (!downloadThread.getIndexes().isDownloadedFromInternet && app.getSettings().isInternetConnectionAvailable()) {
|
||||
downloadThread.runReloadIndexFilesSilent();
|
||||
}
|
||||
} else {
|
||||
for (IndexItem item : indexItems) {
|
||||
if (item.getType() == DownloadActivityType.NORMAL_FILE
|
||||
&& !(item.isDownloaded() || downloadThread.isDownloading(item))) {
|
||||
indexItem = item;
|
||||
name = regionData.getLocaleName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (indexItem != null && name != null) {
|
||||
showDownloadMapToolbar(indexItem, name);
|
||||
} else {
|
||||
hideDownloadMapToolbar();
|
||||
}
|
||||
} else {
|
||||
hideDownloadMapToolbar();
|
||||
}
|
||||
}
|
||||
|
||||
private void showDownloadMapToolbar(final @NonNull IndexItem indexItem, final @NonNull String regionName) {
|
||||
if (!regionName.equals(DownloadMapToolbarController.getLastProcessedRegionName())) {
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!regionName.equals(DownloadMapToolbarController.getLastProcessedRegionName())) {
|
||||
TopToolbarController controller = mapActivity.getTopToolbarController(TopToolbarControllerType.DOWNLOAD_MAP);
|
||||
if (controller == null || !((DownloadMapToolbarController) controller).getRegionName().equals(regionName)) {
|
||||
controller = new DownloadMapToolbarController(mapActivity, indexItem, regionName);
|
||||
mapActivity.showTopToolbar(controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void hideDownloadMapToolbar() {
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mapActivity.hideTopToolbar(TopToolbarControllerType.DOWNLOAD_MAP);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void removeObjectsFromList(List<BinaryMapDataObject> list, List<BinaryMapDataObject> objects) {
|
||||
Iterator<BinaryMapDataObject> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.osmand.plus.views;
|
|||
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
@ -129,10 +130,15 @@ public class MapInfoLayer extends OsmandMapLayer {
|
|||
return topToolbarView == null ? null : topToolbarView.getTopController();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public TopToolbarController getTopToolbarController(TopToolbarControllerType type) {
|
||||
return topToolbarView == null ? null : topToolbarView.getController(type);
|
||||
}
|
||||
|
||||
public boolean isTopToolbarViewVisible() {
|
||||
return topToolbarView != null && topToolbarView.isTopToolbarViewVisible();
|
||||
}
|
||||
|
||||
public void registerAllControls(){
|
||||
RouteInfoWidgetsFactory ric = new RouteInfoWidgetsFactory();
|
||||
MapInfoWidgetsFactory mic = new MapInfoWidgetsFactory();
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package net.osmand.plus.views.mapwidgets;
|
||||
|
||||
import android.animation.LayoutTransition;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
|
@ -19,6 +21,7 @@ import android.support.v7.widget.SwitchCompat;
|
|||
import android.text.ClipboardManager;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
|
@ -72,7 +75,8 @@ public class MapInfoWidgetsFactory {
|
|||
TRACK_DETAILS,
|
||||
DISCOUNT,
|
||||
MEASUREMENT_TOOL,
|
||||
POI_FILTER
|
||||
POI_FILTER,
|
||||
DOWNLOAD_MAP
|
||||
}
|
||||
|
||||
public TextInfoWidget createAltitudeControl(final MapActivity map) {
|
||||
|
@ -383,6 +387,10 @@ public class MapInfoWidgetsFactory {
|
|||
Runnable onCloseToolbarListener;
|
||||
|
||||
View bottomView = null;
|
||||
boolean topViewVisible = true;
|
||||
boolean shadowViewVisible = true;
|
||||
|
||||
private boolean bottomViewAdded = false;
|
||||
|
||||
public TopToolbarController(TopToolbarControllerType type) {
|
||||
this.type = type;
|
||||
|
@ -409,6 +417,22 @@ public class MapInfoWidgetsFactory {
|
|||
this.bottomView = bottomView;
|
||||
}
|
||||
|
||||
public boolean isTopViewVisible() {
|
||||
return topViewVisible;
|
||||
}
|
||||
|
||||
public void setTopViewVisible(boolean topViewVisible) {
|
||||
this.topViewVisible = topViewVisible;
|
||||
}
|
||||
|
||||
public boolean isShadowViewVisible() {
|
||||
return shadowViewVisible;
|
||||
}
|
||||
|
||||
public void setShadowViewVisible(boolean shadowViewVisible) {
|
||||
this.shadowViewVisible = shadowViewVisible;
|
||||
}
|
||||
|
||||
public void setSingleLineTitle(boolean singleLineTitle) {
|
||||
this.singleLineTitle = singleLineTitle;
|
||||
}
|
||||
|
@ -573,11 +597,14 @@ public class MapInfoWidgetsFactory {
|
|||
AndroidUiHelper.updateVisibility(descrView, false);
|
||||
}
|
||||
if (bottomView != null) {
|
||||
bottomViewLayout.removeAllViews();
|
||||
bottomViewLayout.addView(bottomView);
|
||||
AndroidUiHelper.updateVisibility(bottomViewLayout, true);
|
||||
if (!bottomViewAdded) {
|
||||
bottomViewLayout.removeAllViews();
|
||||
bottomViewLayout.addView(bottomView);
|
||||
bottomViewLayout.setVisibility(View.VISIBLE);
|
||||
bottomViewAdded = true;
|
||||
}
|
||||
} else {
|
||||
AndroidUiHelper.updateVisibility(bottomViewLayout, false);
|
||||
bottomViewLayout.setVisibility(View.GONE);
|
||||
}
|
||||
AndroidUiHelper.updateVisibility(switchCompat, topBarSwitchVisible);
|
||||
if (topBarSwitchVisible) {
|
||||
|
@ -586,8 +613,9 @@ public class MapInfoWidgetsFactory {
|
|||
DrawableCompat.setTint(switchCompat.getTrackDrawable(), ContextCompat.getColor(switchCompat.getContext(), R.color.map_toolbar_switch_track_color));
|
||||
}
|
||||
}
|
||||
if (view.getShadowView() != null) {
|
||||
view.getShadowView().setVisibility(View.VISIBLE);
|
||||
View shadowView = view.getShadowView();
|
||||
if (shadowView != null) {
|
||||
AndroidUiHelper.updateVisibility(shadowView, isShadowViewVisible());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -638,6 +666,10 @@ public class MapInfoWidgetsFactory {
|
|||
return topbar;
|
||||
}
|
||||
|
||||
public boolean isTopToolbarViewVisible() {
|
||||
return topbar.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
public View getTopBarLayout() {
|
||||
return topBarLayout;
|
||||
}
|
||||
|
@ -706,6 +738,7 @@ public class MapInfoWidgetsFactory {
|
|||
}
|
||||
}
|
||||
controllers.add(controller);
|
||||
map.getMapLayers().getMapMarkersLayer().getWidgetsFactory().updateInfo(null, map.getMapView().getZoom());
|
||||
updateColors();
|
||||
updateInfo();
|
||||
}
|
||||
|
@ -738,12 +771,15 @@ public class MapInfoWidgetsFactory {
|
|||
initToolbar(defaultController);
|
||||
defaultController.updateToolbar(this);
|
||||
}
|
||||
AndroidUiHelper.updateVisibility(topbar, controller != null && !MapRouteInfoMenu.chooseRoutesVisible && !MapRouteInfoMenu.waypointsVisible &&
|
||||
boolean updated = AndroidUiHelper.updateVisibility(topbar, controller != null && !MapRouteInfoMenu.chooseRoutesVisible && !MapRouteInfoMenu.waypointsVisible &&
|
||||
(!map.getContextMenu().isVisible() || controller.getType() == TopToolbarControllerType.CONTEXT_MENU));
|
||||
if (updated) {
|
||||
map.updateStatusBarColor();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateColors(TopToolbarController controller) {
|
||||
OsmandApplication app = map.getMyApplication();
|
||||
UiUtilities uiUtils = map.getMyApplication().getUIUtilities();
|
||||
controller.nightMode = nightMode;
|
||||
|
||||
boolean portrait = AndroidUiHelper.isOrientationPortrait(map);
|
||||
|
@ -766,29 +802,35 @@ public class MapInfoWidgetsFactory {
|
|||
int descrTextClrId = nightMode ? controller.descrTextClrDarkId : controller.descrTextClrLightId;
|
||||
int textBtnTitleClr = nightMode ? controller.textBtnTitleClrDark : controller.textBtnTitleClrLight;
|
||||
|
||||
if (bg != null) {
|
||||
topBarLayout.setBackgroundDrawable(bg);
|
||||
if (controller.isTopViewVisible()) {
|
||||
if (bg != null) {
|
||||
topBarLayout.setBackgroundDrawable(bg);
|
||||
} else {
|
||||
topBarLayout.setBackgroundResource(bgId);
|
||||
}
|
||||
topBarLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
topBarLayout.setBackgroundResource(bgId);
|
||||
topBarLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (backBtnIconId == 0) {
|
||||
backButton.setImageDrawable(null);
|
||||
} else {
|
||||
if (backBtnIconClr != -1) {
|
||||
backButton.setImageDrawable(app.getUIUtilities().getPaintedIcon(backBtnIconId, backBtnIconClr));
|
||||
backButton.setImageDrawable(uiUtils.getPaintedIcon(backBtnIconId, backBtnIconClr));
|
||||
} else {
|
||||
backButton.setImageDrawable(app.getUIUtilities().getIcon(backBtnIconId, backBtnIconClrId));
|
||||
backButton.setImageDrawable(uiUtils.getIcon(backBtnIconId, backBtnIconClrId));
|
||||
}
|
||||
}
|
||||
if (closeBtnIconId == 0) {
|
||||
closeButton.setImageDrawable(null);
|
||||
} else {
|
||||
closeButton.setImageDrawable(app.getUIUtilities().getIcon(closeBtnIconId, closeBtnIconClrId));
|
||||
closeButton.setImageDrawable(uiUtils.getIcon(closeBtnIconId, closeBtnIconClrId));
|
||||
}
|
||||
if (refreshBtnIconId == 0) {
|
||||
refreshButton.setImageDrawable(null);
|
||||
} else {
|
||||
refreshButton.setImageDrawable(app.getUIUtilities().getIcon(refreshBtnIconId, refreshBtnIconClrId));
|
||||
refreshButton.setImageDrawable(uiUtils.getIcon(refreshBtnIconId, refreshBtnIconClrId));
|
||||
}
|
||||
int titleColor = titleTextClr != -1 ? titleTextClr : map.getResources().getColor(titleTextClrId);
|
||||
int descrColor = descrTextClr != -1 ? descrTextClr : map.getResources().getColor(descrTextClrId);
|
||||
|
|
Loading…
Reference in a new issue