Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a84d3b70fa
34 changed files with 1886 additions and 1116 deletions
11
OsmAnd/res/drawable/bg_coordinate_input_keyboard_dark.xml
Normal file
11
OsmAnd/res/drawable/bg_coordinate_input_keyboard_dark.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<nine-patch android:src="@drawable/bg_contextmenu_shadow_top_light" />
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/ctx_menu_buttons_divider_dark" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/keyboard_item_control_dark_bg_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_control_dark_bg"/>
|
||||
</selector>
|
||||
<item android:drawable="@color/keyboard_item_pressed_bg" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_control_dark_bg"/>
|
||||
</selector>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/keyboard_item_control_light_bg_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_control_light_bg"/>
|
||||
</selector>
|
||||
<item android:drawable="@color/keyboard_item_pressed_bg" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_control_light_bg"/>
|
||||
</selector>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/keyboard_item_dark_bg_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_pressed_bg" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_dark_bg"/>
|
||||
</selector>
|
||||
</selector>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/keyboard_item_light_bg_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_pressed_bg" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/keyboard_item_light_bg"/>
|
||||
</selector>
|
||||
</selector>
|
||||
|
|
|
@ -1,131 +1,115 @@
|
|||
<?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">
|
||||
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="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/route_info_bottom_view_bg_dark">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/coordinate_input_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
osmand:contentInsetLeft="4dp"
|
||||
osmand:contentInsetStart="4dp"
|
||||
osmand:contentInsetRight="16dp"
|
||||
osmand:contentInsetEnd="16dp">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/coordinate_input_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
osmand:contentInsetEnd="0dp"
|
||||
osmand:contentInsetLeft="4dp"
|
||||
osmand:contentInsetRight="0dp"
|
||||
osmand:contentInsetStart="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
style="@style/Widget.AppCompat.ActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_arrow_back"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp"/>
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
style="@style/Widget.AppCompat.ActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:src="@drawable/ic_arrow_back"/>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"/>
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/toolbar_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/coordinates"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:textColor="@color/color_white"/>
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:theme="@style/OsmandTextFieldBoxes"
|
||||
android:id="@+id/latitude_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
osmand:labelText="@string/navigate_point_latitude"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp">
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/options_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="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:text="@string/shared_string_options"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:textColor="@color/color_white"
|
||||
android:textColorHint="@color/white_50_transparent"
|
||||
android:inputType="numberSigned|numberDecimal"
|
||||
android:imeOptions="actionNext"
|
||||
android:id="@+id/latitude_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:theme="@style/OsmandTextFieldBoxes"
|
||||
android:id="@+id/longitude_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
osmand:labelText="@string/navigate_point_longitude"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp">
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:textColor="@color/color_white"
|
||||
android:textColorHint="@color/white_50_transparent"
|
||||
android:inputType="numberSigned|numberDecimal"
|
||||
android:imeOptions="actionNext"
|
||||
android:id="@+id/longitude_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/hand_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false">
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
<FrameLayout
|
||||
android:id="@+id/left_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:theme="@style/OsmandTextFieldBoxes"
|
||||
android:id="@+id/name_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
osmand:labelText="@string/shared_string_name"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp">
|
||||
<ImageView
|
||||
android:id="@+id/left_shadow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bg_shadow_quick_input_left"/>
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:textColor="@color/color_white"
|
||||
android:textColorHint="@color/white_50_transparent"
|
||||
android:inputType="text"
|
||||
android:imeOptions="actionDone"
|
||||
android:id="@+id/name_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/access_hint_enter_name"/>
|
||||
</FrameLayout>
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
<FrameLayout
|
||||
android:id="@+id/right_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/options_button"
|
||||
style="@style/Widget.AppCompat.ActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_overflow_menu_white"/>
|
||||
<ImageView
|
||||
android:id="@+id/right_shadow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bg_shadow_quick_input_right"/>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/hand_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/keyboard_item_top_spacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.35"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:id="@+id/keyboard_item_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.3"
|
||||
android:gravity="center"
|
||||
android:textAllCaps="true"
|
||||
tools:text="3"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/keyboard_item_bottom_spacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.35"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/keyboard_item_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_action_backspace_fill"/>
|
||||
|
||||
</LinearLayout>
|
44
OsmAnd/res/layout/bottom_sheet_item_with_radio_btn.xml
Normal file
44
OsmAnd/res/layout/bottom_sheet_item_with_radio_btn.xml
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?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: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/content_padding_small"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding_small"
|
||||
android:paddingStart="@dimen/content_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_iv"
|
||||
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/name_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||
tools:text="@string/dd_mm_mmm_format"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:saveEnabled="false"/>
|
||||
|
||||
</LinearLayout>
|
360
OsmAnd/res/layout/coordinate_input_data_area.xml
Normal file
360
OsmAnd/res/layout/coordinate_input_data_area.xml
Normal file
|
@ -0,0 +1,360 @@
|
|||
<?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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/ctx_menu_bg_dark">
|
||||
|
||||
<View
|
||||
android:id="@+id/input_area_top_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/content_padding"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!-- Latitude row: -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lat_side_of_the_world_btn"
|
||||
android:layout_width="@dimen/side_of_the_world_button_size"
|
||||
android:layout_height="@dimen/side_of_the_world_button_size"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
tools:background="@drawable/context_menu_controller_bg_dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/south_side_iv"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="-12dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_action_coordinates_longitude"
|
||||
tools:tint="@color/dashboard_blue"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lat_side_of_the_world_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textStyle="bold"
|
||||
tools:text="N"
|
||||
tools:textColor="@color/dashboard_blue"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/north_side_iv"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="-12dp"
|
||||
tools:src="@drawable/ic_action_coordinates_longitude"
|
||||
tools:tint="@color/dashboard_blue"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/navigate_point_latitude"
|
||||
android:textColor="@color/ctx_menu_bottom_view_secondary_text_color_light"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/lat_first_input_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
android:theme="@style/CoordinateInputEditText"
|
||||
tools:hint="xx"
|
||||
tools:maxLength="2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lat_first_separator_tv"
|
||||
android:layout_width="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@color/ctx_menu_bottom_view_secondary_text_color_light"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
tools:text="°"/>
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/lat_second_input_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
android:theme="@style/CoordinateInputEditText"
|
||||
tools:hint="xx"
|
||||
tools:maxLength="2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lat_second_separator_tv"
|
||||
android:layout_width="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@color/ctx_menu_bottom_view_secondary_text_color_light"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
tools:text="."/>
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/lat_third_input_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
android:theme="@style/CoordinateInputEditText"
|
||||
tools:hint="xxxx"
|
||||
tools:maxLength="4"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lat_backspace_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/text_margin_small"
|
||||
android:layout_marginLeft="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_marginRight="@dimen/text_margin_small"
|
||||
android:layout_marginStart="@dimen/context_menu_padding_margin_large"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="@dimen/content_padding_small"
|
||||
tools:src="@drawable/ic_keyboard_backspace"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/lat_end_padding"
|
||||
android:layout_width="@dimen/content_padding"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Longitude row: -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/content_padding_small"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lon_side_of_the_world_btn"
|
||||
android:layout_width="@dimen/side_of_the_world_button_size"
|
||||
android:layout_height="@dimen/side_of_the_world_button_size"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:animateLayoutChanges="true"
|
||||
tools:background="@drawable/context_menu_controller_bg_dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/east_side_iv"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="-12dp"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_action_coordinates_latitude"
|
||||
tools:tint="@color/dashboard_blue"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lon_side_of_the_world_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textStyle="bold"
|
||||
tools:text="W"
|
||||
tools:textColor="@color/dashboard_blue"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/west_side_iv"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="-12dp"
|
||||
android:layout_marginRight="-12dp"
|
||||
tools:src="@drawable/ic_action_coordinates_latitude"
|
||||
tools:tint="@color/dashboard_blue"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/navigate_point_longitude"
|
||||
android:textColor="@color/ctx_menu_bottom_view_secondary_text_color_light"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/lon_first_input_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
android:theme="@style/CoordinateInputEditText"
|
||||
tools:hint="yy"
|
||||
tools:maxLength="2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lon_first_separator_tv"
|
||||
android:layout_width="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@color/ctx_menu_bottom_view_secondary_text_color_light"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
tools:text="°"/>
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/lon_second_input_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
android:theme="@style/CoordinateInputEditText"
|
||||
tools:hint="yy"
|
||||
tools:maxLength="2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lon_second_separator_tv"
|
||||
android:layout_width="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="@color/ctx_menu_bottom_view_secondary_text_color_light"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
tools:text="."/>
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/lon_third_input_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
android:theme="@style/CoordinateInputEditText"
|
||||
tools:hint="yyyy"
|
||||
tools:maxLength="4"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lon_backspace_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/text_margin_small"
|
||||
android:layout_marginLeft="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_marginRight="@dimen/text_margin_small"
|
||||
android:layout_marginStart="@dimen/context_menu_padding_margin_large"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="@dimen/content_padding_small"
|
||||
tools:src="@drawable/ic_keyboard_backspace"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/lon_end_padding"
|
||||
android:layout_width="@dimen/content_padding"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Point name row: -->
|
||||
|
||||
<View
|
||||
android:id="@+id/point_name_top_space"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/point_name_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="@dimen/content_padding"
|
||||
android:background="@color/route_info_divider_dark"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/point_name_et_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||
tools:background="@color/route_info_bottom_view_bg_dark">
|
||||
|
||||
<net.osmand.plus.widgets.EditTextEx
|
||||
android:id="@+id/point_name_et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="@string/optional_point_name"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/point_name_keyboard_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/text_margin_small"
|
||||
android:layout_marginLeft="@dimen/context_menu_padding_margin_large"
|
||||
android:layout_marginRight="@dimen/text_margin_small"
|
||||
android:layout_marginStart="@dimen/context_menu_padding_margin_large"
|
||||
android:padding="@dimen/content_padding_small"
|
||||
tools:src="@drawable/ic_action_keyboard"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
202
OsmAnd/res/layout/coordinate_input_keyboard.xml
Normal file
202
OsmAnd/res/layout/coordinate_input_keyboard.xml
Normal file
|
@ -0,0 +1,202 @@
|
|||
<?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:id="@+id/keyboard_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/keyboard_divider_dark">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_1"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_4"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_2"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_5"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_3"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_6"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_next_field"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false">
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_7"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_8"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_0"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_9"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_clear"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/coords_input_keyboard_item_height"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/keyboard_item_backspace"
|
||||
layout="@layout/coordinate_input_keyboard_item"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,9 +1,11 @@
|
|||
<?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:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/keyboard_item_dark_bg">
|
||||
|
||||
<View
|
||||
android:id="@+id/keyboard_item_top_spacing"
|
||||
|
@ -35,4 +37,4 @@
|
|||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_action_backspace_fill"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
78
OsmAnd/res/layout/coordinate_input_land_data_area.xml
Normal file
78
OsmAnd/res/layout/coordinate_input_land_data_area.xml
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?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:id="@+id/data_area"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"
|
||||
android:orientation="vertical"
|
||||
tools:layout_width="match_parent">
|
||||
|
||||
<include
|
||||
layout="@layout/coordinate_input_data_area"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/keyboard_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/keyboard_controls_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_controls_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/show_hide_keyboard_icon_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginLeft="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginStart="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginTop="@dimen/route_info_button_go_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="@dimen/coords_input_show_hide_keyboard_btn_padding"
|
||||
android:paddingRight="@dimen/coords_input_show_hide_keyboard_btn_padding"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_action_keyboard_hide"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:id="@+id/add_marker_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="@dimen/route_info_button_go_margin"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="@string/shared_string_add"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/keyboard_item_button_text_color"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textStyle="bold"
|
||||
tools:background="@drawable/route_info_go_btn_bg_dark"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/show_hide_keyboard_icon_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginEnd="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginRight="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginTop="@dimen/route_info_button_go_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingLeft="@dimen/coords_input_show_hide_keyboard_btn_padding"
|
||||
android:paddingRight="@dimen/coords_input_show_hide_keyboard_btn_padding"
|
||||
tools:src="@drawable/ic_action_keyboard_hide"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5"
|
||||
tools:layout_width="match_parent">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/markers_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="72dp"
|
||||
android:paddingTop="16dp"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/keyboard_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<include layout="@layout/coordinate_input_keyboard"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
android:layout_weight="0.55"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/map_markers_layout"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"/>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
osmand:cardUseCompatPadding="true"
|
||||
osmand:cardCornerRadius="2dp">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:id="@+id/markers_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v4.widget.NestedScrollView>
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
android:layout_weight="0.45"
|
||||
android:id="@+id/keyboard_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<GridView
|
||||
android:id="@+id/keyboard_grid_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="53dp"
|
||||
android:horizontalSpacing="1dp"
|
||||
android:numColumns="4"
|
||||
android:stretchMode="columnWidth"
|
||||
android:verticalSpacing="1dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:id="@+id/keyboard_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/keyboard_controls_divider"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:id="@+id/add_marker_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="@string/shared_string_add"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/keyboard_item_button_text_color"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
|
@ -1,235 +1,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
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"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
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="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/route_info_bg_dark">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/coordinate_input_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||
osmand:contentInsetLeft="4dp"
|
||||
osmand:contentInsetStart="4dp"
|
||||
osmand:contentInsetRight="0dp"
|
||||
osmand:contentInsetEnd="0dp">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/coordinate_input_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||
osmand:contentInsetEnd="0dp"
|
||||
osmand:contentInsetLeft="4dp"
|
||||
osmand:contentInsetRight="0dp"
|
||||
osmand:contentInsetStart="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
style="@style/Widget.AppCompat.ActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_arrow_back"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp"/>
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
style="@style/Widget.AppCompat.ActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
tools:src="@drawable/ic_arrow_back"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/coordinates"
|
||||
android:textColor="@color/color_white"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
android:textSize="@dimen/dialog_header_text_size"/>
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/toolbar_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/coordinates"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:textColor="@color/color_white"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:id="@+id/options_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/shared_string_options"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
android:textAllCaps="true"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="@color/color_white"
|
||||
android:background="?attr/selectableItemBackground"/>
|
||||
</LinearLayout>
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/options_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="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:text="@string/shared_string_options"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/dashboard_blue"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<LinearLayout
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<include layout="@layout/coordinate_input_data_area"/>
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:theme="@style/OsmandTextFieldBoxes"
|
||||
android:id="@+id/latitude_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:labelText="@string/navigate_point_latitude"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:textColor="@color/color_white"
|
||||
android:textColorHint="@color/white_50_transparent"
|
||||
android:inputType="numberSigned|numberDecimal"
|
||||
android:imeOptions="actionNext"
|
||||
android:id="@+id/latitude_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/markers_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="72dp"
|
||||
android:paddingTop="16dp"/>
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
</LinearLayout>
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:theme="@style/OsmandTextFieldBoxes"
|
||||
android:id="@+id/longitude_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:labelText="@string/navigate_point_longitude">
|
||||
<LinearLayout
|
||||
android:id="@+id/keyboard_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:textColor="@color/color_white"
|
||||
android:textColorHint="@color/white_50_transparent"
|
||||
android:inputType="numberSigned|numberDecimal"
|
||||
android:imeOptions="actionNext"
|
||||
android:id="@+id/longitude_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<include layout="@layout/coordinate_input_keyboard"/>
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
<View
|
||||
android:id="@+id/keyboard_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
tools:background="@color/keyboard_divider_dark"/>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_controls_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp">
|
||||
|
||||
<LinearLayout
|
||||
android:padding="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:id="@+id/add_marker_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginLeft="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginStart="@dimen/route_info_button_go_margin"
|
||||
android:layout_marginTop="@dimen/route_info_button_go_margin"
|
||||
android:layout_weight="3"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="@string/shared_string_add"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/keyboard_item_button_text_color"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textStyle="bold"
|
||||
tools:background="@drawable/route_info_go_btn_bg_dark"/>
|
||||
|
||||
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||
android:theme="@style/OsmandTextFieldBoxes"
|
||||
android:id="@+id/name_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:labelText="@string/shared_string_name"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
<ImageView
|
||||
android:id="@+id/show_hide_keyboard_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="@dimen/route_info_button_go_margin"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_action_keyboard_hide"/>
|
||||
|
||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||
android:textColor="@color/color_white"
|
||||
android:textColorHint="@color/white_50_transparent"
|
||||
android:inputType="text"
|
||||
android:imeOptions="actionDone"
|
||||
android:hint="@string/access_hint_enter_name"
|
||||
android:id="@+id/name_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="72dp"
|
||||
android:id="@+id/markers_recycler_view"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/keyboard_layout"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<GridView
|
||||
android:id="@+id/keyboard_grid_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:horizontalSpacing="1dp"
|
||||
android:verticalSpacing="1dp"
|
||||
android:stretchMode="columnWidth"
|
||||
android:numColumns="4"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/keyboard_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/keyboard_controls_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:id="@+id/add_marker_button"
|
||||
android:textAllCaps="true"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/keyboard_item_button_text_color"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:text="@string/shared_string_add"/>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/keyboard_controls_divider"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/show_hide_keyboard_icon"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_action_arrow_down"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<?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">
|
||||
<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"
|
||||
|
@ -54,6 +55,8 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
|
@ -94,6 +97,8 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
|
@ -101,15 +106,15 @@
|
|||
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
android:id="@+id/hand_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:textColor="@color/map_widget_blue_pressed"
|
||||
tools:text="Right"/>
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="Right"
|
||||
tools:textColor="@color/map_widget_blue_pressed"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
|
@ -117,108 +122,22 @@
|
|||
android:layout_height="1dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/go_to_next_field_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/content_padding"
|
||||
android:paddingRight="@dimen/content_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/go_to_next_field_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
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/go_to_next_field"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/go_to_next_field_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>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/coordinate_input_accuracy_descr"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_sheet_descr_height"
|
||||
android:paddingEnd="@dimen/content_padding"
|
||||
android:paddingLeft="@dimen/bottom_sheet_divider_margin_start"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingStart="@dimen/bottom_sheet_divider_margin_start"
|
||||
android:paddingTop="@dimen/content_padding_small"
|
||||
android:text="@string/coordinates_format"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
tools:text="@string/coordinate_input_accuracy_description"/>
|
||||
android:textSize="@dimen/default_desc_text_size"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/accuracy_row"
|
||||
android:id="@+id/formats_container"
|
||||
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/content_padding"
|
||||
android:paddingLeft="@dimen/bottom_sheet_divider_margin_start"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingStart="@dimen/bottom_sheet_divider_margin_start">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||
android:text="@string/digits_quantity"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/selected_accuracy_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="00:00.0"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/selected_accuracy"
|
||||
tools:text="1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/accuracy_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:src="@drawable/ic_action_arrow_drop_down"/>
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -246,4 +165,4 @@
|
|||
android:textStyle="bold"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -9,4 +9,6 @@
|
|||
<dimen name="empty_state_image_margin_bottom">39dp</dimen>
|
||||
|
||||
<dimen name="measurement_tool_content_padding_medium">14dp</dimen>
|
||||
|
||||
<dimen name="coords_input_keyboard_item_height">50dp</dimen>
|
||||
</resources>
|
|
@ -187,4 +187,8 @@
|
|||
<dimen name="grid_menu_item_sides_margin">60dp</dimen>
|
||||
|
||||
<dimen name="bottom_sheet_menu_peek_height">450dp</dimen>
|
||||
|
||||
<dimen name="side_of_the_world_button_size">54dp</dimen>
|
||||
|
||||
<dimen name="coords_input_show_hide_keyboard_btn_padding">19dp</dimen>
|
||||
</resources>
|
|
@ -32,8 +32,9 @@
|
|||
|
||||
<attr name="dashboard_divider" format="reference" />
|
||||
<attr name="dashboard_button" format="reference" />
|
||||
|
||||
|
||||
|
||||
<attr name="coordinate_input_edit_text_normal" format="reference"/>
|
||||
|
||||
<attr name="expandable_category_color" format="reference"/>
|
||||
<attr name="bottomToolBarColor" format="color" />
|
||||
<attr name="downloadButtonBackground" format="reference" />
|
||||
|
|
|
@ -142,6 +142,7 @@
|
|||
<color name="status_bar_route_dark">#000000</color>
|
||||
<color name="status_bar_dim_light">#8a4e00</color>
|
||||
<color name="status_bar_dim_dark">#13171a</color>
|
||||
<color name="status_bar_coordinate_input_dark">#0d0f0f</color>
|
||||
|
||||
|
||||
<color name="color_transparent">#0000</color>
|
||||
|
@ -280,18 +281,15 @@
|
|||
|
||||
<color name="keyboard_item_divider_control_color_light">#727272</color>
|
||||
<color name="keyboard_item_divider_control_color_light_pressed">#ffffff</color>
|
||||
<color name="keyboard_item_divider_control_color_dark">#8899a6</color>
|
||||
<color name="keyboard_item_divider_control_color_dark">#727272</color>
|
||||
<color name="keyboard_item_text_color_light">#333333</color>
|
||||
<color name="keyboard_item_text_color_light_pressed">#ffffff</color>
|
||||
<color name="keyboard_item_text_color_dark">#ffffff</color>
|
||||
<color name="keyboard_item_text_color_dark">#cccccc</color>
|
||||
<color name="keyboard_item_pressed_bg">#536dfe</color>
|
||||
<color name="keyboard_item_light_bg">#fff</color>
|
||||
<color name="keyboard_item_light_bg_pressed">#536dfe</color>
|
||||
<color name="keyboard_item_dark_bg">#1f2326</color>
|
||||
<color name="keyboard_item_dark_bg_pressed">#536dfe</color>
|
||||
<color name="keyboard_item_dark_bg">#17191a</color>
|
||||
<color name="keyboard_item_control_light_bg">#f2f2f2</color>
|
||||
<color name="keyboard_item_control_light_bg_pressed">#536dfe</color>
|
||||
<color name="keyboard_item_control_dark_bg">#191c1e</color>
|
||||
<color name="keyboard_item_control_dark_bg_pressed">#536dfe</color>
|
||||
<color name="keyboard_item_control_dark_bg">#222526</color>
|
||||
<color name="keyboard_item_add_button_light_bg">#536dfe</color>
|
||||
<color name="keyboard_item_add_button_light_bg_pressed">#4b62e3</color>
|
||||
<color name="keyboard_item_add_button_dark_bg">#2d3980</color>
|
||||
|
@ -302,12 +300,15 @@
|
|||
<color name="keyboard_divider_light">#e6e6e6</color>
|
||||
<color name="keyboard_divider_dark">#2a2f33</color>
|
||||
|
||||
<color name="coordinate_input_status_bar_color_light">#4257c9</color>
|
||||
<color name="coordinate_input_status_bar_color_dark">#1b224d</color>
|
||||
<color name="coordinate_input_app_bar_color_light">#536dfe</color>
|
||||
<color name="coordinate_input_app_bar_color_dark">#2d3980</color>
|
||||
<color name="coordinate_input_keyboard_icon_color">#9fadfc</color>
|
||||
<color name="coordinate_input_error_color">#ed5421</color>
|
||||
<color name="coordinate_input_active_icon_dark">#c0c0c0</color>
|
||||
<color name="coordinate_input_edit_text_activated">#ff8800</color>
|
||||
<color name="coordinate_input_edit_text_normal_light">#e6e6e6</color>
|
||||
<color name="coordinate_input_edit_text_normal_dark">#2d3133</color>
|
||||
<color name="coordinate_input_markers_list_bg_dark">#0b0c0d</color>
|
||||
|
||||
<color name="color_osm_edit_create">#78cc5c</color>
|
||||
<color name="color_osm_edit_modify">#fac403</color>
|
||||
|
|
|
@ -260,4 +260,9 @@
|
|||
<dimen name="grid_menu_item_sides_margin">40dp</dimen>
|
||||
|
||||
<dimen name="bottom_sheet_menu_peek_height">300dp</dimen>
|
||||
|
||||
<dimen name="side_of_the_world_button_size">36dp</dimen>
|
||||
|
||||
<dimen name="coords_input_show_hide_keyboard_btn_padding">13dp</dimen>
|
||||
<dimen name="coords_input_keyboard_item_height">56dp</dimen>
|
||||
</resources>
|
|
@ -9,6 +9,16 @@
|
|||
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="dd_mm_ss_format">DD°MM′SS″</string>
|
||||
<string name="dd_dddddd_format">DD.DDDDDD°</string>
|
||||
<string name="dd_ddddd_format">DD.DDDDD°</string>
|
||||
<string name="dd_mm_mmmm_format">DD°MM.MMMM′</string>
|
||||
<string name="dd_mm_mmm_format">DD°MM.MMM′</string>
|
||||
<string name="east_abbreviation">E</string>
|
||||
<string name="west_abbreviation">W</string>
|
||||
<string name="south_abbreviation">S</string>
|
||||
<string name="north_abbreviation">N</string>
|
||||
<string name="optional_point_name">Optional point name</string>
|
||||
<string name="transport_nearby_routes_within">Routes near in</string>
|
||||
<string name="transport_nearby_routes">NEAR</string>
|
||||
<string name="enter_the_file_name">Enter the file name.</string>
|
||||
|
|
|
@ -191,6 +191,8 @@
|
|||
<item name="popupMenuStyle">@style/PopupMenuLight</item>
|
||||
|
||||
<item name="keyboard_controls_divider">@color/keyboard_item_add_button_divider_light</item>
|
||||
|
||||
<item name="coordinate_input_edit_text_normal">@color/coordinate_input_edit_text_normal_light</item>
|
||||
</style>
|
||||
|
||||
<style name="OverflowMenuButton" parent="@style/Widget.AppCompat.ActionButton.Overflow">
|
||||
|
@ -292,6 +294,11 @@
|
|||
<item name="alertDialogTheme">@style/Theme.AppCompat.Light.Dialog.Alert.NoAnimation</item>
|
||||
</style>
|
||||
|
||||
<style name="CoordinateInputEditText" parent="Widget.AppCompat.EditText">
|
||||
<item name="colorControlActivated">@color/coordinate_input_edit_text_activated</item>
|
||||
<item name="colorControlNormal">?attr/coordinate_input_edit_text_normal</item>
|
||||
</style>
|
||||
|
||||
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
||||
<item name="android:statusBarColor">@color/status_bar_dark</item>
|
||||
<item name="mapBackground">@color/map_background_color_dark</item>
|
||||
|
@ -369,6 +376,8 @@
|
|||
<item name="popupMenuStyle">@style/PopupMenuDark</item>
|
||||
|
||||
<item name="keyboard_controls_divider">@color/keyboard_item_add_button_divider_dark</item>
|
||||
|
||||
<item name="coordinate_input_edit_text_normal">@color/coordinate_input_edit_text_normal_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="FreeVersionBanner" parent="OsmandDarkTheme">
|
||||
|
|
|
@ -142,6 +142,10 @@ public class AndroidUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static ColorStateList createColorStateList(Context ctx, @ColorRes int normal, @ColorRes int pressed) {
|
||||
return createColorStateList(ctx, false, normal, pressed, 0, 0);
|
||||
}
|
||||
|
||||
public static ColorStateList createColorStateList(Context ctx, boolean night,
|
||||
@ColorRes int lightNormal, @ColorRes int lightPressed,
|
||||
@ColorRes int darkNormal, @ColorRes int darkPressed) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
|
|||
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||
import net.osmand.plus.GPXUtilities.WptPt;
|
||||
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
||||
import net.osmand.plus.OsmandSettings.MapMarkersOrderByMode;
|
||||
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
|
||||
import net.osmand.plus.mapmarkers.MarkersPlanRouteContext;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -282,7 +283,7 @@ public class MapMarkersHelper {
|
|||
reorderActiveMarkersIfNeeded();
|
||||
|
||||
List<MapMarker> markersHistory = markersDbHelper.getMarkersHistory();
|
||||
sortMarkers(markersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(markersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
addToMapMarkersHistoryList(markersHistory);
|
||||
|
||||
if (!ctx.isApplicationInitializing()) {
|
||||
|
@ -384,8 +385,12 @@ public class MapMarkersHelper {
|
|||
}
|
||||
}
|
||||
|
||||
public void sortMarkers(List<MapMarker> markers, final boolean visited, final OsmandSettings.MapMarkersOrderByMode orderByMode) {
|
||||
final LatLon location = ctx.getSettings().getLastKnownMapLocation();
|
||||
public void sortMarkers(List<MapMarker> markers, final boolean visited, final MapMarkersOrderByMode orderByMode) {
|
||||
sortMarkers(markers, visited, orderByMode, null);
|
||||
}
|
||||
|
||||
public void sortMarkers(List<MapMarker> markers, final boolean visited,
|
||||
final MapMarkersOrderByMode orderByMode, @Nullable final LatLon location) {
|
||||
Collections.sort(markers, new Comparator<MapMarker>() {
|
||||
@Override
|
||||
public int compare(MapMarker mapMarker1, MapMarker mapMarker2) {
|
||||
|
@ -399,7 +404,7 @@ public class MapMarkersHelper {
|
|||
} else {
|
||||
return orderByMode.isDateAddedDescending() ? 1 : -1;
|
||||
}
|
||||
} else if (orderByMode.isDistanceDescending() || orderByMode.isDistanceAscending()) {
|
||||
} else if (location != null && (orderByMode.isDistanceDescending() || orderByMode.isDistanceAscending())) {
|
||||
int d1 = (int) MapUtils.getDistance(location, mapMarker1.getLatitude(), mapMarker1.getLongitude());
|
||||
int d2 = (int) MapUtils.getDistance(location, mapMarker2.getLatitude(), mapMarker2.getLongitude());
|
||||
if (d1 > d2) {
|
||||
|
@ -418,8 +423,8 @@ public class MapMarkersHelper {
|
|||
});
|
||||
}
|
||||
|
||||
public void orderMarkers(OsmandSettings.MapMarkersOrderByMode orderByMode) {
|
||||
sortMarkers(getMapMarkers(), false, orderByMode);
|
||||
public void orderMarkers(MapMarkersOrderByMode orderByMode, LatLon location) {
|
||||
sortMarkers(getMapMarkers(), false, orderByMode, location);
|
||||
reorderActiveMarkersIfNeeded();
|
||||
}
|
||||
|
||||
|
@ -682,7 +687,7 @@ public class MapMarkersHelper {
|
|||
marker.nextKey = MapMarkersDbHelper.HISTORY_NEXT_VALUE;
|
||||
addToMapMarkersHistoryList(marker);
|
||||
reorderActiveMarkersIfNeeded();
|
||||
sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
@ -702,7 +707,7 @@ public class MapMarkersHelper {
|
|||
markersDbHelper.addMarker(marker);
|
||||
if (marker.history) {
|
||||
addToMapMarkersHistoryList(marker);
|
||||
sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
} else {
|
||||
addToMapMarkersList(marker);
|
||||
reorderActiveMarkersIfNeeded();
|
||||
|
@ -719,7 +724,7 @@ public class MapMarkersHelper {
|
|||
marker.history = false;
|
||||
addToMapMarkersList(position, marker);
|
||||
reorderActiveMarkersIfNeeded();
|
||||
sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
@ -733,7 +738,7 @@ public class MapMarkersHelper {
|
|||
addToMapMarkersList(marker);
|
||||
}
|
||||
reorderActiveMarkersIfNeeded();
|
||||
sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
updateGroups();
|
||||
refresh();
|
||||
}
|
||||
|
@ -824,7 +829,7 @@ public class MapMarkersHelper {
|
|||
removeFromMapMarkersList(markersToRemove);
|
||||
addToMapMarkersList(0, markers);
|
||||
reorderActiveMarkersIfNeeded();
|
||||
ctx.getSettings().MAP_MARKERS_ORDER_BY_MODE.set(OsmandSettings.MapMarkersOrderByMode.CUSTOM);
|
||||
ctx.getSettings().MAP_MARKERS_ORDER_BY_MODE.set(MapMarkersOrderByMode.CUSTOM);
|
||||
}
|
||||
|
||||
public List<LatLon> getActiveMarkersLatLon() {
|
||||
|
@ -857,7 +862,7 @@ public class MapMarkersHelper {
|
|||
cancelAddressRequests();
|
||||
Collections.reverse(mapMarkers);
|
||||
reorderActiveMarkersIfNeeded();
|
||||
ctx.getSettings().MAP_MARKERS_ORDER_BY_MODE.set(OsmandSettings.MapMarkersOrderByMode.CUSTOM);
|
||||
ctx.getSettings().MAP_MARKERS_ORDER_BY_MODE.set(MapMarkersOrderByMode.CUSTOM);
|
||||
}
|
||||
|
||||
public void moveAllActiveMarkersToHistory() {
|
||||
|
@ -871,7 +876,7 @@ public class MapMarkersHelper {
|
|||
}
|
||||
addToMapMarkersHistoryList(mapMarkers);
|
||||
mapMarkers = new LinkedList<>();
|
||||
sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
updateGroups();
|
||||
refresh();
|
||||
}
|
||||
|
@ -935,7 +940,7 @@ public class MapMarkersHelper {
|
|||
}
|
||||
}
|
||||
reorderActiveMarkersIfNeeded();
|
||||
sortMarkers(mapMarkersHistory, true, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersHistory, true, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
@ -1214,7 +1219,7 @@ public class MapMarkersHelper {
|
|||
mapMarkersGroup.getMarkers().add(marker);
|
||||
updateGroup(mapMarkersGroup);
|
||||
if (mapMarkersGroup.getName() == null) {
|
||||
sortMarkers(mapMarkersGroup.getMarkers(), false, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(mapMarkersGroup.getMarkers(), false, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
}
|
||||
} else {
|
||||
mapMarkersGroup = createMapMarkerGroup(marker);
|
||||
|
@ -1328,7 +1333,7 @@ public class MapMarkersHelper {
|
|||
for (int i = 0; i < mapMarkersGroups.size(); i++) {
|
||||
MapMarkersGroup group = mapMarkersGroups.get(i);
|
||||
if (group.getName() == null) {
|
||||
sortMarkers(group.getMarkers(), false, OsmandSettings.MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
sortMarkers(group.getMarkers(), false, MapMarkersOrderByMode.DATE_ADDED_DESC);
|
||||
removeFromGroupsList(group);
|
||||
noGroup = group;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.osmand.plus.api.SettingsAPI.SettingsEditor;
|
|||
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper;
|
||||
import net.osmand.plus.mapillary.MapillaryPlugin;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||
import net.osmand.render.RenderingRulesStorage;
|
||||
|
@ -718,6 +719,9 @@ public class OsmandSettings {
|
|||
|
||||
public final CommonPreference<Boolean> SELECT_MARKER_ON_SINGLE_TAP = new BooleanPreference("select_marker_on_single_tap", false).makeProfile();
|
||||
|
||||
public final CommonPreference<Boolean> COORDS_INPUT_USE_RIGHT_SIDE = new BooleanPreference("coords_input_use_right_side", true).makeGlobal();
|
||||
public final CommonPreference<Integer> COORDS_INPUT_FORMAT = new IntPreference("coords_input_format", CoordinateInputFormats.DD_MM_MMM);
|
||||
|
||||
public final CommonPreference<Boolean> USE_MAPILLARY_FILTER = new BooleanPreference("use_mapillary_filters", false).makeGlobal();
|
||||
public final CommonPreference<String> MAPILLARY_FILTER_USER_KEY = new StringPreference("mapillary_filter_user_key", "").makeGlobal();
|
||||
public final CommonPreference<String> MAPILLARY_FILTER_USERNAME = new StringPreference("mapillary_filter_username", "").makeGlobal();
|
||||
|
|
|
@ -648,7 +648,7 @@ public class ImportHelper {
|
|||
|
||||
if (forceImportFavourites) {
|
||||
importFavoritesImpl(gpxFile, fileName, true);
|
||||
} else {
|
||||
} else if (fileName != null) {
|
||||
ImportGpxBottomSheetDialogFragment fragment = new ImportGpxBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
fragment.setImportHelper(this);
|
||||
|
|
|
@ -1,41 +1,39 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.ListPopupWindow;
|
||||
import android.support.v4.widget.CompoundButtonCompat;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats.CoordinateInputFormatDef;
|
||||
|
||||
import static net.osmand.plus.mapmarkers.CoordinateInputDialogFragment.ACCURACY;
|
||||
import static net.osmand.plus.mapmarkers.CoordinateInputDialogFragment.GO_TO_NEXT_FIELD;
|
||||
import static net.osmand.plus.mapmarkers.CoordinateInputDialogFragment.RIGHT_HAND;
|
||||
import static net.osmand.plus.mapmarkers.CoordinateInputDialogFragment.USE_OSMAND_KEYBOARD;
|
||||
|
||||
public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
|
||||
|
||||
public final static String TAG = "CoordinateInputBottomSheetDialogFragment";
|
||||
|
||||
private View mainView;
|
||||
private boolean useOsmandKeyboard;
|
||||
private boolean rightHand;
|
||||
private boolean goToNextField;
|
||||
private int accuracy;
|
||||
private CoordinateInputFormatChangeListener listener;
|
||||
|
||||
private boolean useOsmandKeyboard;
|
||||
|
||||
public void setListener(CoordinateInputFormatChangeListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
@ -47,111 +45,100 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
|
|||
Bundle args = getArguments();
|
||||
if (args != null) {
|
||||
useOsmandKeyboard = args.getBoolean(USE_OSMAND_KEYBOARD);
|
||||
rightHand = args.getBoolean(RIGHT_HAND);
|
||||
goToNextField = args.getBoolean(GO_TO_NEXT_FIELD);
|
||||
accuracy = args.getInt(ACCURACY);
|
||||
}
|
||||
} else {
|
||||
useOsmandKeyboard = savedInstanceState.getBoolean(USE_OSMAND_KEYBOARD);
|
||||
rightHand = savedInstanceState.getBoolean(RIGHT_HAND);
|
||||
goToNextField = savedInstanceState.getBoolean(GO_TO_NEXT_FIELD);
|
||||
accuracy = savedInstanceState.getInt(ACCURACY);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
final Context context = getContext();
|
||||
final OsmandSettings settings = getMyApplication().getSettings();
|
||||
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
boolean portrait = AndroidUiHelper.isOrientationPortrait(getActivity());
|
||||
|
||||
mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_marker_coordinate_input_options_bottom_sheet_helper, container);
|
||||
View mainView = View.inflate(new ContextThemeWrapper(context, themeRes),
|
||||
R.layout.fragment_marker_coordinate_input_options_bottom_sheet_dialog, container);
|
||||
|
||||
if (nightMode) {
|
||||
((TextView) mainView.findViewById(R.id.coordinate_input_title)).setTextColor(getResources().getColor(R.color.ctx_menu_info_text_dark));
|
||||
((TextView) mainView.findViewById(R.id.coordinate_input_title))
|
||||
.setTextColor(ContextCompat.getColor(context, R.color.ctx_menu_info_text_dark));
|
||||
}
|
||||
|
||||
((TextView) mainView.findViewById(R.id.coordinate_input_accuracy_descr)).setText(getString(R.string.coordinate_input_accuracy_description, accuracy));
|
||||
|
||||
((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() {
|
||||
((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard);
|
||||
|
||||
View.OnClickListener itemsOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
useOsmandKeyboard = !useOsmandKeyboard;
|
||||
((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard);
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onKeyboardChanged(useOsmandKeyboard);
|
||||
int id = v.getId();
|
||||
if (id == R.id.use_system_keyboard_row) {
|
||||
listener.onKeyboardChanged(!useOsmandKeyboard);
|
||||
} else if (id == R.id.hand_row) {
|
||||
OsmandSettings.CommonPreference<Boolean> pref = settings.COORDS_INPUT_USE_RIGHT_SIDE;
|
||||
pref.set(!pref.get());
|
||||
listener.onHandChanged();
|
||||
}
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
mainView.findViewById(R.id.use_system_keyboard_row).setOnClickListener(itemsOnClickListener);
|
||||
mainView.findViewById(R.id.cancel_row).setOnClickListener(itemsOnClickListener);
|
||||
|
||||
View handRow = mainView.findViewById(R.id.hand_row);
|
||||
if (portrait) {
|
||||
handRow.setVisibility(View.GONE);
|
||||
} else {
|
||||
handRow.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
rightHand = !rightHand;
|
||||
populateChangeHandRow();
|
||||
if (listener != null) {
|
||||
listener.onHandChanged(rightHand);
|
||||
}
|
||||
}
|
||||
});
|
||||
populateChangeHandRow();
|
||||
boolean rightHand = settings.COORDS_INPUT_USE_RIGHT_SIDE.get();
|
||||
((ImageView) mainView.findViewById(R.id.hand_icon)).setImageDrawable(getContentIcon(rightHand
|
||||
? R.drawable.ic_action_show_keypad_right : R.drawable.ic_action_show_keypad_left));
|
||||
((TextView) mainView.findViewById(R.id.hand_text_view)).setText(getString(rightHand
|
||||
? R.string.shared_string_right : R.string.shared_string_left));
|
||||
((TextView) mainView.findViewById(R.id.hand_text_view)).setTextColor(getResolvedActiveColor());
|
||||
handRow.setOnClickListener(itemsOnClickListener);
|
||||
}
|
||||
|
||||
((CompoundButton) mainView.findViewById(R.id.go_to_next_field_switch)).setChecked(goToNextField);
|
||||
((ImageView) mainView.findViewById(R.id.go_to_next_field_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_next_field_stroke));
|
||||
mainView.findViewById(R.id.go_to_next_field_row).setOnClickListener(new View.OnClickListener() {
|
||||
View.OnClickListener formatsOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
goToNextField = !goToNextField;
|
||||
((CompoundButton) mainView.findViewById(R.id.go_to_next_field_switch)).setChecked(goToNextField);
|
||||
switchSelectedAccuracy();
|
||||
public void onClick(View v) {
|
||||
int format = (int) v.getTag();
|
||||
settings.COORDS_INPUT_FORMAT.set(format);
|
||||
if (listener != null) {
|
||||
listener.onGoToNextFieldChanged(goToNextField);
|
||||
listener.onFormatChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
switchSelectedAccuracy();
|
||||
populateSelectedAccuracy();
|
||||
|
||||
mainView.findViewById(R.id.accuracy_row).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (goToNextField) {
|
||||
final ListPopupWindow listPopupWindow = new ListPopupWindow(getContext());
|
||||
listPopupWindow.setAnchorView(view);
|
||||
listPopupWindow.setContentWidth(AndroidUtils.dpToPx(getMyApplication(), 100));
|
||||
listPopupWindow.setModal(true);
|
||||
listPopupWindow.setDropDownGravity(Gravity.END | Gravity.TOP);
|
||||
listPopupWindow.setAdapter(new ArrayAdapter<>(getContext(), R.layout.popup_list_text_item, new Integer[]{0, 1, 2, 3, 4, 5, 6}));
|
||||
listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
accuracy = i;
|
||||
populateSelectedAccuracy();
|
||||
if (listener != null) {
|
||||
listener.onAccuracyChanged(accuracy);
|
||||
}
|
||||
listPopupWindow.dismiss();
|
||||
}
|
||||
});
|
||||
listPopupWindow.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mainView.findViewById(R.id.cancel_row).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
LinearLayout formatsContainer = (LinearLayout) mainView.findViewById(R.id.formats_container);
|
||||
Drawable formatIcon = getContentIcon(R.drawable.ic_action_coordinates_latitude);
|
||||
int selectedFormat = settings.COORDS_INPUT_FORMAT.get();
|
||||
for (@CoordinateInputFormatDef int format : CoordinateInputFormats.VALUES) {
|
||||
boolean selectedRow = format == selectedFormat;
|
||||
|
||||
View row = View.inflate(new ContextThemeWrapper(context, themeRes),
|
||||
R.layout.bottom_sheet_item_with_radio_btn, null);
|
||||
row.setTag(format);
|
||||
row.setOnClickListener(formatsOnClickListener);
|
||||
|
||||
((ImageView) row.findViewById(R.id.icon_iv)).setImageDrawable(selectedRow
|
||||
? getActiveIcon(R.drawable.ic_action_coordinates_latitude) : formatIcon);
|
||||
TextView nameTv = (TextView) row.findViewById(R.id.name_tv);
|
||||
nameTv.setText(CoordinateInputFormats.formatToHumanString(context, format));
|
||||
if (selectedRow) {
|
||||
nameTv.setTextColor(getResolvedActiveColor());
|
||||
RadioButton rb = (RadioButton) row.findViewById(R.id.radio_button);
|
||||
rb.setChecked(true);
|
||||
CompoundButtonCompat.setButtonTintList(rb, ColorStateList.valueOf(getResolvedActiveColor()));
|
||||
}
|
||||
|
||||
formatsContainer.addView(row);
|
||||
}
|
||||
|
||||
setupHeightAndBackground(mainView, R.id.marker_coordinate_input_scroll_view);
|
||||
|
||||
|
@ -161,37 +148,20 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
|
|||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
outState.putBoolean(USE_OSMAND_KEYBOARD, useOsmandKeyboard);
|
||||
outState.putBoolean(RIGHT_HAND, rightHand);
|
||||
outState.putBoolean(GO_TO_NEXT_FIELD, goToNextField);
|
||||
outState.putInt(ACCURACY, accuracy);
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
private void populateChangeHandRow() {
|
||||
((ImageView) mainView.findViewById(R.id.hand_icon)).setImageDrawable(getContentIcon(rightHand ? R.drawable.ic_action_show_keypad_right : R.drawable.ic_action_show_keypad_left));
|
||||
((TextView) mainView.findViewById(R.id.hand_text_view)).setText(getString(rightHand ? R.string.shared_string_right : R.string.shared_string_left));
|
||||
((TextView) mainView.findViewById(R.id.hand_text_view)).setTextColor(ContextCompat.getColor(getContext(), nightMode ? R.color.color_dialog_buttons_dark : R.color.map_widget_blue_pressed));
|
||||
}
|
||||
|
||||
private void populateSelectedAccuracy() {
|
||||
((TextView) mainView.findViewById(R.id.selected_accuracy)).setText(String.valueOf(accuracy));
|
||||
((TextView) mainView.findViewById(R.id.selected_accuracy_hint)).setText("00:00." + new String(new char[accuracy]).replace("\0", "0"));
|
||||
}
|
||||
|
||||
private void switchSelectedAccuracy() {
|
||||
((TextView) mainView.findViewById(R.id.selected_accuracy)).setTextColor(ContextCompat.getColor(getContext(), goToNextField ? R.color.map_widget_blue : android.R.color.darker_gray));
|
||||
((ImageView) mainView.findViewById(R.id.accuracy_arrow)).setImageDrawable(goToNextField ? getContentIcon(R.drawable.ic_action_arrow_drop_down) : getIcon(R.drawable.ic_action_arrow_drop_down, android.R.color.darker_gray));
|
||||
@ColorInt
|
||||
private int getResolvedActiveColor() {
|
||||
return ContextCompat.getColor(getContext(), nightMode ? R.color.osmand_orange : R.color.color_myloc_distance);
|
||||
}
|
||||
|
||||
interface CoordinateInputFormatChangeListener {
|
||||
|
||||
void onKeyboardChanged(boolean useOsmandKeyboard);
|
||||
|
||||
void onHandChanged(boolean rightHand);
|
||||
|
||||
void onGoToNextFieldChanged(boolean goToNextField);
|
||||
|
||||
void onAccuracyChanged(int accuracy);
|
||||
void onHandChanged();
|
||||
|
||||
void onFormatChanged();
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,104 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.IntDef;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
public class CoordinateInputFormats {
|
||||
|
||||
public static final int DD_MM_MMM = 0;
|
||||
public static final int DD_MM_MMMM = 1;
|
||||
public static final int DD_DDDDD = 2;
|
||||
public static final int DD_DDDDDD = 3;
|
||||
public static final int DD_MM_SS = 4;
|
||||
|
||||
public static int[] VALUES = new int[]{DD_MM_MMM, DD_MM_MMMM, DD_DDDDD, DD_DDDDDD, DD_MM_SS};
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({DD_MM_MMM, DD_MM_MMMM, DD_DDDDD, DD_DDDDDD, DD_MM_SS})
|
||||
@interface CoordinateInputFormatDef {
|
||||
}
|
||||
|
||||
public static String formatToHumanString(Context ctx, @CoordinateInputFormatDef int format) {
|
||||
switch (format) {
|
||||
case DD_MM_MMM:
|
||||
return ctx.getString(R.string.dd_mm_mmm_format);
|
||||
case DD_MM_MMMM:
|
||||
return ctx.getString(R.string.dd_mm_mmmm_format);
|
||||
case DD_DDDDD:
|
||||
return ctx.getString(R.string.dd_ddddd_format);
|
||||
case DD_DDDDDD:
|
||||
return ctx.getString(R.string.dd_dddddd_format);
|
||||
case DD_MM_SS:
|
||||
return ctx.getString(R.string.dd_mm_ss_format);
|
||||
}
|
||||
return "Unknown format";
|
||||
}
|
||||
|
||||
public static boolean containsThirdPart(@CoordinateInputFormatDef int format) {
|
||||
return format == DD_MM_MMM || format == DD_MM_MMMM || format == DD_MM_SS;
|
||||
}
|
||||
|
||||
public static int getFirstPartSymbolsCount(@CoordinateInputFormatDef int format, boolean latitude) {
|
||||
return latitude ? 2 : 3;
|
||||
}
|
||||
|
||||
public static int getSecondPartSymbolsCount(@CoordinateInputFormatDef int format) {
|
||||
switch (format) {
|
||||
case DD_MM_MMM:
|
||||
case DD_MM_MMMM:
|
||||
case DD_MM_SS:
|
||||
return 2;
|
||||
case DD_DDDDD:
|
||||
return 5;
|
||||
case DD_DDDDDD:
|
||||
return 6;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getThirdPartSymbolsCount(@CoordinateInputFormatDef int format) {
|
||||
switch (format) {
|
||||
case DD_MM_MMM:
|
||||
return 3;
|
||||
case DD_MM_MMMM:
|
||||
return 4;
|
||||
case DD_MM_SS:
|
||||
return 2;
|
||||
case DD_DDDDD:
|
||||
case DD_DDDDDD:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static String getFirstSeparator(@CoordinateInputFormatDef int format) {
|
||||
switch (format) {
|
||||
case DD_MM_MMM:
|
||||
case DD_MM_MMMM:
|
||||
case DD_MM_SS:
|
||||
return "°";
|
||||
case DD_DDDDD:
|
||||
case DD_DDDDDD:
|
||||
return ".";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getSecondSeparator(@CoordinateInputFormatDef int format) {
|
||||
switch (format) {
|
||||
case DD_MM_MMM:
|
||||
case DD_MM_MMMM:
|
||||
return ".";
|
||||
case DD_DDDDD:
|
||||
case DD_DDDDDD:
|
||||
return "°";
|
||||
case DD_MM_SS:
|
||||
return "′";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
|
@ -21,6 +21,8 @@ import android.view.ViewGroup;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.LockableViewPager;
|
||||
import net.osmand.plus.MapMarkersHelper;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -169,6 +171,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
groupsFragment.startLocationUpdate();
|
||||
groupsFragment.setGroupIdToOpen(groupIdToOpen);
|
||||
viewPager.setCurrentItem(GROUPS_POSITION, false);
|
||||
bottomNav.getMenu().findItem(R.id.action_groups).setChecked(true);
|
||||
}
|
||||
bottomNav.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
@Override
|
||||
|
@ -475,7 +478,14 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
|
||||
private void setOrderByMode(MapMarkersOrderByMode orderByMode) {
|
||||
if (orderByMode != MapMarkersOrderByMode.CUSTOM) {
|
||||
getMyApplication().getMapMarkersHelper().orderMarkers(orderByMode);
|
||||
OsmandApplication app = getMyApplication();
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
|
||||
Location location = app.getLocationProvider().getLastKnownLocation();
|
||||
boolean useCenter = !(mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation() && location != null);
|
||||
LatLon loc = useCenter ? mapActivity.getMapLocation() : new LatLon(location.getLatitude(), location.getLongitude());
|
||||
|
||||
app.getMapMarkersHelper().orderMarkers(orderByMode, loc);
|
||||
activeFragment.updateAdapter();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,39 +1,43 @@
|
|||
package net.osmand.plus.mapmarkers.adapters;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.MapMarkersHelper.MapMarker;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CoordinateInputAdapter extends RecyclerView.Adapter<MapMarkerItemViewHolder> {
|
||||
|
||||
private MapActivity mapActivity;
|
||||
private boolean nightTheme;
|
||||
private IconsCache iconsCache;
|
||||
private List<MapMarker> mapMarkers;
|
||||
|
||||
private boolean nightTheme;
|
||||
|
||||
private LatLon location;
|
||||
private Float heading;
|
||||
private boolean useCenter;
|
||||
private int screenOrientation;
|
||||
private boolean portrait;
|
||||
|
||||
public CoordinateInputAdapter (MapActivity mapActivity, List<MapMarker> mapMarkers) {
|
||||
public CoordinateInputAdapter(MapActivity mapActivity, List<MapMarker> mapMarkers) {
|
||||
this.mapActivity = mapActivity;
|
||||
nightTheme = !mapActivity.getMyApplication().getSettings().isLightContent();
|
||||
iconsCache = mapActivity.getMyApplication().getIconsCache();
|
||||
portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
|
||||
this.mapMarkers = mapMarkers;
|
||||
nightTheme = !mapActivity.getMyApplication().getSettings().isLightContent();
|
||||
}
|
||||
|
||||
public void setLocation(LatLon location) {
|
||||
|
@ -61,16 +65,17 @@ public class CoordinateInputAdapter extends RecyclerView.Adapter<MapMarkerItemVi
|
|||
@Override
|
||||
public void onBindViewHolder(final MapMarkerItemViewHolder holder, int position) {
|
||||
final MapMarker mapMarker = getItem(position);
|
||||
|
||||
holder.iconDirection.setVisibility(View.VISIBLE);
|
||||
holder.icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, MapMarker.getColorId(mapMarker.colorIndex)));
|
||||
holder.mainLayout.setBackgroundColor(ContextCompat.getColor(mapActivity, nightTheme ? R.color.bg_color_dark : R.color.bg_color_light));
|
||||
holder.title.setTextColor(ContextCompat.getColor(mapActivity, nightTheme ? R.color.color_white : R.color.color_black));
|
||||
holder.divider.setBackgroundColor(ContextCompat.getColor(mapActivity, nightTheme ? R.color.actionbar_dark_color : R.color.dashboard_divider_light));
|
||||
holder.optionsBtn.setBackgroundDrawable(mapActivity.getResources().getDrawable(nightTheme ? R.drawable.marker_circle_background_dark_with_inset : R.drawable.marker_circle_background_light_with_inset));
|
||||
holder.optionsBtn.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_remove_dark));
|
||||
holder.icon.setImageDrawable(getColoredIcon(R.drawable.ic_action_flag_dark, MapMarker.getColorId(mapMarker.colorIndex)));
|
||||
holder.mainLayout.setBackgroundColor(getResolvedColor(nightTheme ? R.color.ctx_menu_bg_dark : R.color.bg_color_light));
|
||||
holder.title.setTextColor(getResolvedColor(nightTheme ? R.color.ctx_menu_title_color_dark : R.color.color_black));
|
||||
holder.divider.setBackgroundColor(getResolvedColor(nightTheme ? R.color.route_info_divider_dark : R.color.dashboard_divider_light));
|
||||
holder.optionsBtn.setBackgroundDrawable(getRemoveBtnBgSelector());
|
||||
holder.optionsBtn.setImageDrawable(getColoredIcon(R.drawable.ic_action_remove_small, R.color.icon_color));
|
||||
holder.iconReorder.setVisibility(View.GONE);
|
||||
holder.numberText.setVisibility(View.VISIBLE);
|
||||
holder.numberText.setText(Integer.toString(position + 1));
|
||||
holder.numberText.setText(String.valueOf(position + 1));
|
||||
holder.description.setVisibility(View.GONE);
|
||||
|
||||
holder.optionsBtn.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -78,8 +83,7 @@ public class CoordinateInputAdapter extends RecyclerView.Adapter<MapMarkerItemVi
|
|||
public void onClick(View view) {
|
||||
int position = holder.getAdapterPosition();
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
MapMarker mapMarker = getItem(position);
|
||||
mapMarkers.remove(mapMarker);
|
||||
mapMarkers.remove(getItem(position));
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
@ -88,10 +92,9 @@ public class CoordinateInputAdapter extends RecyclerView.Adapter<MapMarkerItemVi
|
|||
boolean singleItem = getItemCount() == 1;
|
||||
boolean fistItem = position == 0;
|
||||
boolean lastItem = position == getItemCount() - 1;
|
||||
if (portrait) {
|
||||
holder.topDivider.setVisibility(fistItem ? View.VISIBLE : View.GONE);
|
||||
holder.bottomShadow.setVisibility(lastItem ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
holder.topDivider.setVisibility(fistItem ? View.VISIBLE : View.GONE);
|
||||
holder.bottomShadow.setVisibility(lastItem ? View.VISIBLE : View.GONE);
|
||||
holder.divider.setVisibility((!singleItem && !lastItem) ? View.VISIBLE : View.GONE);
|
||||
|
||||
holder.title.setText(mapMarker.getName(mapActivity));
|
||||
|
@ -114,4 +117,23 @@ public class CoordinateInputAdapter extends RecyclerView.Adapter<MapMarkerItemVi
|
|||
public MapMarker getItem(int position) {
|
||||
return mapMarkers.get(position);
|
||||
}
|
||||
|
||||
private Drawable getRemoveBtnBgSelector() {
|
||||
if (nightTheme) {
|
||||
return AndroidUtils.createStateListDrawable(
|
||||
getColoredIcon(R.drawable.marker_circle_background_dark_n_with_inset, R.color.keyboard_item_control_dark_bg),
|
||||
ContextCompat.getDrawable(mapActivity, R.drawable.marker_circle_background_p_with_inset)
|
||||
);
|
||||
}
|
||||
return ContextCompat.getDrawable(mapActivity, R.drawable.marker_circle_background_light_with_inset);
|
||||
}
|
||||
|
||||
private Drawable getColoredIcon(@DrawableRes int resId, @ColorRes int colorResId) {
|
||||
return iconsCache.getIcon(resId, colorResId);
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
private int getResolvedColor(@ColorRes int colorResId) {
|
||||
return ContextCompat.getColor(mapActivity, colorResId);
|
||||
}
|
||||
}
|
||||
|
|
39
OsmAnd/src/net/osmand/plus/widgets/EditTextEx.java
Normal file
39
OsmAnd/src/net/osmand/plus/widgets/EditTextEx.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package net.osmand.plus.widgets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.AppCompatEditText;
|
||||
import android.text.InputFilter.LengthFilter;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
|
||||
public class EditTextEx extends AppCompatEditText {
|
||||
|
||||
private int maxSymbolsCount = -1;
|
||||
|
||||
public int getMaxSymbolsCount() {
|
||||
return maxSymbolsCount;
|
||||
}
|
||||
|
||||
public void setMaxSymbolsCount(int maxSymbolsCount) {
|
||||
this.maxSymbolsCount = maxSymbolsCount;
|
||||
setMaxSymbols();
|
||||
}
|
||||
|
||||
public EditTextEx(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public EditTextEx(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public EditTextEx(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private void setMaxSymbols() {
|
||||
if (maxSymbolsCount > 0) {
|
||||
setFilters(new LengthFilter[]{new LengthFilter(maxSymbolsCount)});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue