Merge branch 'master' of ssh://github.com/osmandapp/Osmand into context_menu_hide

This commit is contained in:
PavelRatushnyi 2017-09-29 20:52:36 +03:00
commit 8416a61014
45 changed files with 1617 additions and 423 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/map_widget_blue" android:state_pressed="true"/>
<item android:color="@color/bg_color_dark"/>
</selector>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/map_widget_blue" android:state_pressed="true"/>
<item android:drawable="@color/bg_color_light"/>
</selector>

View file

@ -51,8 +51,14 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/markers_distance_text_view"
@ -80,6 +86,20 @@
tools:text="~ 45 min."/>
</LinearLayout>
<TextView
android:id="@+id/markers_count_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/measurement_tool_text_margin"
android:layout_marginStart="@dimen/measurement_tool_text_margin"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size"
tools:text="3 markers"/>
</LinearLayout>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/select_all_button"
android:layout_width="wrap_content"
@ -104,6 +124,7 @@
android:background="?attr/dashboard_divider"/>
<LinearLayout
android:id="@+id/buttons_row"
android:layout_width="0dp"
android:layout_height="@dimen/measurement_tool_controls_height"
android:layout_weight="0.5">

View file

@ -68,33 +68,39 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
<net.osmand.plus.OsmandTextFieldBoxes
android:id="@+id/latitude_box"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:labelText="@string/navigate_point_latitude">
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
android:hint="50:00.0000"
android:id="@+id/latitude_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
</net.osmand.plus.OsmandTextFieldBoxes>
<View
android:layout_width="16dp"
android:layout_height="match_parent"/>
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
<net.osmand.plus.OsmandTextFieldBoxes
android:id="@+id/longitude_box"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:labelText="@string/navigate_point_longitude">
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
android:hint="50:00.0000"
android:id="@+id/longitude_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
</net.osmand.plus.OsmandTextFieldBoxes>
</LinearLayout>
@ -104,17 +110,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
<net.osmand.plus.OsmandTextFieldBoxes
android:id="@+id/name_box"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:labelText="@string/shared_string_name">
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
android:hint="@string/access_hint_enter_name"
android:id="@+id/name_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
</net.osmand.plus.OsmandTextFieldBoxes>
<View
android:layout_width="16dp"
android:layout_height="match_parent"/>
<View
android:layout_width="0dp"
@ -131,13 +144,14 @@
</LinearLayout>
<FrameLayout
<LinearLayout
android:id="@+id/keyboard_layout"
android:layout_gravity="bottom"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<GridView
osmand:visibility="gone"
android:id="@+id/keyboard_grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -147,6 +161,47 @@
android:stretchMode="columnWidth"
android:numColumns="3"/>
</FrameLayout>
<View
android:id="@+id/keyboard_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
<LinearLayout
android:background="?attr/bg_color"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="56dp">
<ImageView
android:id="@+id/show_hide_keyboard_icon"
android:padding="@dimen/bottom_sheet_content_padding"
android:background="?attr/selectableItemBackground"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
osmand:src="@drawable/ic_action_arrow_down"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?attr/dashboard_divider"/>
<net.osmand.plus.widgets.TextViewEx
android:maxLines="1"
android:ellipsize="end"
android:id="@+id/add_marker"
android:textAllCaps="true"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/keyboard_color"
osmand:typeface="@string/font_roboto_regular"
android:text="@string/shared_string_add"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,73 @@
<?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="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<ScrollView
android:id="@+id/marker_coordinate_input_scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/bottom_sheet_content_padding_small">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/coordinate_input_title"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_title_height"
android:gravity="center_vertical"
android:paddingEnd="@dimen/bottom_sheet_content_padding"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:paddingStart="@dimen/bottom_sheet_content_padding"
android:text="@string/fast_coordinates_input"
android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium"/>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_descr_height"
android:paddingEnd="@dimen/bottom_sheet_content_padding"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:paddingStart="@dimen/bottom_sheet_content_padding"
android:text="@string/fast_coordinates_input_descr"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"/>
<include layout="@layout/marker_coordinate_formats"/>
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
<FrameLayout
android:id="@+id/cancel_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_cancel_button_height"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/shared_string_close"
android:textAllCaps="true"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/>
</FrameLayout>
</LinearLayout>

View file

@ -0,0 +1,120 @@
<?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="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<ScrollView
android:id="@+id/marker_coordinate_input_scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/bottom_sheet_content_padding_small">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/coordinate_input_title"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_title_height"
android:gravity="center_vertical"
android:paddingEnd="@dimen/bottom_sheet_content_padding"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:paddingStart="@dimen/bottom_sheet_content_padding"
android:text="@string/shared_string_options"
android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium"/>
<LinearLayout
android:id="@+id/use_system_keyboard_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"
android:background="?attr/selectableItemBackground"
android:descendantFocusability="blocksDescendants"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding">
<ImageView
android:layout_gravity="center_vertical"
android:id="@+id/use_system_keyboard_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/ic_action_keyboard"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/use_system_keyboard"
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/use_system_keyboard_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
<TextView
android:textColor="?android:textColorSecondary"
android:ellipsize="end"
android:maxLines="1"
android:textAllCaps="true"
android:paddingTop="@dimen/bottom_sheet_content_padding_small"
android:paddingBottom="@dimen/bottom_sheet_content_padding_small"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/coordinates_format"/>
<include layout="@layout/marker_coordinate_formats"/>
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
<FrameLayout
android:id="@+id/cancel_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_cancel_button_height"
android:background="?attr/selectableItemBackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/shared_string_close"
android:textAllCaps="true"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/>
</FrameLayout>
</LinearLayout>

View file

@ -111,6 +111,7 @@
android:background="?attr/dashboard_divider"/>
<LinearLayout
android:visibility="gone"
android:id="@+id/coordinate_input_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"

View file

@ -46,8 +46,14 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/markers_distance_text_view"
@ -75,6 +81,20 @@
tools:text="~ 45 min."/>
</LinearLayout>
<TextView
android:id="@+id/markers_count_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/measurement_tool_text_margin"
android:layout_marginStart="@dimen/measurement_tool_text_margin"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size"
tools:text="3 markers"/>
</LinearLayout>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/select_all_button"
android:layout_width="wrap_content"
@ -123,6 +143,7 @@
</FrameLayout>
<LinearLayout
android:id="@+id/buttons_row"
android:layout_width="match_parent"
android:layout_height="@dimen/measurement_tool_controls_height">

View file

@ -1,16 +1,19 @@
<?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:layout_width="match_parent"
android:layout_height="56dp"
android:background="?attr/bg_color"
android:orientation="vertical">
<TextView
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/keyboard_item"
android:textAllCaps="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/keyboard_color"
osmand:typeface="@string/font_roboto_regular"
tools:text="3"/>
</LinearLayout>

View file

@ -7,11 +7,21 @@
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<include
<LinearLayout
android:id="@+id/top_divider"
layout="@layout/list_item_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"/>
tools:visibility="visible">
<View
android:layout_width="match_parent"
android:layout_height="4dp"/>
<include layout="@layout/card_top_divider"/>
</LinearLayout>
<LinearLayout
android:id="@+id/main_layout"

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/degrees_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:paddingEnd="@dimen/bottom_sheet_content_padding"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:paddingStart="@dimen/bottom_sheet_content_padding">
<ImageView
android:id="@+id/degrees_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/ic_action_coordinates_latitude"/>
<TextView
android:id="@+id/degrees_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="DDD.DD"/>
<RadioButton
android:id="@+id/degrees_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:focusable="false"/>
</LinearLayout>
<LinearLayout
android:id="@+id/minutes_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:paddingEnd="@dimen/bottom_sheet_content_padding"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:paddingStart="@dimen/bottom_sheet_content_padding">
<ImageView
android:id="@+id/minutes_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/ic_action_coordinates_latitude"/>
<TextView
android:id="@+id/minutes_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="DDD MM.MM"/>
<RadioButton
android:id="@+id/minutes_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:focusable="false"/>
</LinearLayout>
<LinearLayout
android:id="@+id/seconds_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_list_item_height"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:paddingEnd="@dimen/bottom_sheet_content_padding"
android:paddingLeft="@dimen/bottom_sheet_content_padding"
android:paddingRight="@dimen/bottom_sheet_content_padding"
android:paddingStart="@dimen/bottom_sheet_content_padding">
<ImageView
android:id="@+id/seconds_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/ic_action_coordinates_latitude"/>
<TextView
android:id="@+id/seconds_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="DDD MM SS.SS"/>
<RadioButton
android:id="@+id/seconds_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:focusable="false"/>
</LinearLayout>
</LinearLayout>

View file

@ -1,97 +0,0 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/list_item_divider"/>
<LinearLayout
android:id="@+id/background_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.AppCompatImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="center_vertical"
android:scaleType="centerInside"
android:src="@drawable/map_pedestrian_location"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:minHeight="56dp"
android:orientation="vertical"
android:paddingBottom="12dp"
android:paddingTop="10dp">
<android.support.v7.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/my_location"
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
<android.support.v7.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/add_location_as_first_point_descr"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="56dp"
android:layout_marginStart="56dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/use_location_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingEnd="@dimen/measurement_tool_text_button_padding_small"
android:paddingRight="@dimen/measurement_tool_text_button_padding_small"
android:text="@string/use_location"
android:textColor="?attr/color_dialog_buttons"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/do_not_use_location_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="@dimen/measurement_tool_text_button_padding_small"
android:paddingStart="@dimen/measurement_tool_text_button_padding_small"
android:text="@string/shared_string_do_not_use"
android:textColor="?attr/color_dialog_buttons"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -1582,4 +1582,29 @@
<string name="poi_running_track">مسار جري</string>
<string name="poi_raceway">مضمار سباق</string>
<string name="poi_archery">الرماية</string>
<string name="poi_turning_circle">دائرة دوران</string>
<string name="poi_waterway_turning_point">نقطة دوران في مجرى مائي</string>
<string name="poi_forest">غابة محمية</string>
<string name="poi_brownfield">أرض صناعية سابقة</string>
<string name="poi_greenfield">حقل أخضر</string>
<string name="poi_works">يعمل</string>
<string name="poi_mineshaft">منجم تعدين</string>
<string name="poi_adit">ممر منجم</string>
<string name="poi_gasometer">مقياس الغاز</string>
<string name="poi_silo">صومعة</string>
<string name="poi_bailiff">مأمور</string>
<string name="poi_baby_hatch">حافظة رضيع</string>
<string name="poi_9pin">بولينج 9 دبابيس</string>
<string name="poi_10pin">بولينج 10 دبابيس</string>
<string name="poi_boules">الكرة الحديدية</string>
<string name="poi_cycling">ركوب الدراجات</string>
<string name="poi_field_hockey">حقل هوكي</string>
<string name="poi_golf">غولف</string>
<string name="poi_korfbal">كرة السلة الهولندية</string>
<string name="poi_racquet">المضرب</string>
<string name="poi_roller_skating">تزحلق بالعجلات</string>
<string name="poi_shooting">الرماية</string>
<string name="poi_surfing">ركوب الأمواج</string>
<string name="poi_artwork">عمل فني</string>
<string name="poi_battlefield">ميدان معركة</string>
</resources>

View file

@ -198,7 +198,7 @@
<string name="poi_fast_food">Fast Food</string>
<string name="poi_ferry_terminal">Fährhafen</string>
<string name="poi_fire_extinguisher">Feuerlöscher</string>
<string name="poi_fire_flapper">Brandschutzklappe</string>
<string name="poi_fire_flapper">Brandpatsche</string>
<string name="poi_fire_hose">Löschschlauch</string>
<string name="poi_fire_hydrant">Hydrant</string>
<string name="poi_fire_station">Feuerwehr</string>
@ -433,12 +433,12 @@
<string name="poi_seafood">Fischgeschäft</string>
<string name="poi_anchor_berth">Ankerplatz</string>
<string name="poi_anchorage">Ankerplatz</string>
<string name="poi_beacon">Signalfeuer (Schifffahrtszeichen)</string>
<string name="poi_beacon">Bake (Seezeichen)</string>
<string name="poi_beacon_cardinal">Untiefenbake (Kardinal)</string>
<string name="poi_beacon_lateral">Fahrrinnenbake (Lateral)</string>
<string name="poi_beacon_safe_water">Mitte-Fahrwasser-Bake</string>
<string name="poi_beacon_special_purpose">Sonderzeichen-Bake</string>
<string name="poi_berth">Anlegestelle</string>
<string name="poi_berth">Landesteg</string>
<string name="poi_seamark_bridge">Seezeichenbrücke</string>
<string name="poi_seamark_building">Seezeichengebäude</string>
<string name="poi_buoy_cardinal">Untiefentonne (Kardinal)</string>
@ -647,7 +647,7 @@
<string name="poi_osmwiki">Wikipedia</string>
<string name="poi_user_defined_other">Benutzerdefiniert</string>
<string name="poi_aerialway_transport">Luftverkehr</string>
<string name="poi_aerialway_transport">Seilbahntransport</string>
<string name="poi_wine">Weinhandlung</string>
<string name="poi_medical_supply">Medizinische Versorgung</string>
@ -1567,7 +1567,7 @@
<string name="poi_denomination_iglesia_ni_cristo">Iglesia ni Cristo</string>
<string name="poi_denomination_mennonite">Mennoniten</string>
<string name="poi_denomination_quaker">Quäker</string>
<string name="poi_denomination_assemblies_of_god">Vereinigung „Assemblies of God</string>
<string name="poi_denomination_assemblies_of_god">Assemblies of God</string>
<string name="poi_denomination_nondenominational">Bekenntnisfrei</string>
<string name="poi_denomination_nazarene">Nazaräer</string>
<string name="poi_denomination_united_methodist">Vereinigte Methodisten</string>
@ -2550,7 +2550,7 @@
<string name="poi_official_name">Offizieller Name</string>
<string name="poi_seamark_dyke">Seezeichen Deich</string>
<string name="poi_dolphin">Delphin</string>
<string name="poi_dolphin">Dalbe</string>
<string name="poi_forestry_compartment">Wegweiser: Forstabteilung</string>
<string name="poi_forestry_allotment">Wegweiser: Forstparzelle</string>
@ -2964,14 +2964,14 @@
<string name="poi_display_sundial_yes">Sonnenuhr</string>
<string name="poi_support_pole">Werbeträger: Mast</string>
<string name="poi_support_wall_mounted">Werbeträger: Wand</string>
<string name="poi_support_tree">Werbeträger: Baum</string>
<string name="poi_support_pedestal">Werbeträger: Sockel</string>
<string name="poi_support_ground">Werbeträger: Boden</string>
<string name="poi_support_ceiling">Werbeträger: Decke</string>
<string name="poi_support_roof">Werbeträger: Dach</string>
<string name="poi_support_tower">Werbeträger: Turm</string>
<string name="poi_support_pole">Anbringung: Mast</string>
<string name="poi_support_wall_mounted">Anbringung: Wand</string>
<string name="poi_support_tree">Anbringung: Baum</string>
<string name="poi_support_pedestal">Anbringung: Sockel</string>
<string name="poi_support_ground">Anbringung: Boden</string>
<string name="poi_support_ceiling">Anbringung: Decke</string>
<string name="poi_support_roof">Anbringung: Dach</string>
<string name="poi_support_tower">Anbringung: Turm</string>
<string name="poi_aquaculture">Aquakultur</string>
<string name="poi_aquaculture_shrimp">Aquakultur: Garnelen</string>
@ -2993,7 +2993,7 @@
<string name="poi_greenhouse_horticulture">Gewächshaus</string>
<string name="poi_generator_output_steam_yes">Ausgabe: Dampf</string>
<string name="poi_support_suspended">Werbeträger: hängend</string>
<string name="poi_support_suspended">Anbringung: hängend</string>
<string name="poi_diplomatic_consulate_general">Generalkonsulat</string>
<string name="poi_diplomatic_honorary_consulate">Honorarkonsulat</string>
<string name="poi_observatory_type_gravitational">Schwerkraft</string>
@ -3001,10 +3001,10 @@
<string name="poi_generator_output_hot_water">Ausgangsleistung: heißes Wasser</string>
<string name="poi_generator_output_compressed_air">Ausgangsleistung: Druckluft</string>
<string name="poi_generator_output_biogas">Ausgangsleistung: Biogas</string>
<string name="poi_support_billboard">Werbeträger: Plakatwand</string>
<string name="poi_support_billboard">Anbringung: Werbetafel</string>
<string name="poi_diplomatic_high_commission">Hochkommissar</string>
<string name="poi_fire_operator">Feuerwehrmann</string>
<string name="poi_fire_operator">Feuerwehrbetreiber</string>
<string name="poi_diaper_table_count">Anzahl Wickeltische</string>
@ -3093,7 +3093,7 @@
<string name="poi_bicycle_service">Fahrradwerkstatt</string>
<string name="poi_service_car">Dienstleistung</string>
<string name="poi_self_service">Selbstbedienung</string>
<string name="poi_pharmacy_dispensing">Dosieren</string>
<string name="poi_pharmacy_dispensing">Rezeptur</string>
<string name="poi_archaeological_site_type">Typ</string>
<string name="poi_star_rating">Bewertung in Sternen</string>
<string name="poi_denomination">Konfession</string>
@ -3268,7 +3268,7 @@
<string name="poi_cuisine_diner">Esslokal</string>
<string name="poi_cuisine_yakiniku">Yakiniku</string>
<string name="poi_cuisine_udon">Udon</string>
<string name="poi_cuisine_brasserie">Bierstube</string>
<string name="poi_cuisine_brasserie">Brasserie</string>
<string name="poi_cuisine_yakitori">Yakitori</string>
<string name="poi_cuisine_teriyaki">Teriyaki</string>

View file

@ -471,7 +471,7 @@
<string name="poi_fountain">Fuente</string>
<string name="poi_historic_ruins">Ruinas históricas</string>
<string name="poi_rune_stone">Piedra rúnica</string>
<string name="poi_wreck">Naufragio</string>
<string name="poi_wreck">Pecio/naufragio</string>
<string name="poi_historic_ship">Barco histórico</string>
<string name="poi_historic_mine">Mina histórica</string>
<string name="poi_monument">Monumento</string>

View file

@ -446,7 +446,7 @@
<string name="poi_fountain">Fuente</string>
<string name="poi_historic_ruins">Ruinas históricas</string>
<string name="poi_rune_stone">Piedra rúnica</string>
<string name="poi_wreck">Naufragio</string>
<string name="poi_wreck">Pecio/naufragio</string>
<string name="poi_historic_ship">Barco histórico</string>
<string name="poi_historic_mine">Mina histórica</string>
<string name="poi_monument">Monumento</string>

View file

@ -764,9 +764,7 @@
<string name="osmand_service_descr">OsmAnd حتی در زمانی که صفحه خاموش است در حال اجرا می‌ماند</string>
<string name="download_files_not_enough_space">فضای کافی برای دانلود %1$s مگابایت وجود ندارد (فضای خالی: %2$s).</string>
<string name="download_files_question_space">آیا {0} فایل را دانلود میکنید؟
حافظه استفاده شده {1} مگابایت است.
(حافظه قابل استفاده {2} مگابایت است.)</string>
<string name="download_files_question_space">آیا {0} فایل را دانلود می‌کنید؟ حافظهٔ استفاده شده {1} مگابایت است. (حافظهٔ قابل‌استفاده {2} مگابایت است.)</string>
<string name="use_transparent_map_theme">تم شفاف</string>
<string name="native_library_not_supported">کتابخانه بومی بر روی این دستگاه پشتیبانی نمیشود.</string>
@ -1387,7 +1385,7 @@
<string name="osmo_connected_devices">دستگاه های متصل</string>
<string name="osmo_groups">OsMo گروه</string>
<string name="osmo_groups">گروه‌های OsMo</string>
<string name="osmo_auto_send_locations_descr">شروع خودکار پس از راه اندازی و ارسال موقعیت</string>
<string name="osmo_auto_send_locations">شروع خودکار سفر</string>
<string name="osmo_tracker_id">شناسه شخصی ردیاب</string>
@ -1440,7 +1438,7 @@
<string name="osmo_expire_group">انقضاء در</string>
<string name="osmo_group_description">شرح</string>
<string name="osmo_group_policy">خط مشی</string>
<string name="osmo_connect_to_group_id">شناسه گروه</string>
<string name="osmo_connect_to_group_id">ID گروه</string>
<string name="osmo_group_name">نام گروه</string>
<string name="osmo_connect_to_group">پیوند به گروه</string>
<string name="osmo_connect">پیوستن</string>
@ -1799,11 +1797,14 @@
<string name="free">"آزاد %1$s… "</string>
<string name="rendering_value__name">پیشفرض</string>
<string name="rendering_value_highContrastRoads_name">جاده‌های کنتراست بالا</string>
<string name="osmo_no_connection_msg">نمیتوان به سرور OsMo متصل شد:
- اتصال اینترنتی خود را بررسی کنید؛
- تنظیمات را بررسی کنید؛
- توییتر ما را بررسی کنید: https://twitter.com/OsMomobi</string>
<string name="anonymous_user_hint">کاربر ناشناس قادر به:\n- ایجاد گروه نیست؛\n- همزمان سازی گروهها و دستگاهها با سرور نمیباشد؛\n- مدیریت گروهها و دستگاهها در دفتر خصوصی نمیباشد.</string>
<string name="osmo_no_connection_msg">نمی‌توان به سرور OsMo متصل شد:
\n- اتصال اینترنتی خود را بررسی کنید؛
\n- تنظیمات را بررسی کنید؛
\n- توییتر ما را بررسی کنید: https://twitter.com/OsMomobi</string>
<string name="anonymous_user_hint">کاربر ناشناس نمی‌تواند:
\n- گروه بسازد؛
\n- گروه‌ها و دستگاه‌ها را با سرور همگام کند؛
\n- گروه‌ها و دستگاه‌ها را در یک پیشخوان شخصی روی وبسایت مدیریت کند.</string>
<string name="index_name_netherlands">اروپا - هلند</string>
<string name="no_updates_available">به روزرسانی وجود ندارد</string>
<string name="download_live_updates">به‌روزرسانی پویا</string>
@ -1856,18 +1857,18 @@
<string name="rendering_value_disabled_name">غیرفعال</string>
<string name="rendering_value_walkingRoutesScopeOSMC_name">رنگ‌بندی براساس دامنه مسیر</string>
<string name="rendering_value_walkingRoutesOSMC_name">رنگ‌بندی براساس OSMC</string>
<string name="osmo_share_my_location">اشتراک گذاری موقعیت</string>
<string name="no_address_found">آدرسی مشخص نشد</string>
<string name="osmo_share_my_location">اشتراکگذاری موقعیت</string>
<string name="no_address_found">آدرسی پیدا نشد</string>
<string name="shared_string_near">نزدیک</string>
<string name="shared_string_hide">مخقی کردن</string>
<string name="av_video_quality_low">پائین‌ترین کیفیت</string>
<string name="shared_string_hide">مخفی‌کردن</string>
<string name="av_video_quality_low">پایین‌ترین کیفیت</string>
<string name="av_video_quality_high">بالاترین کیفیت</string>
<string name="av_video_quality">کیفیت ویدئوی خروجی</string>
<string name="av_video_quality_descr">انتخاب کیفیت ویدئوی خروجی</string>
<string name="av_video_quality_descr">کیفیت ویدئوی خروجی را انتخاب کنید</string>
<string name="av_audio_format">قالب صدای خروجی</string>
<string name="av_audio_format_descr">انتخاب فرمت صدای خروجی</string>
<string name="av_audio_format_descr">قالب صدای خروجی را انتخاب کنید</string>
<string name="please_specify_poi_type_only_from_list">لطفاً نوع درست POI را انتخاب کنید یا از این مرحله رد شوید</string>
<string name="access_from_map_description">کلید منو به عوض نشان دادن منو داشبورد را نشان میدهد</string>
<string name="access_from_map_description">کلید منو پیشخوان را نشان می‌دهد، نه منو را</string>
<string name="access_from_map">دسترسی از نقشه</string>
<string name="versions_item">نسخه‌ها</string>
<string name="feedback">بازخورد</string>
@ -1895,11 +1896,10 @@
<string name="current_track">مسیر فعلی</string>
<string name="move_marker_bottom_sheet_title">نقشه را جابه‌جا کنید تا جای نشان عوض شود</string>
<!-- string name="lat_lon_pattern">طول: %1$.5f عرض: %2$.5f</string -->
<string name="access_sort">مرتب سازی</string>
<string name="number_of_gpx_files_selected_pattern">انتخاب فایل GPX %s</string>
<string name="osm_live_email_desc">ما به اطلاعات شما برای ارائه خدمات نیازمندیم</string>
<string name="download_files_question_space_with_temp">آیا {0} فایل را دانلود میکنید؟
اکنون فضای خالی {2} MB است. شما نیازمند {3} MB فضای خالی و {1} MB فضای اضافی هستید.</string>
<string name="access_sort">مرتب‌سازی</string>
<string name="number_of_gpx_files_selected_pattern">%s فایل GPX انتخاب شده است</string>
<string name="osm_live_email_desc">برای اینکه اطلاعاتی دربارهٔ مشارکت‌ها را برایتان ارسال کنیم، نوشتن آن لازم است</string>
<string name="download_files_question_space_with_temp">آیا {0} فایل را دانلود می‌کنید؟ {3} مگابایت برای ذخیره‌سازی موقت و {1} مگابایت برای ذخیره‌سازی دائمی صرف شده است. (فضای موجود {2} مگابایت است.)</string>
<string name="shared_string_type">نوع</string>
<string name="rec_split">ضبط چند تایی</string>
<string name="shared_string_commit">انجام شده</string>
@ -1968,71 +1968,71 @@
<string name="app_mode_bus">اتوبوس</string>
<string name="app_mode_train">قطار</string>
<string name="follow_us">ما را دنبال کنید</string>
<string name="access_direction_audio_feedback">مسیر پیامهای صوتی</string>
<string name="access_direction_audio_feedback_descr">نشان دادن مقصد به صورت صوتی</string>
<string name="access_direction_haptic_feedback">مسیر پیام لمسی</string>
<string name="access_direction_haptic_feedback_descr">اعلان مقصد از طریق ویبره</string>
<string name="use_osm_live_routing_description">فعال کردن مسیریاب OSM آنلاین (بتا)</string>
<string name="use_osm_live_routing">مسیریاب آنلان OSM</string>
<string name="access_no_destination">مقصد مشخص نیست</string>
<string name="access_direction_audio_feedback">بازخورد صوتی برای مسیریابی</string>
<string name="access_direction_audio_feedback_descr">نشان‌دادن جهت مقصد با پیام صوتی</string>
<string name="access_direction_haptic_feedback">بازخورد لمسی برای مسیریابی</string>
<string name="access_direction_haptic_feedback_descr">نشان‌دادن جهت مقصد از طریق لرزاندن</string>
<string name="use_osm_live_routing_description">فعال‌کردن مسیریابی از روی تغییرات OSM Live (آزمایشی)</string>
<string name="use_osm_live_routing">مسیریابی با OSM Live</string>
<string name="access_no_destination">مقصد را مشخص نکرده‌اید</string>
<string name="map_widget_magnetic_bearing">حالت آهن ربای گوشی</string>
<string name="map_widget_bearing">وضعیت نسبی</string>
<string name="access_disable_offroute_recalc">هنگامی که مسیر درست است آنرا تغییر نده</string>
<string name="access_disable_offroute_recalc_descr">هنگامی که از مسیر خارج شدید مسیر جدید را اتوماتیک تعیین میکند</string>
<string name="access_disable_wrong_direction_recalc">عدم تغییر مسیر یا مقصد اشتباه</string>
<string name="access_disable_wrong_direction_recalc_descr">در صورت انتخاب مقصد نادرست مسیر اتوماتیک تغییر کند</string>
<string name="access_smart_autoannounce">اعلام هوشمند اتوماتیک</string>
<string name="access_smart_autoannounce_descr">در صورت تغییر مقصد آنرا اعلام کن</string>
<string name="access_autoannounce_period">اعلام دوره اتوماتیک</string>
<string name="access_autoannounce_period_descr">حداقل زمان تکرار اعلامها</string>
<string name="access_default_color">رنگ پیش فرض</string>
<string name="access_category_choice">انتخاب دسته بندی</string>
<string name="access_disable_offroute_recalc">با خارج‌شدن از مسیر، مسیر تازه‌ای پیدا نکن</string>
<string name="access_disable_offroute_recalc_descr">هنگامی که از مسیر خارج شوید، برنامه به‌صورت خودکار مسیریابی تازه‌ای انجام نمی‌دهد</string>
<string name="access_disable_wrong_direction_recalc">هنگام حرکت در جهت مخالف، مسیر تازه‌ای پیدا نکن</string>
<string name="access_disable_wrong_direction_recalc_descr">وقتی دارید فقط در جهت مخالف حرکت می‌کنید، به‌صورت خودکار مسیریابی مجدد نمی‌کند</string>
<string name="access_smart_autoannounce">اعلام هوشمند خودکار</string>
<string name="access_smart_autoannounce_descr">فقط اگر جهتم از سمت نقطهٔ مقصد منحرف شد، اعلام کن</string>
<string name="access_autoannounce_period">بازهٔ زمانی اعلام خودکار</string>
<string name="access_autoannounce_period_descr">حداقل زمان تکرار اعلامها</string>
<string name="access_default_color">رنگ پیشفرض</string>
<string name="access_category_choice">انتخاب دسته</string>
<string name="access_hint_enter_name">نام</string>
<string name="access_hint_enter_category">دسته بندی</string>
<string name="access_hint_enter_category">دسته</string>
<string name="access_hint_enter_description">توضیحات</string>
<string name="access_map_linked_to_location">نقشه به موقعیت متصل شد</string>
<string name="access_collapsed_list">جمع کردن</string>
<string name="access_expanded_list">باز کردن</string>
<string name="access_empty_list">لیست خالیست</string>
<string name="access_collapsed_list">لیست جمع‌شده</string>
<string name="access_expanded_list">لیست بازشده</string>
<string name="access_empty_list">لیست خالی</string>
<string name="access_tree_list">لیست درختی</string>
<string name="access_shared_string_not_installed">نصب نیست</string>
<string name="access_widget_expand">باز</string>
<string name="access_widget_expand">بازکردن</string>
<string name="access_shared_string_navigate_up">برو به بالا</string>
<string name="map_mode">حالت نقشه</string>
<string name="rendering_value_thin_name">باریک</string>
<string name="rendering_value_medium_name">متوسط</string>
<string name="rendering_value_bold_name">کلفت</string>
<string name="no_map_markers_found">لطفا در نقشه علامت بزنید</string>
<string name="rendering_value_bold_name">ضخیم</string>
<string name="no_map_markers_found">لطفاً نشان‌ها را از طریق نقشه اضافه کنید</string>
<string name="no_waypoints_found">هیچ نقطه ای پیدا نشد</string>
<string name="report">گزارش</string>
<string name="storage_permission_restart_is_required">اکنون برنامه اجازه ذخیره سازی در کارت حافظه را دارد. برنامه را ببندید و دوباره اجرا کنید.</string>
<string name="storage_permission_restart_is_required">اکنون برنامه اجازهٔ ذخیره‌سازی در کارت حافظه را دارد. برنامه را ببندید و دوباره اجرا کنید.</string>
<string name="shared_string_move_up">برو بالا</string>
<string name="shared_string_move_down">برو پایین</string>
<string name="finish_navigation">پایان مسیریابی</string>
<string name="avoid_road">اجتناب از جاده</string>
<string name="storage_directory_readonly_desc">پوشه ذخیره سازی فقط خواندنی است. پوشه ذخیره سازی به طور موقت به حافظه داخلی تغییر پیدا کرد. لطفا مکان ذخیره سازی معتبر را انتخاب نمایید.</string>
<string name="avoid_road">اجتناب از جادهٔ</string>
<string name="storage_directory_readonly_desc">"پوشهٔ ذخیره‌سازی فقط‌خواندنی است. پوشهٔ ذخیره‌سازی به‌طور موقت به حافظهٔ داخلی تغییر کرد. لطفاً مکان ذخیره‌سازی معتبر را انتخاب نمایید."</string>
<string name="storage_directory_shared">اشتراک گذاری حافظه</string>
<string name="shared_string_topbar">نوار بالا</string>
<string name="full_report">گزارش کامل</string>
<string name="recalculate_route">پیداکردن مجدد مسیر</string>
<string name="open_street_map_login_and_pass">OpenStreetMap یوزر و پسورد</string>
<string name="donations">کمک مالی</string>
<string name="number_of_recipients">تعداد گیرنده ها</string>
<string name="osm_user_stat">اصلاح %1$s، رتبه %2$s، اصلاح نهایی %3$s</string>
<string name="osm_editors_ranking">رتبه بند ویراستاران OSM</string>
<string name="osm_live_subscription">اشتراک آنلاین OSM</string>
<string name="open_street_map_login_and_pass">نام کاربری و رمز عبور OpenStreetMap</string>
<string name="donations">کمک‌های مالی</string>
<string name="number_of_recipients">تعداد گیرندگان</string>
<string name="osm_user_stat">اصلاحات: %1$s، رتبه: %2$s، کل اصلاحات: %3$s</string>
<string name="osm_editors_ranking">رتبه‌بندی ویرایشگران OSM</string>
<string name="osm_live_subscription">اشتراک OSM Live</string>
<string name="osm_live_subscribe_btn">اشتراک</string>
<string name="osm_live_user_public_name">اسم جهانی</string>
<string name="osm_live_hide_user_name">اسم من را در گزارش نشان نده</string>
<string name="osm_live_support_region">پشتیبانی منطقه ای</string>
<string name="osm_live_month_cost">هزینه ماهانه</string>
<string name="osm_live_hide_user_name">اسم من را در گزارشها نشان نده</string>
<string name="osm_live_support_region">منطقهٔ پشتیبانی‌شده</string>
<string name="osm_live_month_cost">هزینهٔ ماهانه</string>
<string name="osm_live_month_cost_desc">پرداخت ماهیانه</string>
<string name="osm_live_active">فعال</string>
<string name="osm_live_not_active">غیرفعال</string>
<string name="osm_live_enter_email">لطفا آدرس ایمیل درست وارد کنید</string>
<string name="osm_live_enter_user_name">اسم جهانی را وارد کنید</string>
<string name="osm_live_thanks">تشکر از شما برای به اشتراک به روز رسانی آنلاین!</string>
<string name="osm_live_region_desc">بخشی از کمکهای مالی شما پرداخت میشود به کاربرانی که در آن منطقه اصلاحات نقشه را انجام میدهند.</string>
<string name="osm_live_enter_email">لطفاً نشانی ایمیل معتبر وارد کنید</string>
<string name="osm_live_enter_user_name">لطفاً اسم جهانی را وارد کنید</string>
<string name="osm_live_thanks">سپاسگزاریم که مشترک به‌روزرسانی‌های زنده شدید!</string>
<string name="osm_live_region_desc">"بخشی از کمکهای مالی شما به کاربرانی پرداخت میشود که در آن منطقه اصلاحات نقشه را انجام میدهند."</string>
<string name="osm_live_subscription_settings">تنظیمات اشتراک</string>
<string name="quick_action_auto_zoom">زوم خودکار روشن/خاموش</string>
<string name="select_street">انتخاب خیابان</string>
@ -2187,4 +2187,62 @@
\n • اضافه‌شدن بومی‌سازی‌های بیشتر و پشتیبانی از نام‌های محلی
\n
\n • رفع بسیاری از مشکلات دیگر و بهبود عملکرد برنامه</string>
<string name="osm_live_ask_for_purchase">لطفاً ابتدا اشتراک OSM Live را بخرید</string>
<string name="osm_live_header">با این اشتراک می‌توانید نقشه‌های سرتاسر جهان را به‌صورت ساعتی به‌روز کنید. بخشی از درآمد حاصله به جامعهٔ OSM برمی‌گردد‌‌ وصرف هر یک از مشارکت‌های OSM می‌شود. اگر OSM و OsmAnd را دوست دارید و مایلید از آن‌ها پشتیبانی کنید، بهترین راه همین تهیهٔ اشتراک است.</string>
<string name="select_map_marker">نشان نقشه را انتخاب کنید</string>
<string name="map_markers_other">نشان‌های دیگر</string>
<string name="upload_anonymously">آپلود به‌صورت ناشناس</string>
<string name="show_transparency_seekbar">نوار تنظیم شفافیت رانشان بده</string>
<string name="download_files_error_not_enough_space">فضای ذخیره‌سازی ناکافی است! {3} مگابایت برای ذخیره‌سازی موقت و {1} مگابایت برای ذخیره‌سازی دائمی لازم است. فضای موجود فقط {2} مگابایت است.</string>
<string name="upload_osm_note">آپلود یادداشت OSM</string>
<string name="map_marker_1st">اولین نشان نقشه</string>
<string name="map_marker_2nd">دومین نشان نقشه</string>
<string name="shared_string_toolbar">نوار ابزار</string>
<string name="shared_string_widgets">ابزارک‌ها</string>
<string name="add_points_to_map_markers_q">آیا همهٔ نقاط را به نشان‌های نقشه اضافه می‌کنید؟</string>
<string name="shared_string_add_to_map_markers">افزودن به نشان‌های نقشه</string>
<string name="select_map_markers">انتخاب نشان‌های نقشه</string>
<string name="shared_string_reverse_order">برعکس‌کردن ترتیب</string>
<string name="show_map_markers_description">فعال‌کذدن ویژگی نشان‌های نقشه</string>
<string name="clear_active_markers_q">آیا همهٔ نشان‌های فعال را حذف می‌کنید؟</string>
<string name="clear_markers_history_q">آیا تاریخچهٔ نشان‌های نقشه را پاک می‌کنید؟</string>
<string name="active_markers">نشان‌های فعال</string>
<string name="map_markers">نشان‌های نقشه</string>
<string name="map_marker">نشان نقشه</string>
<string name="consider_turning_polygons_off">توصیه می‌کنیم رسم چندضلعی‌ها را غیرفعال کنید.</string>
<string name="rendering_attr_showMtbRoutes_name">مسیرهای MTB را نشان بده</string>
<string name="show_polygons">چندضلعی‌ها را نشان بده</string>
<string name="shared_string_status">وضعیت</string>
<string name="shared_string_save_changes">ذخیره‌کردن تغییرات</string>
<string name="shared_string_email_address">نشانی ایمیل</string>
<string name="rendering_attr_hideUnderground_name">اشیای زیر زمین</string>
<string name="data_is_not_available">اطلاعات وجود ندارد</string>
<string name="shared_string_remove">حذف</string>
<string name="shared_string_read_more">بیشتر بخوانید</string>
<string name="clear_updates_proposition_message">می‌توانید به‌روزرسانی‌های دانلودشده را حذف کنید تا به نسخهٔ اولیهٔ نقشه برگردید</string>
<string name="road_blocked">جاده مسدود است</string>
<string name="shared_string_select">انتخاب</string>
<string name="switch_start_finish">عوض‌کردن مبدأ با مقصد</string>
<string name="rendering_attr_hideIcons_name">آیکون‌های POI</string>
<string name="item_removed">حذف شد</string>
<string name="n_items_removed">حذف شدند</string>
<string name="starting_point">مبدأ</string>
<string name="shared_string_not_selected">انتخاب نشده</string>
<string name="rec_split_desc">هنگامی که فضای استفاده‌شده بیشتر از حجم فضای ذخیره‌سازی می‌شود قطعه‌ها را جایگزین کن</string>
<string name="rec_split_clip_length_desc">طول هر کدام از قطعات ضبط‌شده نباید از مدت‌زمان تعیین‌شده بیشتر باشد</string>
<string name="rec_split_storage_size">حجم فضای ذخیره‌سازی</string>
<string name="rec_split_storage_size_desc">مقدار فضای موجود برای همهٔ قطعات ضبط‌شده</string>
<string name="live_updates">به‌روزرسانی‌های زنده</string>
<string name="available_maps">نقشه‌های موجود</string>
<string name="select_voice_provider">راهنمای صوتی را انتخاب کنید</string>
<string name="select_voice_provider_descr">برای زبان خودتان راهنمای صوتی را انتخاب یا دانلود کنید</string>
<string name="impassable_road_desc">جاده‌هایی را انتخاب کنید که باید در هنگام مسیریابی از آن‌ها اجتناب شود</string>
<string name="no_location_permission">برنامه اجازهٔ دسترسی به موقعیت مکانی را ندارد.</string>
<string name="no_camera_permission">برنامه اجازهٔ دسترسی به دوربین را ندارد.</string>
<string name="no_microphone_permission">برنامه اجازهٔ دسترسی به میکروفون را ندارد.</string>
<string name="route_distance">مسافت:</string>
<string name="route_duration">مدت زمان:</string>
<string name="rendering_attr_horseRoutes_name">راه مال‌رو</string>
<string name="av_audio_bitrate">بیت‌رِیت صدا</string>
<string name="av_audio_bitrate_descr">بیت‌رِیت صدا را انتخاب کنید</string>
</resources>

View file

@ -2952,4 +2952,11 @@ représentant la zone : %1$s x %2$s</string>
<string name="marker_save_as_track">Enregistrer comme trace</string>
<string name="move_to_history">Déplacer vers l\'historique</string>
<string name="group_will_be_removed_after_restart">Le groupe sera supprimé au prochain démarrage</string>
<string name="shared_string_markers">Marques</string>
<string name="coordinates_format">Format des coordonnées</string>
<string name="use_system_keyboard">Utiliser le clavier système</string>
<string name="fast_coordinates_input_descr">Définissez le format des coordonnées avec de démarrer. Vous pourrez les modifier plus tard dans les Options.</string>
<string name="fast_coordinates_input">Saisie rapide des coordonnées</string>
<string name="routing_attr_avoid_ice_roads_fords_name">Éviter les routes sur glace, les fjords</string>
<string name="routing_attr_avoid_ice_roads_fords_description">Éviter les routes sur glace et les fjords</string>
</resources>

View file

@ -2840,7 +2840,7 @@ Reprezentuje obszar: %1$s x %2$s</string>
<string name="show_direction">Wskaźnik odległości</string>
<string name="sort_by">Kolejność sortowania</string>
<string name="marker_options">Opcje znacznika</string>
<string name="marker_show_distance_descr">Wybierz w jaki sposób wskazywać odległość i kierunek do znaczników mapy na ekranie:</string>
<string name="marker_show_distance_descr">Proszę wybrać w jaki sposób wskazywać odległość i kierunek do znaczników mapy na ekranie:</string>
<string name="map_orientation_change_in_accordance_with_speed">Zmiana orientacji mapy</string>
<string name="map_orientation_change_in_accordance_with_speed_descr">Wybiera prędkość, poniżej której orientacja mapy zmieni się z „względem kierunku ruchu” na „względem kompasu”</string>
<string name="all_markers_moved_to_history">Wszystkie znaczniki mapy przeniesiono do historii</string>
@ -2865,4 +2865,5 @@ Reprezentuje obszar: %1$s x %2$s</string>
<string name="show_arrows_on_the_map">Wyświetl strzałki na mapie</string>
<string name="show_passed">Wyświetl minione</string>
<string name="hide_passed">Ukryj minione</string>
<string name="coordinate_input">Wprowadź współrzędne</string>
</resources>

View file

@ -1526,7 +1526,7 @@
<string name="gpx_option_calculate_first_last_segment">Обчислити маршрут OsmAnd для першого та останнього сегментів маршруту</string>
<string name="use_displayed_track_for_navigation">Чи Ви хочете використовувати відображення треку для навігації?</string>
<string name="keep_and_add_destination_point">Додати як наступний пункт призначення</string>
<string name="select_gpx">Обрати GPX…</string>
<string name="select_gpx">Виберіть GPX…</string>
<string name="route_descr_select_destination">Виберіть пункт призначення</string>
<string name="shared_string_select_on_map">Виберіть на мапі</string>
<string name="shared_string_favorite">Закладки</string>
@ -2232,7 +2232,7 @@
<string name="clear_active_markers_q">Вилучити всі активні позначки?</string>
<string name="clear_markers_history_q">Очистити історію позначок мапи?</string>
<string name="active_markers">Поточні позназчки</string>
<string name="map_markers">Позначки мапи</string>
<string name="map_markers">Маркери мапи</string>
<string name="map_marker">Позначка мапи</string>
<string name="consider_turning_polygons_off">Рекомендується вимкнути показ полігонів.</string>
<string name="av_locations_descr">Файл GPX з координатами нотаток</string>

View file

@ -264,4 +264,6 @@
<color name="marker_circle_button_color_dark">#525e66</color>
<color name="keyboard_color">#545454</color>
</resources>

View file

@ -9,6 +9,13 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="shared_string_markers">Markers</string>
<string name="coordinates_format">Coordinates format</string>
<string name="use_system_keyboard">Use system keyboard</string>
<string name="fast_coordinates_input_descr">Choose coordinate format before start. You can always change it by tapping Options.</string>
<string name="fast_coordinates_input">Fast Coordinates input</string>
<string name="routing_attr_avoid_ice_roads_fords_name">Avoid ice roads, fords</string>
<string name="routing_attr_avoid_ice_roads_fords_description">Avoid ice roads and fords</string>
<string name="use_location">Use location</string>
<string name="add_location_as_first_point_descr">Add your location as first point to plan perfect route.</string>
<string name="my_location">My Location</string>

View file

@ -338,7 +338,7 @@ public class MapMarkersHelper {
mapMarker.pointDescription.setName(address);
}
markersDbHelper.updateMarker(mapMarker);
updateMarker(mapMarker);
refreshMarker(mapMarker);
}
}, null);
ctx.getGeocodingLookupService().lookupAddress(lookupRequest);
@ -553,13 +553,19 @@ public class MapMarkersHelper {
public void deselectAllActiveMarkers() {
for (MapMarker m : mapMarkers) {
if (m.selected) {
m.selected = false;
markersDbHelper.updateMarker(m);
}
}
}
public void selectAllActiveMarkers() {
for (MapMarker m : mapMarkers) {
if (!m.selected) {
m.selected = true;
markersDbHelper.updateMarker(m);
}
}
}
@ -807,20 +813,20 @@ public class MapMarkersHelper {
listeners.remove(l);
}
private void updateMarker(MapMarker marker) {
private void refreshMarker(MapMarker marker) {
for (MapMarkerChangedListener l : listeners) {
l.onMapMarkerChanged(marker);
}
}
private void updateMarkers() {
private void refreshMarkers() {
for (MapMarkerChangedListener l : listeners) {
l.onMapMarkersChanged();
}
}
public void refresh() {
updateMarkers();
refreshMarkers();
}
private void cancelAddressRequests() {

View file

@ -0,0 +1,88 @@
package net.osmand.plus;
import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import studio.carbonylgroup.textfieldboxes.TextFieldBoxes;
public class OsmandTextFieldBoxes extends TextFieldBoxes {
private boolean useOsmandKeyboard;
public void setUseOsmandKeyboard(boolean useOsmandKeyboard) {
this.useOsmandKeyboard = useOsmandKeyboard;
}
public OsmandTextFieldBoxes(Context context) {
super(context);
}
public OsmandTextFieldBoxes(Context context, AttributeSet attrs) {
super(context, attrs);
}
public OsmandTextFieldBoxes(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (editText != null) {
this.panel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if(!OsmandTextFieldBoxes.this.isActivated()) {
OsmandTextFieldBoxes.this.activate(true);
}
OsmandTextFieldBoxes.this.setHasFocus(true);
if (!useOsmandKeyboard) {
OsmandTextFieldBoxes.this.inputMethodManager.showSoftInput(OsmandTextFieldBoxes.this.editText, InputMethodManager.SHOW_IMPLICIT);
}
}
});
this.iconImageButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
select();
}
});
}
}
public void select() {
if(!OsmandTextFieldBoxes.this.isActivated()) {
OsmandTextFieldBoxes.this.activate(true);
}
OsmandTextFieldBoxes.this.setHasFocus(true);
if (!useOsmandKeyboard) {
OsmandTextFieldBoxes.this.inputMethodManager.showSoftInput(OsmandTextFieldBoxes.this.editText, InputMethodManager.SHOW_IMPLICIT);
}
}
@Override
public void activate(boolean animated) {
super.activate(animated);
}
@Override
protected void deactivate() {
if(this.editText.getText().toString().isEmpty()) {
ViewCompat.animate(this.floatingLabel).alpha(1.0F).scaleX(1.0F).scaleY(1.0F).translationY(0.0F).setDuration((long)this.ANIMATION_DURATION);
this.editTextLayout.setVisibility(View.INVISIBLE);
if(this.editText.hasFocus()) {
if (!useOsmandKeyboard) {
this.inputMethodManager.hideSoftInputFromWindow(this.editText.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
}
this.editText.clearFocus();
}
}
this.activated = false;
}
}

View file

@ -50,6 +50,7 @@ import net.osmand.plus.views.ContextMenuLayer;
import net.osmand.plus.views.OsmandMapLayer;
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;
import java.lang.ref.WeakReference;
@ -703,7 +704,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
mapActivity.getDashboard().setDashboardVisibility(true, DashboardOnMap.DashboardType.MAP_MARKERS);
} else {
mapActivity.getMapActions().addMapMarker(latLon.getLatitude(), latLon.getLongitude(),
getPointDescriptionForTarget());
getPointDescriptionForMarker());
}
} else {
mapActivity.getMapActions().addAsTarget(latLon.getLatitude(), latLon.getLongitude(),
@ -880,6 +881,15 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
}
}
public PointDescription getPointDescriptionForMarker() {
PointDescription pd = getPointDescriptionForTarget();
if (Algorithms.isEmpty(pd.getName()) && !nameStr.equals(PointDescription.getAddressNotFoundStr(mapActivity))) {
return new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, nameStr);
} else {
return pd;
}
}
public void setBaseFragmentVisibility(boolean visible) {
WeakReference<MapContextMenuFragment> fragmentRef = findMenuFragment();
if (fragmentRef != null) {

View file

@ -0,0 +1,261 @@
package net.osmand.plus.mapmarkers;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.SwitchCompat;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.data.PointDescription;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.BottomSheetDialogFragment;
import net.osmand.plus.helpers.AndroidUiHelper;
public class CoordinateInputBottomSheetDialogFragment extends BottomSheetDialogFragment {
public final static String TAG = "CoordinateInputBottomSheetDialogFragment";
private boolean portrait;
private View mainView;
private boolean night;
private int coordinateFormat = -1;
private boolean useOsmandKeyboard = true;
private CoordinateInputFormatChangeListener listener;
private boolean shouldClose;
public void setListener(CoordinateInputFormatChangeListener listener) {
this.listener = listener;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle args = getArguments();
if (args != null) {
coordinateFormat = args.getInt(CoordinateInputDialogFragment.COORDINATE_FORMAT);
useOsmandKeyboard = args.getBoolean(CoordinateInputDialogFragment.USE_OSMAND_KEYBOARD);
} else {
shouldClose = true;
}
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final MapActivity mapActivity = (MapActivity) getActivity();
portrait = AndroidUiHelper.isOrientationPortrait(getActivity());
night = !mapActivity.getMyApplication().getSettings().isLightContent();
final int themeRes = night ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), coordinateFormat == -1 ?
R.layout.fragment_marker_coordinate_input_bottom_sheet_dialog : R.layout.fragment_marker_coordinate_input_options_bottom_sheet_helper, container);
if (portrait) {
AndroidUtils.setBackground(getActivity(), mainView, night, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
}
if (night) {
((TextView) mainView.findViewById(R.id.coordinate_input_title)).setTextColor(getResources().getColor(R.color.ctx_menu_info_text_dark));
}
ImageView degreesIcon = (ImageView) mainView.findViewById(R.id.degrees_icon);
TextView degreesText = (TextView) mainView.findViewById(R.id.degrees_text);
if (coordinateFormat == PointDescription.FORMAT_DEGREES) {
degreesIcon.setImageDrawable(getIcon(R.drawable.ic_action_coordinates_latitude, R.color.dashboard_blue));
degreesText.setTextColor(ContextCompat.getColor(mapActivity, R.color.dashboard_blue));
((RadioButton) mainView.findViewById(R.id.degrees_radio_button)).setChecked(true);
} else {
degreesIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_coordinates_latitude));
}
degreesText.setText(PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_DEGREES));
ImageView minutesIcon = (ImageView) mainView.findViewById(R.id.minutes_icon);
TextView minutesText = (TextView) mainView.findViewById(R.id.minutes_text);
if (coordinateFormat == PointDescription.FORMAT_MINUTES) {
minutesIcon.setImageDrawable(getIcon(R.drawable.ic_action_coordinates_latitude, R.color.dashboard_blue));
minutesText.setTextColor(ContextCompat.getColor(mapActivity, R.color.dashboard_blue));
((RadioButton) mainView.findViewById(R.id.minutes_radio_button)).setChecked(true);
} else {
minutesIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_coordinates_latitude));
}
minutesText.setText(PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_MINUTES));
ImageView secondsIcon = (ImageView) mainView.findViewById(R.id.seconds_icon);
TextView secondsText = (TextView) mainView.findViewById(R.id.seconds_text);
if (coordinateFormat == PointDescription.FORMAT_SECONDS) {
secondsIcon.setImageDrawable(getIcon(R.drawable.ic_action_coordinates_latitude, R.color.dashboard_blue));
secondsText.setTextColor(ContextCompat.getColor(mapActivity, R.color.dashboard_blue));
((RadioButton) mainView.findViewById(R.id.seconds_radio_button)).setChecked(true);
} else {
secondsIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_coordinates_latitude));
}
secondsText.setText(PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_SECONDS));
if (coordinateFormat != -1) {
((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard);
((ImageView) mainView.findViewById(R.id.use_system_keyboard_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_keyboard));
mainView.findViewById(R.id.use_system_keyboard_row).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
useOsmandKeyboard = !useOsmandKeyboard;
((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard);
if (listener != null) {
listener.onKeyboardChanged(useOsmandKeyboard);
}
}
});
highlightSelectedItem(true);
}
View.OnClickListener formatChangeListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
highlightSelectedItem(false);
switch (view.getId()) {
case R.id.degrees_row:
coordinateFormat = PointDescription.FORMAT_DEGREES;
break;
case R.id.minutes_row:
coordinateFormat = PointDescription.FORMAT_MINUTES;
break;
case R.id.seconds_row:
coordinateFormat = PointDescription.FORMAT_SECONDS;
break;
default:
throw new IllegalArgumentException("Unsupported format");
}
highlightSelectedItem(true);
if (listener != null) {
listener.onCoordinateFormatChanged(coordinateFormat);
}
if (shouldClose) {
dismiss();
}
}
};
mainView.findViewById(R.id.degrees_row).setOnClickListener(formatChangeListener);
mainView.findViewById(R.id.minutes_row).setOnClickListener(formatChangeListener);
mainView.findViewById(R.id.seconds_row).setOnClickListener(formatChangeListener);
mainView.findViewById(R.id.cancel_row).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
if (shouldClose && listener != null) {
listener.onCancel();
}
}
});
final int screenHeight = AndroidUtils.getScreenHeight(getActivity());
final int statusBarHeight = AndroidUtils.getStatusBarHeight(getActivity());
final int navBarHeight = AndroidUtils.getNavBarHeight(getActivity());
mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
final View scrollView = mainView.findViewById(R.id.marker_coordinate_input_scroll_view);
int scrollViewHeight = scrollView.getHeight();
int dividerHeight = AndroidUtils.dpToPx(getContext(), 1);
int cancelButtonHeight = getContext().getResources().getDimensionPixelSize(R.dimen.bottom_sheet_cancel_button_height);
int spaceForScrollView = screenHeight - statusBarHeight - navBarHeight - dividerHeight - cancelButtonHeight;
if (scrollViewHeight > spaceForScrollView) {
scrollView.getLayoutParams().height = spaceForScrollView;
scrollView.requestLayout();
}
if (!portrait) {
if (screenHeight - statusBarHeight - mainView.getHeight()
>= AndroidUtils.dpToPx(getActivity(), 8)) {
AndroidUtils.setBackground(getActivity(), mainView, false,
R.drawable.bg_bottom_sheet_topsides_landscape_light, R.drawable.bg_bottom_sheet_topsides_landscape_dark);
} else {
AndroidUtils.setBackground(getActivity(), mainView, false,
R.drawable.bg_bottom_sheet_sides_landscape_light, R.drawable.bg_bottom_sheet_sides_landscape_dark);
}
}
ViewTreeObserver obs = mainView.getViewTreeObserver();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
obs.removeOnGlobalLayoutListener(this);
} else {
obs.removeGlobalOnLayoutListener(this);
}
}
});
return mainView;
}
@Override
public void onStart() {
super.onStart();
if (!portrait) {
final Window window = getDialog().getWindow();
WindowManager.LayoutParams params = window.getAttributes();
params.width = getActivity().getResources().getDimensionPixelSize(R.dimen.landscape_bottom_sheet_dialog_fragment_width);
window.setAttributes(params);
}
}
@Override
public void onCancel(DialogInterface dialog) {
super.onCancel(dialog);
if (shouldClose && listener != null) {
listener.onCancel();
}
}
@Override
protected Drawable getContentIcon(@DrawableRes int id) {
return getIcon(id, night ? R.color.ctx_menu_info_text_dark : R.color.on_map_icon_color);
}
private void highlightSelectedItem(boolean check) {
int iconColor = check ? R.color.dashboard_blue : night ? R.color.ctx_menu_info_text_dark : R.color.on_map_icon_color;
int textColor = ContextCompat.getColor(getContext(), check ? (night ? R.color.color_dialog_buttons_dark : R.color.dashboard_blue) : night ? R.color.color_white : R.color.color_black);
switch (coordinateFormat) {
case PointDescription.FORMAT_DEGREES:
((TextView) mainView.findViewById(R.id.degrees_text)).setTextColor(textColor);
((ImageView) mainView.findViewById(R.id.degrees_icon)).setImageDrawable((getIcon(R.drawable.ic_action_coordinates_latitude, iconColor)));
((RadioButton) mainView.findViewById(R.id.degrees_radio_button)).setChecked(check);
break;
case PointDescription.FORMAT_MINUTES:
((TextView) mainView.findViewById(R.id.minutes_text)).setTextColor(textColor);
((ImageView) mainView.findViewById(R.id.minutes_icon)).setImageDrawable((getIcon(R.drawable.ic_action_coordinates_latitude, iconColor)));
((RadioButton) mainView.findViewById(R.id.minutes_radio_button)).setChecked(check);
break;
case PointDescription.FORMAT_SECONDS:
((TextView) mainView.findViewById(R.id.seconds_text)).setTextColor(textColor);
((ImageView) mainView.findViewById(R.id.seconds_icon)).setImageDrawable((getIcon(R.drawable.ic_action_coordinates_latitude, iconColor)));
((RadioButton) mainView.findViewById(R.id.seconds_radio_button)).setChecked(check);
break;
}
}
interface CoordinateInputFormatChangeListener {
void onCoordinateFormatChanged(int format);
void onKeyboardChanged(boolean useOsmandKeyboard);
void onCancel();
}
}

View file

@ -5,29 +5,56 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.InputFilter;
import android.text.InputType;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.ImageView;
import net.osmand.AndroidUtils;
import net.osmand.data.PointDescription;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandTextFieldBoxes;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.widgets.TextViewEx;
import java.util.ArrayList;
import java.util.List;
import studio.carbonylgroup.textfieldboxes.ExtendedEditText;
public class CoordinateInputDialogFragment extends DialogFragment {
public static final String TAG = "CoordinateInputDialogFragment";
public static final String COORDINATE_FORMAT = "coordinate_format";
public static final String USE_OSMAND_KEYBOARD = "use_osmand_keyboard";
private static final int DELETE_BUTTON_POSITION = 9;
private static final int CLEAR_BUTTON_POSITION = 11;
private static final int DEGREES_MAX_LENGTH = 6;
private static final int MINUTES_MAX_LENGTH = 9;
private static final int SECONDS_MAX_LENGTH = 12;
private boolean lightTheme;
private EditText focusedEditText;
private boolean useOsmandKeyboard = true;
private int coordinateFormat = -1;
private List<OsmandTextFieldBoxes> textFieldBoxes;
private ExtendedEditText nameEditText;
private List<ExtendedEditText> extendedLatLonEditTexts;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -36,6 +63,10 @@ public class CoordinateInputDialogFragment extends DialogFragment {
lightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
int themeId = lightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
setStyle(STYLE_NO_FRAME, themeId);
CoordinateInputBottomSheetDialogFragment fragment = new CoordinateInputBottomSheetDialogFragment();
fragment.setListener(createCoordinateInputFormatChangeListener());
fragment.show(getMapActivity().getSupportFragmentManager(), CoordinateInputBottomSheetDialogFragment.TAG);
}
@Nullable
@ -43,11 +74,14 @@ public class CoordinateInputDialogFragment extends DialogFragment {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final View mainView = inflater.inflate(R.layout.fragment_coordinate_input_dialog, container);
final MapActivity mapActivity = getMapActivity();
final IconsCache ic = getMyApplication().getIconsCache();
Fragment coordinateInputBottomSheetDialogFragment = mapActivity.getSupportFragmentManager().findFragmentByTag(CoordinateInputBottomSheetDialogFragment.TAG);
if (coordinateInputBottomSheetDialogFragment != null) {
((CoordinateInputBottomSheetDialogFragment) coordinateInputBottomSheetDialogFragment).setListener(createCoordinateInputFormatChangeListener());
}
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.coordinate_input_toolbar);
if (!lightTheme) {
toolbar.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.actionbar_dark_color));
}
toolbar.setNavigationIcon(getMyApplication().getIconsCache().getIcon(R.drawable.ic_arrow_back));
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@ -60,51 +94,238 @@ public class CoordinateInputDialogFragment extends DialogFragment {
optionsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CoordinateInputBottomSheetDialogFragment fragment = new CoordinateInputBottomSheetDialogFragment();
Bundle args = new Bundle();
args.putInt(COORDINATE_FORMAT, coordinateFormat);
args.putBoolean(USE_OSMAND_KEYBOARD, useOsmandKeyboard);
fragment.setArguments(args);
fragment.setListener(createCoordinateInputFormatChangeListener());
fragment.show(getMapActivity().getSupportFragmentManager(), CoordinateInputBottomSheetDialogFragment.TAG);
}
});
final EditText latitudeEditText = (EditText) mainView.findViewById(R.id.latitude_edit_text);
final EditText longitudeEditText = (EditText) mainView.findViewById(R.id.longitude_edit_text);
final EditText nameEditText = (EditText) mainView.findViewById(R.id.name_edit_text);
textFieldBoxes = new ArrayList<>();
final OsmandTextFieldBoxes latitudeBox = (OsmandTextFieldBoxes) mainView.findViewById(R.id.latitude_box);
textFieldBoxes.add(latitudeBox);
final OsmandTextFieldBoxes longitudeBox = (OsmandTextFieldBoxes) mainView.findViewById(R.id.longitude_box);
textFieldBoxes.add(longitudeBox);
final OsmandTextFieldBoxes nameBox = (OsmandTextFieldBoxes) mainView.findViewById(R.id.name_box);
textFieldBoxes.add(nameBox);
View.OnTouchListener editTextOnTouchListener = new View.OnTouchListener() {
extendedLatLonEditTexts = new ArrayList<>();
final ExtendedEditText latitudeEditText = (ExtendedEditText) mainView.findViewById(R.id.latitude_edit_text);
extendedLatLonEditTexts.add(latitudeEditText);
final ExtendedEditText longitudeEditText = (ExtendedEditText) mainView.findViewById(R.id.longitude_edit_text);
extendedLatLonEditTexts.add(longitudeEditText);
nameEditText = (ExtendedEditText) mainView.findViewById(R.id.name_edit_text);
final View.OnFocusChangeListener focusChangeListener = new View.OnFocusChangeListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
EditText editText = null;
public void onFocusChange(View view, boolean b) {
ExtendedEditText editText = null;
OsmandTextFieldBoxes fieldBox = null;
switch (view.getId()) {
case R.id.latitude_edit_text:
editText = latitudeEditText;
fieldBox = latitudeBox;
break;
case R.id.longitude_edit_text:
editText = longitudeEditText;
fieldBox = longitudeBox;
break;
case R.id.name_edit_text:
editText = nameEditText;
fieldBox = nameBox;
break;
}
if (editText != null) {
editText.requestFocus();
if (fieldBox != null) {
if (b) {
fieldBox.setHasFocus(true);
focusedEditText = editText;
} else {
fieldBox.setHasFocus(false);
focusedEditText = null;
}
}
return true;
}
};
latitudeEditText.setOnTouchListener(editTextOnTouchListener);
longitudeEditText.setOnTouchListener(editTextOnTouchListener);
nameEditText.setOnTouchListener(editTextOnTouchListener);
TextWatcher textWatcher = new TextWatcher() {
int len = 0;
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (focusedEditText != null) {
String str = focusedEditText.getText().toString();
len = str.length();
}
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (focusedEditText != null && focusedEditText != nameEditText) {
String str = focusedEditText.getText().toString();
int strLength = str.length();
if (strLength == 2 && len < strLength) {
String strToAppend;
if (coordinateFormat == PointDescription.FORMAT_DEGREES) {
strToAppend = ".";
} else {
strToAppend = ":";
}
focusedEditText.append(strToAppend);
} else if (strLength == 5 && coordinateFormat != PointDescription.FORMAT_DEGREES && len < strLength) {
String strToAppend;
if (coordinateFormat == PointDescription.FORMAT_MINUTES) {
strToAppend = ".";
} else {
strToAppend = ":";
}
focusedEditText.append(strToAppend);
} else if (strLength == 8 && coordinateFormat == PointDescription.FORMAT_SECONDS && len < strLength) {
focusedEditText.append(".");
} else if ((strLength == DEGREES_MAX_LENGTH && coordinateFormat == PointDescription.FORMAT_DEGREES)
|| (strLength == MINUTES_MAX_LENGTH && coordinateFormat == PointDescription.FORMAT_MINUTES)
|| (strLength == SECONDS_MAX_LENGTH && coordinateFormat == PointDescription.FORMAT_SECONDS)) {
if (focusedEditText == latitudeEditText) {
longitudeBox.select();
} else {
nameBox.select();
}
}
}
}
};
latitudeEditText.setOnFocusChangeListener(focusChangeListener);
longitudeEditText.setOnFocusChangeListener(focusChangeListener);
nameEditText.setOnFocusChangeListener(focusChangeListener);
latitudeEditText.addTextChangedListener(textWatcher);
longitudeEditText.addTextChangedListener(textWatcher);
nameEditText.addTextChangedListener(textWatcher);
changeKeyboardInBoxes();
changeKeyboardInEditTexts();
View keyboardLayout = mainView.findViewById(R.id.keyboard_layout);
AndroidUtils.setBackground(mapActivity, keyboardLayout, !lightTheme, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
String[] keyboardItems = new String[] { "1", "2", "3",
"4", "5", "6",
"7", "8", "9",
getString(R.string.shared_string_delete), "0", getString(R.string.shared_string_clear) };
GridView keyboardGrid = (GridView) mainView.findViewById(R.id.keyboard_grid_view);
KeyboardAdapter keyboardAdapter = new KeyboardAdapter(mapActivity, keyboardItems);
final GridView keyboardGrid = (GridView) mainView.findViewById(R.id.keyboard_grid_view);
final KeyboardAdapter keyboardAdapter = new KeyboardAdapter(mapActivity, keyboardItems);
keyboardGrid.setAdapter(keyboardAdapter);
keyboardGrid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (focusedEditText != null) {
switch (i) {
case DELETE_BUTTON_POSITION:
String str = focusedEditText.getText().toString();
if (str.length() > 0) {
str = str.substring(0, str.length() - 1);
focusedEditText.setText(str);
}
break;
case CLEAR_BUTTON_POSITION:
focusedEditText.setText("");
break;
default:
focusedEditText.append(keyboardAdapter.getItem(i));
}
}
}
});
final ImageView showHideKeyBoardIcon = (ImageView) mainView.findViewById(R.id.show_hide_keyboard_icon);
final View keyboardDivider = mainView.findViewById(R.id.keyboard_divider);
showHideKeyBoardIcon.setImageDrawable(ic.getThemedIcon(R.drawable.ic_action_arrow_down));
showHideKeyBoardIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int keyboardVisibility = keyboardGrid.getVisibility();
if (keyboardVisibility == View.VISIBLE) {
keyboardGrid.setVisibility(View.GONE);
keyboardDivider.setVisibility(View.GONE);
showHideKeyBoardIcon.setImageDrawable(ic.getThemedIcon(R.drawable.ic_action_arrow_up));
} else {
keyboardGrid.setVisibility(View.VISIBLE);
keyboardDivider.setVisibility(View.VISIBLE);
showHideKeyBoardIcon.setImageDrawable(ic.getThemedIcon(R.drawable.ic_action_arrow_down));
}
}
});
return mainView;
}
@Override
public void onDestroyView() {
focusedEditText = null;
if (getDialog() != null && getRetainInstance()) {
getDialog().setDismissMessage(null);
}
super.onDestroyView();
}
private CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener createCoordinateInputFormatChangeListener() {
return new CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener() {
@Override
public void onCoordinateFormatChanged(int format) {
coordinateFormat = format;
changeEditTextLengths();
}
@Override
public void onKeyboardChanged(boolean useOsmandKeyboard) {
CoordinateInputDialogFragment.this.useOsmandKeyboard = useOsmandKeyboard;
changeKeyboardInBoxes();
changeKeyboardInEditTexts();
}
@Override
public void onCancel() {
dismiss();
}
};
}
private void changeEditTextLengths() {
int maxLength;
if (coordinateFormat == PointDescription.FORMAT_DEGREES) {
maxLength = DEGREES_MAX_LENGTH;
} else if (coordinateFormat == PointDescription.FORMAT_MINUTES) {
maxLength = MINUTES_MAX_LENGTH;
} else {
maxLength = SECONDS_MAX_LENGTH;
}
InputFilter[] filtersArray = new InputFilter[] {new InputFilter.LengthFilter(maxLength)};
for (ExtendedEditText extendedEditText : extendedLatLonEditTexts) {
extendedEditText.setFilters(filtersArray);
}
}
public void changeKeyboardInBoxes() {
for (OsmandTextFieldBoxes textFieldBox : textFieldBoxes) {
textFieldBox.setUseOsmandKeyboard(useOsmandKeyboard);
}
}
public void changeKeyboardInEditTexts() {
for (ExtendedEditText extendedEditText : extendedLatLonEditTexts) {
extendedEditText.setInputType(useOsmandKeyboard ? InputType.TYPE_NULL : InputType.TYPE_CLASS_TEXT);
}
nameEditText.setInputType(useOsmandKeyboard ? InputType.TYPE_NULL : InputType.TYPE_CLASS_TEXT);
}
private MapActivity getMapActivity() {
return (MapActivity) getActivity();
}
@ -119,6 +340,7 @@ public class CoordinateInputDialogFragment extends DialogFragment {
return false;
}
CoordinateInputDialogFragment fragment = new CoordinateInputDialogFragment();
fragment.setRetainInstance(true);
fragment.show(mapActivity.getSupportFragmentManager(), TAG);
return true;
} catch (RuntimeException e) {
@ -128,8 +350,8 @@ public class CoordinateInputDialogFragment extends DialogFragment {
private class KeyboardAdapter extends ArrayAdapter<String> {
KeyboardAdapter(@NonNull Context context, String[] items) {
super(context, 0, items);
KeyboardAdapter(@NonNull Context context, @NonNull String[] objects) {
super(context, 0, objects);
}
@NonNull
@ -138,8 +360,16 @@ public class CoordinateInputDialogFragment extends DialogFragment {
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.input_coordinate_keyboard_item, parent, false);
}
convertView.setBackgroundResource(lightTheme ? R.drawable.keyboard_item_light_bg : R.drawable.keyboard_item_dark_bg);
((TextView) convertView.findViewById(R.id.keyboard_item)).setText(getItem(position));
TextViewEx keyboardItem = (TextViewEx) convertView.findViewById(R.id.keyboard_item);
// if (position == DELETE_BUTTON_POSITION || position == CLEAR_BUTTON_POSITION) {
// keyboardItem.setTextSize(getResources().getDimension(R.dimen.default_list_text_size));
// } else {
// keyboardItem.setTextSize(getResources().getDimension(R.dimen.map_button_text_size));
// }
keyboardItem.setText(getItem(position));
return convertView;
}

View file

@ -21,7 +21,7 @@ import java.util.Random;
public class MapMarkersDbHelper {
private static final int DB_VERSION = 9;
private static final int DB_VERSION = 10;
public static final String DB_NAME = "map_markers_db";
private static final String MARKERS_TABLE_NAME = "map_markers";
@ -37,6 +37,7 @@ public class MapMarkersDbHelper {
private static final String MARKERS_COL_COLOR = "marker_color";
private static final String MARKERS_COL_NEXT_KEY = "marker_next_key";
private static final String MARKERS_COL_DISABLED = "marker_disabled";
private static final String MARKERS_COL_SELECTED = "marker_selected";
private static final String MARKERS_TABLE_CREATE = "CREATE TABLE IF NOT EXISTS " +
MARKERS_TABLE_NAME + " (" +
@ -51,7 +52,8 @@ public class MapMarkersDbHelper {
MARKERS_COL_GROUP_KEY + " TEXT, " +
MARKERS_COL_COLOR + " int, " +
MARKERS_COL_NEXT_KEY + " TEXT, " +
MARKERS_COL_DISABLED + " int);";
MARKERS_COL_DISABLED + " int, " + // 1 = true, 0 = false
MARKERS_COL_SELECTED + " int);"; // 1 = true, 0 = false
private static final String MARKERS_TABLE_SELECT = "SELECT " +
MARKERS_COL_ID + ", " +
@ -65,7 +67,8 @@ public class MapMarkersDbHelper {
MARKERS_COL_GROUP_KEY + ", " +
MARKERS_COL_COLOR + ", " +
MARKERS_COL_NEXT_KEY + ", " +
MARKERS_COL_DISABLED +
MARKERS_COL_DISABLED + ", " +
MARKERS_COL_SELECTED +
" FROM " + MARKERS_TABLE_NAME;
private static final String GROUPS_TABLE_NAME = "map_markers_groups";
@ -134,6 +137,12 @@ public class MapMarkersDbHelper {
" SET " + MARKERS_COL_DISABLED + " = ? " +
"WHERE " + MARKERS_COL_DISABLED + " IS NULL", new Object[]{0});
}
if (oldVersion < 10) {
db.execSQL("ALTER TABLE " + MARKERS_TABLE_NAME + " ADD " + MARKERS_COL_SELECTED + " int");
db.execSQL("UPDATE " + MARKERS_TABLE_NAME +
" SET" + MARKERS_COL_SELECTED + " = ? " +
"WHERE " + MARKERS_COL_SELECTED + " IS NULL", new Object[]{0});
}
}
private void saveExistingMarkersToDb() {
@ -319,10 +328,10 @@ public class MapMarkersDbHelper {
"WHERE " + MARKERS_COL_NEXT_KEY + " = ?", new Object[]{marker.id, TAIL_NEXT_VALUE});
}
db.execSQL("INSERT INTO " + MARKERS_TABLE_NAME + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
db.execSQL("INSERT INTO " + MARKERS_TABLE_NAME + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
new Object[]{marker.id, marker.getLatitude(), marker.getLongitude(), descr, active,
currentTime, visited, marker.groupName, marker.groupKey, marker.colorIndex,
marker.history ? HISTORY_NEXT_VALUE : TAIL_NEXT_VALUE, 0});
marker.history ? HISTORY_NEXT_VALUE : TAIL_NEXT_VALUE, 0, 0});
}
public List<MapMarker> getMarkersFromGroup(MarkersSyncGroup group) {
@ -398,6 +407,7 @@ public class MapMarkersDbHelper {
String groupKey = query.getString(8);
int colorIndex = query.getInt(9);
String nextKey = query.getString(10);
boolean selected = query.getInt(12) == 1;
LatLon latLon = new LatLon(lat, lon);
MapMarker marker = new MapMarker(latLon, PointDescription.deserializeFromString(desc, latLon),
@ -409,6 +419,7 @@ public class MapMarkersDbHelper {
marker.groupName = groupName;
marker.groupKey = groupKey;
marker.nextKey = nextKey;
marker.selected = selected;
return marker;
}
@ -437,9 +448,10 @@ public class MapMarkersDbHelper {
MARKERS_COL_LAT + " = ?, " +
MARKERS_COL_LON + " = ?, " +
MARKERS_COL_DESCRIPTION + " = ?, " +
MARKERS_COL_COLOR + " = ? " +
MARKERS_COL_COLOR + " = ?, " +
MARKERS_COL_SELECTED + " = ? " +
"WHERE " + MARKERS_COL_ID + " = ?",
new Object[]{marker.getLatitude(), marker.getLongitude(), descr, marker.colorIndex, marker.id});
new Object[]{marker.getLatitude(), marker.getLongitude(), descr, marker.colorIndex, marker.selected, marker.id});
} finally {
db.close();
}

View file

@ -1,6 +1,7 @@
package net.osmand.plus.mapmarkers;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
@ -14,6 +15,7 @@ import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
@ -22,11 +24,14 @@ import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.Location;
import net.osmand.data.LatLon;
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.IconsCache;
import net.osmand.plus.MapMarkersHelper;
import net.osmand.plus.MapMarkersHelper.MapMarker;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.MapViewTrackingUtilities;
@ -40,9 +45,11 @@ import net.osmand.plus.views.MapMarkersLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory;
import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController;
import net.osmand.util.MapUtils;
import java.util.List;
import static net.osmand.plus.OsmandSettings.LANDSCAPE_MIDDLE_RIGHT_CONSTANT;
import static net.osmand.plus.OsmandSettings.MIDDLE_TOP_CONSTANT;
public class PlanRouteFragment extends Fragment implements OsmAndLocationListener {
@ -56,6 +63,8 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
private int previousMapPosition;
private int selectedCount = 0;
private int toolbarHeight;
private Location location;
private boolean locationUpdateStarted;
@ -69,6 +78,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
private ImageView upDownIconIv;
private TextView distanceTv;
private TextView timeTv;
private TextView countTv;
@Nullable
@Override
@ -88,6 +98,8 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
hideMarkersListFragment();
}
toolbarHeight = mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
iconsCache = mapActivity.getMyApplication().getIconsCache();
nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
@ -102,6 +114,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
distanceTv = (TextView) mainView.findViewById(R.id.markers_distance_text_view);
timeTv = (TextView) mainView.findViewById(R.id.markers_time_text_view);
countTv = (TextView) mainView.findViewById(R.id.markers_count_text_view);
enterPlanRouteMode();
@ -129,15 +142,20 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
@Override
public void onClick(View view) {
int activeMarkersCount = markersHelper.getMapMarkers().size();
if (selectedCount == activeMarkersCount) {
if (selectedCount == activeMarkersCount && markersHelper.isStartFromMyLocation()) {
markersHelper.deselectAllActiveMarkers();
markersHelper.setStartFromMyLocation(false);
selectedCount = 0;
} else {
markersHelper.selectAllActiveMarkers();
markersHelper.setStartFromMyLocation(true);
selectedCount = activeMarkersCount;
}
adapter.notifyDataSetChanged();
updateText();
updateSelectButton();
showMarkersRouteOnMap();
mapActivity.refreshMap();
}
});
@ -161,7 +179,9 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
toolbarController.setOnBackButtonClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
quit(false);
if (quit(false)) {
MapMarkersDialogFragment.showInstance(mapActivity);
}
}
});
mapActivity.showTopToolbar(toolbarController);
@ -183,11 +203,18 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
@Override
public void onItemClick(View view) {
int pos = markersRv.getChildAdapterPosition(view);
if (pos == 0) {
markersHelper.setStartFromMyLocation(!mapActivity.getMyApplication().getSettings().ROUTE_MAP_MARKERS_START_MY_LOC.get());
} else {
MapMarker marker = adapter.getItem(pos);
selectedCount = marker.selected ? selectedCount - 1 : selectedCount + 1;
marker.selected = !marker.selected;
markersHelper.updateMapMarker(marker, false);
}
adapter.notifyItemChanged(pos);
updateSelectButton();
updateText();
showMarkersRouteOnMap();
}
@Override
@ -201,7 +228,14 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
toPosition = holder.getAdapterPosition();
if (toPosition >= 0 && fromPosition >= 0 && toPosition != fromPosition) {
mapActivity.getMyApplication().getMapMarkersHelper().checkAndFixActiveMarkersOrderIfNeeded();
mapActivity.getMyApplication().getSettings().MAP_MARKERS_ORDER_BY_MODE.set(OsmandSettings.MapMarkersOrderByMode.CUSTOM);
mapActivity.refreshMap();
try {
adapter.notifyDataSetChanged();
} catch (Exception e) {
// to avoid crash because of:
// java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
}
}
}
});
@ -211,6 +245,34 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
markersRv.setLayoutManager(new LinearLayoutManager(getContext()));
markersRv.setAdapter(adapter);
final int screenH = AndroidUtils.getScreenHeight(mapActivity);
final int statusBarH = AndroidUtils.getStatusBarHeight(mapActivity);
final int navBarH = AndroidUtils.getNavBarHeight(mapActivity);
final int availableHeight = (screenH - statusBarH - navBarH) / 2;
mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (portrait) {
int upDownRowH = mainView.findViewById(R.id.up_down_row).getHeight();
int buttonsRowH = mainView.findViewById(R.id.buttons_row).getHeight();
int listContainerH = availableHeight - upDownRowH - buttonsRowH;
View listContainer = mainView.findViewById(R.id.markers_list_container);
listContainer.getLayoutParams().height = listContainerH;
listContainer.requestLayout();
}
showMarkersList();
ViewTreeObserver obs = mainView.getViewTreeObserver();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
obs.removeOnGlobalLayoutListener(this);
} else {
obs.removeGlobalOnLayoutListener(this);
}
}
});
return view;
}
@ -278,6 +340,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
public void onApplicationModeItemClick(ApplicationMode mode) {
appMode = mode;
setupAppModesBtn();
updateText();
}
};
}
@ -310,10 +373,11 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
}
if (appMode == null) {
appMode = mapActivity.getMyApplication().getSettings().getApplicationMode();
appMode = ApplicationMode.DEFAULT;
}
setupAppModesBtn();
showMarkersRouteOnMap();
mapActivity.refreshMap();
updateText();
updateSelectButton();
@ -331,6 +395,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
public void onClick(View view) {
SnapToRoadBottomSheetDialogFragment fragment = new SnapToRoadBottomSheetDialogFragment();
fragment.setListener(createSnapToRoadFragmentListener());
fragment.setRemoveDefaultMode(false);
fragment.show(mapActivity.getSupportFragmentManager(), SnapToRoadBottomSheetDialogFragment.TAG);
}
});
@ -367,24 +432,50 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
mapActivity.findViewById(R.id.snap_to_road_image_button).setVisibility(View.GONE);
mainView.findViewById(R.id.snap_to_road_progress_bar).setVisibility(View.GONE);
markersLayer.clearRoute();
mapActivity.refreshMap();
}
}
private void updateText() {
distanceTv.setText("1.39 km,");
timeTv.setText("~ 45 min.");
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
boolean defaultMode = appMode.getStringKey().equals(ApplicationMode.DEFAULT.getStringKey());
float dist = 0;
Location myLoc = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
boolean useLocation = myLoc != null && mapActivity.getMyApplication().getSettings().ROUTE_MAP_MARKERS_START_MY_LOC.get();
List<LatLon> markers = markersHelper.getSelectedMarkersLatLon();
if (useLocation ? markers.size() > 0 : markers.size() > 1) {
if (useLocation) {
dist += MapUtils.getDistance(myLoc.getLatitude(), myLoc.getLongitude(),
markers.get(0).getLatitude(), markers.get(0).getLongitude());
}
for (int i = 1; i < markers.size(); i++) {
dist += MapUtils.getDistance(markers.get(i - 1), markers.get(i));
}
}
distanceTv.setText(OsmAndFormatter.getFormattedDistance(dist, mapActivity.getMyApplication()) + (defaultMode ? "" : ","));
if (defaultMode) {
timeTv.setText("");
} else {
int seconds = (int) (dist / appMode.getDefaultSpeed());
timeTv.setText("~ " + OsmAndFormatter.getFormattedDuration(seconds, mapActivity.getMyApplication()));
}
countTv.setText(mapActivity.getString(R.string.shared_string_markers) + ": " + selectedCount);
}
}
private void updateSelectButton() {
if (selectedCount == markersHelper.getMapMarkers().size()) {
if (selectedCount == markersHelper.getMapMarkers().size() && markersHelper.isStartFromMyLocation()) {
((TextView) mainView.findViewById(R.id.select_all_button)).setText(getString(R.string.shared_string_deselect_all));
} else {
((TextView) mainView.findViewById(R.id.select_all_button)).setText(getString(R.string.shared_string_select_all));
}
}
private void updateLocationUi() {
final MapActivity mapActivity = (MapActivity) getActivity();
if (mapActivity != null && adapter != null) {
@ -422,7 +513,6 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
MapMarkersLayer markersLayer = getMapMarkersLayer();
if (mapActivity != null && markersLayer != null) {
markersListOpened = true;
markersLayer.setMarkersListOpened(true);
upDownIconIv.setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_down));
View listContainer = mainView.findViewById(R.id.markers_list_container);
if (portrait && listContainer != null) {
@ -432,9 +522,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
}
OsmandMapTileView tileView = mapActivity.getMapView();
previousMapPosition = tileView.getMapPosition();
if (portrait) {
tileView.setMapPosition(MIDDLE_TOP_CONSTANT);
} else {
if (!portrait) {
tileView.setMapPosition(LANDSCAPE_MIDDLE_RIGHT_CONSTANT);
}
mapActivity.refreshMap();
@ -446,7 +534,6 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
MapMarkersLayer markersLayer = getMapMarkersLayer();
if (mapActivity != null && markersLayer != null) {
markersListOpened = false;
markersLayer.setMarkersListOpened(false);
upDownIconIv.setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_up));
View listContainer = mainView.findViewById(R.id.markers_list_container);
if (portrait && listContainer != null) {
@ -506,6 +593,55 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
}
}
private void showMarkersRouteOnMap() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
List<LatLon> points = markersHelper.getSelectedMarkersLatLon();
mapActivity.getMapLayers().getMapMarkersLayer().setRoute(points);
showRouteOnMap(points);
}
}
private void showRouteOnMap(List<LatLon> points) {
MapActivity mapActivity = getMapActivity();
if (points.size() > 0 && mapActivity != null) {
OsmandMapTileView mapView = mapActivity.getMapView();
double left = 0, right = 0;
double top = 0, bottom = 0;
Location myLocation = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
if (mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) {
left = myLocation.getLongitude();
right = myLocation.getLongitude();
top = myLocation.getLatitude();
bottom = myLocation.getLatitude();
}
for (LatLon l : points) {
if (left == 0) {
left = l.getLongitude();
right = l.getLongitude();
top = l.getLatitude();
bottom = l.getLatitude();
} else {
left = Math.min(left, l.getLongitude());
right = Math.max(right, l.getLongitude());
top = Math.max(top, l.getLatitude());
bottom = Math.min(bottom, l.getLatitude());
}
}
RotatedTileBox tb = mapView.getCurrentRotatedTileBox().copy();
int tileBoxWidthPx = 0;
int tileBoxHeightPx = 0;
if (portrait) {
tileBoxHeightPx = 3 * (tb.getPixHeight() - mainView.getHeight() - toolbarHeight) / 4;
} else {
tileBoxWidthPx = tb.getPixWidth() - mainView.findViewById(R.id.up_down_row).getWidth();
}
mapView.fitRectToMap(left, right, top, bottom, tileBoxWidthPx, tileBoxHeightPx, toolbarHeight * 3 / 2);
}
}
public boolean quit(boolean hideMarkersListFirst) {
if (markersListOpened && hideMarkersListFirst) {
hideMarkersList();
@ -520,7 +656,6 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
if (markersListOpened) {
hideMarkersList();
}
markersHelper.deselectAllActiveMarkers();
activity.getSupportFragmentManager().beginTransaction().remove(this).commitAllowingStateLoss();
}

View file

@ -281,7 +281,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
}
} else {
boolean firstItemInDisplayGroup = position - 1 != -1 && getItem(position - 1) instanceof Integer;
boolean lastItemInDisplayGroup = !(getItem(position) instanceof MapMarker);
boolean lastItemInDisplayGroup = position == getItemCount() || !(getItem(position) instanceof MapMarker);
if (firstItemInDisplayGroup && lastItemInDisplayGroup) {
items.remove(position - 1);
}

View file

@ -132,8 +132,10 @@ public class MapMarkersItemTouchHelperCallback extends ItemTouchHelper.Callback
@Override
public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
super.clearView(recyclerView, viewHolder);
if (iconHidden) {
((MapMarkerItemViewHolder) viewHolder).optionsBtn.setVisibility(View.VISIBLE);
iconHidden = false;
}
adapter.onItemDismiss(viewHolder);
}

View file

@ -63,18 +63,22 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
@Override
public void onBindViewHolder(final MapMarkerItemViewHolder holder, int pos) {
boolean night = !mapActivity.getMyApplication().getSettings().isLightContent();
boolean night = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
IconsCache iconsCache = mapActivity.getMyApplication().getIconsCache();
MapMarker marker = markers.get(pos);
holder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, MapMarker.getColorId(marker.colorIndex)));
holder.iconReorder.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_reorder));
holder.iconDirection.setVisibility(View.GONE);
boolean locationItem = pos == 0;
boolean firstMarkerItem = pos == 1;
boolean lastMarkerItem = pos == getItemCount() - 1;
MapMarker marker = locationItem ? null : getItem(pos);
holder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.bg_color_dark : R.color.bg_color_light));
holder.title.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.color_white : R.color.color_black));
holder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.actionbar_dark_color : R.color.dashboard_divider_light));
holder.title.setText(locationItem ? mapActivity.getString(R.string.shared_string_my_location) : marker.getName(mapActivity));
holder.iconDirection.setVisibility(View.GONE);
holder.optionsBtn.setVisibility(View.GONE);
holder.description.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.dash_search_icon_dark : R.color.icon_color));
holder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, night ? R.color.actionbar_dark_color : R.color.dashboard_divider_light));
holder.divider.setVisibility(lastMarkerItem ? View.GONE : View.VISIBLE);
holder.checkBox.setVisibility(View.VISIBLE);
holder.checkBox.setOnClickListener(new View.OnClickListener() {
@Override
@ -82,31 +86,33 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
listener.onItemClick(holder.itemView);
}
});
holder.checkBox.setChecked(marker.selected);
holder.bottomShadow.setVisibility(lastMarkerItem ? View.VISIBLE : View.GONE);
if (pos == 0 || pos == getItemCount() - 1) {
holder.firstDescription.setVisibility(View.VISIBLE);
if (pos == 0) {
holder.topDivider.setVisibility(View.VISIBLE);
holder.firstDescription.setVisibility((firstMarkerItem || lastMarkerItem) ? View.VISIBLE : View.GONE);
if (firstMarkerItem) {
holder.firstDescription.setText(mapActivity.getString(R.string.shared_string_control_start) + "");
} else {
} else if (lastMarkerItem) {
holder.firstDescription.setText(mapActivity.getString(R.string.shared_string_finish) + "");
}
if (locationItem) {
holder.topDivider.setVisibility(View.VISIBLE);
holder.flagIconLeftSpace.setVisibility(View.VISIBLE);
holder.icon.setImageDrawable(ContextCompat.getDrawable(mapActivity, R.drawable.map_pedestrian_location));
holder.point.setVisibility(View.GONE);
holder.checkBox.setChecked(mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation());
holder.iconReorder.setVisibility(View.GONE);
holder.description.setVisibility(View.GONE);
holder.distance.setVisibility(View.GONE);
} else {
holder.firstDescription.setVisibility(View.GONE);
holder.topDivider.setVisibility(View.GONE);
}
if (pos == getItemCount() - 1) {
holder.bottomShadow.setVisibility(View.VISIBLE);
holder.divider.setVisibility(View.GONE);
} else {
holder.bottomShadow.setVisibility(View.GONE);
holder.divider.setVisibility(View.VISIBLE);
}
holder.flagIconLeftSpace.setVisibility(View.GONE);
holder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, MapMarker.getColorId(marker.colorIndex)));
holder.point.setVisibility(View.VISIBLE);
holder.checkBox.setChecked(marker.selected);
holder.iconReorder.setVisibility(View.VISIBLE);
holder.iconReorder.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_reorder));
holder.iconReorder.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent event) {
@ -117,8 +123,8 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
}
});
holder.title.setText(marker.getName(mapActivity));
holder.description.setVisibility(View.VISIBLE);
holder.description.setTextColor(ContextCompat.getColor(mapActivity, night ? R.color.dash_search_icon_dark : R.color.icon_color));
String descr;
if ((descr = marker.groupName) != null) {
if (descr.equals("")) {
@ -136,6 +142,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
holder.description.setText(descr);
if (location != null) {
holder.distance.setVisibility(View.VISIBLE);
holder.distance.setTextColor(ContextCompat.getColor(mapActivity, useCenter
? R.color.color_distance : R.color.color_myloc_distance));
float dist = (float) MapUtils.getDistance(location.getLatitude(), location.getLongitude(),
@ -143,14 +150,15 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
holder.distance.setText(OsmAndFormatter.getFormattedDistance(dist, mapActivity.getMyApplication()));
}
}
}
@Override
public int getItemCount() {
return markers.size();
return markers.size() + 1;
}
public MapMarker getItem(int position) {
return markers.get(position);
return markers.get(position - 1);
}
@Override
@ -160,7 +168,10 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
@Override
public boolean onItemMove(int from, int to) {
Collections.swap(markers, from, to);
if (to == 0) {
return false;
}
Collections.swap(markers, from - 1, to - 1);
notifyItemMoved(from, to);
return true;
}

View file

@ -11,7 +11,6 @@ import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
@ -36,11 +35,16 @@ public class SnapToRoadBottomSheetDialogFragment extends android.support.design.
private boolean nightMode;
private boolean portrait;
private boolean snapToRoadEnabled;
private boolean removeDefaultMode = true;
public void setListener(SnapToRoadFragmentListener listener) {
this.listener = listener;
}
public void setRemoveDefaultMode(boolean removeDefaultMode) {
this.removeDefaultMode = removeDefaultMode;
}
@Override
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
@ -73,7 +77,9 @@ public class SnapToRoadBottomSheetDialogFragment extends android.support.design.
LinearLayout container = (LinearLayout) mainView.findViewById(R.id.navigation_types_container);
final List<ApplicationMode> modes = new ArrayList<>(ApplicationMode.values(settings));
if (removeDefaultMode) {
modes.remove(ApplicationMode.DEFAULT);
}
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override

View file

@ -727,8 +727,8 @@ public class MapControlsLayer extends OsmandMapLayer {
routePlanningBtn.updateVisibility(showButtons);
menuControl.updateVisibility(showButtons);
mapZoomIn.updateVisibility(!routeDialogOpened && !isInExpandedRouteMode());
mapZoomOut.updateVisibility(!routeDialogOpened && !isInExpandedRouteMode());
mapZoomIn.updateVisibility(!routeDialogOpened);
mapZoomOut.updateVisibility(!routeDialogOpened);
compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass()
&& !isInMeasurementToolMode() && !isInPlanRouteMode());
@ -814,7 +814,7 @@ public class MapControlsLayer extends OsmandMapLayer {
backToLocationControl.iv.setContentDescription(mapActivity.getString(R.string.map_widget_back_to_loc));
}
boolean visible = !(tracked && rh.isFollowingMode());
backToLocationControl.updateVisibility(visible && !dialogOpened && !isInExpandedRouteMode());
backToLocationControl.updateVisibility(visible && !dialogOpened);
if (app.accessibilityEnabled()) {
backToLocationControl.iv.setClickable(enabled && visible);
}
@ -1136,10 +1136,6 @@ public class MapControlsLayer extends OsmandMapLayer {
return mapActivity.getMapLayers().getMapMarkersLayer().isInPlanRouteMode();
}
private boolean isInExpandedRouteMode() {
return mapActivity.getMapLayers().getMapMarkersLayer().isMarkersListOpened();
}
public static View.OnLongClickListener getOnClickMagnifierListener(final OsmandMapTileView view) {
return new View.OnLongClickListener() {

View file

@ -69,7 +69,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
private float[] calculations = new float[2];
private final RenderingLineAttributes lineAttrs = new RenderingLineAttributes("measureDistanceLine");
private final RenderingLineAttributes textAttrs = new RenderingLineAttributes("rulerCircle");
private final RenderingLineAttributes textAttrs = new RenderingLineAttributes("rulerLineFont");
private Paint paint;
private Path path;
private List<LatLon> route = new ArrayList<>();
@ -77,12 +77,10 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
private TIntArrayList tx = new TIntArrayList();
private TIntArrayList ty = new TIntArrayList();
private Path linePath = new Path();
private String distanceText;
private ContextMenuLayer contextMenuLayer;
private boolean inPlanRouteMode;
private boolean markersListOpened;
public MapMarkersLayer(MapActivity map) {
this.map = map;
@ -100,14 +98,6 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
this.inPlanRouteMode = inPlanRouteMode;
}
public boolean isMarkersListOpened() {
return inPlanRouteMode && markersListOpened;
}
public void setMarkersListOpened(boolean markersListOpened) {
this.markersListOpened = markersListOpened;
}
private void initUI() {
bitmapPaint = new Paint();
bitmapPaint.setDither(true);
@ -141,8 +131,8 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
paint.setAlpha(200);
float textSize = TEXT_SIZE * map.getResources().getDisplayMetrics().density;
textAttrs.paint.setTextSize(textSize);
textAttrs.paint2.setTextSize(textSize);
textAttrs.paint3.setTextSize(textSize);
widgetsFactory = new MapMarkersWidgetsFactory(map);
@ -219,25 +209,18 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
}
@Override
public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) {
Location myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
widgetsFactory.updateInfo(myLoc == null
? tileBox.getCenterLatLon() : new LatLon(myLoc.getLatitude(), myLoc.getLongitude()), tileBox.getZoom());
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) {
OsmandSettings settings = map.getMyApplication().getSettings();
if (tileBox.getZoom() < 3 || !settings.USE_MAP_MARKERS.get()) {
return;
}
Location myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
if (route.size() > 0) {
path.reset();
boolean first = true;
Location myLocation = map.getMapViewTrackingUtilities().getMyLocation();
if (markersHelper.isStartFromMyLocation() && myLocation != null) {
int locationX = tileBox.getPixXFromLonNoRot(myLocation.getLongitude());
int locationY = tileBox.getPixYFromLatNoRot(myLocation.getLatitude());
if (markersHelper.isStartFromMyLocation() && myLoc != null) {
int locationX = tileBox.getPixXFromLonNoRot(myLoc.getLongitude());
int locationY = tileBox.getPixYFromLatNoRot(myLoc.getLatitude());
path.moveTo(locationX, locationY);
first = false;
}
@ -254,12 +237,10 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
canvas.drawPath(path, paint);
}
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
if (settings.SHOW_LINES_TO_FIRST_MARKERS.get() && myLoc != null) {
lineAttrs.updatePaints(view, nightMode, tileBox);
textAttrs.updatePaints(view, nightMode, tileBox);
textAttrs.paint2.setStyle(Paint.Style.FILL);
textAttrs.paint.setStyle(Paint.Style.FILL);
int locX = (int) tileBox.getPixXFromLatLon(myLoc.getLatitude(), myLoc.getLongitude());
int locY = (int) tileBox.getPixYFromLatLon(myLoc.getLatitude(), myLoc.getLongitude());
@ -286,6 +267,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
float generalDist = (float) MapUtils.getDistance(myLoc.getLatitude(), myLoc.getLongitude(), marker.getLatitude(), marker.getLongitude());
String generalDistSt = OsmAndFormatter.getFormattedDistance(generalDist, view.getApplication());
boolean locationInvisible = locX < 0 || locX > tileBox.getPixWidth() || locY < 0 || locY > tileBox.getPixHeight();
String distanceText;
if (locationInvisible) {
float centerToMarkerDist = (float) MapUtils.getDistance(tileBox.getLatLonFromPixel(pos[0], pos[1]), marker.getLatitude(), marker.getLongitude());
String centerToMarkerDistSt = OsmAndFormatter.getFormattedDistance(centerToMarkerDist, view.getApplication());
@ -298,7 +280,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
distanceText = generalDistSt;
}
Rect bounds = new Rect();
textAttrs.paint2.getTextBounds(distanceText, 0, distanceText.length(), bounds);
textAttrs.paint.getTextBounds(distanceText, 0, distanceText.length(), bounds);
float hOffset = pm.getLength() / 2 - bounds.width() / 2;
lineAttrs.paint.setColor(colors[marker.colorIndex]);
@ -309,18 +291,32 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
}
if (locX >= markerX) {
canvas.rotate(180, pos[0], pos[1]);
canvas.drawTextOnPath(distanceText, linePath, hOffset, bounds.height() + VERTICAL_OFFSET, textAttrs.paint3);
canvas.drawTextOnPath(distanceText, linePath, hOffset, bounds.height() + VERTICAL_OFFSET, textAttrs.paint2);
canvas.drawTextOnPath(distanceText, linePath, hOffset, bounds.height() + VERTICAL_OFFSET, textAttrs.paint);
canvas.rotate(-180, pos[0], pos[1]);
} else {
canvas.drawTextOnPath(distanceText, linePath, hOffset, -VERTICAL_OFFSET, textAttrs.paint3);
canvas.drawTextOnPath(distanceText, linePath, hOffset, -VERTICAL_OFFSET, textAttrs.paint2);
canvas.drawTextOnPath(distanceText, linePath, hOffset, -VERTICAL_OFFSET, textAttrs.paint);
}
canvas.rotate(tileBox.getRotate(), tileBox.getCenterPixelX(), tileBox.getCenterPixelY());
}
}
}
for (MapMarker marker : activeMapMarkers) {
@Override
public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) {
Location myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
widgetsFactory.updateInfo(myLoc == null
? tileBox.getCenterLatLon() : new LatLon(myLoc.getLatitude(), myLoc.getLongitude()), tileBox.getZoom());
OsmandSettings settings = map.getMyApplication().getSettings();
if (tileBox.getZoom() < 3 || !settings.USE_MAP_MARKERS.get()) {
return;
}
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
for (MapMarker marker : markersHelper.getMapMarkers()) {
if (isLocationVisible(tileBox, marker) && !overlappedByWaypoint(marker)
&& !isInMotion(marker)) {
Bitmap bmp = getMapMarkerBitmap(marker.colorIndex);
@ -336,9 +332,8 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
if (settings.SHOW_ARROWS_TO_FIRST_MARKERS.get()) {
LatLon loc = tileBox.getCenterLatLon();
List<MapMarker> mapMarkers = markersHelper.getMapMarkers();
int i = 0;
for (MapMarker marker : mapMarkers) {
for (MapMarker marker : markersHelper.getMapMarkers()) {
if (!isLocationVisible(tileBox, marker) && !isInMotion(marker)) {
canvas.save();
net.osmand.Location.distanceBetween(loc.getLatitude(), loc.getLongitude(),
@ -414,12 +409,12 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
@Override
public boolean disableSingleTap() {
return false;
return inPlanRouteMode;
}
@Override
public boolean disableLongPressOnMap() {
return false;
return inPlanRouteMode;
}
@Override

View file

@ -41,6 +41,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
private final ContextMenuLayer contextMenuLayer;
private final MeasurementToolLayer measurementToolLayer;
private final MapMarkersLayer mapMarkersLayer;
private ImageView contextMarker;
private final MapActivity mapActivity;
private final OsmandApplication app;
@ -66,6 +67,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
settings = activity.getMyApplication().getSettings();
quickActionRegistry = activity.getMapLayers().getQuickActionRegistry();
measurementToolLayer = mapActivity.getMapLayers().getMeasurementToolLayer();
mapMarkersLayer = mapActivity.getMapLayers().getMapMarkersLayer();
}
@ -323,6 +325,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
contextMenuLayer.isInChangeMarkerPositionMode() ||
contextMenuLayer.isInGpxDetailsMode() ||
measurementToolLayer.isInMeasurementMode() ||
mapMarkersLayer.isInPlanRouteMode() ||
mapActivity.getContextMenu().isVisible() && !mapActivity.getContextMenu().findMenuFragment().get().isRemoving() ||
mapActivity.getContextMenu().isVisible() && mapActivity.getContextMenu().findMenuFragment().get().isAdded() ||
mapActivity.getContextMenu().getMultiSelectionMenu().isVisible() && mapActivity.getContextMenu().getMultiSelectionMenu().getFragmentByTag().isAdded() ||

View file

@ -76,10 +76,9 @@ public class RulerControlLayer extends OsmandMapLayer {
private Bitmap centerIconNight;
private Paint bitmapPaint;
private RenderingLineAttributes lineAttrs;
private RenderingLineAttributes lineFontAttrs;
private RenderingLineAttributes circleAttrs;
private RenderingLineAttributes circleAttrsAlt;
private float circleTextSize;
private float lineTextSize;
private Handler handler;
@ -122,8 +121,12 @@ public class RulerControlLayer extends OsmandMapLayer {
lineAttrs = new RenderingLineAttributes("rulerLine");
circleTextSize = TEXT_SIZE * mapActivity.getResources().getDisplayMetrics().density;
lineTextSize = DISTANCE_TEXT_SIZE * mapActivity.getResources().getDisplayMetrics().density;
float circleTextSize = TEXT_SIZE * mapActivity.getResources().getDisplayMetrics().density;
float lineTextSize = DISTANCE_TEXT_SIZE * mapActivity.getResources().getDisplayMetrics().density;
lineFontAttrs = new RenderingLineAttributes("rulerLineFont");
lineFontAttrs.paint.setTextSize(lineTextSize);
lineFontAttrs.paint2.setTextSize(lineTextSize);
circleAttrs = new RenderingLineAttributes("rulerCircle");
circleAttrs.paint2.setTextSize(circleTextSize);
@ -179,6 +182,8 @@ public class RulerControlLayer extends OsmandMapLayer {
public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {
if (rulerModeOn()) {
lineAttrs.updatePaints(view, settings, tb);
lineFontAttrs.updatePaints(view, settings, tb);
lineFontAttrs.paint.setStyle(Style.FILL);
circleAttrs.updatePaints(view, settings, tb);
circleAttrs.paint2.setStyle(Style.FILL);
circleAttrsAlt.updatePaints(view, settings, tb);
@ -221,14 +226,7 @@ public class RulerControlLayer extends OsmandMapLayer {
}
if (mode == RulerMode.FIRST || mode == RulerMode.SECOND) {
updateData(tb, center);
RenderingLineAttributes attrs;
if (mode == RulerMode.FIRST) {
circleAttrs.paint2.setTextSize(circleTextSize);
circleAttrs.paint3.setTextSize(circleTextSize);
attrs = circleAttrs;
} else {
attrs = circleAttrsAlt;
}
RenderingLineAttributes attrs = mode == RulerMode.FIRST ? circleAttrs : circleAttrsAlt;
for (int i = 1; i <= cacheDistances.size(); i++) {
drawCircle(canvas, tb, i, center, attrs);
}
@ -268,22 +266,19 @@ public class RulerControlLayer extends OsmandMapLayer {
private void drawTextOnCenterOfPath(Canvas canvas, float x1, float x2, Path path, String text) {
PathMeasure pm = new PathMeasure(path, false);
Rect bounds = new Rect();
circleAttrs.paint2.getTextBounds(text, 0, text.length(), bounds);
lineFontAttrs.paint.getTextBounds(text, 0, text.length(), bounds);
float hOffset = pm.getLength() / 2 - bounds.width() / 2;
circleAttrs.paint2.setTextSize(lineTextSize);
circleAttrs.paint3.setTextSize(lineTextSize);
if (x1 >= x2) {
float[] pos = new float[2];
pm.getPosTan(pm.getLength() / 2, pos, null);
canvas.rotate(180, pos[0], pos[1]);
canvas.drawTextOnPath(text, path, hOffset, bounds.height() + VERTICAL_OFFSET, circleAttrs.paint3);
canvas.drawTextOnPath(text, path, hOffset, bounds.height() + VERTICAL_OFFSET, circleAttrs.paint2);
canvas.drawTextOnPath(text, path, hOffset, bounds.height() + VERTICAL_OFFSET, lineFontAttrs.paint2);
canvas.drawTextOnPath(text, path, hOffset, bounds.height() + VERTICAL_OFFSET, lineFontAttrs.paint);
canvas.rotate(-180, pos[0], pos[1]);
} else {
canvas.drawTextOnPath(text, path, hOffset, -VERTICAL_OFFSET, circleAttrs.paint3);
canvas.drawTextOnPath(text, path, hOffset, -VERTICAL_OFFSET, circleAttrs.paint2);
canvas.drawTextOnPath(text, path, hOffset, -VERTICAL_OFFSET, lineFontAttrs.paint2);
canvas.drawTextOnPath(text, path, hOffset, -VERTICAL_OFFSET, lineFontAttrs.paint);
}
}