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

# Conflicts:
#	OsmAnd/res/values-large/sizes.xml
#	OsmAnd/res/values/colors.xml
#	OsmAnd/res/values/sizes.xml
This commit is contained in:
Alexander Sytnyk 2018-01-11 15:36:32 +02:00
commit 4e134d0292
90 changed files with 2007 additions and 973 deletions

View file

@ -40,7 +40,7 @@
<uses-feature android:name="com.sec.feature.spen_usp" android:required="false"/> <uses-feature android:name="com.sec.feature.spen_usp" android:required="false"/>
<uses-sdk android:targetSdkVersion="21" android:minSdkVersion="9" <uses-sdk android:targetSdkVersion="21" android:minSdkVersion="9"
tools:overrideLibrary="com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes"/> tools:overrideLibrary="com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes, android.support.customtabs"/>
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" <supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
android:xlargeScreens="true" android:anyDensity="true" /> android:xlargeScreens="true" android:anyDensity="true" />

View file

@ -389,6 +389,7 @@ dependencies {
compile 'com.android.support:cardview-v7:26.1.0' compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0' compile 'com.android.support:design:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
compile fileTree(include: ['*.jar'], exclude: ['QtAndroid-bundled.jar', 'QtAndroidAccessibility-bundled.jar', 'OsmAndCore_android.jar', 'OsmAndCore_wrapper.jar', 'android-support-multidex.jar'], dir: 'libs') compile fileTree(include: ['*.jar'], exclude: ['QtAndroid-bundled.jar', 'QtAndroidAccessibility-bundled.jar', 'OsmAndCore_android.jar', 'OsmAndCore_wrapper.jar', 'android-support-multidex.jar'], dir: 'libs')
legacyCompile "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar" legacyCompile "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar"
qtcoredebugCompile "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar" qtcoredebugCompile "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<nine-patch android:src="@drawable/bg_contextmenu_dots_dark" /> <nine-patch android:src="@drawable/bg_contextmenu_shadow_top_light" />
</item> </item>
<item> <item>
<shape> <shape>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<nine-patch android:src="@drawable/bg_contextmenu_dots_light" /> <nine-patch android:src="@drawable/bg_contextmenu_shadow_top_light" />
</item> </item>
<item> <item>
<shape> <shape>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/route_info_bg_dark" />
<stroke
android:width="1dp"
android:color="@color/route_info_divider_dark" />
<corners android:radius="3dp" />
</shape>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/route_info_bg_light" />
<stroke
android:width="1dp"
android:color="@color/route_info_divider_light" />
<corners android:radius="3dp" />
</shape>

View 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_bg_dark" />
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,12 @@
<?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_right_light" />
</item>
<item>
<shape>
<solid
android:color="@color/ctx_menu_bg_dark" />
</shape>
</item>
</layer-list>

View 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_bg_light" />
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,12 @@
<?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_right_light" />
</item>
<item>
<shape>
<solid
android:color="@color/ctx_menu_bg_light" />
</shape>
</item>
</layer-list>

View file

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

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/ctx_menu_buttons_bg_dark" />
<stroke
android:width="1dp"
android:color="@color/ctx_menu_controller_button_outline_color_dark_n" />
<corners android:radius="3dp" />
</shape>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/ctx_menu_controller_button_bg_color_dark_p" />
<stroke
android:width="1dp"
android:color="@color/ctx_menu_controller_button_outline_color_dark_p" />
<corners android:radius="3dp" />
</shape>

View file

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

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/ctx_menu_buttons_bg_light" />
<stroke
android:width="1dp"
android:color="@color/ctx_menu_info_divider_light" />
<corners android:radius="3dp" />
</shape>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/ctx_menu_controller_button_bg_color_light_p" />
<stroke
android:width="1dp"
android:color="@color/ctx_menu_controller_button_outline_color_light_p" />
<corners android:radius="3dp" />
</shape>

View file

@ -49,7 +49,7 @@
android:id="@+id/waypoints" android:id="@+id/waypoints"
android:layout_width="@dimen/list_item_height" android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/map_action_waypoints"/> android:src="@drawable/map_action_waypoints"/>
</LinearLayout> </LinearLayout>
@ -74,16 +74,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:background="?attr/selectableItemBackground"
android:id="@+id/FromLayout" android:id="@+id/FromLayout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
@ -130,39 +133,19 @@
android:layout_marginRight="@dimen/list_header_text_left_margin" android:layout_marginRight="@dimen/list_header_text_left_margin"
android:src="@drawable/ic_action_arrow_drop_down"/> android:src="@drawable/ic_action_arrow_drop_down"/>
<View
android:id="@+id/from_layout_empty_view"
android:layout_width="@dimen/route_info_directions_margin"
android:layout_height="match_parent"/>
</LinearLayout> </LinearLayout>
<FrameLayout <View
android:layout_marginStart="@dimen/route_info_divider_margin"
android:layout_marginLeft="@dimen/route_info_divider_margin"
android:id="@+id/dividerFromDropDown"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="1dp"
android:background="@color/dashboard_divider_dark"
<View android:focusable="false"/>
android:layout_marginStart="@dimen/route_info_divider_margin"
android:layout_marginLeft="@dimen/route_info_divider_margin"
android:layout_marginRight="@dimen/route_info_directions_margin"
android:layout_marginEnd="@dimen/route_info_directions_margin"
android:id="@+id/dividerFromDropDown"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dashboard_divider_dark"
android:focusable="false"/>
<View
android:id="@+id/divider_from_drop_down_empty"
android:layout_gravity="end"
android:layout_width="@dimen/route_info_directions_margin"
android:layout_height="1dp"
android:focusable="false"
android:background="@color/dashboard_divider_dark"/>
</FrameLayout>
<LinearLayout <LinearLayout
android:background="?attr/selectableItemBackground"
android:id="@+id/ViaLayout" android:id="@+id/ViaLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
@ -216,6 +199,7 @@
android:focusable="false"/> android:focusable="false"/>
<LinearLayout <LinearLayout
android:background="?attr/selectableItemBackground"
android:id="@+id/ToLayout" android:id="@+id/ToLayout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
@ -262,18 +246,13 @@
android:layout_marginRight="@dimen/list_header_text_left_margin" android:layout_marginRight="@dimen/list_header_text_left_margin"
android:src="@drawable/ic_action_arrow_drop_down"/> android:src="@drawable/ic_action_arrow_drop_down"/>
<View
android:id="@+id/to_layout_empty_view"
android:layout_width="@dimen/route_info_directions_margin"
android:layout_height="match_parent"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:background="?attr/selectableItemBackground"
android:id="@+id/swap_direction_image_view" android:id="@+id/swap_direction_image_view"
android:visibility="gone"
android:paddingRight="@dimen/route_info_icon_padding_right" android:paddingRight="@dimen/route_info_icon_padding_right"
android:paddingLeft="@dimen/route_info_icon_padding_right" android:paddingLeft="@dimen/route_info_icon_padding_right"
android:layout_gravity="end" android:layout_gravity="end"
@ -281,7 +260,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
</FrameLayout> </LinearLayout>
<View <View
android:id="@+id/dividerToDropDown" android:id="@+id/dividerToDropDown"
@ -300,7 +279,7 @@
android:id="@+id/Info" android:id="@+id/Info"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:minHeight="@dimen/list_item_height" android:minHeight="@dimen/list_item_height"
android:orientation="horizontal"> android:orientation="horizontal">
@ -308,7 +287,7 @@
android:id="@+id/Prev" android:id="@+id/Prev"
android:layout_width="@dimen/list_item_height" android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:contentDescription="@string/shared_string_previous" android:contentDescription="@string/shared_string_previous"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_prev"/> android:src="@drawable/ic_prev"/>
@ -407,7 +386,7 @@
android:layout_width="@dimen/list_item_height" android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:contentDescription="@string/shared_string_next" android:contentDescription="@string/shared_string_next"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_next"/> android:src="@drawable/ic_next"/>

View file

@ -1,65 +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="wrap_content"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal"
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp">
<net.osmand.plus.widgets.TextViewEx
android:textAllCaps="true"
osmand:typeface="@string/font_roboto_medium"
android:id="@+id/route_ref"
android:layout_width="32dp"
android:layout_height="18dp"
android:background="@drawable/transport_stop_route_bg"
android:gravity="center"
android:textColor="@color/color_white"
android:textSize="@dimen/default_sub_text_size_small"
tools:text="3"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:textSize="16sp"
android:id="@+id/route_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="№5: Льва Толстого площа - Белицкая улица (25м)"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="8dp">
<ImageView
android:id="@+id/route_type_icon"
android:layout_marginRight="@dimen/context_menu_transport_grid_spacing"
android:layout_marginEnd="@dimen/context_menu_transport_grid_spacing"
android:layout_width="@dimen/context_menu_transport_icon_size"
android:layout_height="@dimen/context_menu_transport_icon_size"
tools:src="@drawable/ic_action_polygom_dark"/>
<TextView
android:id="@+id/route_type_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Метро "/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -97,20 +97,21 @@
android:layout_height="@dimen/context_menu_sub_info_height" android:layout_height="@dimen/context_menu_sub_info_height"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <net.osmand.plus.widgets.TextViewEx
android:layout_marginRight="@dimen/context_menu_padding_margin_small" android:layout_marginRight="@dimen/context_menu_padding_margin_small"
android:layout_marginEnd="@dimen/context_menu_padding_margin_small" android:layout_marginEnd="@dimen/context_menu_padding_margin_small"
tools:text="Museum" tools:text="Museum"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/context_menu_line3" android:id="@+id/context_menu_line3"
osmand:typeface="@string/font_roboto_medium"
style="@style/TextAppearance.ContextMenuSubtitle"/> style="@style/TextAppearance.ContextMenuSubtitle"/>
<TextView <TextView
android:layout_marginRight="@dimen/context_menu_padding_margin_small" android:layout_marginRight="@dimen/context_menu_padding_margin_small"
android:layout_marginEnd="@dimen/context_menu_padding_margin_small" android:layout_marginEnd="@dimen/context_menu_padding_margin_small"
tools:text="Closed till 10:00" tools:text="Closed till 10:00"
android:id="@+id/opening_hours_text_view" android:id="@+id/additional_info_text_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
@ -174,7 +175,7 @@
android:paddingRight="@dimen/context_menu_button_padding_x" android:paddingRight="@dimen/context_menu_button_padding_x"
android:textAllCaps="true" android:textAllCaps="true"
android:text="@string/recording_context_menu_play" android:text="@string/recording_context_menu_play"
tools:textColor="?attr/contextMenuButtonColor" tools:textColor="?attr/ctx_menu_controller_text_color"
android:textSize="@dimen/default_desc_text_size"/> android:textSize="@dimen/default_desc_text_size"/>
<TextView <TextView
@ -209,7 +210,7 @@
android:paddingLeft="@dimen/context_menu_button_padding_x" android:paddingLeft="@dimen/context_menu_button_padding_x"
android:paddingRight="@dimen/context_menu_button_padding_x" android:paddingRight="@dimen/context_menu_button_padding_x"
android:text="@string/shared_string_delete" android:text="@string/shared_string_delete"
tools:textColor="?attr/contextMenuButtonColor" tools:textColor="?attr/ctx_menu_controller_text_color"
android:textSize="@dimen/default_desc_text_size"/> android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout> </LinearLayout>
@ -246,7 +247,7 @@
android:paddingLeft="@dimen/context_menu_button_padding_x" android:paddingLeft="@dimen/context_menu_button_padding_x"
android:paddingRight="@dimen/context_menu_button_padding_x" android:paddingRight="@dimen/context_menu_button_padding_x"
android:text="@string/shared_string_download" android:text="@string/shared_string_download"
tools:textColor="?attr/contextMenuButtonColor" tools:textColor="?attr/ctx_menu_controller_text_color"
android:textSize="@dimen/default_desc_text_size"/> android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout> </LinearLayout>
@ -270,8 +271,8 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="@dimen/context_menu_button_padding_x" android:paddingLeft="@dimen/context_menu_button_padding_x"
android:paddingRight="@dimen/context_menu_button_padding_x" android:paddingRight="@dimen/context_menu_button_padding_x"
android:text="@string/shared_string_delete" android:text="@string/shared_string_others"
tools:textColor="?attr/contextMenuButtonColor" tools:textColor="?attr/ctx_menu_controller_text_color"
android:textSize="@dimen/default_desc_text_size"/> android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout> </LinearLayout>
@ -305,9 +306,9 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="@dimen/context_menu_button_padding_x" android:paddingLeft="@dimen/context_menu_button_padding_x"
android:paddingRight="@dimen/context_menu_button_padding_x" android:paddingRight="@dimen/context_menu_button_padding_x"
android:text="@string/shared_string_others" android:text="@string/shared_string_delete"
android:textAllCaps="true" android:textAllCaps="true"
tools:textColor="?attr/contextMenuButtonColor" tools:textColor="?attr/ctx_menu_controller_text_color"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"/> osmand:typeface="@string/font_roboto_medium"/>
@ -382,8 +383,8 @@
android:background="?attr/ctx_menu_divider"/> android:background="?attr/ctx_menu_divider"/>
<LinearLayout <LinearLayout
android:paddingLeft="@dimen/context_menu_padding_margin_small" android:paddingLeft="@dimen/map_widget_icon_margin"
android:paddingRight="@dimen/context_menu_padding_margin_small" android:paddingRight="@dimen/map_widget_icon_margin"
android:id="@+id/context_menu_buttons" android:id="@+id/context_menu_buttons"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -18,7 +18,7 @@
android:paddingLeft="@dimen/route_info_buttons_padding_left_right" android:paddingLeft="@dimen/route_info_buttons_padding_left_right"
android:paddingRight="@dimen/route_info_buttons_padding_left_right" android:paddingRight="@dimen/route_info_buttons_padding_left_right"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_action_test_light" /> android:src="@drawable/ic_action_test_light" />
<View <View
@ -40,7 +40,7 @@
android:paddingLeft="@dimen/route_info_buttons_padding_left_right" android:paddingLeft="@dimen/route_info_buttons_padding_left_right"
android:paddingRight="@dimen/route_info_buttons_padding_left_right" android:paddingRight="@dimen/route_info_buttons_padding_left_right"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_action_test_light" /> android:src="@drawable/ic_action_test_light" />
<View <View
@ -62,7 +62,7 @@
android:paddingLeft="@dimen/route_info_buttons_padding_left_right" android:paddingLeft="@dimen/route_info_buttons_padding_left_right"
android:paddingRight="@dimen/route_info_buttons_padding_left_right" android:paddingRight="@dimen/route_info_buttons_padding_left_right"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_action_test_light" /> android:src="@drawable/ic_action_test_light" />
<TextView <TextView

View file

@ -2,13 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:minHeight="@dimen/list_item_height" android:minHeight="@dimen/list_item_height"
android:orientation="vertical" android:orientation="vertical"
android:baselineAligned="false"> android:baselineAligned="false">
<LinearLayout <LinearLayout
android:id="@+id/content" android:id="@+id/content"
android:background="?attr/expandable_list_item_background" android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/list_content_padding" android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding" android:paddingRight="@dimen/list_content_padding"
android:orientation="horizontal" android:orientation="horizontal"
@ -18,8 +19,8 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="@dimen/content_padding_small" android:paddingBottom="@dimen/multi_selection_menu_padding_bottom"
android:paddingTop="@dimen/list_content_padding" android:paddingTop="@dimen/multi_selection_menu_padding_top"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
@ -42,7 +43,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:paddingTop="@dimen/list_content_padding" android:paddingTop="@dimen/multi_selection_menu_padding_top"
android:id="@+id/context_menu_icon_layout" android:id="@+id/context_menu_icon_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -64,6 +65,6 @@
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="?attr/dashboard_divider"/> tools:background="@color/multi_selection_menu_divider_dark"/>
</LinearLayout> </LinearLayout>

View file

@ -29,7 +29,7 @@
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="?attr/dashboard_divider"/> tools:background="@color/multi_selection_menu_divider_dark"/>
<FrameLayout <FrameLayout
android:id="@+id/cancel_row" android:id="@+id/cancel_row"
@ -44,7 +44,6 @@
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/shared_string_close" android:text="@string/shared_string_close"
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
android:textStyle="bold"/> android:textStyle="bold"/>
</FrameLayout> </FrameLayout>

View file

@ -10,7 +10,7 @@
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/header_title" android:id="@+id/header_title"
android:textAppearance="@style/TextAppearance.ListItemTitle" android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium" osmand:typeface="@string/font_roboto_regular"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

View file

@ -49,7 +49,7 @@
android:id="@+id/waypoints" android:id="@+id/waypoints"
android:layout_width="@dimen/list_item_height" android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/map_action_waypoints"/> android:src="@drawable/map_action_waypoints"/>
</LinearLayout> </LinearLayout>
@ -73,16 +73,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:background="?attr/selectableItemBackground"
android:id="@+id/FromLayout" android:id="@+id/FromLayout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
@ -131,39 +134,19 @@
android:layout_marginRight="@dimen/list_header_text_left_margin" android:layout_marginRight="@dimen/list_header_text_left_margin"
android:src="@drawable/ic_action_arrow_drop_down"/> android:src="@drawable/ic_action_arrow_drop_down"/>
<View
android:id="@+id/from_layout_empty_view"
android:layout_width="@dimen/route_info_directions_margin"
android:layout_height="match_parent"/>
</LinearLayout> </LinearLayout>
<FrameLayout <View
android:layout_marginStart="@dimen/route_info_divider_margin"
android:layout_marginLeft="@dimen/route_info_divider_margin"
android:id="@+id/dividerFromDropDown"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="1dp"
android:background="@color/dashboard_divider_dark"
<View android:focusable="false"/>
android:layout_marginStart="@dimen/route_info_divider_margin"
android:layout_marginLeft="@dimen/route_info_divider_margin"
android:layout_marginRight="@dimen/route_info_directions_margin"
android:layout_marginEnd="@dimen/route_info_directions_margin"
android:id="@+id/dividerFromDropDown"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dashboard_divider_dark"
android:focusable="false"/>
<View
android:id="@+id/divider_from_drop_down_empty"
android:layout_gravity="end"
android:layout_width="@dimen/route_info_directions_margin"
android:layout_height="1dp"
android:focusable="false"
android:background="@color/dashboard_divider_dark"/>
</FrameLayout>
<LinearLayout <LinearLayout
android:background="?attr/selectableItemBackground"
android:id="@+id/ViaLayout" android:id="@+id/ViaLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
@ -219,6 +202,7 @@
android:focusable="false"/> android:focusable="false"/>
<LinearLayout <LinearLayout
android:background="?attr/selectableItemBackground"
android:id="@+id/ToLayout" android:id="@+id/ToLayout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
@ -267,16 +251,12 @@
android:layout_marginRight="@dimen/list_header_text_left_margin" android:layout_marginRight="@dimen/list_header_text_left_margin"
android:src="@drawable/ic_action_arrow_drop_down"/> android:src="@drawable/ic_action_arrow_drop_down"/>
<View
android:id="@+id/to_layout_empty_view"
android:layout_width="@dimen/route_info_directions_margin"
android:layout_height="match_parent"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:background="?attr/selectableItemBackground"
android:id="@+id/swap_direction_image_view" android:id="@+id/swap_direction_image_view"
android:paddingRight="@dimen/route_info_icon_padding_right" android:paddingRight="@dimen/route_info_icon_padding_right"
android:paddingLeft="@dimen/route_info_icon_padding_right" android:paddingLeft="@dimen/route_info_icon_padding_right"
@ -285,7 +265,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
</FrameLayout> </LinearLayout>
<View <View
android:id="@+id/dividerToDropDown" android:id="@+id/dividerToDropDown"
@ -304,7 +284,7 @@
android:id="@+id/Info" android:id="@+id/Info"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:minHeight="@dimen/list_item_height" android:minHeight="@dimen/list_item_height"
android:orientation="horizontal"> android:orientation="horizontal">
@ -312,7 +292,7 @@
android:id="@+id/Prev" android:id="@+id/Prev"
android:layout_width="@dimen/list_item_height" android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:contentDescription="@string/shared_string_previous" android:contentDescription="@string/shared_string_previous"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_prev"/> android:src="@drawable/ic_prev"/>
@ -366,7 +346,7 @@
android:layout_marginRight="@dimen/list_content_padding" android:layout_marginRight="@dimen/list_content_padding"
android:contentDescription="@string/info_button" android:contentDescription="@string/info_button"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_action_time"/> android:src="@drawable/ic_action_time_span"/>
<LinearLayout <LinearLayout
android:id="@+id/InfoDuration" android:id="@+id/InfoDuration"
@ -411,7 +391,7 @@
android:layout_width="@dimen/list_item_height" android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height" android:layout_height="@dimen/list_item_height"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:background="?attr/dashboard_button" android:background="?attr/selectableItemBackground"
android:contentDescription="@string/shared_string_next" android:contentDescription="@string/shared_string_next"
android:scaleType="center" android:scaleType="center"
android:src="@drawable/ic_next"/> android:src="@drawable/ic_next"/>

View file

@ -7,6 +7,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:foreground="?attr/selectableItemBackground"
android:textAllCaps="true" android:textAllCaps="true"
osmand:typeface="@string/font_roboto_medium" osmand:typeface="@string/font_roboto_medium"
android:textColor="@color/color_white" android:textColor="@color/color_white"

View file

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
osmand:layout_scrollFlags="scroll|enterAlways"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
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"
tools:src="@drawable/ic_arrow_back"/>
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/select_language_text_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/content_padding_small"
android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/context_menu_padding_margin_small"
android:layout_marginRight="@dimen/context_menu_padding_margin_small"
tools:background="?attr/ctx_menu_controller_bg"
android:gravity="center_vertical"
android:padding="@dimen/context_menu_padding_margin_tiny"
android:textAllCaps="true"
tools:textColor="?attr/ctx_menu_controller_text_color"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="RU"/>
</LinearLayout>
<TextView
android:id="@+id/title_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingTop="@dimen/list_header_padding"
android:paddingBottom="@dimen/list_header_padding"
android:textSize="@dimen/map_button_text_size"
tools:text="Title"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
osmand:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/content_padding"/>
</android.support.v4.widget.NestedScrollView>
<net.osmand.plus.widgets.TextViewEx
osmand:typeface="@string/font_roboto_medium"
android:layout_margin="@dimen/content_padding"
android:id="@+id/read_full_article"
android:layout_gravity="bottom|center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:background="@drawable/bt_round_long_night"
android:text="@string/read_full_article"
android:gravity="center_vertical"
android:textAllCaps="true"
tools:textColor="?attr/ctx_menu_controller_text_color"/>
</android.support.design.widget.CoordinatorLayout>

View file

@ -2963,4 +2963,9 @@ U vypadku, kali vy lubіcie OsmAnd і OSM і chočacie padtrymać jaho, heta іd
<string name="osm_recipient_stat">Zmien %1$s, suma %2$s mBTC</string> <string name="osm_recipient_stat">Zmien %1$s, suma %2$s mBTC</string>
<string name="osm_recipients_label">OSM-atrymaĺniki</string> <string name="osm_recipients_label">OSM-atrymaĺniki</string>
<string name="total_donations">Usiaho achviaravanniaŭ</string> <string name="total_donations">Usiaho achviaravanniaŭ</string>
</resources> <string name="open_from">Adkryta z</string>
<string name="open_till">Adkryta da</string>
<string name="will_close_at">Zakryjecca a</string>
<string name="will_open_at">Adkryjecca a</string>
<string name="will_open_on">Adkryjecca</string>
</resources>

View file

@ -3012,4 +3012,9 @@
<string name="osm_recipient_stat">Змен %1$s, сума %2$s mBTC</string> <string name="osm_recipient_stat">Змен %1$s, сума %2$s mBTC</string>
<string name="osm_recipients_label">OSM-атрымальнікі</string> <string name="osm_recipients_label">OSM-атрымальнікі</string>
<string name="total_donations">Усяго ахвяраванняў</string> <string name="total_donations">Усяго ахвяраванняў</string>
</resources> <string name="open_from">Адкрыта з</string>
<string name="open_till">Адкрыта да</string>
<string name="will_close_at">Закрыецца а</string>
<string name="will_open_at">Адкрыецца а</string>
<string name="will_open_on">Адкрыецца</string>
</resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><resources> <?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="add_tag">Προσθήκη Ετικέτας</string> <string name="add_tag">Προσθήκη Ετικέτας</string>
<string name="btn_advanced_mode">Λειτουργία για προχωρημένους…</string> <string name="btn_advanced_mode">Λειτουργία για προχωρημένους…</string>
<string name="poi_filter_parking">Στάθμευση</string> <string name="poi_filter_parking">Στάθμευση</string>
@ -1084,7 +1085,7 @@
<string name="keep_intermediate_points">Διατήρηση ενδιάμεσων προορισμών</string> <string name="keep_intermediate_points">Διατήρηση ενδιάμεσων προορισμών</string>
<string name="context_menu_item_directions_to">Οδηγίες προς</string> <string name="context_menu_item_directions_to">Οδηγίες προς</string>
<string name="context_menu_item_directions_from">Οδηγίες από</string> <string name="context_menu_item_directions_from">Οδηγίες από</string>
<string name="route_descr_map_location">Χάρτης:</string> <string name="route_descr_map_location">Χάρτης:</string>
<string name="route_to">Προς:</string> <string name="route_to">Προς:</string>
<string name="route_via">Μέσω:</string> <string name="route_via">Μέσω:</string>
<string name="route_from">Από:</string> <string name="route_from">Από:</string>
@ -1719,4 +1720,23 @@
<string name="rendering_value_medium_name">Μέτριο</string> <string name="rendering_value_medium_name">Μέτριο</string>
<string name="rendering_value_bold_name">Παχύ</string> <string name="rendering_value_bold_name">Παχύ</string>
<string name="report">Αναφορά</string> <string name="report">Αναφορά</string>
<string name="keep_showing_on_map">Διατήρηση εμφάνισης στο χάρτη</string>
<string name="exit_without_saving">Έξοδος χωρίς αποθήκευση;</string>
<string name="shared_string_options">Επιλογές</string>
<string name="none_point_error">Παρακαλώ προσθέστε τουλάχιστον ένα σημείο.</string>
<string name="show_on_map_after_saving">Εμφάνιση στο χάρτη μετά την αποθήκευση</string>
<string name="shared_string_reset">Επαναφορά</string>
<string name="shared_string_reload">Επαναφόρτωση</string>
<string name="mapillary_menu_date_from">Από</string>
<string name="mapillary_menu_title_username">Παρωνύμιο</string>
<string name="shared_string_permissions">Άδειες</string>
<string name="distance_moving">Η απόσταση διορθώθηκε</string>
<string name="open_mapillary">Άνοιγμα του Mapillary</string>
<string name="shared_string_install">Εγκατάσταση</string>
<string name="online_photos">Online φωτογραφίες</string>
<string name="shared_string_add_photos">Προσθήκη φωτογραφιών</string>
<string name="nothing_found">Δεν βρέθηκε κάτι :(</string>
<string name="quick_action_showhide_osmbugs_title">Εμφάνιση/απόκρυψη σημειώσεων OSM</string>
<string name="quick_action_osmbugs_show">Εμφάνιση σημειώσεων OSM</string>
<string name="quick_action_osmbugs_hide">Απόκρυψη σημειώσεων OSM</string>
</resources> </resources>

View file

@ -2605,4 +2605,6 @@
<string name="navigate_point_olc">פתיחת קוד מיקום</string> <string name="navigate_point_olc">פתיחת קוד מיקום</string>
<string name="osm_recipients_label">נמעני OSM</string> <string name="osm_recipients_label">נמעני OSM</string>
<string name="total_donations">סך כל התרומות</string> <string name="total_donations">סך כל התרומות</string>
</resources> <string name="access_direction_audio_feedback_descr">ציון כיוון נקודת היעד עם צליל.</string>
<string name="delay_to_start_navigation_descr">נא לציין את זמן ההמתנה להישאר במסך תכנון הנתיב.</string>
</resources>

View file

@ -602,8 +602,8 @@
<string name="poi_wood">Skógur</string> <string name="poi_wood">Skógur</string>
<string name="poi_strait">Sund</string> <string name="poi_strait">Sund</string>
<string name="poi_anchorage">Akkerisfestar</string> <string name="poi_anchorage">Akkerisfestar</string>
<string name="poi_anchor_berth">Viðlegufæri</string> <string name="poi_anchor_berth">Akkerislægi</string>
<string name="poi_berth">Ból</string> <string name="poi_berth">Skipalægi</string>
<string name="poi_buoy_isolated_danger">Bauja, einangruð hætta</string> <string name="poi_buoy_isolated_danger">Bauja, einangruð hætta</string>
<string name="poi_dry_dock">Þurrkví</string> <string name="poi_dry_dock">Þurrkví</string>
<string name="poi_floating_dock">Flotkví</string> <string name="poi_floating_dock">Flotkví</string>
@ -1353,11 +1353,11 @@
<string name="poi_impromptu_no">Án pöntunar: nei</string> <string name="poi_impromptu_no">Án pöntunar: nei</string>
<string name="poi_sanitary_dump_station_yes">Stöð fyrir hreinlætisúrgang: já</string> <string name="poi_sanitary_dump_station_yes">Stöð fyrir hreinlætisúrgang: já</string>
<string name="poi_sanitary_dump_station_no">Stöð fyrir hreinlætisúrgang: nei</string> <string name="poi_sanitary_dump_station_no">Stöð fyrir hreinlætisúrgang: nei</string>
<string name="poi_power_supply_no">Rafmagnsinnstungur: nei</string> <string name="poi_power_supply_no">Aflgjafi: nei</string>
<string name="poi_power_supply_cee_17_blue">Rafmagnsinnstungur: CEE 17 blátt</string> <string name="poi_power_supply_cee_17_blue">Aflgjafi (innstunga): CEE 17 blátt</string>
<string name="poi_power_supply_cee_7_4">Rafmagnsinnstungur: CEE 7/4</string> <string name="poi_power_supply_cee_7_4">Aflgjafi (innstunga): CEE 7/4</string>
<string name="poi_power_supply_cee_7_5">Rafmagnsinnstungur: CEE 7/5</string> <string name="poi_power_supply_cee_7_5">Aflgjafi (innstunga): CEE 7/5</string>
<string name="poi_power_supply_nema_5_15">Rafmagnsinnstungur: NEMA 5-15</string> <string name="poi_power_supply_nema_5_15">Aflgjafi (innstunga): NEMA 5-15</string>
<string name="poi_capacity_tents">Hámarksfjöldi tjalda</string> <string name="poi_capacity_tents">Hámarksfjöldi tjalda</string>
<string name="poi_capacity_caravans">Hámarksfjöldi hjólhýsa</string> <string name="poi_capacity_caravans">Hámarksfjöldi hjólhýsa</string>
@ -1782,7 +1782,7 @@
<string name="poi_diet">Mataræði</string> <string name="poi_diet">Mataræði</string>
<string name="poi_health_specialty">Heilsutengt sérsvið</string> <string name="poi_health_specialty">Heilsutengt sérsvið</string>
<string name="poi_massage_type">Tegund af nuddi</string> <string name="poi_massage_type">Tegund af nuddi</string>
<string name="poi_power_supply">Rafmagnsinnstungur</string> <string name="poi_power_supply">Aflgjafi</string>
<string name="poi_medical_system">Lækningasvið</string> <string name="poi_medical_system">Lækningasvið</string>
<string name="poi_home_visit">Heimsóknir</string> <string name="poi_home_visit">Heimsóknir</string>
<string name="poi_free_flying_characteristic">Eiginleikar</string> <string name="poi_free_flying_characteristic">Eiginleikar</string>
@ -2918,4 +2918,274 @@
<string name="poi_water_purification_reverse_osmosis">Öfug osmósa</string> <string name="poi_water_purification_reverse_osmosis">Öfug osmósa</string>
<string name="poi_water_place_access_community">Samfélag</string> <string name="poi_water_place_access_community">Samfélag</string>
<string name="poi_water_place_access_family">Fjölskylda</string> <string name="poi_water_place_access_family">Fjölskylda</string>
<string name="poi_water_place_access">Aðgangur að vatni</string>
<string name="poi_car_sharing">Deiling bíla</string>
<string name="poi_boat_sharing">Deiling báta</string>
<string name="poi_payment_terminal">Greiðslukassi</string>
<string name="poi_money_lender">Peningaútlán</string>
<string name="poi_lock_basin">Lokukví skipastiga</string>
<string name="poi_seamark_clearance_height">Nothæf hæð</string>
<string name="poi_seamark_clearance_height_closed">Nothæf hæð (lokað)</string>
<string name="poi_seamark_clearance_height_open">Nothæf hæð (opið)</string>
<string name="poi_seamark_clearance_width">Nothæf breidd</string>
<string name="poi_military_bunker">Hernaðarsprengjubyrgi</string>
<string name="poi_military_range">Hersvæði</string>
<string name="poi_military_office">Hermálaskrifstofa</string>
<string name="poi_icn_ref">Hnútur í alþjóðlegu hjólaleiðaneti</string>
<string name="poi_ncn_ref">Hnútur í landsbundnu hjólaleiðaneti</string>
<string name="poi_rcn_ref">Hnútur í svæðisbundnu hjólaleiðaneti</string>
<string name="poi_lcn_ref">Hnútur í svtaðbundnu hjólaleiðaneti</string>
<string name="poi_iwn_ref">Hnútur í alþjóðlegu gönguleiðaneti</string>
<string name="poi_nwn_ref">Hnútur í landsbundnu gönguleiðaneti</string>
<string name="poi_rwn_ref">Hnútur í svæðisbundnu gönguleiðaneti</string>
<string name="poi_lwn_ref">Hnútur í staðbundnu gönguleiðaneti</string>
<string name="poi_route_hiking_iwn_poi">Alþjóðleg gönguleið</string>
<string name="poi_route_hiking_nwn_poi">Gönguleið á landsvísu</string>
<string name="poi_route_hiking_rwn_poi">Svæðisbundin gönguleið</string>
<string name="poi_route_hiking_lwn_poi">Staðbundin gönguleið</string>
<string name="poi_route_hiking_ref_poi">Tilvísun gönguleiðar</string>
<string name="poi_aerialway_summer_access_entry">Aðgangur að sumarlagi: einungis inngangur</string>
<string name="poi_aerialway_summer_access_exit">Aðgangur að sumarlagi: einungis útgangur</string>
<string name="poi_aerialway_summer_access_both">Aðgangur að sumarlagi: út- og inngangur</string>
<string name="poi_love_hotel">Elskendahótel</string>
<string name="poi_payment_pikepass_designated">PIKEPASS (uppgefið)</string>
<string name="poi_payment_routex_yes">Routex</string>
<string name="poi_payment_routex_no">Ekki tekið við Routex eldsneytiskortum</string>
<string name="poi_payment_bancomat_yes">Bancomat</string>
<string name="poi_payment_bancomat_no">Ekki tekið við Bancomat</string>
<string name="poi_payment_icsf_yes">IC Stored Fare</string>
<string name="poi_payment_icsf_no">Ekki tekið við IC Stored Fare kortum</string>
<string name="poi_payment_prepaid_ticket_yes">Fyrirframgreiddir miðar</string>
<string name="poi_payment_jcb_yes">JCB</string>
<string name="poi_payment_jcb_no">Ekki tekið við JCB-kortum</string>
<string name="poi_payment_laser_yes">Laser</string>
<string name="poi_payment_laser_no">Ekki tekið við Laser-kortum</string>
<string name="poi_payment_ep_quick_yes">Quick</string>
<string name="poi_payment_ep_quick_no">Ekki tekið við Quick-kortum</string>
<string name="poi_payment_eurowag_yes">Eurowag</string>
<string name="poi_payment_eurowag_no">Ekki tekið við Eurowag-kortum</string>
<string name="poi_payment_e_zpass_yes">EZPass</string>
<string name="poi_payment_e_zpass_no">Ekki tekið við EZPass</string>
<string name="poi_payment_euroshell_yes">Euroshell</string>
<string name="poi_payment_euroshell_no">Ekki tekið við Euroshell eldsneytiskortum</string>
<string name="poi_payment_kitcard_yes">KITCard</string>
<string name="poi_payment_kitcard_no">Ekki tekið við KITCard</string>
<string name="poi_payment_westfalen_card_yes">Westfalen</string>
<string name="poi_payment_westfalen_card_no">Ekki tekið við Westfalen-kortum</string>
<string name="poi_payment_v_pay_yes">V PAY</string>
<string name="poi_payment_v_pay_no">Ekki tekið við V-PAY kortum</string>
<string name="poi_payment_dogecoin_yes">Dogecoin</string>
<string name="poi_payment_dogecoin_no">Ekki tekið við Dogecoin</string>
<string name="poi_payment_cibus_yes">Cibus</string>
<string name="poi_payment_cibus_no">Ekki tekið við Cibus-kortum</string>
<string name="poi_payment_ep_cash_yes">Reiðufjárkort (Geldkarte)</string>
<string name="poi_payment_ep_cash_no">Ekki tekið við reiðufjárkortum (Geldkarte)</string>
<string name="poi_payment_ep_proton_yes">Proton</string>
<string name="poi_payment_ep_proton_no">Ekki tekið við Proton-kortum</string>
<string name="poi_payment_ep_avant_yes">AvantCard</string>
<string name="poi_payment_ep_avant_no">Ekki tekið við AvantCard</string>
<string name="poi_payment_ep_mep_yes">MEP</string>
<string name="poi_payment_ep_mep_no">Ekki tekið við MEP</string>
<string name="poi_payment_ep_minipay_yes">Minipay</string>
<string name="poi_payment_ep_minipay_no">Ekki tekið við Minipay</string>
<string name="poi_payment_ep_minicash_yes">MiniCash</string>
<string name="poi_payment_ep_minicash_no">Ekki tekið við MiniCash</string>
<string name="poi_payment_ep_moneo_yes">Moneo</string>
<string name="poi_payment_ep_moneo_no">Ekki tekið við Moneo</string>
<string name="poi_payment_ep_monedero4b_yes">Monedero 4B</string>
<string name="poi_payment_ep_monedero4b_no">Ekki tekið við Monedero 4B</string>
<string name="poi_payment_ep_monedero_yes">Monedero</string>
<string name="poi_payment_ep_monedero_no">Ekki tekið við Monedero</string>
<string name="poi_payment_bankaxess_yes">BankAxess</string>
<string name="poi_payment_bankaxess_no">Ekki tekið við BankAxess</string>
<string name="poi_payment_coinkite_yes">Coinkite</string>
<string name="poi_payment_coinkite_no">Ekki tekið við Coinkite</string>
<string name="poi_payment_roadrunner_yes">Roadrunner</string>
<string name="poi_payment_roadrunner_no">Ekki tekið við Roadrunner-kortum</string>
<string name="poi_payment_sube_yes">SUBE</string>
<string name="poi_payment_sube_no">Ekki tekið við SUBE-kortum</string>
<string name="poi_payment_via_verde_yes">Via Verde</string>
<string name="poi_payment_via_verde_no">Ekki tekið við Via Verde</string>
<string name="poi_payment_u_key_yes">U-Key</string>
<string name="poi_payment_u_key_no">Ekki tekið við U-Key</string>
<string name="poi_payment_gift_card_yes">Gjafakort</string>
<string name="poi_payment_gift_card_no">Ekki tekið við gjafakortum</string>
<string name="poi_payment_golden_crown_yes">Golden Crown</string>
<string name="poi_payment_golden_crown_no">Ekki tekið við Golden Crown kortum</string>
<string name="poi_payment_pro100_yes">PRO100</string>
<string name="poi_payment_pro100_no">Ekki tekið við PRO100-kortum</string>
<string name="poi_payment_union_card_yes">Union-kort</string>
<string name="poi_payment_union_card_no">Ekki tekið við Union-greiðslukortum</string>
<string name="poi_payment_mtsmoney_yes">MTS-Money</string>
<string name="poi_payment_mtsmoney_no">Ekki tekið við MTS-Money</string>
<string name="poi_payment_yandexmoney_yes">Yandex.Money</string>
<string name="poi_payment_yandexmoney_no">Ekki tekið við Yandex.Money</string>
<string name="poi_vending_fuel">Eldsneytissjálfsali</string>
<string name="poi_vending_toll">Tollsjálfsali</string>
<string name="poi_vending_water">Vatnssjálfsali</string>
<string name="poi_vending_telephone_vouchers">Símaávísanir</string>
<string name="poi_vending_vouchers">Greiðsluseðlar</string>
<string name="poi_wheelchair_designated">Uppgefið</string>
<string name="poi_socket_cee_blue">Rafmagnsinnstunga: CEE blátt</string>
<string name="poi_socket_cee_blue_current">Rafmagnsinnstunga: CEE blátt: straumur</string>
<string name="poi_socket_cee_blue_output">Rafmagnsinnstunga: CEE blátt: úttak</string>
<string name="poi_socket_cee_red_16a">Rafmagnsinnstunga: CEE rautt 16A</string>
<string name="poi_socket_cee_red_16a_current">Rafmagnsinnstunga: CEE rautt 16A: straumur</string>
<string name="poi_socket_cee_red_16a_output">Rafmagnsinnstunga: CEE rautt 16A: úttak</string>
<string name="poi_socket_cee_red_32a">Rafmagnsinnstunga: CEE rautt 32A</string>
<string name="poi_socket_cee_red_32a_current">Rafmagnsinnstunga: CEE rautt 32A: straumur</string>
<string name="poi_socket_cee_red_32a_output">Rafmagnsinnstunga: CEE rautt 32A: úttak</string>
<string name="poi_socket_cee_red_64a">Rafmagnsinnstunga: CEE rautt 64A</string>
<string name="poi_socket_cee_red_64a_current">Rafmagnsinnstunga: CEE rautt 64A: straumur</string>
<string name="poi_socket_cee_red_64a_output">Rafmagnsinnstunga: CEE rautt 64A: úttak</string>
<string name="poi_socket_cee_red_125a">Rafmagnsinnstunga: CEE rautt 125A</string>
<string name="poi_socket_cee_red_125a_current">Rafmagnsinnstunga: CEE rautt 125A: straumur</string>
<string name="poi_socket_cee_red_125a_output">Rafmagnsinnstunga: CEE rautt 125A: úttak</string>
<string name="poi_socket_type1">Rafmagnsinnstunga: Type 1</string>
<string name="poi_socket_type1_current">Rafmagnsinnstunga: Type 1: straumur</string>
<string name="poi_socket_type1_output">Rafmagnsinnstunga: Type 1: úttak</string>
<string name="poi_socket_type1_combo">Rafmagnsinnstunga: Type 1 combo</string>
<string name="poi_socket_type1_combo_current">Rafmagnsinnstunga: Type 1 combo: straumur</string>
<string name="poi_socket_type1_combo_output">Rafmagnsinnstunga: Type 1 combo: úttak</string>
<string name="poi_socket_type2">Rafmagnsinnstunga: Type 2</string>
<string name="poi_socket_type2_current">Rafmagnsinnstunga: Type 2: straumur</string>
<string name="poi_socket_type2_output">Rafmagnsinnstunga: Type 2: úttak</string>
<string name="poi_socket_type2_combo">Rafmagnsinnstunga: Type 2 combo</string>
<string name="poi_socket_type2_combo_current">Rafmagnsinnstunga: Type 2 combo: straumur</string>
<string name="poi_socket_type2_combo_output">Rafmagnsinnstunga: Type 2 combo: úttak</string>
<string name="poi_socket_type3">Rafmagnsinnstunga: Type 3</string>
<string name="poi_socket_type3_current">Rafmagnsinnstunga: Type 3: straumur</string>
<string name="poi_socket_type3_output">Rafmagnsinnstunga: Type 3: úttak</string>
<string name="poi_socket_chademo">Rafmagnsinnstunga: CHAdeMO</string>
<string name="poi_socket_chademo_current">Rafmagnsinnstunga: CHAdeMO: straumur</string>
<string name="poi_socket_chademo_output">Rafmagnsinnstunga: CHAdeMO: úttak</string>
<string name="poi_socket_tesla_standard">Rafmagnsinnstunga: Staðlað Tesla</string>
<string name="poi_socket_tesla_standard_current">Rafmagnsinnstunga: Staðlað Tesla: straumur</string>
<string name="poi_socket_tesla_standard_output">Rafmagnsinnstunga: Staðlað Tesla: úttak</string>
<string name="poi_socket_tesla_supercharger">Rafmagnsinnstunga: Tesla Supercharger</string>
<string name="poi_socket_tesla_supercharger_current">Rafmagnsinnstunga: Tesla Supercharger: straumur</string>
<string name="poi_socket_tesla_supercharger_output">Rafmagnsinnstunga: Tesla Supercharger: úttak</string>
<string name="poi_socket_tesla_roadster">Rafmagnsinnstunga: Tesla Roadster</string>
<string name="poi_socket_tesla_roadster_current">Rafmagnsinnstunga: Tesla Roadster: straumur</string>
<string name="poi_socket_tesla_roadster_output">Rafmagnsinnstunga: Tesla Roadster: úttak</string>
<string name="poi_socket_nema_5_15">Rafmagnsinnstunga: NEMA 5-15R</string>
<string name="poi_car_yes">Bíll: já</string>
<string name="poi_car_no">Bíll: nei</string>
<string name="poi_bicycle_yes">Reiðhjól: já</string>
<string name="poi_bicycle_no">Reiðhjól: nei</string>
<string name="poi_scooter_yes">Skellinaðra: já</string>
<string name="poi_scooter_no">Skellinaðra: nei</string>
<string name="poi_truck_yes">Flutningabifreið: já</string>
<string name="poi_truck_no">Flutningabifreið: nei</string>
<string name="poi_parking_fee_yes">Bílastæðagjöld: já</string>
<string name="poi_parking_fee_no">Bílastæðagjöld: nei</string>
<string name="poi_parking_fee">Bílastæðagjöld</string>
<string name="poi_amperage">Amperstyrkur</string>
<string name="poi_charging_station_output">Aflúttak hleðslustöðvar</string>
<string name="poi_map_type_topo">Tegund korts: landfræðileg</string>
<string name="poi_map_type_street">Tegund korts: götukort</string>
<string name="poi_map_type_scheme">Tegund korts: skematísk</string>
<string name="poi_map_size_city">Tegund korts: borgarkort</string>
<string name="poi_map_size_region">Tegund korts: héraðskort</string>
<string name="poi_letter_box">Bréfakassi</string>
<string name="poi_post_street">Gata</string>
<string name="poi_post_housenumber">Húsnúmer</string>
<string name="poi_post_flats">Íbúð</string>
<string name="poi_payment_centre">Greiðslumiðstöð</string>
<string name="poi_money_transfer">Greiðslumiðlun</string>
<string name="poi_government_archive">Skjalasafn</string>
<string name="poi_government_treasury">Ríkissjóður</string>
<string name="poi_government_transportation">Samgöngustofnun</string>
<string name="poi_government_legislative">Lagastofnun</string>
<string name="poi_location_underwater">Staðsetning: neðan vatnsyfirborðs</string>
<string name="poi_location_overground">Staðsetning: á yfirborði</string>
<string name="poi_location_overhead">Staðsetning: upphengt</string>
<string name="poi_location_roof">Staðsetning: þak</string>
<string name="poi_location_rooftop">Staðsetning: efst á þaki</string>
<string name="poi_location_outdoor">Staðsetning: utandyra</string>
<string name="poi_location_indoor">Staðsetning: innandyra</string>
<string name="poi_location_platform">Staðsetning: pallur</string>
<string name="poi_location_kiosk">Staðsetning: sölubás</string>
<string name="poi_location_bridge">Staðsetning: brú</string>
<string name="poi_location_wall">Staðsetning: veggur</string>
<string name="poi_location_entrance">Staðsetning: inngangur</string>
<string name="poi_visibility_house">Sýnileiki: hús</string>
<string name="poi_visibility_street">Sýnileiki: gata</string>
<string name="poi_visibility_area">Sýnileiki: svæði</string>
<string name="poi_socket_nema_5_15_current">Rafmagnsinnstunga: NEMA 5-15R: straumur</string>
<string name="poi_socket_nema_5_15_output">Rafmagnsinnstunga: NEMA 5-15R: úttak</string>
<string name="poi_socket_nema_5_20">Rafmagnsinnstunga: NEMA 5-20</string>
<string name="poi_socket_nema_5_20_current">Rafmagnsinnstunga: NEMA 5-20: straumur</string>
<string name="poi_socket_nema_5_20_output">Rafmagnsinnstunga: NEMA 5-20: úttak</string>
<string name="poi_socket_nema_14_30">Rafmagnsinnstunga: NEMA 14-30</string>
<string name="poi_socket_nema_14_30_current">Rafmagnsinnstunga: NEMA 14-30: straumur</string>
<string name="poi_socket_nema_14_30_output">Rafmagnsinnstunga: NEMA 14-30: úttak</string>
<string name="poi_socket_nema_14_50">Rafmagnsinnstunga: NEMA 14-50</string>
<string name="poi_socket_nema_14_50_current">Rafmagnsinnstunga: NEMA 14-50: straumur</string>
<string name="poi_socket_nema_14_50_output">Rafmagnsinnstunga: NEMA 14-50: úttak</string>
<string name="poi_socket_schuko">Rafmagnsinnstunga: Schuko</string>
<string name="poi_socket_schuko_current">Rafmagnsinnstunga: Schuko: straumur</string>
<string name="poi_socket_schuko_output">Rafmagnsinnstunga: Schuko: úttak</string>
<string name="poi_socket_bs1363">Rafmagnsinnstunga: BS 1363</string>
<string name="poi_socket_bs1363_current">Rafmagnsinnstunga: BS 1363: straumur</string>
<string name="poi_socket_bs1363_output">Rafmagnsinnstunga: BS 1363: úttak</string>
<string name="poi_socket_as3112">Rafmagnsinnstunga: AS/NZS 3112</string>
<string name="poi_socket_as3112_current">Rafmagnsinnstunga: AS/NZS 3112: straumur</string>
<string name="poi_socket_as3112_output">Rafmagnsinnstunga: AS/NZS 3112: úttak</string>
<string name="poi_variety_store">Smávörumarkaður</string>
<string name="poi_energy">Verslun orkusöluaðila</string>
<string name="poi_denomination_bulgarian_orthodox">Búlgarska réttrúnaðarkirkjan</string>
<string name="poi_denomination_armenian_apostolic">Armenska postulakirkjan</string>
<string name="poi_denomination_romanian_orthodox">Rúmenska rétttrúnaðarkirkjan</string>
<string name="poi_craft_stand_builder">Kynningarbásagerð</string>
<string name="poi_craft_sun_protection">Sólarvarnir</string>
<string name="poi_craft_sweep">Sóthreinsun</string>
<string name="poi_craft_tiler">Flísaleggjari</string>
<string name="poi_cutline">Grisjunarfar</string>
<string name="poi_beacon_cardinal">Höfuðáttamerki</string>
<string name="poi_beacon_lateral">Hliðarmerki</string>
<string name="poi_beacon_safe_water">Sjómerki á öruggri siglingaleið</string>
<string name="poi_buoy_cardinal">Höfuðáttadufl</string>
<string name="poi_buoy_installation">Festardufl</string>
<string name="poi_buoy_lateral">Hliðardufl</string>
<string name="poi_buoy_safe_water">Dufl á öruggri siglingaleið</string>
<string name="poi_notice">Upplýsingar, sjómerki</string>
<string name="poi_pile">Staur</string>
<string name="poi_small_craft_facility">Smábátaaðstaða</string>
<string name="poi_topmark">Toppmerki, sjómerki</string>
<string name="poi_sally_port">Virkishlið</string>
<string name="poi_kent_carriage_gap">Kent-hlið fyrir hestaumferð</string>
<string name="poi_payment_token_yes">Aðrir greiðslumátar</string>
<string name="poi_payment_token_no">Ekki tekið við öðru en reiðufé og greiðslukortum</string>
<string name="poi_events_venue">Aðstaða fyrir atburð</string>
<string name="poi_vending_elongated_coin">Myntpressa</string>
<string name="poi_motorcycle_type_standard">Staðlað</string>
<string name="poi_generator_output_electricity_no">Úttak: (rafmagn): nei</string>
<string name="poi_owner">Eigandi</string>
<string name="poi_reservation_required">Panta fyrirfram: nauðsynleg</string>
<string name="poi_reservation_recommended">Panta fyrirfram: mælt með</string>
<string name="poi_reservation_yes">Panta fyrirfram: já</string>
<string name="poi_reservation_no">Panta fyrirfram: nei</string>
<string name="poi_reservation_members_only">Panta fyrirfram: einungis meðlimir</string>
</resources> </resources>

View file

@ -175,7 +175,12 @@
<dimen name="multi_selection_header_height">78dp</dimen> <dimen name="multi_selection_header_height">78dp</dimen>
<dimen name="grid_menu_item_width">180dp</dimen> <dimen name="wikipedia_button_left_padding">29dp</dimen>
<dimen name="grid_menu_item_bottom_top_margin">24dp</dimen>
<dimen name="grid_menu_item_sides_margin">60dp</dimen> <dimen name="multi_selection_menu_padding_top">20dp</dimen>
<dimen name="multi_selection_menu_padding_bottom">23dp</dimen>
<dimen name="grid_menu_item_width">180dp</dimen>
<dimen name="grid_menu_item_bottom_top_margin">24dp</dimen>
<dimen name="grid_menu_item_sides_margin">60dp</dimen>
</resources> </resources>

View file

@ -844,7 +844,7 @@
<string name="show_more_map_detail_descr">Vis noen vektorkartdetaljer (veier etc.) allerede ved lavere zoom.</string> <string name="show_more_map_detail_descr">Vis noen vektorkartdetaljer (veier etc.) allerede ved lavere zoom.</string>
<string name="choose_audio_stream">Utdata for taleveiledning</string> <string name="choose_audio_stream">Utdata for taleveiledning</string>
<string name="choose_audio_stream_descr">Velg høyttaleren til å avspille taleveiledningen.</string> <string name="choose_audio_stream_descr">Velg høyttaleren til å avspille taleveiledningen.</string>
<string name="voice_stream_voice_call">Taleanropslyd</string> <string name="voice_stream_voice_call">"Telefonanropslyd (også for å avbryte bluetooth-bilstereo)"</string>
<string name="voice_stream_notification">Varslingslyd</string> <string name="voice_stream_notification">Varslingslyd</string>
<string name="voice_stream_music">Media-/musikklyd</string> <string name="voice_stream_music">Media-/musikklyd</string>
<string name="level_to_switch_vector_raster_descr">Minimum zoomnivå for å bruke vektorkart.</string> <string name="level_to_switch_vector_raster_descr">Minimum zoomnivå for å bruke vektorkart.</string>
@ -1873,7 +1873,7 @@
<string name="trip_rec_notification_settings_desc">Vis et systemvarsel slik at du kan starte turopptak.</string> <string name="trip_rec_notification_settings_desc">Vis et systemvarsel slik at du kan starte turopptak.</string>
<string name="save_track_min_speed">Minimumshastighet for logging</string> <string name="save_track_min_speed">Minimumshastighet for logging</string>
<string name="save_track_min_speed_descr">Filter: Still inn minimumshastighet for at et punkt skal logges.</string> <string name="save_track_min_speed_descr">Filter: Still inn minimumshastighet for at et punkt skal logges.</string>
<string name="save_track_min_distance">Logging ved bevegelsesoppdagelse</string> <string name="save_track_min_distance">Minsteavstand for logging</string>
<string name="save_track_min_distance_descr">Filter: Angi minste avstand fra siste posisjon for at et punkt skal logges.</string> <string name="save_track_min_distance_descr">Filter: Angi minste avstand fra siste posisjon for at et punkt skal logges.</string>
<string name="save_track_precision">Minste loggingspresisjon</string> <string name="save_track_precision">Minste loggingspresisjon</string>
<string name="save_track_precision_descr">Filter: Velg minste presisjon som starter loggføring av et punkt.</string> <string name="save_track_precision_descr">Filter: Velg minste presisjon som starter loggføring av et punkt.</string>
@ -2469,7 +2469,7 @@ Representerer området: %1$s x %2$s</string>
<string name="live_monitoring_max_interval_to_send_desrc">Oppgi tidsmellomlager for å beholde plasseringer å sende uten tilkobling</string> <string name="live_monitoring_max_interval_to_send_desrc">Oppgi tidsmellomlager for å beholde plasseringer å sende uten tilkobling</string>
<string name="shared_string_others">Annet</string> <string name="shared_string_others">Annet</string>
<string name="trace_rendering">Tegner feilrettingsinfo</string> <string name="trace_rendering">Tegner feilrettingsinfo</string>
<string name="trace_rendering_descr">Vis tegningsytelse</string> <string name="trace_rendering_descr">Vis opptegningsytelsen.</string>
<string name="tts_missing_language_data">Ingen data for valgt språk installert. Vil du gå til markedet for å installere det?</string> <string name="tts_missing_language_data">Ingen data for valgt språk installert. Vil du gå til markedet for å installere det?</string>
<string name="gpx_option_reverse_route">Inverter GPX-retning</string> <string name="gpx_option_reverse_route">Inverter GPX-retning</string>
<string name="gpx_option_from_start_point">Passer langs hele turen</string> <string name="gpx_option_from_start_point">Passer langs hele turen</string>
@ -2626,8 +2626,8 @@ Representerer området: %1$s x %2$s</string>
<string name="mark_passed">Marker som passert</string> <string name="mark_passed">Marker som passert</string>
<string name="osn_modify_dialog_error">Unntak inntraff: Notat ble ikke endret</string> <string name="osn_modify_dialog_error">Unntak inntraff: Notat ble ikke endret</string>
<string name="quick_action_auto_zoom_desc">Trykk på handlingsknappen vil slå av/på automatisk kartzoom i henhold til din hastighet.</string> <string name="quick_action_auto_zoom_desc">Trykk på handlingsknappen vil slå av/på automatisk kartzoom i henhold til din hastighet.</string>
<string name="quick_action_add_destination_desc">Handlingsknappen vil legge til et mål midt på skjermen. Forrige valgte mål vil bli siste mellomliggende mål.</string> <string name="quick_action_add_destination_desc">Trykk på handlingsknappen vil legge til et mål midt på skjermen. Det tidligere angitte målet blir det siste mellomliggende målet.</string>
<string name="quick_action_replace_destination_desc">Handlingsknappen vil erstatte målet med skjermens sentrum.</string> <string name="quick_action_replace_destination_desc">Trykk på handlingsknappen vil erstatte målet med posisjonen midt på skjermen.</string>
<string name="quick_action_add_first_intermediate_desc">Trykk på handlingsknappen vil legge til et første mellomliggende punkt midt på skjermen.</string> <string name="quick_action_add_first_intermediate_desc">Trykk på handlingsknappen vil legge til et første mellomliggende punkt midt på skjermen.</string>
<string name="subscribe_email_desc">Abonner på vår e-postliste om programrabatter og få tre kartnedlastinger til!</string> <string name="subscribe_email_desc">Abonner på vår e-postliste om programrabatter og få tre kartnedlastinger til!</string>
<string name="index_item_depth_points_southern_hemisphere">Havdybdepunkter for sørlig halvkule</string> <string name="index_item_depth_points_southern_hemisphere">Havdybdepunkter for sørlig halvkule</string>
@ -2663,11 +2663,11 @@ Representerer området: %1$s x %2$s</string>
<string name="activate_seamarks_plugin">Aktiver sjømerketillegget</string> <string name="activate_seamarks_plugin">Aktiver sjømerketillegget</string>
<string name="save_poi_too_many_uppercase">Navnet inneholder for mange store bokstaver. Ønsker du å fortsette?</string> <string name="save_poi_too_many_uppercase">Navnet inneholder for mange store bokstaver. Ønsker du å fortsette?</string>
<string name="quick_action_add_poi">Legg til interessepunkt</string> <string name="quick_action_add_poi">Legg til interessepunkt</string>
<string name="quick_action_showhide_poi_descr">Handlingsknappen vil vise eller skjule interessepunkter på kartet.</string> <string name="quick_action_showhide_poi_descr">Trykk på handlingsknappen vil vise eller skjule interessepunkter på kartet.</string>
<string name="quick_action_page_list_descr">Handlingsknappen blar gjennom listen nedenfor.</string> <string name="quick_action_page_list_descr">Trykk på handlingsknappen vil bla gjennom listen nedenfor.</string>
<string name="quick_action_empty_param_error">Parameterne kan ikke være tomme</string> <string name="quick_action_empty_param_error">Parameterne kan ikke være tomme</string>
<string name="quick_action_btn_tutorial_descr">Trykk lenge og dra knappen for å endre dens posisjon på skjermen.</string> <string name="quick_action_btn_tutorial_descr">Trykk lenge og dra knappen for å endre dens posisjon på skjermen.</string>
<string name="add_track_to_markers_descr">Velg et spor for å legge dets rutepunkter til markørene. (Kun spor med rutepunkter vises).</string> <string name="add_track_to_markers_descr">Velg et spor for å legge til dets rutepunkter til markørene. (Kun spor med rutepunkter er listet opp.)</string>
<string name="empty_state_markers_history">\@string/shared_string_history</string> <string name="empty_state_markers_history">\@string/shared_string_history</string>
<string name="depth_contour_descr">Knippe kart som inneholder havdybdekotelinjer og sjømerker.</string> <string name="depth_contour_descr">Knippe kart som inneholder havdybdekotelinjer og sjømerker.</string>
<string name="do_not_send_anonymous_app_usage_desc">OsmAnd samler inn informasjon om hvilke deler av programmet du åpner. Plasseringen din blir aldri sendt, ei heller noe du måtte skrive inn i programmet eller detaljer om områder som vises, søkes etter, eller lastes ned.</string> <string name="do_not_send_anonymous_app_usage_desc">OsmAnd samler inn informasjon om hvilke deler av programmet du åpner. Plasseringen din blir aldri sendt, ei heller noe du måtte skrive inn i programmet eller detaljer om områder som vises, søkes etter, eller lastes ned.</string>
@ -2690,7 +2690,8 @@ Representerer området: %1$s x %2$s</string>
<string name="opened_till">Åpen til</string> <string name="opened_till">Åpen til</string>
<string name="will_be_closed_at">Stenger</string> <string name="will_be_closed_at">Stenger</string>
<string name="will_be_opened_at">Åpner</string> <string name="will_be_opened_at">Åpner</string>
<string name="will_be_opened_on">Åpen på</string> <string name="will_be_opened_on">Åpner</string>
<string name="av_locations_selected_desc">GPX-fil med de valgte notatenes koordinater og data.</string> <string name="av_locations_selected_desc">GPX-fil med de valgte notatenes koordinater og data.</string>
<string name="av_locations_all_desc">GPX-fil med alle notaters koordinater og data.</string> <string name="av_locations_all_desc">GPX-fil med alle notaters koordinater og data.</string>
<string name="quick_action_add_poi_descr">Trykk på handlingsknappen vil legge til et interessepunkt midt på skjermen.</string>
</resources> </resources>

View file

@ -227,7 +227,7 @@
<string name="poi_driving_school">Szkoła nauki jazdy</string> <string name="poi_driving_school">Szkoła nauki jazdy</string>
<string name="poi_school">Szkoła</string> <string name="poi_school">Szkoła</string>
<string name="poi_kindergarten">Przedszkole</string> <string name="poi_kindergarten">Przedszkole</string>
<string name="poi_college">Kolegium</string> <string name="poi_college">Uczelnia</string>
<string name="poi_university">Uniwersytet</string> <string name="poi_university">Uniwersytet</string>
<string name="poi_social_facility">Placówka społeczna</string> <string name="poi_social_facility">Placówka społeczna</string>
@ -715,7 +715,7 @@
<string name="poi_craft_boatbuilder">Stocznia</string> <string name="poi_craft_boatbuilder">Stocznia</string>
<string name="poi_craft_jeweller">Jubiler</string> <string name="poi_craft_jeweller">Jubiler</string>
<string name="poi_transport_construction">Roboty drogowe</string> <string name="poi_transport_construction">Roboty drogowe</string>
<string name="poi_base">Miejsce do base jumpingu</string> <string name="poi_base">Base jumping</string>
<string name="poi_ice_stock">Ice stock</string> <string name="poi_ice_stock">Ice stock</string>
<string name="poi_artwork">Dzieło sztuki</string> <string name="poi_artwork">Dzieło sztuki</string>
<string name="poi_attraction_amusement_ride">Karuzela</string> <string name="poi_attraction_amusement_ride">Karuzela</string>
@ -1197,7 +1197,7 @@
<string name="poi_denomination_adventist">Adwentyści</string> <string name="poi_denomination_adventist">Adwentyści</string>
<string name="poi_denomination_nazarene">Kościół Nazarejczyka</string> <string name="poi_denomination_nazarene">Kościół Nazarejczyka</string>
<string name="poi_denomination_old_believers">Staroobrzędowcy</string> <string name="poi_denomination_old_believers">Staroobrzędowcy</string>
<string name="poi_denomination_serbian_orthodox">Serbski ortodoksyjny</string> <string name="poi_denomination_serbian_orthodox">Serbski prawosławny</string>
<string name="poi_denomination_armenian_apostolic">Apostolski Kościół Ormiański</string> <string name="poi_denomination_armenian_apostolic">Apostolski Kościół Ormiański</string>
<string name="poi_denomination_dutch_reformed">Holenderski Kościół Reformowany</string> <string name="poi_denomination_dutch_reformed">Holenderski Kościół Reformowany</string>
<string name="poi_denomination_apostolic">Kościół Apostolski</string> <string name="poi_denomination_apostolic">Kościół Apostolski</string>

View file

@ -2229,7 +2229,7 @@ Pôr do Sol: %2$s</string>
<string name="private_access_routing_req">Seu destino está localizado em uma área de acesso privado. Você quer permitir acesso à estradas privadas para esta viagem?</string> <string name="private_access_routing_req">Seu destino está localizado em uma área de acesso privado. Você quer permitir acesso à estradas privadas para esta viagem?</string>
<string name="restart_search">Reiniciar pesquisa</string> <string name="restart_search">Reiniciar pesquisa</string>
<string name="increase_search_radius">Aumentar o raio de busca</string> <string name="increase_search_radius">Aumentar o raio de busca</string>
<string name="nothing_found">Não encontrou nada :(</string> <string name="nothing_found">Nada encontrado :(</string>
<string name="nothing_found_descr">Modificar o texto da pesquisa ou aumentar o raio de busca.</string> <string name="nothing_found_descr">Modificar o texto da pesquisa ou aumentar o raio de busca.</string>
<string name="quick_action_showhide_osmbugs_title">Mostrar/ocultar Anotações do OSM</string> <string name="quick_action_showhide_osmbugs_title">Mostrar/ocultar Anotações do OSM</string>
<string name="quick_action_osmbugs_show">Mostrar Anotações do OSM</string> <string name="quick_action_osmbugs_show">Mostrar Anotações do OSM</string>

View file

@ -25,6 +25,7 @@
<attr name="bg_point_editor_view" format="reference" /> <attr name="bg_point_editor_view" format="reference" />
<attr name="ctx_menu_info_view_bg" format="reference" /> <attr name="ctx_menu_info_view_bg" format="reference" />
<attr name="ctx_menu_controller_bg" format="reference" /> <attr name="ctx_menu_controller_bg" format="reference" />
<attr name="ctx_menu_controller_text_color" format="reference" />
<attr name="ctx_menu_divider" format="reference" /> <attr name="ctx_menu_divider" format="reference" />
<attr name="bottom_menu_view_bg" format="reference" /> <attr name="bottom_menu_view_bg" format="reference" />
<attr name="left_menu_view_bg" format="reference" /> <attr name="left_menu_view_bg" format="reference" />

View file

@ -341,7 +341,7 @@
<color name="ctx_menu_bottom_view_bg_light">#ffffff</color> <color name="ctx_menu_bottom_view_bg_light">#ffffff</color>
<color name="ctx_menu_bottom_view_bg_dark">#17191a</color> <color name="ctx_menu_bottom_view_bg_dark">#17191a</color>
<color name="ctx_menu_bottom_view_icon_light">#b3b3b3</color> <color name="ctx_menu_bottom_view_icon_light">#b3b3b3</color>
<color name="ctx_menu_bottom_view_icon_dark">#536dfe</color> <color name="ctx_menu_bottom_view_icon_dark">#454a4d</color>
<color name="ctx_menu_bottom_view_text_color_light">#212121</color> <color name="ctx_menu_bottom_view_text_color_light">#212121</color>
<color name="ctx_menu_bottom_view_text_color_dark">#cccccc</color> <color name="ctx_menu_bottom_view_text_color_dark">#cccccc</color>
<color name="ctx_menu_bottom_view_secondary_text_color_light">#a6a6a6</color> <color name="ctx_menu_bottom_view_secondary_text_color_light">#a6a6a6</color>
@ -349,9 +349,11 @@
<color name="ctx_menu_amenity_opened_text_color">#5baf3f</color> <color name="ctx_menu_amenity_opened_text_color">#5baf3f</color>
<color name="ctx_menu_amenity_closed_text_color">#c66545</color> <color name="ctx_menu_amenity_closed_text_color">#c66545</color>
<color name="ctx_menu_bottom_view_divider_light">#f2f2f2</color> <color name="ctx_menu_bottom_view_divider_light">#f2f2f2</color>
<color name="ctx_menu_bottom_view_divider_dark">#536dfe</color> <color name="ctx_menu_bottom_view_divider_dark">#222526</color>
<color name="ctx_menu_bottom_view_url_color_light">#536dfe</color> <color name="ctx_menu_bottom_view_url_color_light">#536dfe</color>
<color name="ctx_menu_bottom_view_url_color_dark">#d28521</color> <color name="ctx_menu_bottom_view_url_color_dark">#d28521</color>
<color name="ctx_menu_controller_disabled_text_color_light">#b3b3b3</color>
<color name="ctx_menu_controller_disabled_text_color_dark">#666666</color>
<color name="route_info_bg_light">#ffffff</color> <color name="route_info_bg_light">#ffffff</color>
<color name="route_info_bg_dark">#17191a</color> <color name="route_info_bg_dark">#17191a</color>
@ -371,6 +373,11 @@
<color name="route_info_checked_mode_icon_color_dark">#d28521</color> <color name="route_info_checked_mode_icon_color_dark">#d28521</color>
<color name="route_info_unchecked_mode_icon_color">#727272</color> <color name="route_info_unchecked_mode_icon_color">#727272</color>
<color name="grid_menu_icon_dark">#808080</color> <color name="multi_selection_menu_divider_light">#f0f0f0</color>
<color name="multi_selection_menu_divider_dark">#222526</color>
<color name="multi_selection_menu_close_btn_light">#2f7af5</color>
<color name="multi_selection_menu_close_btn_dark">#e69122</color>
<color name="grid_menu_icon_dark">#808080</color>
</resources> </resources>

View file

@ -248,7 +248,12 @@
<dimen name="multi_selection_header_height">52dp</dimen> <dimen name="multi_selection_header_height">52dp</dimen>
<dimen name="grid_menu_item_width">120dp</dimen> <dimen name="wikipedia_button_left_padding">19dp</dimen>
<dimen name="grid_menu_item_bottom_top_margin">16dp</dimen>
<dimen name="grid_menu_item_sides_margin">40dp</dimen> <dimen name="multi_selection_menu_padding_top">13dp</dimen>
<dimen name="multi_selection_menu_padding_bottom">15dp</dimen>
<dimen name="grid_menu_item_width">120dp</dimen>
<dimen name="grid_menu_item_bottom_top_margin">16dp</dimen>
<dimen name="grid_menu_item_sides_margin">40dp</dimen>
</resources> </resources>

View file

@ -132,6 +132,7 @@
<item name="dashboard_button">@drawable/dashboard_button_light</item> <item name="dashboard_button">@drawable/dashboard_button_light</item>
<item name="ctx_menu_info_view_bg">@color/ctx_menu_info_view_bg_light</item> <item name="ctx_menu_info_view_bg">@color/ctx_menu_info_view_bg_light</item>
<item name="ctx_menu_controller_bg">@drawable/context_menu_controller_bg_light</item> <item name="ctx_menu_controller_bg">@drawable/context_menu_controller_bg_light</item>
<item name="ctx_menu_controller_text_color">@drawable/context_menu_controller_text_color_light</item>
<item name="ctx_menu_divider">@color/ctx_menu_buttons_divider_light</item> <item name="ctx_menu_divider">@color/ctx_menu_buttons_divider_light</item>
<item name="search_background">@color/search_background_dark</item> <item name="search_background">@color/search_background_dark</item>
<item name="actionModeCloseDrawable">@drawable/ic_action_mode_back</item> <item name="actionModeCloseDrawable">@drawable/ic_action_mode_back</item>
@ -321,6 +322,7 @@
<item name="dashboard_button">@drawable/dashboard_button_dark</item> <item name="dashboard_button">@drawable/dashboard_button_dark</item>
<item name="ctx_menu_info_view_bg">@color/ctx_menu_info_view_bg_dark</item> <item name="ctx_menu_info_view_bg">@color/ctx_menu_info_view_bg_dark</item>
<item name="ctx_menu_controller_bg">@drawable/context_menu_controller_bg_dark</item> <item name="ctx_menu_controller_bg">@drawable/context_menu_controller_bg_dark</item>
<item name="ctx_menu_controller_text_color">@drawable/context_menu_controller_text_color_dark</item>
<item name="ctx_menu_divider">@color/ctx_menu_buttons_divider_dark</item> <item name="ctx_menu_divider">@color/ctx_menu_buttons_divider_dark</item>
<item name="search_background">@color/color_white</item> <item name="search_background">@color/color_white</item>
<item name="switch_ex_background">@drawable/switch_ex_background_dark</item> <item name="switch_ex_background">@drawable/switch_ex_background_dark</item>

View file

@ -4,6 +4,7 @@ package net.osmand;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.PointF; import android.graphics.PointF;
@ -11,6 +12,7 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable; import android.graphics.drawable.StateListDrawable;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes; import android.support.annotation.DrawableRes;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.text.TextUtils; import android.text.TextUtils;
@ -118,6 +120,21 @@ public class AndroidUtils {
return null; return null;
} }
public static ColorStateList createColorStateList(Context ctx, boolean night,
@ColorRes int lightNormal, @ColorRes int lightPressed,
@ColorRes int darkNormal, @ColorRes int darkPressed) {
return new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_pressed},
new int[]{}
},
new int[]{
ContextCompat.getColor(ctx, night ? darkPressed : lightPressed),
ContextCompat.getColor(ctx, night ? darkNormal : lightNormal)
}
);
}
public static StateListDrawable createStateListDrawable(Context ctx, boolean night, public static StateListDrawable createStateListDrawable(Context ctx, boolean night,
@DrawableRes int lightNormal, @DrawableRes int lightPressed, @DrawableRes int lightNormal, @DrawableRes int lightPressed,
@DrawableRes int darkNormal, @DrawableRes int darkPressed) { @DrawableRes int darkNormal, @DrawableRes int darkPressed) {
@ -198,6 +215,12 @@ public class AndroidUtils {
); );
} }
public static int resolveAttribute(Context ctx, int attribute) {
TypedValue outValue = new TypedValue();
ctx.getTheme().resolveAttribute(attribute, outValue, true);
return outValue.resourceId;
}
public static int getStatusBarHeight(Context ctx) { public static int getStatusBarHeight(Context ctx) {
int result = 0; int result = 0;
int resourceId = ctx.getResources().getIdentifier("status_bar_height", "dimen", "android"); int resourceId = ctx.getResources().getIdentifier("status_bar_height", "dimen", "android");

View file

@ -842,9 +842,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
boolean mapControlsVisible = findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE; boolean mapControlsVisible = findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
boolean night = app.getDaynightHelper().isNightModeForMapControls(); boolean night = app.getDaynightHelper().isNightModeForMapControls();
boolean quickSearchTopBar = getTopToolbarController(TopToolbarControllerType.QUICK_SEARCH) != null; boolean quickSearchTopBar = getTopToolbarController(TopToolbarControllerType.QUICK_SEARCH) != null;
boolean contextMenuTopBar = getTopToolbarController(TopToolbarControllerType.CONTEXT_MENU) != null;
boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE; boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE;
boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE; boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE;
if ((quickSearchTopBar || mapTopBar) && mapControlsVisible) { if (((quickSearchTopBar || mapTopBar) && mapControlsVisible) || contextMenuTopBar) {
colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light; colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light;
} else if (markerTopBar && mapControlsVisible) { } else if (markerTopBar && mapControlsVisible) {
colorId = R.color.status_bar_dark; colorId = R.color.status_bar_dark;
@ -1885,11 +1886,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
public void showTopToolbar(TopToolbarController controller) { public void showTopToolbar(TopToolbarController controller) {
MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer(); MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
mapInfoLayer.addTopToolbarController(controller); mapInfoLayer.addTopToolbarController(controller);
updateStatusBarColor();
} }
public void hideTopToolbar(TopToolbarController controller) { public void hideTopToolbar(TopToolbarController controller) {
MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer(); MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
mapInfoLayer.removeTopToolbarController(controller); mapInfoLayer.removeTopToolbarController(controller);
updateStatusBarColor();
} }
public void registerActivityResultListener(ActivityResultListener listener) { public void registerActivityResultListener(ActivityResultListener listener) {

View file

@ -78,7 +78,7 @@ public class AppModeDialog {
} else { } else {
if (useMapTheme) { if (useMapTheme) {
iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), R.color.route_info_unchecked_mode_icon_color)); iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), R.color.route_info_unchecked_mode_icon_color));
AndroidUtils.setBackground(ctx, iv, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark); iv.setBackgroundResource(AndroidUtils.resolveAttribute(ctx, android.R.attr.selectableItemBackground));
} else { } else {
iv.setImageDrawable(ctx.getIconsCache().getThemedIcon(mode.getSmallIconDark())); iv.setImageDrawable(ctx.getIconsCache().getThemedIcon(mode.getSmallIconDark()));
} }

View file

@ -42,7 +42,7 @@ public class AudioVideoNoteMenuBuilder extends MenuBuilder {
DateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(view.getContext()); DateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(view.getContext());
DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(view.getContext()); DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(view.getContext());
Date date = new Date(recording.getFile().lastModified()); Date date = new Date(recording.getFile().lastModified());
buildRow(view, R.drawable.ic_action_data, dateFormat.format(date) + "" + timeFormat.format(date), buildRow(view, R.drawable.ic_action_data, null, dateFormat.format(date) + "" + timeFormat.format(date),
0, false, null, false, 0, false, null, false); 0, false, null, false, 0, false, null, false);
buildPlainMenuItems(view); buildPlainMenuItems(view);

View file

@ -86,7 +86,7 @@ public class AudioVideoNoteMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
if (mRecording.isPhoto()) { if (mRecording.isPhoto()) {
return getIcon(R.drawable.ic_action_photo_dark, R.color.audio_video_icon_color); return getIcon(R.drawable.ic_action_photo_dark, R.color.audio_video_icon_color);
} else if (mRecording.isAudio()) { } else if (mRecording.isAudio()) {

View file

@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
@ -37,7 +38,7 @@ import net.osmand.plus.mapcontextmenu.MenuController.MenuType;
import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController; import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController; import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
import net.osmand.plus.mapcontextmenu.controllers.MapDataMenuController; import net.osmand.plus.mapcontextmenu.controllers.MapDataMenuController;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor; import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor;
import net.osmand.plus.mapcontextmenu.editors.PointEditor; import net.osmand.plus.mapcontextmenu.editors.PointEditor;
import net.osmand.plus.mapcontextmenu.editors.RtePtEditor; import net.osmand.plus.mapcontextmenu.editors.RtePtEditor;
@ -418,7 +419,10 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
} }
public boolean navigateInPedestrianMode() { public boolean navigateInPedestrianMode() {
return menuController instanceof ParkingPositionMenuController; if (menuController != null) {
return menuController.navigateInPedestrianMode();
}
return false;
} }
public boolean close() { public boolean close() {
@ -597,7 +601,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
historyStack.add(menuData); historyStack.add(menuData);
} }
if (!(menuController instanceof MapDataMenuController)) { if (!(menuController instanceof MapDataMenuController)) {
menuController.buildMapDownloadButton(latLon); menuController.buildMapDownloadButtonAndSizeInfo(latLon);
} }
return true; return true;
} else { } else {
@ -1135,13 +1139,37 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
return menuController != null && menuController.displayDistanceDirection(); return menuController != null && menuController.displayDistanceDirection();
} }
public boolean displayAdditionalTypeStrInHours() { public String getSubtypeStr() {
return menuController != null && menuController.displayAdditionalTypeStrInHours(); if (menuController != null) {
return menuController.getSubtypeStr();
}
return "";
} }
public int getTimeStrColor() { public Drawable getSubtypeIcon() {
if (menuController != null) { if (menuController != null) {
return menuController.getTimeStrColor(); return menuController.getSubtypeIcon();
}
return null;
}
public int getAdditionalInfoColor() {
if (menuController != null) {
return menuController.getAdditionalInfoColor();
}
return 0;
}
public String getAdditionalInfo() {
if (menuController != null) {
return menuController.getAdditionalInfoStr();
}
return "";
}
public int getAdditionalInfoIconRes() {
if (menuController != null) {
return menuController.getAdditionalInfoIconRes();
} }
return 0; return 0;
} }

View file

@ -14,6 +14,7 @@ import android.support.v4.content.ContextCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.GestureDetector; import android.view.GestureDetector;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.VelocityTracker; import android.view.VelocityTracker;
@ -34,6 +35,7 @@ import android.widget.TextView;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.Location; import net.osmand.Location;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.data.QuadPoint; import net.osmand.data.QuadPoint;
import net.osmand.data.RotatedTileBox; import net.osmand.data.RotatedTileBox;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
@ -46,10 +48,11 @@ import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
import net.osmand.plus.mapcontextmenu.MenuController.MenuState; import net.osmand.plus.mapcontextmenu.MenuController.MenuState;
import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController; import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController; import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu;
import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.TransportStopsLayer;
import net.osmand.plus.views.controls.HorizontalSwipeConfirm; import net.osmand.plus.views.controls.HorizontalSwipeConfirm;
import net.osmand.plus.views.controls.SingleTapConfirm; import net.osmand.plus.views.controls.SingleTapConfirm;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
@ -198,8 +201,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}); });
// Bottom title button // Bottom title button
final View bottomTitleButton = view.findViewById(R.id.title_button_bottom_view); final View bottomTitleButtonView = view.findViewById(R.id.title_button_bottom_view);
bottomTitleButton.setOnClickListener(new View.OnClickListener() { bottomTitleButtonView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
TitleButtonController bottomTitleButtonController = menu.getBottomTitleButtonController(); TitleButtonController bottomTitleButtonController = menu.getBottomTitleButtonController();
@ -211,8 +214,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
// Progress bar // Progress bar
final ImageView progressButton = (ImageView) view.findViewById(R.id.progressButton); final ImageView progressButton = (ImageView) view.findViewById(R.id.progressButton);
progressButton.setImageDrawable(getIcon(R.drawable.ic_action_remove_dark, progressButton.setImageDrawable(getIcon(R.drawable.ic_action_remove_dark, R.color.ctx_menu_buttons_icon_color));
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
progressButton.setOnClickListener(new View.OnClickListener() { progressButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -388,7 +390,22 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
GridView transportStopRoutesGrid = (GridView) view.findViewById(R.id.transport_stop_routes_grid); GridView transportStopRoutesGrid = (GridView) view.findViewById(R.id.transport_stop_routes_grid);
List<TransportStopRoute> transportStopRoutes = menu.getTransportStopRoutes(); List<TransportStopRoute> transportStopRoutes = menu.getTransportStopRoutes();
if (transportStopRoutes != null && transportStopRoutes.size() > 0) { if (transportStopRoutes != null && transportStopRoutes.size() > 0) {
TransportStopRouteAdapter adapter = new TransportStopRouteAdapter(getContext(), transportStopRoutes); final TransportStopRouteAdapter adapter = new TransportStopRouteAdapter(getMyApplication(), transportStopRoutes, nightMode);
adapter.setListener(new TransportStopRouteAdapter.OnClickListener() {
@Override
public void onClick(int position) {
TransportStopRoute route = adapter.getItem(position);
if (route != null) {
PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_TRANSPORT_ROUTE,
route.getDescription(getMapActivity().getMyApplication(), false));
menu.show(menu.getLatLon(), pd, route);
TransportStopsLayer stopsLayer = getMapActivity().getMapLayers().getTransportStopsLayer();
stopsLayer.setRoute(route);
int cz = route.calculateZoom(0, getMapActivity().getMapView().getCurrentRotatedTileBox());
getMapActivity().changeZoom(cz - getMapActivity().getMapView().getZoom());
}
}
});
transportStopRoutesGrid.setAdapter(adapter); transportStopRoutesGrid.setAdapter(adapter);
transportStopRoutesGrid.setVisibility(View.VISIBLE); transportStopRoutesGrid.setVisibility(View.VISIBLE);
} else { } else {
@ -513,6 +530,23 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
return view; return view;
} }
private void toggleDetailsHideButton() {
int menuState = menu.getCurrentMenuState();
final boolean showShowHideButton = menuState == MenuState.HALF_SCREEN || (!menu.isLandscapeLayout() && menuState == MenuState.FULL_SCREEN);
TextView detailsButton = (TextView) view.findViewById(R.id.context_menu_details_button);
detailsButton.setText(showShowHideButton ? R.string.shared_string_collapse : R.string.description);
detailsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (showShowHideButton) {
openMenuHeaderOnly();
} else {
openMenuFullScreen();
}
}
});
}
private void deactivate(View view) { private void deactivate(View view) {
view.setEnabled(false); view.setEnabled(false);
view.setAlpha(0.5f); view.setAlpha(0.5f);
@ -547,6 +581,10 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
changeMenuState(getViewY(), true, true, false); changeMenuState(getViewY(), true, true, false);
} }
public void openMenuHeaderOnly() {
changeMenuState(getViewY(), true, false, true);
}
public void openMenuHalfScreen() { public void openMenuHalfScreen() {
int oldMenuState = menu.getCurrentMenuState(); int oldMenuState = menu.getCurrentMenuState();
if (oldMenuState == MenuState.HEADER_ONLY) { if (oldMenuState == MenuState.HEADER_ONLY) {
@ -579,6 +617,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
restoreCustomMapRatio(); restoreCustomMapRatio();
menu.updateControlsVisibility(true); menu.updateControlsVisibility(true);
doBeforeMenuStateChange(oldMenuState, newMenuState); doBeforeMenuStateChange(oldMenuState, newMenuState);
toggleDetailsHideButton();
} }
applyPosY(currentY, needCloseMenu, needMapAdjust, oldMenuState, newMenuState, 0); applyPosY(currentY, needCloseMenu, needMapAdjust, oldMenuState, newMenuState, 0);
@ -675,7 +714,22 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
origMarkerY = box.getCenterPixelY(); origMarkerY = box.getCenterPixelY();
} }
private void updateButtonsAndProgress() { private void enableDisableButtons(View buttonView, TextView button, boolean enabled) {
if (enabled) {
ColorStateList buttonColorStateList = AndroidUtils.createColorStateList(getContext(), nightMode,
R.color.ctx_menu_controller_button_text_color_light_n, R.color.ctx_menu_controller_button_text_color_light_p,
R.color.ctx_menu_controller_button_text_color_dark_n, R.color.ctx_menu_controller_button_text_color_dark_p);
buttonView.setBackgroundResource(nightMode ? R.drawable.context_menu_controller_bg_dark : R.drawable.context_menu_controller_bg_light);
button.setTextColor(buttonColorStateList);
} else {
buttonView.setBackgroundResource(nightMode ? R.drawable.context_menu_controller_disabled_bg_dark: R.drawable.context_menu_controller_disabled_bg_light);
button.setTextColor(ContextCompat.getColor(getContext(), nightMode ? R.color.ctx_menu_controller_disabled_text_color_dark : R.color.ctx_menu_controller_disabled_text_color_light));
}
button.setEnabled(enabled);
}
public void updateButtonsAndProgress() {
if (view != null) { if (view != null) {
TitleButtonController leftTitleButtonController = menu.getLeftTitleButtonController(); TitleButtonController leftTitleButtonController = menu.getLeftTitleButtonController();
TitleButtonController rightTitleButtonController = menu.getRightTitleButtonController(); TitleButtonController rightTitleButtonController = menu.getRightTitleButtonController();
@ -684,10 +738,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
TitleButtonController rightDownloadButtonController = menu.getRightDownloadButtonController(); TitleButtonController rightDownloadButtonController = menu.getRightDownloadButtonController();
TitleProgressController titleProgressController = menu.getTitleProgressController(); TitleProgressController titleProgressController = menu.getTitleProgressController();
ColorStateList textColorStateList = ContextCompat.getColorStateList(getContext(),
nightMode ? R.color.context_menu_controller_text_color_dark : R.color.context_menu_controller_text_color_light);
int buttonViewBackgroundResId = nightMode ? R.drawable.context_menu_controller_bg_dark : R.drawable.context_menu_controller_bg_light;
// Title buttons // Title buttons
boolean showTitleButtonsContainer = (leftTitleButtonController != null || rightTitleButtonController != null); boolean showTitleButtonsContainer = (leftTitleButtonController != null || rightTitleButtonController != null);
final View titleButtonsContainer = view.findViewById(R.id.title_button_container); final View titleButtonsContainer = view.findViewById(R.id.title_button_container);
@ -698,16 +748,15 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
final TextView leftTitleButton = (TextView) view.findViewById(R.id.title_button); final TextView leftTitleButton = (TextView) view.findViewById(R.id.title_button);
final TextView titleButtonRightText = (TextView) view.findViewById(R.id.title_button_right_text); final TextView titleButtonRightText = (TextView) view.findViewById(R.id.title_button_right_text);
if (leftTitleButtonController != null) { if (leftTitleButtonController != null) {
enableDisableButtons(leftTitleButtonView, leftTitleButton, leftTitleButtonController.enabled);
leftTitleButton.setText(leftTitleButtonController.caption); leftTitleButton.setText(leftTitleButtonController.caption);
leftTitleButton.setTextColor(textColorStateList);
if (leftTitleButtonController.visible) { if (leftTitleButtonController.visible) {
leftTitleButtonView.setVisibility(View.VISIBLE); leftTitleButtonView.setVisibility(View.VISIBLE);
leftTitleButtonView.setBackgroundResource(buttonViewBackgroundResId);
Drawable leftIcon = leftTitleButtonController.getLeftIcon(); Drawable leftIcon = leftTitleButtonController.getLeftIcon();
if (leftIcon != null) { Drawable rightIcon = leftTitleButtonController.getRightIcon();
leftTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null); leftTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, rightIcon, null);
leftTitleButton.setCompoundDrawablePadding(dpToPx(8f)); leftTitleButton.setCompoundDrawablePadding(dpToPx(8f));
} ((LinearLayout) leftTitleButtonView).setGravity(rightIcon != null ? Gravity.END : Gravity.START);
if (leftTitleButtonController.needRightText) { if (leftTitleButtonController.needRightText) {
titleButtonRightText.setText(leftTitleButtonController.rightTextCaption); titleButtonRightText.setText(leftTitleButtonController.rightTextCaption);
@ -727,16 +776,15 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
final View rightTitleButtonView = view.findViewById(R.id.title_button_right_view); final View rightTitleButtonView = view.findViewById(R.id.title_button_right_view);
final TextView rightTitleButton = (TextView) view.findViewById(R.id.title_button_right); final TextView rightTitleButton = (TextView) view.findViewById(R.id.title_button_right);
if (rightTitleButtonController != null) { if (rightTitleButtonController != null) {
enableDisableButtons(rightTitleButtonView, rightTitleButton, rightTitleButtonController.enabled);
rightTitleButton.setText(rightTitleButtonController.caption); rightTitleButton.setText(rightTitleButtonController.caption);
rightTitleButton.setTextColor(textColorStateList);
rightTitleButtonView.setVisibility(rightTitleButtonController.visible ? View.VISIBLE : View.INVISIBLE); rightTitleButtonView.setVisibility(rightTitleButtonController.visible ? View.VISIBLE : View.INVISIBLE);
if (rightTitleButtonController.visible) {
rightTitleButtonView.setBackgroundResource(buttonViewBackgroundResId);
}
Drawable leftIcon = rightTitleButtonController.getLeftIcon(); Drawable leftIcon = rightTitleButtonController.getLeftIcon();
rightTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null); Drawable rightIcon = rightTitleButtonController.getRightIcon();
rightTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, rightIcon, null);
rightTitleButton.setCompoundDrawablePadding(dpToPx(8f)); rightTitleButton.setCompoundDrawablePadding(dpToPx(8f));
((LinearLayout) rightTitleButtonView).setGravity(rightIcon != null ? Gravity.END : Gravity.START);
} else { } else {
rightTitleButtonView.setVisibility(View.INVISIBLE); rightTitleButtonView.setVisibility(View.INVISIBLE);
} }
@ -745,16 +793,15 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
final View bottomTitleButtonView = view.findViewById(R.id.title_button_bottom_view); final View bottomTitleButtonView = view.findViewById(R.id.title_button_bottom_view);
final TextView bottomTitleButton = (TextView) view.findViewById(R.id.title_button_bottom); final TextView bottomTitleButton = (TextView) view.findViewById(R.id.title_button_bottom);
if (bottomTitleButtonController != null) { if (bottomTitleButtonController != null) {
enableDisableButtons(bottomTitleButtonView, bottomTitleButton, bottomTitleButtonController.enabled);
bottomTitleButton.setText(bottomTitleButtonController.caption); bottomTitleButton.setText(bottomTitleButtonController.caption);
bottomTitleButton.setTextColor(textColorStateList);
bottomTitleButtonView.setVisibility(bottomTitleButtonController.visible ? View.VISIBLE : View.GONE); bottomTitleButtonView.setVisibility(bottomTitleButtonController.visible ? View.VISIBLE : View.GONE);
if (bottomTitleButtonController.visible) {
bottomTitleButtonView.setBackgroundResource(buttonViewBackgroundResId);
}
Drawable leftIcon = bottomTitleButtonController.getLeftIcon(); Drawable leftIcon = bottomTitleButtonController.getLeftIcon();
bottomTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null); Drawable rightIcon = bottomTitleButtonController.getRightIcon();
bottomTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, rightIcon, null);
bottomTitleButton.setCompoundDrawablePadding(dpToPx(8f)); bottomTitleButton.setCompoundDrawablePadding(dpToPx(8f));
((LinearLayout) bottomTitleButtonView).setGravity(rightIcon != null ? Gravity.END : Gravity.START);
} else { } else {
bottomTitleButtonView.setVisibility(View.GONE); bottomTitleButtonView.setVisibility(View.GONE);
} }
@ -771,18 +818,15 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
final View leftDownloadButtonView = view.findViewById(R.id.download_button_left_view); final View leftDownloadButtonView = view.findViewById(R.id.download_button_left_view);
final TextView leftDownloadButton = (TextView) view.findViewById(R.id.download_button_left); final TextView leftDownloadButton = (TextView) view.findViewById(R.id.download_button_left);
if (leftDownloadButtonController != null) { if (leftDownloadButtonController != null) {
enableDisableButtons(leftDownloadButtonView, leftDownloadButton, leftDownloadButtonController.enabled);
leftDownloadButton.setText(leftDownloadButtonController.caption); leftDownloadButton.setText(leftDownloadButtonController.caption);
leftDownloadButton.setTextColor(textColorStateList);
leftDownloadButtonView.setVisibility(leftDownloadButtonController.visible ? View.VISIBLE : View.INVISIBLE); leftDownloadButtonView.setVisibility(leftDownloadButtonController.visible ? View.VISIBLE : View.INVISIBLE);
if (leftDownloadButtonController.visible) {
leftDownloadButtonView.setBackgroundResource(buttonViewBackgroundResId);
}
Drawable leftIcon = leftDownloadButtonController.getLeftIcon(); Drawable leftIcon = leftDownloadButtonController.getLeftIcon();
if (leftIcon != null) { Drawable rightIcon = leftDownloadButtonController.getRightIcon();
leftDownloadButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null); leftDownloadButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, rightIcon, null);
leftDownloadButton.setCompoundDrawablePadding(dpToPx(8f)); leftDownloadButton.setCompoundDrawablePadding(dpToPx(8f));
} ((LinearLayout) leftDownloadButtonView).setGravity(rightIcon != null ? Gravity.END : Gravity.START);
} else { } else {
leftDownloadButtonView.setVisibility(View.INVISIBLE); leftDownloadButtonView.setVisibility(View.INVISIBLE);
} }
@ -791,16 +835,15 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
final View rightDownloadButtonView = view.findViewById(R.id.download_button_right_view); final View rightDownloadButtonView = view.findViewById(R.id.download_button_right_view);
final TextView rightDownloadButton = (TextView) view.findViewById(R.id.download_button_right); final TextView rightDownloadButton = (TextView) view.findViewById(R.id.download_button_right);
if (rightDownloadButtonController != null) { if (rightDownloadButtonController != null) {
enableDisableButtons(rightDownloadButtonView, rightDownloadButton, rightDownloadButtonController.enabled);
rightDownloadButton.setText(rightDownloadButtonController.caption); rightDownloadButton.setText(rightDownloadButtonController.caption);
rightDownloadButton.setTextColor(textColorStateList);
rightDownloadButtonView.setVisibility(rightDownloadButtonController.visible ? View.VISIBLE : View.INVISIBLE); rightDownloadButtonView.setVisibility(rightDownloadButtonController.visible ? View.VISIBLE : View.INVISIBLE);
if (rightDownloadButtonController.visible) {
rightDownloadButtonView.setBackgroundResource(buttonViewBackgroundResId);
}
Drawable leftIcon = rightDownloadButtonController.getLeftIcon(); Drawable leftIcon = rightDownloadButtonController.getLeftIcon();
rightDownloadButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null); Drawable rightIcon = rightDownloadButtonController.getRightIcon();
rightDownloadButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, rightIcon, null);
rightDownloadButton.setCompoundDrawablePadding(dpToPx(8f)); rightDownloadButton.setCompoundDrawablePadding(dpToPx(8f));
((LinearLayout) rightDownloadButtonView).setGravity(rightIcon != null ? Gravity.END : Gravity.START);
} else { } else {
rightDownloadButtonView.setVisibility(View.INVISIBLE); rightDownloadButtonView.setVisibility(View.INVISIBLE);
} }
@ -835,8 +878,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
OsmandApplication app = getMyApplication(); OsmandApplication app = getMyApplication();
if (app != null && view != null) { if (app != null && view != null) {
final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view); final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);
Drawable icon = menu.getLeftIcon(); Drawable icon = menu.getRightIcon();
int iconId = menu.getLeftIconId(); int iconId = menu.getRightIconId();
if (icon != null) { if (icon != null) {
iconView.setImageDrawable(icon); iconView.setImageDrawable(icon);
iconView.setVisibility(View.VISIBLE); iconView.setVisibility(View.VISIBLE);
@ -929,8 +972,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
OsmandApplication app = getMyApplication(); OsmandApplication app = getMyApplication();
if (app != null && view != null) { if (app != null && view != null) {
final ImageView buttonFavorite = (ImageView) view.findViewById(R.id.context_menu_fav_image_view); final ImageView buttonFavorite = (ImageView) view.findViewById(R.id.context_menu_fav_image_view);
buttonFavorite.setImageDrawable(getIcon(menu.getFavActionIconId(), buttonFavorite.setImageDrawable(getIcon(menu.getFavActionIconId(), R.color.ctx_menu_buttons_icon_color));
!nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
String favActionString = getString(menu.getFavActionStringId()); String favActionString = getString(menu.getFavActionStringId());
buttonFavorite.setContentDescription(favActionString); buttonFavorite.setContentDescription(favActionString);
((TextView) view.findViewById(R.id.context_menu_fav_text_view)).setText(favActionString); ((TextView) view.findViewById(R.id.context_menu_fav_text_view)).setText(favActionString);
@ -945,6 +987,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
this.initLayout = true; this.initLayout = true;
this.centered = true; this.centered = true;
} }
updateButtonsAndProgress();
runLayoutListener(); runLayoutListener();
} }
} }
@ -1132,61 +1175,43 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
} }
line2Str.append(streetStr); line2Str.append(streetStr);
} }
line2.setText(line2Str.toString()); if (!TextUtils.isEmpty(line2Str)) {
line2.setText(line2Str.toString());
line2.setVisibility(View.VISIBLE);
} else {
line2.setVisibility(View.GONE);
}
} }
TextView line3 = (TextView) view.findViewById(R.id.context_menu_line3); TextView line3 = (TextView) view.findViewById(R.id.context_menu_line3);
String additionalTypeStr = menu.getAdditionalTypeStr(); String subtypeStr = menu.getSubtypeStr();
boolean displayAdditionalTypeStrInHours = menu.displayAdditionalTypeStrInHours(); if (TextUtils.isEmpty(subtypeStr)) {
boolean emptyAdditionalTypeStr = TextUtils.isEmpty(additionalTypeStr);
if (emptyAdditionalTypeStr || displayAdditionalTypeStrInHours) {
line3.setVisibility(View.GONE); line3.setVisibility(View.GONE);
} else { } else {
line3.setVisibility(View.VISIBLE); line3.setVisibility(View.VISIBLE);
line3.setText(additionalTypeStr); line3.setText(subtypeStr);
Drawable icon = menu.getAdditionalLineTypeIcon(); Drawable icon = menu.getSubtypeIcon();
line3.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); line3.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
line3.setCompoundDrawablePadding(dpToPx(5f)); line3.setCompoundDrawablePadding(dpToPx(5f));
} }
TextView openingHoursTextView = (TextView) view.findViewById(R.id.opening_hours_text_view); TextView additionalInfoTextView = (TextView) view.findViewById(R.id.additional_info_text_view);
OpeningHoursInfo openingHoursInfo = menu.getOpeningHoursInfo(); String additionalInfoStr = menu.getAdditionalInfo();
boolean containsOpeningHours = openingHoursInfo != null && openingHoursInfo.containsInfo(); if (!TextUtils.isEmpty(additionalInfoStr)) {
if (containsOpeningHours || (displayAdditionalTypeStrInHours && !emptyAdditionalTypeStr)) { int colorId = menu.getAdditionalInfoColor();
int colorId; int additionalInfoIconRes = menu.getAdditionalInfoIconRes();
if (containsOpeningHours) {
colorId = openingHoursInfo.isOpened() ? R.color.ctx_menu_amenity_opened_text_color : R.color.ctx_menu_amenity_closed_text_color;
} else {
colorId = menu.getTimeStrColor();
}
String timeInfo = "";
if (containsOpeningHours) {
if (openingHoursInfo.isOpened24_7()) {
timeInfo = getString(R.string.shared_string_is_open_24_7);
} else if (!Algorithms.isEmpty(openingHoursInfo.getNearToOpeningTime())) {
timeInfo = getString(R.string.will_open_at) + " " + openingHoursInfo.getNearToOpeningTime();
} else if (!Algorithms.isEmpty(openingHoursInfo.getOpeningTime())) {
timeInfo = getString(R.string.open_from) + " " + openingHoursInfo.getOpeningTime();
} else if (!Algorithms.isEmpty(openingHoursInfo.getNearToClosingTime())) {
timeInfo = getString(R.string.will_close_at) + " " + openingHoursInfo.getNearToClosingTime();
} else if (!Algorithms.isEmpty(openingHoursInfo.getClosingTime())) {
timeInfo = getString(R.string.open_till) + " " + openingHoursInfo.getClosingTime();
} else if (!Algorithms.isEmpty(openingHoursInfo.getOpeningDay())) {
timeInfo = getString(R.string.will_open_on) + " " + openingHoursInfo.getOpeningDay() + ".";
}
} else {
timeInfo = additionalTypeStr;
}
if (colorId != 0) { if (colorId != 0) {
openingHoursTextView.setTextColor(ContextCompat.getColor(getContext(), colorId)); additionalInfoTextView.setTextColor(ContextCompat.getColor(getContext(), colorId));
Drawable drawable = getIcon(R.drawable.ic_action_opening_hour_16, colorId); if (additionalInfoIconRes != 0) {
openingHoursTextView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); Drawable additionalIcon = getIcon(additionalInfoIconRes, colorId);
openingHoursTextView.setCompoundDrawablePadding(dpToPx(8)); additionalInfoTextView.setCompoundDrawablesWithIntrinsicBounds(additionalIcon, null, null, null);
additionalInfoTextView.setCompoundDrawablePadding(dpToPx(8));
}
} }
openingHoursTextView.setText(timeInfo); additionalInfoTextView.setText(additionalInfoStr);
openingHoursTextView.setVisibility(View.VISIBLE); additionalInfoTextView.setVisibility(View.VISIBLE);
} else { } else {
openingHoursTextView.setVisibility(View.GONE); additionalInfoTextView.setVisibility(View.GONE);
} }
} }
updateCompassVisibility(); updateCompassVisibility();
@ -1482,7 +1507,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
boolean progressVisible = menu.getTitleProgressController() != null && menu.getTitleProgressController().visible; boolean progressVisible = menu.getTitleProgressController() != null && menu.getTitleProgressController().visible;
updateButtonsAndProgress(); updateButtonsAndProgress();
if (wasProgressVisible != progressVisible) { if (wasProgressVisible != progressVisible) {
runLayoutListener(); refreshTitle();
} }
} }
} }
@ -1491,7 +1516,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
if (created) { if (created) {
menu.updateData(); menu.updateData();
updateButtonsAndProgress(); updateButtonsAndProgress();
runLayoutListener(); refreshTitle();
} }
} }

View file

@ -5,8 +5,10 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
@ -17,7 +19,6 @@ import android.text.TextUtils;
import android.text.util.Linkify; import android.text.util.Linkify;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -27,6 +28,7 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.FavouritePoint; import net.osmand.data.FavouritePoint;
@ -51,7 +53,7 @@ import net.osmand.plus.mapcontextmenu.builders.cards.CardsRowBuilder;
import net.osmand.plus.mapcontextmenu.builders.cards.ImageCard; import net.osmand.plus.mapcontextmenu.builders.cards.ImageCard;
import net.osmand.plus.mapcontextmenu.builders.cards.ImageCard.GetImageCardsTask; import net.osmand.plus.mapcontextmenu.builders.cards.ImageCard.GetImageCardsTask;
import net.osmand.plus.mapcontextmenu.builders.cards.NoImagesCard; import net.osmand.plus.mapcontextmenu.builders.cards.NoImagesCard;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.render.RenderingIcons; import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.views.TransportStopsLayer; import net.osmand.plus.views.TransportStopsLayer;
@ -99,6 +101,7 @@ public class MenuBuilder {
public class PlainMenuItem { public class PlainMenuItem {
private int iconId; private int iconId;
private String buttonText;
private String text; private String text;
private boolean needLinks; private boolean needLinks;
private boolean url; private boolean url;
@ -106,10 +109,11 @@ public class MenuBuilder {
private CollapsableView collapsableView; private CollapsableView collapsableView;
private OnClickListener onClickListener; private OnClickListener onClickListener;
public PlainMenuItem(int iconId, String text, boolean needLinks, boolean url, public PlainMenuItem(int iconId, String buttonText, String text, boolean needLinks, boolean url,
boolean collapsable, CollapsableView collapsableView, boolean collapsable, CollapsableView collapsableView,
OnClickListener onClickListener) { OnClickListener onClickListener) {
this.iconId = iconId; this.iconId = iconId;
this.buttonText = buttonText;
this.text = text; this.text = text;
this.needLinks = needLinks; this.needLinks = needLinks;
this.url = url; this.url = url;
@ -122,6 +126,10 @@ public class MenuBuilder {
return iconId; return iconId;
} }
public String getButtonText() {
return buttonText;
}
public String getText() { public String getText() {
return text; return text;
} }
@ -289,7 +297,7 @@ public class MenuBuilder {
buildTitleRow(view); buildTitleRow(view);
} }
if (showTransportRoutes()) { if (showTransportRoutes()) {
buildRow(view, 0, app.getString(R.string.transport_Routes), 0, true, getCollapsableTransportStopRoutesView(view.getContext(), false), buildRow(view, 0, null, app.getString(R.string.transport_Routes), 0, true, getCollapsableTransportStopRoutesView(view.getContext(), false),
false, 0, false, null, true); false, 0, false, null, true);
} }
buildNearestWikiRow(view); buildNearestWikiRow(view);
@ -324,7 +332,7 @@ public class MenuBuilder {
protected void buildPlainMenuItems(View view) { protected void buildPlainMenuItems(View view) {
for (PlainMenuItem item : plainMenuItems) { for (PlainMenuItem item : plainMenuItems) {
buildRow(view, item.getIconId(), item.getText(), 0, item.collapsable, item.collapsableView, buildRow(view, item.getIconId(), item.getButtonText(), item.getText(), 0, item.collapsable, item.collapsableView,
item.isNeedLinks(), 0, item.isUrl(), item.getOnClickListener(), false); item.isNeedLinks(), 0, item.isUrl(), item.getOnClickListener(), false);
} }
} }
@ -349,14 +357,14 @@ public class MenuBuilder {
if (mapContextMenu != null) { if (mapContextMenu != null) {
String title = mapContextMenu.getTitleStr(); String title = mapContextMenu.getTitleStr();
if (title.length() > TITLE_LIMIT) { if (title.length() > TITLE_LIMIT) {
buildRow(view, R.drawable.ic_action_note_dark, title, 0, false, null, false, 0, false, null, false); buildRow(view, R.drawable.ic_action_note_dark, null, title, 0, false, null, false, 0, false, null, false);
} }
} }
} }
protected void buildNearestWikiRow(View view) { protected void buildNearestWikiRow(View view) {
if (processNearstWiki() && nearestWiki.size() > 0) { if (processNearstWiki() && nearestWiki.size() > 0) {
buildRow(view, R.drawable.ic_action_wikipedia, app.getString(R.string.wiki_around) + " (" + nearestWiki.size()+")", 0, buildRow(view, R.drawable.ic_action_wikipedia, null, app.getString(R.string.wiki_around) + " (" + nearestWiki.size()+")", 0,
true, getCollapsableWikiView(view.getContext(), true), true, getCollapsableWikiView(view.getContext(), true),
false, 0, false, null, false); false, 0, false, null, false);
} }
@ -380,7 +388,7 @@ public class MenuBuilder {
} }
} }
}); });
buildRow(view, R.drawable.ic_action_photo_dark, app.getString(R.string.online_photos), 0, true, buildRow(view, R.drawable.ic_action_photo_dark, null, app.getString(R.string.online_photos), 0, true,
collapsableView, false, 1, false, null, false); collapsableView, false, 1, false, null, false);
if (needUpdateOnly && onlinePhotoCards != null) { if (needUpdateOnly && onlinePhotoCards != null) {
@ -437,14 +445,14 @@ public class MenuBuilder {
firstRow = false; firstRow = false;
} }
public View buildRow(View view, int iconId, String text, int textColor, public View buildRow(View view, int iconId, String buttonText, String text, int textColor,
boolean collapsable, final CollapsableView collapsableView, boolean collapsable, final CollapsableView collapsableView,
boolean needLinks, int textLinesLimit, boolean isUrl, OnClickListener onClickListener, boolean matchWidthDivider) { boolean needLinks, int textLinesLimit, boolean isUrl, OnClickListener onClickListener, boolean matchWidthDivider) {
return buildRow(view, iconId == 0 ? null : getRowIcon(iconId), text, textColor, null, collapsable, collapsableView, return buildRow(view, iconId == 0 ? null : getRowIcon(iconId), buttonText, text, textColor, null, collapsable, collapsableView,
needLinks, textLinesLimit, isUrl, onClickListener, matchWidthDivider); needLinks, textLinesLimit, isUrl, onClickListener, matchWidthDivider);
} }
public View buildRow(final View view, Drawable icon, final String text, int textColor, String secondaryText, public View buildRow(final View view, Drawable icon, final String buttonText, final String text, int textColor, String secondaryText,
boolean collapsable, final CollapsableView collapsableView, boolean needLinks, boolean collapsable, final CollapsableView collapsableView, boolean needLinks,
int textLinesLimit, boolean isUrl, OnClickListener onClickListener, boolean matchWidthDivider) { int textLinesLimit, boolean isUrl, OnClickListener onClickListener, boolean matchWidthDivider) {
@ -461,7 +469,7 @@ public class MenuBuilder {
ll.setOrientation(LinearLayout.HORIZONTAL); ll.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ll.setLayoutParams(llParams); ll.setLayoutParams(llParams);
ll.setBackgroundResource(resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground)); ll.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));
ll.setOnLongClickListener(new View.OnLongClickListener() { ll.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
@ -538,6 +546,20 @@ public class MenuBuilder {
llText.addView(textViewSecondary); llText.addView(textViewSecondary);
} }
//Button
if (!TextUtils.isEmpty(buttonText)) {
TextViewEx buttonTextView = new TextViewEx(view.getContext());
LinearLayout.LayoutParams buttonTextViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
buttonTextViewParams.gravity = Gravity.CENTER_VERTICAL;
buttonTextViewParams.setMargins(dpToPx(8), 0, dpToPx(8), 0);
buttonTextView.setLayoutParams(buttonTextViewParams);
buttonTextView.setTypeface(FontCache.getRobotoMedium(view.getContext()));
buttonTextView.setAllCaps(true);
buttonTextView.setTextColor(ContextCompat.getColor(view.getContext(), !light ? R.color.ctx_menu_controller_button_text_color_dark_n : R.color.ctx_menu_controller_button_text_color_light_n));
buttonTextView.setText(buttonText);
ll.addView(buttonTextView);
}
final ImageView iconViewCollapse = new ImageView(view.getContext()); final ImageView iconViewCollapse = new ImageView(view.getContext());
if (collapsable && collapsableView != null) { if (collapsable && collapsableView != null) {
// Icon // Icon
@ -614,7 +636,7 @@ public class MenuBuilder {
ll.setOrientation(LinearLayout.HORIZONTAL); ll.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ll.setLayoutParams(llParams); ll.setLayoutParams(llParams);
ll.setBackgroundResource(resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground)); ll.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));
// Empty // Empty
LinearLayout llIcon = new LinearLayout(view.getContext()); LinearLayout llIcon = new LinearLayout(view.getContext());
@ -635,7 +657,7 @@ public class MenuBuilder {
buttonView.setPadding(dpToPx(10f), 0, dpToPx(10f), 0); buttonView.setPadding(dpToPx(10f), 0, dpToPx(10f), 0);
buttonView.setGravity(Gravity.START | Gravity.CENTER_VERTICAL); buttonView.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
//buttonView.setTextSize(view.getResources().getDimension(resolveAttribute(view.getContext(), R.dimen.default_desc_text_size))); //buttonView.setTextSize(view.getResources().getDimension(resolveAttribute(view.getContext(), R.dimen.default_desc_text_size)));
buttonView.setTextColor(view.getResources().getColor(resolveAttribute(view.getContext(), R.attr.contextMenuButtonColor))); buttonView.setTextColor(view.getResources().getColor(AndroidUtils.resolveAttribute(view.getContext(), R.attr.contextMenuButtonColor)));
buttonView.setText(text); buttonView.setText(text);
if (buttonIcon != null) { if (buttonIcon != null) {
@ -671,13 +693,17 @@ public class MenuBuilder {
} }
public void addPlainMenuItem(int iconId, String text, boolean needLinks, boolean isUrl, OnClickListener onClickListener) { public void addPlainMenuItem(int iconId, String text, boolean needLinks, boolean isUrl, OnClickListener onClickListener) {
plainMenuItems.add(new PlainMenuItem(iconId, text, needLinks, isUrl, false, null, onClickListener)); plainMenuItems.add(new PlainMenuItem(iconId, null, text, needLinks, isUrl, false, null, onClickListener));
}
public void addPlainMenuItem(int iconId, String buttonText, String text, boolean needLinks, boolean isUrl, OnClickListener onClickListener) {
plainMenuItems.add(new PlainMenuItem(iconId, buttonText, text, needLinks, isUrl, false, null, onClickListener));
} }
public void addPlainMenuItem(int iconId, String text, boolean needLinks, boolean isUrl, public void addPlainMenuItem(int iconId, String text, boolean needLinks, boolean isUrl,
boolean collapsable, CollapsableView collapsableView, boolean collapsable, CollapsableView collapsableView,
OnClickListener onClickListener) { OnClickListener onClickListener) {
plainMenuItems.add(new PlainMenuItem(iconId, text, needLinks, isUrl, collapsable, collapsableView, onClickListener)); plainMenuItems.add(new PlainMenuItem(iconId, null, text, needLinks, isUrl, collapsable, collapsableView, onClickListener));
} }
public void clearPlainMenuItems() { public void clearPlainMenuItems() {
@ -699,12 +725,6 @@ public class MenuBuilder {
} }
} }
public int resolveAttribute(Context ctx, int attribute) {
TypedValue outValue = new TypedValue();
ctx.getTheme().resolveAttribute(attribute, outValue, true);
return outValue.resourceId;
}
public int dpToPx(float dp) { public int dpToPx(float dp) {
Resources r = app.getResources(); Resources r = app.getResources();
return (int) TypedValue.applyDimension( return (int) TypedValue.applyDimension(
@ -714,69 +734,90 @@ public class MenuBuilder {
); );
} }
private void buildTransportRouteRow(ViewGroup parent, TransportStopRoute r, OnClickListener listener) { private View buildTransportRowItem(View view, TransportStopRoute route, OnClickListener listener) {
if (!isFirstRow()) { LinearLayout baseView = new LinearLayout(view.getContext());
baseView.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams llBaseViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
baseView.setLayoutParams(llBaseViewParams);
baseView.setPadding(dpToPx(16), 0, dpToPx(16), dpToPx(12));
baseView.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));
TextViewEx transportRect = new TextViewEx(view.getContext());
LinearLayout.LayoutParams trParams = new LinearLayout.LayoutParams(dpToPx(32), dpToPx(18));
trParams.setMargins(0, dpToPx(16), 0, 0);
transportRect.setLayoutParams(trParams);
transportRect.setGravity(Gravity.CENTER);
transportRect.setAllCaps(true);
transportRect.setTypeface(FontCache.getRobotoMedium(view.getContext()));
transportRect.setTextColor(Color.WHITE);
transportRect.setTextSize(10);
GradientDrawable shape = new GradientDrawable();
shape.setShape(GradientDrawable.RECTANGLE);
shape.setCornerRadius(dpToPx(3));
shape.setColor(route.getColor(mapActivity.getMyApplication(), !light));
transportRect.setBackgroundDrawable(shape);
transportRect.setText(route.route.getRef());
baseView.addView(transportRect);
LinearLayout infoView = new LinearLayout(view.getContext());
infoView.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams infoViewLayoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
infoViewLayoutParams.setMargins(dpToPx(16), dpToPx(12), dpToPx(16), 0);
infoView.setLayoutParams(infoViewLayoutParams);
baseView.addView(infoView);
TextView titleView = new TextView(view.getContext());
LinearLayout.LayoutParams titleParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
titleView.setLayoutParams(titleParams);
titleView.setTextSize(16);
titleView.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_bottom_view_text_color_light : R.color.ctx_menu_bottom_view_text_color_dark));
titleView.setText(route.getDescription(getMapActivity().getMyApplication(), true));
infoView.addView(titleView);
LinearLayout typeView = new LinearLayout(view.getContext());
typeView.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams typeViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
typeViewParams.setMargins(0, dpToPx(8), 0, 0);
typeView.setGravity(Gravity.CENTER);
typeView.setLayoutParams(typeViewParams);
infoView.addView(typeView);
ImageView typeImageView = new ImageView(view.getContext());
LinearLayout.LayoutParams typeImageParams = new LinearLayout.LayoutParams(dpToPx(16), dpToPx(16));
typeImageParams.setMargins(dpToPx(4), 0, dpToPx(4), 0);
typeImageView.setLayoutParams(typeImageParams);
int drawableResId = route.type == null ? R.drawable.ic_action_polygom_dark : route.type.getResourceId();
typeImageView.setImageDrawable(getRowIcon(drawableResId));
typeView.addView(typeImageView);
TextView typeTextView = new TextView(view.getContext());
LinearLayout.LayoutParams typeTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
typeTextView.setLayoutParams(typeTextParams);
typeTextView.setText(route.getTypeStrRes());
typeView.addView(typeTextView);
baseView.setOnClickListener(listener);
((ViewGroup) view).addView(baseView);
return baseView;
}
private void buildTransportRouteRow(ViewGroup parent, TransportStopRoute r, OnClickListener listener, boolean showDivider) {
buildTransportRowItem(parent, r, listener);
if (showDivider) {
buildRowDivider(parent); buildRowDivider(parent);
} }
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.ctx_menu_transport_route_layout, parent, false);
TextView routeDesc = (TextView) view.findViewById(R.id.route_desc);
routeDesc.setText(r.getDescription(getMapActivity().getMyApplication(), true));
routeDesc.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_bottom_view_text_color_light : R.color.ctx_menu_bottom_view_text_color_dark));
int drawableResId = r.type == null ? R.drawable.ic_action_polygom_dark : r.type.getResourceId();
((ImageView) view.findViewById(R.id.route_type_icon)).setImageDrawable(getRowIcon(drawableResId));
((TextView) view.findViewById(R.id.route_ref)).setText(r.route.getRef());
view.setOnClickListener(listener);
int typeResId;
switch (r.type) {
case BUS:
typeResId = R.string.poi_route_bus_ref;
break;
case TRAM:
typeResId = R.string.poi_route_tram_ref;
break;
case FERRY:
typeResId = R.string.poi_route_ferry_ref;
break;
case TRAIN:
typeResId = R.string.poi_route_train_ref;
break;
case SHARE_TAXI:
typeResId = R.string.poi_route_share_taxi_ref;
break;
case FUNICULAR:
typeResId = R.string.poi_route_funicular_ref;
break;
case LIGHT_RAIL:
typeResId = R.string.poi_route_light_rail_ref;
break;
case MONORAIL:
typeResId = R.string.poi_route_monorail_ref;
break;
case TROLLEYBUS:
typeResId = R.string.poi_route_trolleybus_ref;
break;
case RAILWAY:
typeResId = R.string.poi_route_railway_ref;
break;
case SUBWAY:
typeResId = R.string.poi_route_subway_ref;
break;
default:
typeResId = R.string.poi_filter_public_transport;
break;
}
((TextView) view.findViewById(R.id.route_type_text)).setText(typeResId);
parent.addView(view);
rowBuilt();
} }
private CollapsableView getCollapsableTransportStopRoutesView(final Context context, boolean collapsed) { private CollapsableView getCollapsableTransportStopRoutesView(final Context context, boolean collapsed) {
LinearLayout view = (LinearLayout) buildCollapsableContentView(context, collapsed, false); LinearLayout view = (LinearLayout) buildCollapsableContentView(context, collapsed, false);
for (final TransportStopRoute r : routes) { for (int i = 0; i < routes.size(); i++) {
final TransportStopRoute r = routes.get(i);
View.OnClickListener listener = new View.OnClickListener() { View.OnClickListener listener = new View.OnClickListener() {
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
@ -785,12 +826,13 @@ public class MenuBuilder {
r.getDescription(getMapActivity().getMyApplication(), false)); r.getDescription(getMapActivity().getMyApplication(), false));
mm.show(latLon, pd, r); mm.show(latLon, pd, r);
TransportStopsLayer stopsLayer = getMapActivity().getMapLayers().getTransportStopsLayer(); TransportStopsLayer stopsLayer = getMapActivity().getMapLayers().getTransportStopsLayer();
stopsLayer.setRoute(r.route); stopsLayer.setRoute(r);
int cz = r.calculateZoom(0, getMapActivity().getMapView().getCurrentRotatedTileBox()); int cz = r.calculateZoom(0, getMapActivity().getMapView().getCurrentRotatedTileBox());
getMapActivity().changeZoom(cz - getMapActivity().getMapView().getZoom()); getMapActivity().changeZoom(cz - getMapActivity().getMapView().getZoom());
} }
}; };
buildTransportRouteRow(view, r, listener); boolean showDivider = i < routes.size() - 1;
buildTransportRouteRow(view, r, listener, showDivider);
} }
return new CollapsableView(view, collapsed); return new CollapsableView(view, collapsed);
@ -949,16 +991,9 @@ public class MenuBuilder {
int paddingSides = dpToPx(10f); int paddingSides = dpToPx(10f);
button.setPadding(paddingSides, 0, paddingSides, 0); button.setPadding(paddingSides, 0, paddingSides, 0);
if (!selected) { if (!selected) {
ColorStateList buttonColorStateList = new ColorStateList( ColorStateList buttonColorStateList = AndroidUtils.createColorStateList(context, !light,
new int[][] { R.color.ctx_menu_controller_button_text_color_light_n, R.color.ctx_menu_controller_button_text_color_light_p,
new int[]{android.R.attr.state_pressed}, R.color.ctx_menu_controller_button_text_color_dark_n, R.color.ctx_menu_controller_button_text_color_dark_p);
new int[]{}
},
new int[] {
context.getResources().getColor(light ? R.color.ctx_menu_controller_button_text_color_light_p : R.color.ctx_menu_controller_button_text_color_dark_p),
context.getResources().getColor(light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n)
}
);
button.setTextColor(buttonColorStateList); button.setTextColor(buttonColorStateList);
} else { } else {
button.setTextColor(ContextCompat.getColor(context, light ? R.color.ctx_menu_bottom_view_text_color_light : R.color.ctx_menu_bottom_view_text_color_dark)); button.setTextColor(ContextCompat.getColor(context, light ? R.color.ctx_menu_bottom_view_text_color_light : R.color.ctx_menu_bottom_view_text_color_dark));

View file

@ -4,6 +4,7 @@ import android.graphics.drawable.Drawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -51,7 +52,7 @@ import net.osmand.plus.mapcontextmenu.controllers.RenderedObjectMenuController;
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController; import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
import net.osmand.plus.mapcontextmenu.controllers.TransportRouteController; import net.osmand.plus.mapcontextmenu.controllers.TransportRouteController;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController; import net.osmand.plus.mapcontextmenu.controllers.TransportStopController;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController; import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
import net.osmand.plus.mapcontextmenu.other.ShareMenu; import net.osmand.plus.mapcontextmenu.other.ShareMenu;
import net.osmand.plus.mapillary.MapillaryImage; import net.osmand.plus.mapillary.MapillaryImage;
@ -225,8 +226,8 @@ public abstract class MenuController extends BaseMenuController {
return true; return true;
} }
public void addPlainMenuItem(int iconId, String text, boolean needLinks, boolean isUrl, OnClickListener onClickListener) { public void addPlainMenuItem(int iconId, String buttonText, String text, boolean needLinks, boolean isUrl, OnClickListener onClickListener) {
builder.addPlainMenuItem(iconId, text, needLinks, isUrl, onClickListener); builder.addPlainMenuItem(iconId, buttonText, text, needLinks, isUrl, onClickListener);
} }
public void clearPlainMenuItems() { public void clearPlainMenuItems() {
@ -239,7 +240,7 @@ public abstract class MenuController extends BaseMenuController {
protected void addMyLocationToPlainItems(LatLon latLon) { protected void addMyLocationToPlainItems(LatLon latLon) {
OsmandSettings st = ((OsmandApplication) getMapActivity().getApplicationContext()).getSettings(); OsmandSettings st = ((OsmandApplication) getMapActivity().getApplicationContext()).getSettings();
addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationName(getMapActivity(), addPlainMenuItem(R.drawable.ic_action_get_my_location, null, PointDescription.getLocationName(getMapActivity(),
latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", " "), false, false, null); latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", " "), false, false, null);
//if (st.COORDINATES_FORMAT.get() != PointDescription.OLC_FORMAT) //if (st.COORDINATES_FORMAT.get() != PointDescription.OLC_FORMAT)
// addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationOlcName( // addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationOlcName(
@ -386,15 +387,11 @@ public abstract class MenuController extends BaseMenuController {
return false; return false;
} }
public boolean displayAdditionalTypeStrInHours() { public int getRightIconId() {
return false;
}
public int getLeftIconId() {
return 0; return 0;
} }
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return null; return null;
} }
@ -402,10 +399,14 @@ public abstract class MenuController extends BaseMenuController {
return null; return null;
} }
public Drawable getAdditionalLineTypeIcon() { public Drawable getSubtypeIcon() {
return null; return null;
} }
public boolean navigateInPedestrianMode() {
return false;
}
public int getFavActionIconId() { public int getFavActionIconId() {
return R.drawable.map_action_fav_dark; return R.drawable.map_action_fav_dark;
} }
@ -432,16 +433,29 @@ public abstract class MenuController extends BaseMenuController {
return ""; return "";
} }
public String getAdditionalTypeStr() { public String getSubtypeStr() {
return ""; return "";
} }
public int getTimeStrColor() { public int getAdditionalInfoColor() {
if (indexItem != null) {
return R.color.icon_color;
}
return 0; return 0;
} }
public OpeningHoursInfo getOpeningHoursInfo() { public String getAdditionalInfoStr() {
return null; if (indexItem != null) {
return getMapActivity().getString(R.string.file_size_in_mb, indexItem.getArchiveSizeMB());
}
return "";
}
public int getAdditionalInfoIconRes() {
if (indexItem != null) {
return R.drawable.ic_sdcard_16;
}
return 0;
} }
public String getCommonTypeStr() { public String getCommonTypeStr() {
@ -531,11 +545,14 @@ public abstract class MenuController extends BaseMenuController {
public abstract class TitleButtonController { public abstract class TitleButtonController {
public String caption = ""; public String caption = "";
public int leftIconId = 0; public int leftIconId = 0;
public int rightIconId = 0;
public boolean needRightText = false; public boolean needRightText = false;
public String rightTextCaption = ""; public String rightTextCaption = "";
public boolean visible = true; public boolean visible = true;
public boolean needColorizeIcon = true; public boolean needColorizeIcon = true;
public Drawable leftIcon; public Drawable leftIcon;
public Drawable rightIcon;
public boolean enabled = true;
public Drawable getLeftIcon() { public Drawable getLeftIcon() {
if (leftIcon != null) { if (leftIcon != null) {
@ -543,7 +560,7 @@ public abstract class MenuController extends BaseMenuController {
} }
if (leftIconId != 0) { if (leftIconId != 0) {
if (needColorizeIcon) { if (needColorizeIcon) {
return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange); return getIcon(leftIconId, getColorRes());
} }
return ContextCompat.getDrawable(getMapActivity(), leftIconId); return ContextCompat.getDrawable(getMapActivity(), leftIconId);
} else { } else {
@ -551,6 +568,30 @@ public abstract class MenuController extends BaseMenuController {
} }
} }
public Drawable getRightIcon() {
if (rightIcon != null) {
return rightIcon;
}
if (rightIconId != 0) {
if (needColorizeIcon) {
return getIcon(rightIconId, getColorRes());
}
return ContextCompat.getDrawable(getMapActivity(), rightIconId);
} else {
return null;
}
}
private int getColorRes() {
int colorRes;
if (enabled) {
colorRes = isLight() ? R.color.map_widget_blue : R.color.osmand_orange;
} else {
colorRes = isLight() ? R.color.ctx_menu_controller_disabled_text_color_light : R.color.ctx_menu_controller_disabled_text_color_dark;
}
return colorRes;
}
public abstract void buttonPressed(); public abstract void buttonPressed();
} }
@ -619,7 +660,7 @@ public abstract class MenuController extends BaseMenuController {
} }
} }
public void buildMapDownloadButton(final LatLon latLon) { public void buildMapDownloadButtonAndSizeInfo(final LatLon latLon) {
new AsyncTask<Void, Void, BinaryMapDataObject>() { new AsyncTask<Void, Void, BinaryMapDataObject>() {
ResourceManager rm; ResourceManager rm;
@ -774,6 +815,11 @@ public abstract class MenuController extends BaseMenuController {
public ContextMenuToolbarController(MenuController menuController) { public ContextMenuToolbarController(MenuController menuController) {
super(TopToolbarControllerType.CONTEXT_MENU); super(TopToolbarControllerType.CONTEXT_MENU);
this.menuController = menuController; this.menuController = menuController;
setBgIds(R.color.actionbar_light_color, R.color.actionbar_dark_color,
R.color.actionbar_light_color, R.color.actionbar_dark_color);
setBackBtnIconClrIds(R.color.color_white, R.color.color_white);
setCloseBtnIconClrIds(R.color.color_white, R.color.color_white);
setTitleTextClrIds(R.color.color_white, R.color.color_white);
} }
public MenuController getMenuController() { public MenuController getMenuController() {

View file

@ -11,16 +11,13 @@ import net.osmand.util.Algorithms;
public abstract class MenuTitleController { public abstract class MenuTitleController {
protected int leftIconId; protected int rightIconId;
protected Drawable leftIcon; protected Drawable rightIcon;
protected String nameStr = ""; protected String nameStr = "";
protected String typeStr = ""; protected String typeStr = "";
protected String additionalTypeStr = "";
protected String commonTypeStr = ""; protected String commonTypeStr = "";
protected Drawable secondLineTypeIcon; protected Drawable secondLineTypeIcon;
protected Drawable additionalLineTypeIcon;
protected String streetStr = ""; protected String streetStr = "";
protected OpeningHoursInfo openingHoursInfo;
private AddressLookupRequest addressLookupRequest; private AddressLookupRequest addressLookupRequest;
@ -68,22 +65,18 @@ public abstract class MenuTitleController {
return !addressNotFoundStr.equals(title) && !searchAddressStr.equals(title); return !addressNotFoundStr.equals(title) && !searchAddressStr.equals(title);
} }
public int getLeftIconId() { public int getRightIconId() {
return leftIconId; return rightIconId;
} }
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return leftIcon; return rightIcon;
} }
public Drawable getTypeIcon() { public Drawable getTypeIcon() {
return secondLineTypeIcon; return secondLineTypeIcon;
} }
public Drawable getAdditionalLineTypeIcon() {
return additionalLineTypeIcon;
}
public String getTypeStr() { public String getTypeStr() {
MenuController menuController = getMenuController(); MenuController menuController = getMenuController();
if (menuController != null && menuController.needTypeStr()) { if (menuController != null && menuController.needTypeStr()) {
@ -93,15 +86,6 @@ public abstract class MenuTitleController {
} }
} }
public String getAdditionalTypeStr() {
MenuController menuController = getMenuController();
if (menuController != null) {
return additionalTypeStr;
} else {
return "";
}
}
public String getStreetStr() { public String getStreetStr() {
if (needStreetName()) { if (needStreetName()) {
if (searchingAddress()) { if (searchingAddress()) {
@ -114,10 +98,6 @@ public abstract class MenuTitleController {
} }
} }
public OpeningHoursInfo getOpeningHoursInfo() {
return openingHoursInfo;
}
protected void initTitle() { protected void initTitle() {
searchAddressStr = PointDescription.getSearchAddressStr(getMapActivity()); searchAddressStr = PointDescription.getSearchAddressStr(getMapActivity());
addressNotFoundStr = PointDescription.getAddressNotFoundStr(getMapActivity()); addressNotFoundStr = PointDescription.getAddressNotFoundStr(getMapActivity());
@ -131,8 +111,6 @@ public abstract class MenuTitleController {
if (needStreetName()) { if (needStreetName()) {
acquireStreetName(); acquireStreetName();
} }
acquireOpeningHoursInfo();
} }
protected boolean needStreetName() { protected boolean needStreetName() {
@ -147,16 +125,14 @@ public abstract class MenuTitleController {
protected void acquireIcons() { protected void acquireIcons() {
MenuController menuController = getMenuController(); MenuController menuController = getMenuController();
leftIconId = 0; rightIconId = 0;
leftIcon = null; rightIcon = null;
secondLineTypeIcon = null; secondLineTypeIcon = null;
additionalLineTypeIcon = null;
if (menuController != null) { if (menuController != null) {
leftIconId = menuController.getLeftIconId(); rightIconId = menuController.getRightIconId();
leftIcon = menuController.getLeftIcon(); rightIcon = menuController.getRightIcon();
secondLineTypeIcon = menuController.getSecondLineTypeIcon(); secondLineTypeIcon = menuController.getSecondLineTypeIcon();
additionalLineTypeIcon = menuController.getAdditionalLineTypeIcon();
} }
} }
@ -170,7 +146,6 @@ public abstract class MenuTitleController {
if (menuController != null) { if (menuController != null) {
nameStr = menuController.getNameStr(); nameStr = menuController.getNameStr();
typeStr = menuController.getTypeStr(); typeStr = menuController.getTypeStr();
additionalTypeStr = menuController.getAdditionalTypeStr();
commonTypeStr = menuController.getCommonTypeStr(); commonTypeStr = menuController.getCommonTypeStr();
} }
@ -211,13 +186,6 @@ public abstract class MenuTitleController {
getMapActivity().getMyApplication().getGeocodingLookupService().lookupAddress(addressLookupRequest); getMapActivity().getMyApplication().getGeocodingLookupService().lookupAddress(addressLookupRequest);
} }
protected void acquireOpeningHoursInfo() {
MenuController menuController = getMenuController();
if (menuController != null) {
openingHoursInfo = menuController.getOpeningHoursInfo();
}
}
protected void onSearchAddressDone() { protected void onSearchAddressDone() {
} }

View file

@ -1,5 +1,8 @@
package net.osmand.plus.mapcontextmenu; package net.osmand.plus.mapcontextmenu;
import android.content.Context;
import net.osmand.plus.R;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
public class OpeningHoursInfo { public class OpeningHoursInfo {
@ -68,12 +71,20 @@ public class OpeningHoursInfo {
this.openingDay = openingDay; this.openingDay = openingDay;
} }
public boolean containsInfo() { public String getInfo(Context context) {
return opened24_7 if (isOpened24_7()) {
|| !Algorithms.isEmpty(openingTime) return context.getString(R.string.shared_string_is_open_24_7);
|| !Algorithms.isEmpty(nearToOpeningTime) } else if (!Algorithms.isEmpty(getNearToOpeningTime())) {
|| !Algorithms.isEmpty(closingTime) return context.getString(R.string.will_open_at) + " " + getNearToOpeningTime();
|| !Algorithms.isEmpty(nearToClosingTime) } else if (!Algorithms.isEmpty(getOpeningTime())) {
|| !Algorithms.isEmpty(openingDay); return context.getString(R.string.open_from) + " " + getOpeningTime();
} else if (!Algorithms.isEmpty(getNearToClosingTime())) {
return context.getString(R.string.will_close_at) + " " + getNearToClosingTime();
} else if (!Algorithms.isEmpty(getClosingTime())) {
return context.getString(R.string.open_till) + " " + getClosingTime();
} else if (!Algorithms.isEmpty(getOpeningDay())) {
return context.getString(R.string.will_open_on) + " " + getOpeningDay() + ".";
}
return "";
} }
} }

View file

@ -1,6 +1,6 @@
package net.osmand.plus.mapcontextmenu; package net.osmand.plus.mapcontextmenu;
import android.content.Context; import android.graphics.drawable.GradientDrawable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -9,26 +9,56 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import java.util.List; import java.util.List;
public class TransportStopRouteAdapter extends ArrayAdapter<TransportStopRoute> { public class TransportStopRouteAdapter extends ArrayAdapter<TransportStopRoute> {
public TransportStopRouteAdapter(@NonNull Context context, @NonNull List<TransportStopRoute> objects) { private boolean nightMode;
super(context, 0, objects); private OnClickListener listener;
private OsmandApplication app;
public TransportStopRouteAdapter(@NonNull OsmandApplication application, @NonNull List<TransportStopRoute> objects, boolean nightMode) {
super(application, 0, objects);
this.nightMode = nightMode;
this.app = application;
}
public void setListener(OnClickListener listener) {
this.listener = listener;
} }
@NonNull @NonNull
@Override @Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { public View getView(final int position, @Nullable View convertView, @NonNull ViewGroup parent) {
if (convertView == null) { if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.transport_stop_route_item, parent, false); convertView = LayoutInflater.from(getContext()).inflate(R.layout.transport_stop_route_item, parent, false);
} }
((TextView) convertView.findViewById(R.id.transport_stop_route_text)).setText(getItem(position).route.getRef()); TransportStopRoute transportStopRoute = getItem(position);
if (transportStopRoute != null) {
TextView transportStopRouteTextView = (TextView) convertView.findViewById(R.id.transport_stop_route_text);
transportStopRouteTextView.setText(transportStopRoute.route.getRef());
GradientDrawable gradientDrawableBg = (GradientDrawable) transportStopRouteTextView.getBackground();
gradientDrawableBg.setColor(transportStopRoute.getColor(app, nightMode));
}
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onClick(position);
}
}
});
return convertView; return convertView;
} }
public interface OnClickListener {
void onClick(int position);
}
} }

View file

@ -0,0 +1,291 @@
package net.osmand.plus.mapcontextmenu;
import android.app.Dialog;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.customtabs.CustomTabsIntent;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.PopupMenu;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.data.Amenity;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.util.Algorithms;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
public class WikipediaDialogFragment extends DialogFragment {
public static final String TAG = "WikipediaDialogFragment";
private View mainView;
private boolean darkMode;
private Amenity amenity;
private String lang;
public void setAmenity(Amenity amenity) {
this.amenity = amenity;
}
public void setLanguage(String lang) {
this.lang = lang;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OsmandApplication app = getMyApplication();
darkMode = app.getDaynightHelper().isNightMode() || !app.getSettings().isLightContent();
int themeId = darkMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
setStyle(STYLE_NO_FRAME, themeId);
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = new Dialog(getContext(), getTheme());
if (!getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get()) {
dialog.getWindow().getAttributes().windowAnimations = R.style.Animations_Alpha;
}
return dialog;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mainView = inflater.inflate(R.layout.wikipedia_dialog_fragment, container, false);
mainView.setBackgroundColor(ContextCompat.getColor(getContext(), darkMode ? R.color.ctx_menu_bottom_view_bg_dark : R.color.ctx_menu_bottom_view_bg_light));
AppBarLayout appBarLayout = (AppBarLayout) mainView.findViewById(R.id.app_bar);
appBarLayout.setBackgroundColor(ContextCompat.getColor(getContext(), darkMode ? R.color.ctx_menu_buttons_bg_dark: R.color.ctx_menu_buttons_bg_light));
int toolbarTextColor = ContextCompat.getColor(getContext(), R.color.dashboard_subheader_text_light);
ImageButton backButton = (ImageButton) mainView.findViewById(R.id.back_button);
backButton.setImageDrawable(getMyApplication().getIconsCache().getPaintedIcon(R.drawable.ic_arrow_back, toolbarTextColor));
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
TextView titleTextView = (TextView) mainView.findViewById(R.id.title_text_view);
titleTextView.setTextColor(toolbarTextColor);
ColorStateList buttonColorStateList = AndroidUtils.createColorStateList(getContext(), darkMode,
R.color.ctx_menu_controller_button_text_color_light_n, R.color.ctx_menu_controller_button_text_color_light_p,
R.color.ctx_menu_controller_button_text_color_dark_n, R.color.ctx_menu_controller_button_text_color_dark_p);
final TextView readFullArticleButton = (TextView) mainView.findViewById(R.id.read_full_article);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) readFullArticleButton.getLayoutParams();
params.setBehavior(new CoordinatorLayout.Behavior() {
@Override
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
return dependency instanceof AppBarLayout;
}
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
if (dependency instanceof AppBarLayout) {
int readFullArticleButtonHeight = child.getMeasuredHeight();
if (readFullArticleButtonHeight != 0) {
CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
int viewBottomMargin = lp.bottomMargin;
int distanceToScroll = child.getHeight() + viewBottomMargin;
float ratio = dependency.getY() / readFullArticleButtonHeight;
child.setTranslationY(-distanceToScroll * ratio);
}
}
return true;
}
});
readFullArticleButton.setLayoutParams(params);
readFullArticleButton.setBackgroundResource(darkMode ? R.drawable.bt_round_long_night : R.drawable.bt_round_long_day);
readFullArticleButton.setTextColor(buttonColorStateList);
int paddingLeft = (int) getResources().getDimension(R.dimen.wikipedia_button_left_padding);
int paddingRight = (int) getResources().getDimension(R.dimen.dialog_content_margin);
readFullArticleButton.setPadding(paddingLeft, 0, paddingRight, 0);
readFullArticleButton.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_world_globe_dark), null, null, null);
readFullArticleButton.setCompoundDrawablePadding((int) getResources().getDimension(R.dimen.content_padding_small));
final TextView selectLanguageTextView = mainView.findViewById(R.id.select_language_text_view);
selectLanguageTextView.setTextColor(buttonColorStateList);
selectLanguageTextView.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_action_map_language), null, null, null);
selectLanguageTextView.setCompoundDrawablePadding((int) getResources().getDimension(R.dimen.context_menu_padding_margin_small));
selectLanguageTextView.setBackgroundResource(darkMode ? R.drawable.wikipedia_select_lang_bg_dark : R.drawable.wikipedia_select_lang_bg_light);
return mainView;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
populateWiki();
}
@Override
public void onDestroyView() {
Dialog dialog = getDialog();
if (dialog != null) {
dialog.setDismissMessage(null);
}
super.onDestroyView();
}
private void populateWiki() {
if (amenity != null) {
String preferredLanguage = lang;
if (TextUtils.isEmpty(preferredLanguage)) {
preferredLanguage = getMyApplication().getLanguage();
}
final String title = TextUtils.isEmpty(preferredLanguage) ? amenity.getName() : amenity.getName(lang);
((TextView) mainView.findViewById(R.id.title_text_view)).setText(title);
String lng = amenity.getContentLanguage("content", preferredLanguage, "en");
if (Algorithms.isEmpty(lng)) {
lng = "en";
}
final String langSelected = lng;
mainView.findViewById(R.id.read_full_article).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String article = "https://" + langSelected.toLowerCase() + ".wikipedia.org/wiki/" + title.replace(' ', '_');
showFullArticle(Uri.parse(article));
}
});
final TextView selectLanguageTextView = mainView.findViewById(R.id.select_language_text_view);
selectLanguageTextView.setText(langSelected);
selectLanguageTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showPopupLangMenu(selectLanguageTextView, langSelected);
}
});
String content = amenity.getDescription(langSelected);
TextView articleTextView = (TextView) mainView.findViewById(R.id.content);
Spannable spannableContent = new SpannableString(Html.fromHtml(content));
int length = spannableContent.length();
spannableContent.setSpan(new RelativeSizeSpan(1.2f), 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
int contentTextColor = ContextCompat.getColor(getContext(), darkMode ? R.color.ctx_menu_bottom_view_text_color_dark : R.color.ctx_menu_bottom_view_text_color_light);
spannableContent.setSpan(new ForegroundColorSpan(contentTextColor), 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
articleTextView.setText(spannableContent);
}
}
private void showFullArticle(Uri uri) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
.setToolbarColor(ContextCompat.getColor(getContext(), darkMode ? R.color.actionbar_dark_color : R.color.actionbar_light_color))
.build();
customTabsIntent.launchUrl(getContext(), uri);
} else {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(uri);
startActivity(i);
}
}
private void showPopupLangMenu(View view, final String langSelected) {
final PopupMenu optionsMenu = new PopupMenu(getContext(), view, Gravity.RIGHT);
Set<String> namesSet = new TreeSet<>();
namesSet.addAll(amenity.getNames("content", "en"));
namesSet.addAll(amenity.getNames("description", "en"));
Map<String, String> names = new HashMap<>();
for (String n : namesSet) {
names.put(n, FileNameTranslationHelper.getVoiceName(getContext(), n));
}
String selectedLangName = names.get(langSelected);
if (selectedLangName != null) {
names.remove(langSelected);
}
Map<String, String> sortedNames = AndroidUtils.sortByValue(names);
if (selectedLangName != null) {
MenuItem item = optionsMenu.getMenu().add(selectedLangName);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
setLanguage(langSelected);
populateWiki();
return true;
}
});
}
for (final Map.Entry<String, String> e : sortedNames.entrySet()) {
MenuItem item = optionsMenu.getMenu().add(e.getValue());
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
setLanguage(e.getKey());
populateWiki();
return true;
}
});
}
optionsMenu.show();
}
private Drawable getIcon(int resId) {
int colorId = darkMode ? R.color.ctx_menu_controller_button_text_color_dark_n : R.color.ctx_menu_controller_button_text_color_light_n;
return getMyApplication().getIconsCache().getIcon(resId, colorId);
}
private OsmandApplication getMyApplication() {
return (OsmandApplication) getActivity().getApplication();
}
public static boolean showInstance(AppCompatActivity activity, Amenity amenity) {
try {
if (!amenity.getType().isWiki()) {
return false;
}
OsmandApplication app = (OsmandApplication) activity.getApplication();
String lang = app.getSettings().MAP_PREFERRED_LOCALE.get();
WikipediaDialogFragment wikipediaDialogFragment = new WikipediaDialogFragment();
wikipediaDialogFragment.setAmenity(amenity);
wikipediaDialogFragment.setLanguage(lang);
wikipediaDialogFragment.setRetainInstance(true);
wikipediaDialogFragment.show(activity.getSupportFragmentManager(), TAG);
return true;
} catch (RuntimeException e) {
return false;
}
}
}

View file

@ -19,6 +19,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
@ -31,6 +32,7 @@ import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.FontCache; import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.WikipediaDialogFragment;
import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.views.POIMapLayer; import net.osmand.plus.views.POIMapLayer;
import net.osmand.plus.widgets.TextViewEx; import net.osmand.plus.widgets.TextViewEx;
@ -92,7 +94,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
ll.setOrientation(LinearLayout.HORIZONTAL); ll.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ll.setLayoutParams(llParams); ll.setLayoutParams(llParams);
ll.setBackgroundResource(resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground)); ll.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));
ll.setOnLongClickListener(new View.OnLongClickListener() { ll.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
@ -131,7 +133,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
llTextParams.setMargins(icon == null ? dpToPx(16f) : 0, collapsable ? dpToPx(13f) : dpToPx(8f), 0, collapsable ? dpToPx(13f) : dpToPx(8f)); llTextParams.setMargins(icon == null ? dpToPx(16f) : 0, collapsable ? dpToPx(13f) : dpToPx(8f), 0, collapsable ? dpToPx(13f) : dpToPx(8f));
textView.setLayoutParams(llTextParams); textView.setLayoutParams(llTextParams);
textView.setTextSize(16); textView.setTextSize(16);
textView.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_info_text_light : R.color.ctx_menu_info_text_dark)); textView.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_bottom_view_text_color_light : R.color.ctx_menu_bottom_view_text_color_dark));
boolean textDefined = false; boolean textDefined = false;
if (isPhoneNumber || isUrl) { if (isPhoneNumber || isUrl) {
@ -217,16 +219,9 @@ public class AmenityMenuBuilder extends MenuBuilder {
button.setTextSize(14); button.setTextSize(14);
int paddingSides = dpToPx(10f); int paddingSides = dpToPx(10f);
button.setPadding(paddingSides, 0, paddingSides, 0); button.setPadding(paddingSides, 0, paddingSides, 0);
ColorStateList buttonColorStateList = new ColorStateList( ColorStateList buttonColorStateList = AndroidUtils.createColorStateList(view.getContext(), !light,
new int[][] { R.color.ctx_menu_controller_button_text_color_light_n, R.color.ctx_menu_controller_button_text_color_light_p,
new int[]{android.R.attr.state_pressed}, R.color.ctx_menu_controller_button_text_color_dark_n, R.color.ctx_menu_controller_button_text_color_dark_p);
new int[]{}
},
new int[] {
view.getResources().getColor(light ? R.color.ctx_menu_controller_button_text_color_light_p : R.color.ctx_menu_controller_button_text_color_dark_p),
view.getResources().getColor(light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n)
}
);
button.setTextColor(buttonColorStateList); button.setTextColor(buttonColorStateList);
button.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL); button.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
button.setSingleLine(true); button.setSingleLine(true);
@ -234,12 +229,12 @@ public class AmenityMenuBuilder extends MenuBuilder {
button.setOnClickListener(new View.OnClickListener() { button.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
POIMapLayer.showWikipediaDialog(view.getContext(), app, amenity); WikipediaDialogFragment.showInstance(mapActivity, amenity);
} }
}); });
button.setAllCaps(true); button.setAllCaps(true);
button.setText(R.string.context_menu_read_full_article); button.setText(R.string.context_menu_read_full_article);
Drawable compoundDrawable = app.getIconsCache().getIcon(R.drawable.ic_action_note_dark, light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n); Drawable compoundDrawable = app.getIconsCache().getIcon(R.drawable.ic_action_read_text, light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n);
button.setCompoundDrawablesWithIntrinsicBounds(compoundDrawable, null, null, null); button.setCompoundDrawablesWithIntrinsicBounds(compoundDrawable, null, null, null);
button.setCompoundDrawablePadding(dpToPx(8f)); button.setCompoundDrawablePadding(dpToPx(8f));
llText.addView(button); llText.addView(button);
@ -284,7 +279,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
ll.setOnClickListener(new View.OnClickListener() { ll.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
POIMapLayer.showWikipediaDialog(view.getContext(), app, amenity); WikipediaDialogFragment.showInstance(mapActivity, amenity);
} }
}); });
} else if (isText && text.length() > 200) { } else if (isText && text.length() > 200) {
@ -516,10 +511,10 @@ public class AmenityMenuBuilder extends MenuBuilder {
} else { } else {
link = "https://www.openstreetmap.org/way/"; link = "https://www.openstreetmap.org/way/";
} }
buildRow(view, R.drawable.ic_action_info_dark, link + (amenity.getId() >> 1), buildRow(view, R.drawable.ic_action_info_dark, null, link + (amenity.getId() >> 1),
0, false, null, true, 0, true, null, false); 0, false, null, true, 0, true, null, false);
} }
buildRow(view, R.drawable.ic_action_get_my_location, PointDescription.getLocationName(app, buildRow(view, R.drawable.ic_action_get_my_location, null, PointDescription.getLocationName(app,
amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), true) amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), true)
.replaceAll("\n", " "), 0, false, null, false, 0, false, null, false); .replaceAll("\n", " "), 0, false, null, false, 0, false, null, false);
//if (st.COORDINATES_FORMAT.get() != PointDescription.OLC_FORMAT) //if (st.COORDINATES_FORMAT.get() != PointDescription.OLC_FORMAT)

View file

@ -78,7 +78,7 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
int disabledColor = light ? R.color.secondary_text_light : R.color.secondary_text_dark; int disabledColor = light ? R.color.secondary_text_light : R.color.secondary_text_dark;
color = favoriteGroup.visible ? (color | 0xff000000) : view.getResources().getColor(disabledColor); color = favoriteGroup.visible ? (color | 0xff000000) : view.getResources().getColor(disabledColor);
String name = view.getContext().getString(R.string.context_menu_points_of_group); String name = view.getContext().getString(R.string.context_menu_points_of_group);
buildRow(view, app.getIconsCache().getPaintedIcon(R.drawable.ic_action_folder, color), name, 0, null, buildRow(view, app.getIconsCache().getPaintedIcon(R.drawable.ic_action_folder, color), null, name, 0, null,
true, getCollapsableFavouritesView(view.getContext(), true, favoriteGroup, fav), true, getCollapsableFavouritesView(view.getContext(), true, favoriteGroup, fav),
false, 0, false, null, false); false, 0, false, null, false);
} }

View file

@ -34,7 +34,7 @@ public class GpxItemMenuBuilder extends MenuBuilder {
String description = GpxUiHelper.getDescription(app, item.analysis, false); String description = GpxUiHelper.getDescription(app, item.analysis, false);
String[] lines = description.split("\n"); String[] lines = description.split("\n");
for (String line : lines) { for (String line : lines) {
buildRow(view, R.drawable.ic_action_info_dark, line, 0, false, null, false, 0, false, null, false); buildRow(view, R.drawable.ic_action_info_dark, null, line, 0, false, null, false, 0, false, null, false);
} }
} }

View file

@ -44,23 +44,23 @@ public class WptPtMenuBuilder extends MenuBuilder {
DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(view.getContext()); DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(view.getContext());
Date date = new Date(wpt.time); Date date = new Date(wpt.time);
buildRow(view, R.drawable.ic_action_data, buildRow(view, R.drawable.ic_action_data,
dateFormat.format(date) + "" + timeFormat.format(date), 0, false, null, false, 0, false, null, false); null, dateFormat.format(date) + "" + timeFormat.format(date), 0, false, null, false, 0, false, null, false);
} }
if (wpt.speed > 0) { if (wpt.speed > 0) {
buildRow(view, R.drawable.ic_action_speed, buildRow(view, R.drawable.ic_action_speed,
OsmAndFormatter.getFormattedSpeed((float)wpt.speed, app), 0, false, null, false, 0, false, null, false); null, OsmAndFormatter.getFormattedSpeed((float)wpt.speed, app), 0, false, null, false, 0, false, null, false);
} }
if (!Double.isNaN(wpt.ele)) { if (!Double.isNaN(wpt.ele)) {
buildRow(view, R.drawable.ic_action_altitude, buildRow(view, R.drawable.ic_action_altitude,
OsmAndFormatter.getFormattedDistance((float) wpt.ele, app), 0, false, null, false, 0, false, null, false); null, OsmAndFormatter.getFormattedDistance((float) wpt.ele, app), 0, false, null, false, 0, false, null, false);
} }
if (!Double.isNaN(wpt.hdop)) { if (!Double.isNaN(wpt.hdop)) {
buildRow(view, R.drawable.ic_action_gps_info, buildRow(view, R.drawable.ic_action_gps_info,
Algorithms.capitalizeFirstLetterAndLowercase(app.getString(R.string.plugin_distance_point_hdop)) + ": " + (int)wpt.hdop, 0, null, Algorithms.capitalizeFirstLetterAndLowercase(app.getString(R.string.plugin_distance_point_hdop)) + ": " + (int)wpt.hdop, 0,
false, null, false, 0, false, null, false); false, null, false, 0, false, null, false);
} }
if (!Algorithms.isEmpty(wpt.desc)) { if (!Algorithms.isEmpty(wpt.desc)) {
final View row = buildRow(view, R.drawable.ic_action_note_dark, wpt.desc, 0, false, null, true, 10, false, null, false); final View row = buildRow(view, R.drawable.ic_action_note_dark, null, wpt.desc, 0, false, null, true, 10, false, null, false);
row.setOnClickListener(new View.OnClickListener() { row.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -70,7 +70,7 @@ public class WptPtMenuBuilder extends MenuBuilder {
}); });
} }
if (!Algorithms.isEmpty(wpt.comment)) { if (!Algorithms.isEmpty(wpt.comment)) {
final View rowc = buildRow(view, R.drawable.ic_action_note_dark, wpt.comment, 0, final View rowc = buildRow(view, R.drawable.ic_action_note_dark, null, wpt.comment, 0,
false, null, true, 10, false, null, false); false, null, true, 10, false, null, false);
rowc.setOnClickListener(new View.OnClickListener() { rowc.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -96,7 +96,7 @@ public class WptPtMenuBuilder extends MenuBuilder {
File file = new File(gpx.path); File file = new File(gpx.path);
String gpxName = file.getName().replace(".gpx", "").replace("/", " ").replace("_", " "); String gpxName = file.getName().replace(".gpx", "").replace("/", " ").replace("_", " ");
int color = getPointColor(wpt, getFileColor(selectedGpxFile)); int color = getPointColor(wpt, getFileColor(selectedGpxFile));
buildRow(view, app.getIconsCache().getPaintedIcon(R.drawable.ic_type_waypoints_group, color), title, 0, gpxName, buildRow(view, app.getIconsCache().getPaintedIcon(R.drawable.ic_type_waypoints_group, color), null, title, 0, gpxName,
true, getCollapsableWaypointsView(view.getContext(), true, gpx, wpt), true, getCollapsableWaypointsView(view.getContext(), true, gpx, wpt),
false, 0, false, null, false); false, 0, false, null, false);
} }

View file

@ -49,7 +49,7 @@ public class AMapPointMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_get_my_location); return getIcon(R.drawable.ic_action_get_my_location);
} }

View file

@ -1,7 +1,5 @@
package net.osmand.plus.mapcontextmenu.controllers; package net.osmand.plus.mapcontextmenu.controllers;
import android.view.View;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
@ -14,16 +12,15 @@ import net.osmand.osm.PoiType;
import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.MapMarkersHelper.MapMarker;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.OpeningHoursInfo; import net.osmand.plus.mapcontextmenu.OpeningHoursInfo;
import net.osmand.plus.mapcontextmenu.WikipediaDialogFragment;
import net.osmand.plus.mapcontextmenu.builders.AmenityMenuBuilder; import net.osmand.plus.mapcontextmenu.builders.AmenityMenuBuilder;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.render.RenderingIcons; import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.resources.TransportIndexRepository; import net.osmand.plus.resources.TransportIndexRepository;
import net.osmand.plus.views.POIMapLayer; import net.osmand.plus.transport.TransportStopType;
import net.osmand.plus.views.TransportStopsLayer;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
import net.osmand.util.OpeningHoursParser; import net.osmand.util.OpeningHoursParser;
@ -39,6 +36,7 @@ public class AmenityMenuController extends MenuController {
private Amenity amenity; private Amenity amenity;
private List<TransportStopRoute> routes = new ArrayList<>(); private List<TransportStopRoute> routes = new ArrayList<>();
private OpeningHoursInfo openingHoursInfo;
private MapMarker marker; private MapMarker marker;
@ -71,12 +69,14 @@ public class AmenityMenuController extends MenuController {
leftTitleButtonController = new TitleButtonController() { leftTitleButtonController = new TitleButtonController() {
@Override @Override
public void buttonPressed() { public void buttonPressed() {
POIMapLayer.showWikipediaDialog(mapActivity, mapActivity.getMyApplication(), amenity); WikipediaDialogFragment.showInstance(mapActivity, amenity);
} }
}; };
leftTitleButtonController.caption = getMapActivity().getString(R.string.context_menu_read_article); leftTitleButtonController.caption = getMapActivity().getString(R.string.context_menu_read_article);
leftTitleButtonController.leftIcon = getIcon(R.drawable.ic_action_note_dark, isLight() ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n); leftTitleButtonController.leftIcon = getIcon(R.drawable.ic_action_read_text, isLight() ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n);
} }
openingHoursInfo = processOpeningHours(amenity);
} }
@Override @Override
@ -108,11 +108,11 @@ public class AmenityMenuController extends MenuController {
} }
@Override @Override
public int getLeftIconId() { public int getRightIconId() {
return getLeftIconId(amenity); return getRightIconId(amenity);
} }
private static int getLeftIconId(Amenity amenity) { private static int getRightIconId(Amenity amenity) {
String id = null; String id = null;
PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType()); PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
if (st != null) { if (st != null) {
@ -146,8 +146,27 @@ public class AmenityMenuController extends MenuController {
} }
@Override @Override
public OpeningHoursInfo getOpeningHoursInfo() { public int getAdditionalInfoColor() {
return processOpeningHours(amenity); if (openingHoursInfo != null) {
return openingHoursInfo.isOpened() ? R.color.ctx_menu_amenity_opened_text_color : R.color.ctx_menu_amenity_closed_text_color;
}
return super.getAdditionalInfoColor();
}
@Override
public String getAdditionalInfoStr() {
if (openingHoursInfo != null) {
return openingHoursInfo.getInfo(getMapActivity());
}
return super.getAdditionalInfoStr();
}
@Override
public int getAdditionalInfoIconRes() {
if (openingHoursInfo != null) {
return R.drawable.ic_action_opening_hour_16;
}
return super.getAdditionalInfoIconRes();
} }
public static String getTypeStr(Amenity amenity) { public static String getTypeStr(Amenity amenity) {
@ -201,7 +220,7 @@ public class AmenityMenuController extends MenuController {
public static void addPlainMenuItems(Amenity amenity, String typeStr, MenuBuilder builder) { public static void addPlainMenuItems(Amenity amenity, String typeStr, MenuBuilder builder) {
if (!Algorithms.isEmpty(typeStr)) { if (!Algorithms.isEmpty(typeStr)) {
int resId = getLeftIconId(amenity); int resId = getRightIconId(amenity);
if (resId == 0) { if (resId == 0) {
PoiCategory pc = amenity.getType(); PoiCategory pc = amenity.getType();
resId = RenderingIcons.getBigIconResourceId(pc.getIconKeyName()); resId = RenderingIcons.getBigIconResourceId(pc.getIconKeyName());
@ -254,7 +273,7 @@ public class AmenityMenuController extends MenuController {
if (rts != null) { if (rts != null) {
for (TransportRoute rs : rts) { for (TransportRoute rs : rts) {
if (!containsRef(rs)) { if (!containsRef(rs)) {
TransportStopController.TransportStopType type = TransportStopController.TransportStopType.findType(rs.getType()); TransportStopType type = TransportStopType.findType(rs.getType());
TransportStopRoute r = new TransportStopRoute(); TransportStopRoute r = new TransportStopRoute();
r.type = type; r.type = type;
r.desc = useEnglishNames ? rs.getEnName(true) : rs.getName(); r.desc = useEnglishNames ? rs.getEnName(true) : rs.getName();

View file

@ -18,6 +18,7 @@ import net.osmand.plus.mapcontextmenu.OpeningHoursInfo;
import net.osmand.plus.mapcontextmenu.builders.FavouritePointMenuBuilder; import net.osmand.plus.mapcontextmenu.builders.FavouritePointMenuBuilder;
import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor; import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor;
import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditorFragment; import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditorFragment;
import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import java.util.ArrayList; import java.util.ArrayList;
@ -27,7 +28,8 @@ public class FavouritePointMenuController extends MenuController {
private FavouritePoint fav; private FavouritePoint fav;
private MapMarker mapMarker; private MapMarker mapMarker;
private List<TransportStopController.TransportStopRoute> routes = new ArrayList<>(); private List<TransportStopRoute> routes = new ArrayList<>();
private OpeningHoursInfo openingHoursInfo;
public FavouritePointMenuController(MapActivity mapActivity, PointDescription pointDescription, final FavouritePoint fav) { public FavouritePointMenuController(MapActivity mapActivity, PointDescription pointDescription, final FavouritePoint fav) {
super(new FavouritePointMenuBuilder(mapActivity, fav), pointDescription, mapActivity); super(new FavouritePointMenuBuilder(mapActivity, fav), pointDescription, mapActivity);
@ -50,6 +52,11 @@ public class FavouritePointMenuController extends MenuController {
routes = transportStopController.processTransportStop(); routes = transportStopController.processTransportStop();
builder.setRoutes(routes); builder.setRoutes(routes);
} }
Object originObject = getBuilder().getOriginObject();
if (originObject instanceof Amenity) {
openingHoursInfo = AmenityMenuController.processOpeningHours((Amenity) originObject);
}
} }
@Override @Override
@ -65,7 +72,7 @@ public class FavouritePointMenuController extends MenuController {
} }
@Override @Override
public List<TransportStopController.TransportStopRoute> getTransportStopRoutes() { public List<TransportStopRoute> getTransportStopRoutes() {
return routes; return routes;
} }
@ -95,7 +102,7 @@ public class FavouritePointMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false); return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false);
} }
@ -106,7 +113,7 @@ public class FavouritePointMenuController extends MenuController {
@Override @Override
public Drawable getSecondLineTypeIcon() { public Drawable getSecondLineTypeIcon() {
return getIcon(R.drawable.ic_action_group_name_16); return getIcon(R.drawable.ic_action_group_name_16, isLight() ? R.color.icon_color : R.color.ctx_menu_bottom_view_icon_dark);
} }
@Override @Override
@ -132,7 +139,7 @@ public class FavouritePointMenuController extends MenuController {
@Override @Override
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) { public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
if (!Algorithms.isEmpty(fav.getDescription())) { if (!Algorithms.isEmpty(fav.getDescription())) {
addPlainMenuItem(R.drawable.ic_action_note_dark, fav.getDescription(), true, false, null); addPlainMenuItem(R.drawable.ic_action_note_dark, null, fav.getDescription(), true, false, null);
} }
Object originObject = getBuilder().getOriginObject(); Object originObject = getBuilder().getOriginObject();
if (originObject != null) { if (originObject != null) {
@ -146,11 +153,26 @@ public class FavouritePointMenuController extends MenuController {
} }
@Override @Override
public OpeningHoursInfo getOpeningHoursInfo() { public int getAdditionalInfoColor() {
Object originObject = getBuilder().getOriginObject(); if (openingHoursInfo != null) {
if (originObject instanceof Amenity) { return openingHoursInfo.isOpened() ? R.color.ctx_menu_amenity_opened_text_color : R.color.ctx_menu_amenity_closed_text_color;
return AmenityMenuController.processOpeningHours((Amenity) originObject);
} }
return null; return 0;
}
@Override
public String getAdditionalInfoStr() {
if (openingHoursInfo != null) {
return openingHoursInfo.getInfo(getMapActivity());
}
return "";
}
@Override
public int getAdditionalInfoIconRes() {
if (openingHoursInfo != null) {
return R.drawable.ic_action_opening_hour_16;
}
return 0;
} }
} }

View file

@ -45,7 +45,7 @@ public class GpxItemMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_polygom_dark, R.color.osmand_orange); return getIcon(R.drawable.ic_action_polygom_dark, R.color.osmand_orange);
} }
} }

View file

@ -52,7 +52,7 @@ public class HistoryMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return getIcon(SearchHistoryFragment.getItemIcon(entry.getName())); return getIcon(SearchHistoryFragment.getItemIcon(entry.getName()));
} }

View file

@ -53,7 +53,7 @@ public class ImpassibleRoadsMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return ContextCompat.getDrawable(getMapActivity(), R.drawable.map_pin_avoid_road); return ContextCompat.getDrawable(getMapActivity(), R.drawable.map_pin_avoid_road);
} }
} }

View file

@ -118,23 +118,6 @@ public class MapDataMenuController extends MenuController {
leftDownloadButtonController.leftIconId = R.drawable.ic_action_import; leftDownloadButtonController.leftIconId = R.drawable.ic_action_import;
rightDownloadButtonController = new TitleButtonController() { rightDownloadButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
if (indexItem != null) {
if (backuped) {
deleteItem(indexItem.getBackupFile(app));
} else {
deleteItem(indexItem.getTargetFile(app));
}
} else if (localIndexInfo != null) {
deleteItem(new File(localIndexInfo.getPathToData()));
}
}
};
rightDownloadButtonController.caption = getMapActivity().getString(R.string.shared_string_delete);
rightDownloadButtonController.leftIconId = R.drawable.ic_action_delete_dark;
bottomTitleButtonController = new TitleButtonController() {
@Override @Override
public void buttonPressed() { public void buttonPressed() {
getMapActivity().getContextMenu().close(); getMapActivity().getContextMenu().close();
@ -158,7 +141,25 @@ public class MapDataMenuController extends MenuController {
mapActivity.getContextMenu().getLatLon(), selectedObjects); mapActivity.getContextMenu().getLatLon(), selectedObjects);
} }
}; };
bottomTitleButtonController.caption = getMapActivity().getString(R.string.download_select_map_types); rightDownloadButtonController.caption = getMapActivity().getString(R.string.download_select_map_types);
rightDownloadButtonController.leftIconId = R.drawable.ic_plugin_srtm;
bottomTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
if (indexItem != null) {
if (backuped) {
deleteItem(indexItem.getBackupFile(app));
} else {
deleteItem(indexItem.getTargetFile(app));
}
} else if (localIndexInfo != null) {
deleteItem(new File(localIndexInfo.getPathToData()));
}
}
};
bottomTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete);
bottomTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark;
titleProgressController = new TitleProgressController() { titleProgressController = new TitleProgressController() {
@Override @Override
@ -178,6 +179,39 @@ public class MapDataMenuController extends MenuController {
updateData(); updateData();
} }
@Override
public boolean displayDistanceDirection() {
return true;
}
@Override
public int getAdditionalInfoColor() {
return R.color.icon_color;
}
@Override
public String getAdditionalInfoStr() {
double mb = 0;
if (backuped) {
if (localIndexInfo != null) {
mb = localIndexInfo.getSize();
} else if (indexItem != null) {
mb = indexItem.getArchiveSizeMB();
}
} else if (indexItem != null) {
mb = indexItem.getArchiveSizeMB();
}
if (mb != 0) {
return getMapActivity().getString(R.string.file_size_in_mb, mb);
}
return "";
}
@Override
public int getAdditionalInfoIconRes() {
return R.drawable.ic_sdcard_16;
}
@Override @Override
protected void setObject(Object object) { protected void setObject(Object object) {
if (object instanceof DownloadMapObject) { if (object instanceof DownloadMapObject) {
@ -197,7 +231,7 @@ public class MapDataMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
int iconResId; int iconResId;
if (getDownloadActivityType() != null) { if (getDownloadActivityType() != null) {
iconResId = getDownloadActivityType().getIconResource(); iconResId = getDownloadActivityType().getIconResource();
@ -219,6 +253,10 @@ public class MapDataMenuController extends MenuController {
} else { } else {
res = getMapActivity().getString(R.string.shared_string_map); res = getMapActivity().getString(R.string.shared_string_map);
} }
DownloadActivityType downloadActivityType = getDownloadActivityType();
if (downloadActivityType != null) {
res += ", " + downloadActivityType.getString(getMapActivity());
}
if (getMenuType() == MenuType.STANDARD) { if (getMenuType() == MenuType.STANDARD) {
res += "\n"; res += "\n";
} }
@ -233,16 +271,16 @@ public class MapDataMenuController extends MenuController {
@Override @Override
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) { public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
if (indexItem != null) { if (indexItem != null) {
addPlainMenuItem(R.drawable.ic_action_info_dark, indexItem.getType().getString(getMapActivity()), false, false, null); addPlainMenuItem(R.drawable.ic_action_info_dark, null, indexItem.getType().getString(getMapActivity()), false, false, null);
StringBuilder sizeStr = new StringBuilder(); StringBuilder sizeStr = new StringBuilder();
sizeStr.append(indexItem.getSizeDescription(getMapActivity())); sizeStr.append(indexItem.getSizeDescription(getMapActivity()));
if (backuped) { if (backuped) {
sizeStr.append("").append(LocalIndexType.DEACTIVATED.getHumanString(getMapActivity())); sizeStr.append("").append(LocalIndexType.DEACTIVATED.getHumanString(getMapActivity()));
} }
addPlainMenuItem(R.drawable.ic_action_info_dark, sizeStr.toString(), false, false, null); addPlainMenuItem(R.drawable.ic_action_info_dark, null, sizeStr.toString(), false, false, null);
} else if (localIndexInfo != null) { } else if (localIndexInfo != null) {
if (getDownloadActivityType() != null) { if (getDownloadActivityType() != null) {
addPlainMenuItem(R.drawable.ic_action_info_dark, getDownloadActivityType().getString(getMapActivity()), false, false, null); addPlainMenuItem(R.drawable.ic_action_info_dark, null, getDownloadActivityType().getString(getMapActivity()), false, false, null);
} }
StringBuilder sizeStr = new StringBuilder(); StringBuilder sizeStr = new StringBuilder();
if (localIndexInfo.getSize() >= 0) { if (localIndexInfo.getSize() >= 0) {
@ -259,7 +297,7 @@ public class MapDataMenuController extends MenuController {
sizeStr.append(LocalIndexType.DEACTIVATED.getHumanString(getMapActivity())); sizeStr.append(LocalIndexType.DEACTIVATED.getHumanString(getMapActivity()));
} }
} }
addPlainMenuItem(R.drawable.ic_action_info_dark, sizeStr.toString(), false, false, null); addPlainMenuItem(R.drawable.ic_action_info_dark, null, sizeStr.toString(), false, false, null);
} }
if (!Algorithms.isEmpty(mapObject.getWorldRegion().getParams().getWikiLink())) { if (!Algorithms.isEmpty(mapObject.getWorldRegion().getParams().getWikiLink())) {
String[] items = mapObject.getWorldRegion().getParams().getWikiLink().split(":"); String[] items = mapObject.getWorldRegion().getParams().getWikiLink().split(":");
@ -269,7 +307,7 @@ public class MapDataMenuController extends MenuController {
} else { } else {
url = "https://wikipedia.org/wiki/" + items[0].replace(' ', '_'); url = "https://wikipedia.org/wiki/" + items[0].replace(' ', '_');
} }
addPlainMenuItem(R.drawable.ic_world_globe_dark, url, false, true, null); addPlainMenuItem(R.drawable.ic_world_globe_dark, null, url, false, true, null);
} }
if (!Algorithms.isEmpty(mapObject.getWorldRegion().getParams().getPopulation())) { if (!Algorithms.isEmpty(mapObject.getWorldRegion().getParams().getPopulation())) {
String population = mapObject.getWorldRegion().getParams().getPopulation(); String population = mapObject.getWorldRegion().getParams().getPopulation();
@ -283,14 +321,14 @@ public class MapDataMenuController extends MenuController {
b.insert(0, population.charAt(i)); b.insert(0, population.charAt(i));
k++; k++;
} }
addPlainMenuItem(R.drawable.ic_action_info_dark, getMapActivity().getResources().getString(R.string.poi_population) addPlainMenuItem(R.drawable.ic_action_info_dark, null, getMapActivity().getResources().getString(R.string.poi_population)
+ ": " + b, false, false, null); + ": " + b, false, false, null);
} }
if (indexItem != null) { if (indexItem != null) {
DateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(getMapActivity()); DateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(getMapActivity());
addPlainMenuItem(R.drawable.ic_action_data, indexItem.getRemoteDate(dateFormat), false, false, null); addPlainMenuItem(R.drawable.ic_action_data, null, indexItem.getRemoteDate(dateFormat), false, false, null);
} else if (localIndexInfo != null) { } else if (localIndexInfo != null) {
addPlainMenuItem(R.drawable.ic_action_data, localIndexInfo.getDescription(), false, false, null); addPlainMenuItem(R.drawable.ic_action_data, null, localIndexInfo.getDescription(), false, false, null);
} }
} }
@ -349,8 +387,8 @@ public class MapDataMenuController extends MenuController {
leftDownloadButtonController.visible = false; leftDownloadButtonController.visible = false;
} }
rightDownloadButtonController.visible = downloaded; bottomTitleButtonController.visible = downloaded;
bottomTitleButtonController.visible = (otherIndexItems != null && otherIndexItems.size() > 0) rightDownloadButtonController.visible = (otherIndexItems != null && otherIndexItems.size() > 0)
|| (otherLocalIndexInfos != null && otherLocalIndexInfos.size() > 0); || (otherLocalIndexInfos != null && otherLocalIndexInfos.size() > 0);
boolean internetConnectionAvailable = boolean internetConnectionAvailable =

View file

@ -89,7 +89,7 @@ public class MapMarkerMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return MapMarkerDialogHelper.getMapMarkerIcon(getMapActivity().getMyApplication(), mapMarker.colorIndex); return MapMarkerDialogHelper.getMapMarkerIcon(getMapActivity().getMyApplication(), mapMarker.colorIndex);
} }

View file

@ -42,7 +42,7 @@ public class MyLocationMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode(); ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode();
return getMapActivity().getResources().getDrawable(appMode.getResourceLocationDay()); return getMapActivity().getResources().getDrawable(appMode.getResourceLocationDay());
} }

View file

@ -46,7 +46,7 @@ public class PointDescriptionMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return getIcon(SearchHistoryFragment.getItemIcon(getPointDescription())); return getIcon(SearchHistoryFragment.getItemIcon(getPointDescription()));
} }

View file

@ -49,7 +49,7 @@ public class RenderedObjectMenuController extends MenuController {
} }
@Override @Override
public int getLeftIconId() { public int getRightIconId() {
if (renderedObject.getIconRes() != null && RenderingIcons.containsBigIcon(renderedObject.getIconRes())) { if (renderedObject.getIconRes() != null && RenderingIcons.containsBigIcon(renderedObject.getIconRes())) {
return RenderingIcons.getBigIconResourceId(renderedObject.getIconRes()); return RenderingIcons.getBigIconResourceId(renderedObject.getIconRes());
} else { } else {
@ -95,7 +95,7 @@ public class RenderedObjectMenuController extends MenuController {
if (entry.getKey().equalsIgnoreCase("maxheight")) { if (entry.getKey().equalsIgnoreCase("maxheight")) {
AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(entry.getKey()); AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(entry.getKey());
if (pt != null) { if (pt != null) {
addPlainMenuItem(R.drawable.ic_action_note_dark, pt.getTranslation() + ": " + entry.getValue(), false, false, null); addPlainMenuItem(R.drawable.ic_action_note_dark, null, pt.getTranslation() + ": " + entry.getValue(), false, false, null);
} }
} }
} }
@ -110,7 +110,7 @@ public class RenderedObjectMenuController extends MenuController {
} else { } else {
link = "https://www.openstreetmap.org/way/"; link = "https://www.openstreetmap.org/way/";
} }
addPlainMenuItem(R.drawable.ic_action_info_dark, link + (renderedObject.getId() >> 7), true, true, null); addPlainMenuItem(R.drawable.ic_action_info_dark, null, link + (renderedObject.getId() >> 7), true, true, null);
} }
addMyLocationToPlainItems(latLon); addMyLocationToPlainItems(latLon);
} }

View file

@ -79,7 +79,7 @@ public class TargetPointMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
if (targetPoint.start) { if (targetPoint.start) {
return getIconOrig(R.drawable.list_startpoint); return getIconOrig(R.drawable.list_startpoint);
} else if (!targetPoint.intermediate) { } else if (!targetPoint.intermediate) {

View file

@ -1,5 +1,6 @@
package net.osmand.plus.mapcontextmenu.controllers; package net.osmand.plus.mapcontextmenu.controllers;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
@ -12,7 +13,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MapContextMenu; import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController.TransportStopRoute; import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.views.TransportStopsLayer; import net.osmand.plus.views.TransportStopsLayer;
import java.util.List; import java.util.List;
@ -46,6 +47,30 @@ public class TransportRouteController extends MenuController {
mapActivity.getContextMenu().closeToolbar(TransportRouteController.this); mapActivity.getContextMenu().closeToolbar(TransportRouteController.this);
} }
}); });
leftTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
final int previousStop = getPreviousStop();
if (previousStop != -1) {
showTransportStop(transportRoute.route.getForwardStops().get(previousStop));
}
}
};
leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_previous);
leftTitleButtonController.leftIconId = R.drawable.ic_arrow_back;
rightTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
final int nextStop = getNextStop();
if (nextStop != -1) {
showTransportStop(transportRoute.route.getForwardStops().get(nextStop));
}
}
};
rightTitleButtonController.caption = mapActivity.getString(R.string.shared_string_next);
rightTitleButtonController.rightIconId = R.drawable.ic_arrow_forward;
} }
@Override @Override
@ -55,13 +80,18 @@ public class TransportRouteController extends MenuController {
} }
} }
@Override
public boolean navigateInPedestrianMode() {
return true;
}
@Override @Override
protected Object getObject() { protected Object getObject() {
return transportRoute; return transportRoute;
} }
@Override @Override
public int getLeftIconId() { public int getRightIconId() {
return this.transportRoute.type == null ? return this.transportRoute.type == null ?
R.drawable.mx_public_transport : R.drawable.mx_public_transport :
this.transportRoute.type.getTopResourceId(); this.transportRoute.type.getTopResourceId();
@ -77,11 +107,6 @@ public class TransportRouteController extends MenuController {
return false; return false;
} }
@Override
public boolean navigateButtonVisible() {
return false;
}
@Override @Override
public boolean isClosable() { public boolean isClosable() {
return false; return false;
@ -94,13 +119,17 @@ public class TransportRouteController extends MenuController {
@Override @Override
public String getTypeStr() { public String getTypeStr() {
if (transportRoute.refStop != null) { return getPointDescription().getName();
return transportRoute.refStop.getName(); }
} else if (transportRoute.stop != null) {
return transportRoute.stop.getName(); private String getStopType() {
} else { return getMapActivity().getString(transportRoute.getTypeStrRes()) + " " + getMapActivity().getString(R.string.transport_Stop).toLowerCase();
return getPointDescription().getTypeName(); }
}
@Override
public void updateData() {
super.updateData();
updateControllers();
} }
@Override @Override
@ -121,25 +150,98 @@ public class TransportRouteController extends MenuController {
} }
} }
private void updateControllers() {
boolean previousStopEnabled = false;
final int previousStop = getPreviousStop();
if (previousStop != -1) {
previousStopEnabled = true;
}
leftTitleButtonController.enabled = previousStopEnabled;
boolean nextStopEnabled = false;
final int nextStop = getNextStop();
if (nextStop != -1) {
nextStopEnabled = true;
}
rightTitleButtonController.enabled = nextStopEnabled;
}
private void showTransportStop(TransportStop stop) {
if (mapContextMenu != null) {
transportRoute.stop = stop;
transportRoute.refStop = stop;
PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_TRANSPORT_ROUTE,
transportRoute.getDescription(getMapActivity().getMyApplication(), false));
updateControllers();
LatLon stopLocation = stop.getLocation();
if (mapContextMenu.isVisible()) {
mapContextMenu.updateMapCenter(stopLocation);
} else {
mapContextMenu.setMapCenter(stopLocation);
mapContextMenu.setMapPosition(getMapActivity().getMapView().getMapPosition());
}
mapContextMenu.setCenterMarker(true);
mapContextMenu.setMapZoom(15);
mapContextMenu.showOrUpdate(stopLocation, pd, transportRoute);
}
}
private int getCurrentStop() {
List<TransportStop> stops = transportRoute.route.getForwardStops();
for (int i = 0; i < stops.size(); i++) {
final TransportStop stop = stops.get(i);
if (stop.getName().equals(transportRoute.stop.getName())) {
return i;
}
}
return -1;
}
private int getNextStop() {
List<TransportStop> stops = transportRoute.route.getForwardStops();
int currentPos = getCurrentStop();
if (currentPos != -1 && currentPos + 1 < stops.size()) {
return currentPos + 1;
}
return -1;
}
private int getPreviousStop() {
int currentPos = getCurrentStop();
if (currentPos > 0) {
return currentPos - 1;
}
return -1;
}
@Override
public String getNameStr() {
if (transportRoute.refStop != null && !TextUtils.isEmpty(transportRoute.refStop.getName())) {
return transportRoute.refStop.getName();
} else if (transportRoute.stop != null && !TextUtils.isEmpty(transportRoute.stop.getName())) {
return transportRoute.stop.getName();
} else if (!TextUtils.isEmpty(getPointDescription().getTypeName())) {
return getPointDescription().getTypeName();
} else {
return getStopType();
}
}
@Override @Override
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, final LatLon latLon) { public void addPlainMenuItems(String typeStr, PointDescription pointDescription, final LatLon latLon) {
super.addPlainMenuItems(typeStr, pointDescription, latLon); super.addPlainMenuItems(typeStr, pointDescription, latLon);
List<TransportStop> stops = transportRoute.route.getForwardStops(); List<TransportStop> stops = transportRoute.route.getForwardStops();
boolean useEnglishNames = getMapActivity().getMyApplication().getSettings().usingEnglishNames(); boolean useEnglishNames = getMapActivity().getMyApplication().getSettings().usingEnglishNames();
int currentStop = -1; int currentStop = getCurrentStop();
for (int i = 0; i < stops.size(); i++) {
final TransportStop stop = stops.get(i);
if (stop.getName().equals(transportRoute.stop.getName())) {
currentStop = i;
break;
}
}
int defaultIcon = transportRoute.type == null ? R.drawable.mx_route_bus_ref : transportRoute.type.getResourceId(); int defaultIcon = transportRoute.type == null ? R.drawable.mx_route_bus_ref : transportRoute.type.getResourceId();
int startPosition = 0; int startPosition = 0;
if (!transportRoute.showWholeRoute) { if (!transportRoute.showWholeRoute) {
startPosition = (currentStop == -1 ? 0 : currentStop); startPosition = (currentStop == -1 ? 0 : currentStop);
if (currentStop > 0) { if (currentStop > 0) {
addPlainMenuItem(defaultIcon, getMapActivity().getString(R.string.route_stops_before, currentStop), addPlainMenuItem(defaultIcon, getMapActivity().getString(R.string.shared_string_show),
getMapActivity().getString(R.string.route_stops_before, currentStop),
false, false, new OnClickListener() { false, false, new OnClickListener() {
@Override @Override
@ -152,29 +254,16 @@ public class TransportRouteController extends MenuController {
} }
for (int i = startPosition; i < stops.size(); i++) { for (int i = startPosition; i < stops.size(); i++) {
final TransportStop stop = stops.get(i); final TransportStop stop = stops.get(i);
final String name = useEnglishNames ? stop.getEnName(true) : stop.getName(); String name = useEnglishNames ? stop.getEnName(true) : stop.getName();
if (TextUtils.isEmpty(name)) {
name = getStopType();
}
addPlainMenuItem(currentStop == i ? R.drawable.ic_action_marker_dark : defaultIcon, addPlainMenuItem(currentStop == i ? R.drawable.ic_action_marker_dark : defaultIcon,
name, false, false, new OnClickListener() { null, name, false, false, new OnClickListener() {
@Override @Override
public void onClick(View arg0) { public void onClick(View arg0) {
if (mapContextMenu != null) { showTransportStop(stop);
transportRoute.stop = stop;
transportRoute.refStop = stop;
PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_TRANSPORT_ROUTE,
transportRoute.getDescription(getMapActivity().getMyApplication(), false));
LatLon stopLocation = stop.getLocation();
if (mapContextMenu.isVisible()) {
mapContextMenu.updateMapCenter(stopLocation);
} else {
mapContextMenu.setMapCenter(stopLocation);
mapContextMenu.setMapPosition(getMapActivity().getMapView().getMapPosition());
}
mapContextMenu.setCenterMarker(true);
mapContextMenu.setMapZoom(15);
mapContextMenu.showOrUpdate(stopLocation, pd, transportRoute);
}
/* /*
PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_TRANSPORT_STOP, PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_TRANSPORT_STOP,
getMapActivity().getString(R.string.transport_Stop), name); getMapActivity().getString(R.string.transport_Stop), name);
@ -202,7 +291,7 @@ public class TransportRouteController extends MenuController {
TransportStopsLayer stopsLayer = getMapActivity().getMapLayers().getTransportStopsLayer(); TransportStopsLayer stopsLayer = getMapActivity().getMapLayers().getTransportStopsLayer();
int cz = transportRoute.calculateZoom(0, getMapActivity().getMapView().getCurrentRotatedTileBox()); int cz = transportRoute.calculateZoom(0, getMapActivity().getMapView().getCurrentRotatedTileBox());
getMapActivity().changeZoom(cz - getMapActivity().getMapView().getZoom()); getMapActivity().changeZoom(cz - getMapActivity().getMapView().getZoom());
stopsLayer.setRoute(transportRoute.route); stopsLayer.setRoute(transportRoute);
} }
private void resetRoute() { private void resetRoute() {

View file

@ -6,17 +6,16 @@ import android.view.View.OnClickListener;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.data.QuadRect; import net.osmand.data.QuadRect;
import net.osmand.data.RotatedTileBox;
import net.osmand.data.TransportRoute; import net.osmand.data.TransportRoute;
import net.osmand.data.TransportStop; import net.osmand.data.TransportStop;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MapContextMenu; import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.mapcontextmenu.MenuBuilder; import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.resources.TransportIndexRepository; import net.osmand.plus.resources.TransportIndexRepository;
import net.osmand.plus.transport.TransportStopType;
import net.osmand.plus.views.TransportStopsLayer; import net.osmand.plus.views.TransportStopsLayer;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
@ -29,51 +28,6 @@ import java.util.List;
public class TransportStopController extends MenuController { public class TransportStopController extends MenuController {
public enum TransportStopType {
BUS(R.drawable.mx_route_bus_ref, R.drawable.mx_route_bus_ref),
FERRY(R.drawable.mx_route_ferry_ref, R.drawable.mx_route_ferry_ref),
FUNICULAR(R.drawable.mx_route_funicular_ref, R.drawable.mx_route_funicular_ref),
LIGHT_RAIL(R.drawable.mx_route_light_rail_ref, R.drawable.mx_route_light_rail_ref),
MONORAIL(R.drawable.mx_route_monorail_ref, R.drawable.mx_route_monorail_ref),
RAILWAY(R.drawable.mx_route_railway_ref, R.drawable.mx_route_railway_ref),
SHARE_TAXI(R.drawable.mx_route_share_taxi_ref, R.drawable.mx_route_share_taxi_ref),
TRAIN(R.drawable.mx_route_train_ref, R.drawable.mx_route_train_ref),
TRAM(R.drawable.mx_route_tram_ref, R.drawable.mx_railway_tram_stop),
TROLLEYBUS(R.drawable.mx_route_trolleybus_ref, R.drawable.mx_route_trolleybus_ref),
SUBWAY(R.drawable.mx_subway_station, R.drawable.mx_subway_station);
final int resId;
final int topResId;
TransportStopType(int resId, int topResId) {
this.resId = resId;
this.topResId = topResId;
}
public int getResourceId() {
return resId;
}
public int getTopResourceId() {
return topResId;
}
public boolean isTopType() {
return this == TRAM || this == SUBWAY;
}
public static TransportStopType findType(String typeName) {
String tName = typeName.toUpperCase();
for (TransportStopType t : values()) {
if (t.name().equals(tName)) {
return t;
}
}
return null;
}
}
private TransportStop transportStop; private TransportStop transportStop;
private List<TransportStopRoute> routes = new ArrayList<>(); private List<TransportStopRoute> routes = new ArrayList<>();
private TransportStopType topType; private TransportStopType topType;
@ -82,26 +36,29 @@ public class TransportStopController extends MenuController {
PointDescription pointDescription, TransportStop transportStop) { PointDescription pointDescription, TransportStop transportStop) {
super(new MenuBuilder(mapActivity), pointDescription, mapActivity); super(new MenuBuilder(mapActivity), pointDescription, mapActivity);
this.transportStop = transportStop; this.transportStop = transportStop;
routes = processTransportStop(); processRoutes();
builder.setRoutes(routes);
} }
@Override @Override
protected void setObject(Object object) { protected void setObject(Object object) {
if (object instanceof TransportStop) { if (object instanceof TransportStop) {
this.transportStop = (TransportStop) object; this.transportStop = (TransportStop) object;
routes = processTransportStop(); processRoutes();
builder.setRoutes(routes);
} }
} }
private void processRoutes() {
routes = processTransportStop();
builder.setRoutes(routes);
}
@Override @Override
protected Object getObject() { protected Object getObject() {
return transportStop; return transportStop;
} }
@Override @Override
public int getLeftIconId() { public int getRightIconId() {
if (topType == null) { if (topType == null) {
return R.drawable.mx_public_transport; return R.drawable.mx_public_transport;
} else { } else {
@ -204,42 +161,4 @@ public class TransportStopController extends MenuController {
return false; return false;
} }
public static class TransportStopRoute {
public TransportStop refStop;
public TransportStopType type;
public String desc;
public TransportRoute route;
public TransportStop stop;
public int distance;
public boolean showWholeRoute;
public String getDescription(OsmandApplication ctx, boolean useDistance) {
if (useDistance && distance > 0) {
String nm = OsmAndFormatter.getFormattedDistance(distance, ctx);
if (refStop != null && !refStop.getName().equals(stop.getName())) {
nm = refStop.getName() + ", " + nm;
}
return desc + " (" + nm + ")";
}
return desc;
}
public int calculateZoom(int startPosition, RotatedTileBox currentRotatedTileBox) {
RotatedTileBox cp = currentRotatedTileBox.copy();
boolean notContains = true;
while (cp.getZoom() > 12 && notContains) {
notContains = false;
List<TransportStop> sts = route.getForwardStops();
for(int i = startPosition; i < sts.size(); i++) {
TransportStop st = sts.get(startPosition);
if (!cp.containsLatLon(st.getLocation())) {
notContains = true;
break;
}
}
cp.setZoom(cp.getZoom() - 1);
}
return cp.getZoom();
}
}
} }

View file

@ -76,17 +76,17 @@ public class WptPtMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(),
wpt.getColor(ContextCompat.getColor(getMapActivity(), R.color.gpx_color_point)), false); wpt.getColor(ContextCompat.getColor(getMapActivity(), R.color.gpx_color_point)), false);
} }
@Override @Override
public Drawable getAdditionalLineTypeIcon() { public Drawable getSubtypeIcon() {
if (Algorithms.isEmpty(getAdditionalTypeStr())) { if (Algorithms.isEmpty(getSubtypeStr())) {
return null; return null;
} else { } else {
return getIcon(R.drawable.ic_action_group_name_16); return getIcon(R.drawable.ic_action_group_name_16, isLight() ? R.color.icon_color : R.color.ctx_menu_bottom_view_icon_dark);
} }
} }
@ -111,7 +111,7 @@ public class WptPtMenuController extends MenuController {
} }
@Override @Override
public String getAdditionalTypeStr() { public String getSubtypeStr() {
return wpt.category != null ? wpt.category : ""; return wpt.category != null ? wpt.category : "";
} }

View file

@ -4,6 +4,7 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -38,10 +39,10 @@ public class MapMultiSelectionMenuFragment extends Fragment implements MultiSele
view = inflater.inflate(R.layout.menu_obj_selection_fragment, container, false); view = inflater.inflate(R.layout.menu_obj_selection_fragment, container, false);
if (menu.isLandscapeLayout()) { if (menu.isLandscapeLayout()) {
AndroidUtils.setBackground(view.getContext(), view, !menu.isLight(), AndroidUtils.setBackground(view.getContext(), view, !menu.isLight(),
R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark); R.drawable.multi_selection_menu_bg_light_land, R.drawable.multi_selection_menu_bg_dark_land);
} else { } else {
AndroidUtils.setBackground(view.getContext(), view, !menu.isLight(), AndroidUtils.setBackground(view.getContext(), view, !menu.isLight(),
R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); R.drawable.multi_selection_menu_bg_light, R.drawable.multi_selection_menu_bg_dark);
} }
ListView listView = (ListView) view.findViewById(R.id.list); ListView listView = (ListView) view.findViewById(R.id.list);
@ -49,11 +50,6 @@ public class MapMultiSelectionMenuFragment extends Fragment implements MultiSele
AndroidUtils.addStatusBarPadding21v(getActivity(), listView); AndroidUtils.addStatusBarPadding21v(getActivity(), listView);
} }
View headerView = inflater.inflate(R.layout.menu_obj_selection_header, listView, false); View headerView = inflater.inflate(R.layout.menu_obj_selection_header, listView, false);
if (!menu.isLight()) {
((TextViewEx) headerView.findViewById(R.id.header_title)).setTextColor(getResources().getColor(R.color.ctx_menu_info_text_dark));
((TextView) view.findViewById(R.id.cancel_row_text)).setTextColor(getResources().getColor(R.color.color_dialog_buttons_dark));
view.findViewById(R.id.divider).setBackgroundResource(R.color.dashboard_divider_dark);
}
headerView.setOnClickListener(null); headerView.setOnClickListener(null);
listView.addHeaderView(headerView); listView.addHeaderView(headerView);
listAdapter = createAdapter(); listAdapter = createAdapter();
@ -62,6 +58,9 @@ public class MapMultiSelectionMenuFragment extends Fragment implements MultiSele
runLayoutListener(); runLayoutListener();
view.findViewById(R.id.divider).setBackgroundColor(ContextCompat.getColor(getContext(), menu.isLight() ? R.color.multi_selection_menu_divider_light : R.color.multi_selection_menu_divider_dark));
((TextView) view.findViewById(R.id.cancel_row_text)).setTextColor(ContextCompat.getColor(getContext(), menu.isLight() ? R.color.multi_selection_menu_close_btn_light : R.color.multi_selection_menu_close_btn_dark));
view.findViewById(R.id.cancel_row).setOnClickListener(new View.OnClickListener() { view.findViewById(R.id.cancel_row).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {

View file

@ -259,24 +259,16 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
private void updateViaView(final View parentView) { private void updateViaView(final View parentView) {
String via = generateViaDescription(); String via = generateViaDescription();
View viaLayout = parentView.findViewById(R.id.ViaLayout); View viaLayout = parentView.findViewById(R.id.ViaLayout);
View fromLayoutEmptyView = parentView.findViewById(R.id.from_layout_empty_view); View viaLayoutDivider = parentView.findViewById(R.id.viaLayoutDivider);
View toLayoutEmptyView = parentView.findViewById(R.id.to_layout_empty_view);
View dividerFromDropDownEmpty = parentView.findViewById(R.id.divider_from_drop_down_empty);
ImageView swapDirectionView = (ImageView) parentView.findViewById(R.id.swap_direction_image_view); ImageView swapDirectionView = (ImageView) parentView.findViewById(R.id.swap_direction_image_view);
if (via.length() == 0) { if (via.length() == 0) {
viaLayout.setVisibility(View.GONE); viaLayout.setVisibility(View.GONE);
parentView.findViewById(R.id.viaLayoutDivider).setVisibility(View.GONE); viaLayoutDivider.setVisibility(View.GONE);
dividerFromDropDownEmpty.setVisibility(View.GONE);
fromLayoutEmptyView.setVisibility(View.VISIBLE);
toLayoutEmptyView.setVisibility(View.VISIBLE);
swapDirectionView.setVisibility(View.VISIBLE); swapDirectionView.setVisibility(View.VISIBLE);
} else { } else {
fromLayoutEmptyView.setVisibility(View.GONE);
toLayoutEmptyView.setVisibility(View.GONE);
swapDirectionView.setVisibility(View.GONE); swapDirectionView.setVisibility(View.GONE);
dividerFromDropDownEmpty.setVisibility(View.VISIBLE);
viaLayout.setVisibility(View.VISIBLE); viaLayout.setVisibility(View.VISIBLE);
parentView.findViewById(R.id.viaLayoutDivider).setVisibility(View.VISIBLE); viaLayoutDivider.setVisibility(View.VISIBLE);
((TextView) parentView.findViewById(R.id.ViaView)).setText(via); ((TextView) parentView.findViewById(R.id.ViaView)).setText(via);
} }
@ -294,7 +286,6 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
swapDirectionView.setImageDrawable(mapActivity.getMyApplication().getIconsCache().getIcon(R.drawable.ic_action_change_navigation_points, swapDirectionView.setImageDrawable(mapActivity.getMyApplication().getIconsCache().getIcon(R.drawable.ic_action_change_navigation_points,
isLight() ? R.color.route_info_control_icon_color_light : R.color.route_info_control_icon_color_dark)); isLight() ? R.color.route_info_control_icon_color_light : R.color.route_info_control_icon_color_dark));
AndroidUtils.setBackground(mapActivity, swapDirectionView, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
swapDirectionView.setOnClickListener(new View.OnClickListener() { swapDirectionView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -638,7 +629,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
} else { } else {
infoIcon.setImageDrawable(ctx.getIconsCache().getIcon(R.drawable.ic_action_route_distance, R.color.route_info_unchecked_mode_icon_color)); infoIcon.setImageDrawable(ctx.getIconsCache().getIcon(R.drawable.ic_action_route_distance, R.color.route_info_unchecked_mode_icon_color));
infoIcon.setVisibility(View.VISIBLE); infoIcon.setVisibility(View.VISIBLE);
durationIcon.setImageDrawable(ctx.getIconsCache().getIcon(R.drawable.ic_action_time, R.color.route_info_unchecked_mode_icon_color)); durationIcon.setImageDrawable(ctx.getIconsCache().getIcon(R.drawable.ic_action_time_span, R.color.route_info_unchecked_mode_icon_color));
durationIcon.setVisibility(View.VISIBLE); durationIcon.setVisibility(View.VISIBLE);
infoDistanceView.setVisibility(View.VISIBLE); infoDistanceView.setVisibility(View.VISIBLE);
infoDurationView.setVisibility(View.VISIBLE); infoDurationView.setVisibility(View.VISIBLE);

View file

@ -150,8 +150,6 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
R.color.route_info_divider_light, R.color.route_info_divider_dark); R.color.route_info_divider_light, R.color.route_info_divider_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerFromDropDown), nightMode, AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerFromDropDown), nightMode,
R.color.route_info_divider_light, R.color.route_info_divider_dark); R.color.route_info_divider_light, R.color.route_info_divider_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.divider_from_drop_down_empty), nightMode,
R.color.route_info_divider_light, R.color.route_info_divider_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.viaLayoutDivider), nightMode, AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.viaLayoutDivider), nightMode,
R.color.route_info_divider_light, R.color.route_info_divider_dark); R.color.route_info_divider_light, R.color.route_info_divider_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerToDropDown), nightMode, AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerToDropDown), nightMode,
@ -170,14 +168,6 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.fromTitle), nightMode); AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.fromTitle), nightMode);
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.InfoTextView), nightMode); AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.InfoTextView), nightMode);
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.FromLayout), nightMode);
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.ViaLayout), nightMode);
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.ToLayout), nightMode);
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.Info), nightMode);
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.Next), nightMode);
AndroidUtils.setDashButtonBackground(ctx, mainView.findViewById(R.id.Prev), nightMode);
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.DistanceText), nightMode); AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.DistanceText), nightMode);
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.DistanceTitle), nightMode); AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.DistanceTitle), nightMode);
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.DurationText), nightMode); AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.DurationText), nightMode);

View file

@ -38,8 +38,6 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter<MapMultiSelectionMe
} }
final MapMultiSelectionMenu.MenuObject item = getItem(position); final MapMultiSelectionMenu.MenuObject item = getItem(position);
if (item != null) { if (item != null) {
convertView.findViewById(R.id.content).setBackgroundResource(menu.isLight()
? R.drawable.expandable_list_item_background_light : R.drawable.expandable_list_item_background_dark);
convertView.setOnClickListener(new View.OnClickListener() { convertView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -51,8 +49,8 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter<MapMultiSelectionMe
IconsCache iconsCache = menu.getMapActivity().getMyApplication().getIconsCache(); IconsCache iconsCache = menu.getMapActivity().getMyApplication().getIconsCache();
final View iconLayout = convertView.findViewById(R.id.context_menu_icon_layout); final View iconLayout = convertView.findViewById(R.id.context_menu_icon_layout);
final ImageView iconView = (ImageView) convertView.findViewById(R.id.context_menu_icon_view); final ImageView iconView = (ImageView) convertView.findViewById(R.id.context_menu_icon_view);
Drawable icon = item.getLeftIcon(); Drawable icon = item.getRightIcon();
int iconId = item.getLeftIconId(); int iconId = item.getRightIconId();
if (icon != null) { if (icon != null) {
iconView.setImageDrawable(icon); iconView.setImageDrawable(icon);
iconLayout.setVisibility(View.VISIBLE); iconLayout.setVisibility(View.VISIBLE);
@ -66,7 +64,7 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter<MapMultiSelectionMe
// Text line 1 // Text line 1
TextView line1 = (TextView) convertView.findViewById(R.id.context_menu_line1); TextView line1 = (TextView) convertView.findViewById(R.id.context_menu_line1);
((TextView) convertView.findViewById(R.id.context_menu_line1)).setTextColor(ContextCompat.getColor(getContext(), line1.setTextColor(ContextCompat.getColor(getContext(),
!menu.isLight() ? R.color.ctx_menu_title_color_dark : R.color.ctx_menu_title_color_light)); !menu.isLight() ? R.color.ctx_menu_title_color_dark : R.color.ctx_menu_title_color_light));
line1.setText(item.getTitleStr()); line1.setText(item.getTitleStr());
@ -80,9 +78,7 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter<MapMultiSelectionMe
// Divider // Divider
View divider = convertView.findViewById(R.id.divider); View divider = convertView.findViewById(R.id.divider);
if (!menu.isLight()) { divider.setBackgroundColor(ContextCompat.getColor(getContext(), menu.isLight() ? R.color.multi_selection_menu_divider_light : R.color.multi_selection_menu_divider_dark));
divider.setBackgroundResource(R.color.dashboard_divider_dark);
}
divider.setVisibility(position != getCount() - 1 ? View.VISIBLE : View.GONE); divider.setVisibility(position != getCount() - 1 ? View.VISIBLE : View.GONE);
} }

View file

@ -56,7 +56,7 @@ public class MapillaryMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_mapillary, R.color.mapillary_color); return getIcon(R.drawable.ic_action_mapillary, R.color.mapillary_color);
} }

View file

@ -754,26 +754,12 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
private class KeyboardAdapter extends ArrayAdapter<Object> { private class KeyboardAdapter extends ArrayAdapter<Object> {
private ColorStateList dividerControlColorStateList = new ColorStateList( private ColorStateList dividerControlColorStateList = AndroidUtils.createColorStateList(getContext(), false,
new int[][]{ R.color.keyboard_item_divider_control_color_light, R.color.keyboard_item_divider_control_color_light_pressed,
new int[]{android.R.attr.state_pressed}, 0, 0);
new int[]{} private ColorStateList numberColorStateList = AndroidUtils.createColorStateList(getContext(), false,
}, R.color.keyboard_item_text_color_light, R.color.keyboard_item_text_color_light_pressed,
new int[] { 0, 0);
getResources().getColor(R.color.keyboard_item_divider_control_color_light_pressed),
getResources().getColor(R.color.keyboard_item_divider_control_color_light)
}
);
private ColorStateList numberColorStateList = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_pressed},
new int[]{}
},
new int[] {
getResources().getColor(R.color.keyboard_item_text_color_light_pressed),
getResources().getColor(R.color.keyboard_item_text_color_light)
}
);
KeyboardAdapter(@NonNull Context context, @NonNull Object[] objects) { KeyboardAdapter(@NonNull Context context, @NonNull Object[] objects) {
super(context, 0, objects); super(context, 0, objects);

View file

@ -30,8 +30,8 @@ public class EditPOIMenuBuilder extends MenuBuilder {
if (osmPoint instanceof OsmNotesPoint) { if (osmPoint instanceof OsmNotesPoint) {
OsmNotesPoint notes = (OsmNotesPoint) osmPoint; OsmNotesPoint notes = (OsmNotesPoint) osmPoint;
buildRow(view, R.drawable.ic_action_note_dark, notes.getText(), 0, false, null, false, 0, false, null, false); buildRow(view, R.drawable.ic_action_note_dark, null, notes.getText(), 0, false, null, false, 0, false, null, false);
buildRow(view, R.drawable.ic_group, notes.getAuthor(), 0, false, null, false, 0, false, null, false); buildRow(view, R.drawable.ic_group, null, notes.getAuthor(), 0, false, null, false, 0, false, null, false);
} else if (osmPoint instanceof OpenstreetmapPoint) { } else if (osmPoint instanceof OpenstreetmapPoint) {
OpenstreetmapPoint point = (OpenstreetmapPoint) osmPoint; OpenstreetmapPoint point = (OpenstreetmapPoint) osmPoint;
@ -56,7 +56,7 @@ public class EditPOIMenuBuilder extends MenuBuilder {
if (resId == 0) { if (resId == 0) {
resId = R.drawable.ic_action_folder_stroke; resId = R.drawable.ic_action_folder_stroke;
} }
buildRow(view, resId, poiTranslation, 0, false, null, false, 0, false, null, false); buildRow(view, resId, null, poiTranslation, 0, false, null, false, 0, false, null, false);
break; break;
} }
} }
@ -67,11 +67,11 @@ public class EditPOIMenuBuilder extends MenuBuilder {
continue; continue;
} }
String text = e.getKey() + "=" + e.getValue(); String text = e.getKey() + "=" + e.getValue();
buildRow(view, R.drawable.ic_action_info_dark, text, 0, false, null, false, 0, false, null, false); buildRow(view, R.drawable.ic_action_info_dark, null, text, 0, false, null, false, 0, false, null, false);
} }
} }
buildRow(view, R.drawable.ic_action_get_my_location, PointDescription.getLocationName(app, buildRow(view, R.drawable.ic_action_get_my_location, null, PointDescription.getLocationName(app,
osmPoint.getLatitude(), osmPoint.getLongitude(), true) osmPoint.getLatitude(), osmPoint.getLongitude(), true)
.replaceAll("\n", " "), 0, false, null, false, 0, false, null, false); .replaceAll("\n", " "), 0, false, null, false, 0, false, null, false);
} }

View file

@ -5,19 +5,24 @@ import android.graphics.drawable.Drawable;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.osm.PoiType;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.osmedit.OsmPoint.Action; import net.osmand.plus.osmedit.OsmPoint.Action;
import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment; import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import java.util.Map;
public class EditPOIMenuController extends MenuController { public class EditPOIMenuController extends MenuController {
private OsmPoint osmPoint; private OsmPoint osmPoint;
private OsmEditingPlugin plugin; private OsmEditingPlugin plugin;
private String pointTypeStr; private String category;
private String actionStr;
public EditPOIMenuController(final MapActivity mapActivity, PointDescription pointDescription, OsmPoint osmPoint) { public EditPOIMenuController(final MapActivity mapActivity, PointDescription pointDescription, OsmPoint osmPoint) {
super(new EditPOIMenuBuilder(mapActivity, osmPoint), pointDescription, mapActivity); super(new EditPOIMenuBuilder(mapActivity, osmPoint), pointDescription, mapActivity);
@ -70,30 +75,36 @@ public class EditPOIMenuController extends MenuController {
rightTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); rightTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete);
rightTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; rightTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark;
category = getCategory();
if (osmPoint.getGroup() == OsmPoint.Group.POI) { if (osmPoint.getGroup() == OsmPoint.Group.POI) {
if(osmPoint.getAction() == Action.DELETE) { if(osmPoint.getAction() == Action.DELETE) {
pointTypeStr = getMapActivity().getString(R.string.osm_edit_deleted_poi); actionStr = getMapActivity().getString(R.string.osm_edit_deleted_poi);
} else if(osmPoint.getAction() == Action.MODIFY) { } else if(osmPoint.getAction() == Action.MODIFY) {
pointTypeStr = getMapActivity().getString(R.string.osm_edit_modified_poi); actionStr = getMapActivity().getString(R.string.osm_edit_modified_poi);
} else/* if(osmPoint.getAction() == Action.CREATE) */{ } else/* if(osmPoint.getAction() == Action.CREATE) */{
pointTypeStr = getMapActivity().getString(R.string.osm_edit_created_poi); actionStr = getMapActivity().getString(R.string.osm_edit_created_poi);
} }
} else if (osmPoint.getGroup() == OsmPoint.Group.BUG) { } else if (osmPoint.getGroup() == OsmPoint.Group.BUG) {
if(osmPoint.getAction() == Action.DELETE) { if(osmPoint.getAction() == Action.DELETE) {
pointTypeStr = getMapActivity().getString(R.string.osm_edit_removed_note); actionStr = getMapActivity().getString(R.string.osm_edit_removed_note);
} else if(osmPoint.getAction() == Action.MODIFY) { } else if(osmPoint.getAction() == Action.MODIFY) {
pointTypeStr = getMapActivity().getString(R.string.osm_edit_commented_note); actionStr = getMapActivity().getString(R.string.osm_edit_commented_note);
} else if(osmPoint.getAction() == Action.REOPEN) { } else if(osmPoint.getAction() == Action.REOPEN) {
pointTypeStr = getMapActivity().getString(R.string.osm_edit_reopened_note); actionStr = getMapActivity().getString(R.string.osm_edit_reopened_note);
} else/* if(osmPoint.getAction() == Action.CREATE) */{ } else/* if(osmPoint.getAction() == Action.CREATE) */{
pointTypeStr = getMapActivity().getString(R.string.osm_edit_created_note); actionStr = getMapActivity().getString(R.string.osm_edit_created_note);
} }
} else { } else {
pointTypeStr = ""; actionStr = "";
} }
} }
@Override
public String getTypeStr() {
return category;
}
@Override @Override
protected void setObject(Object object) { protected void setObject(Object object) {
if (object instanceof OsmPoint) { if (object instanceof OsmPoint) {
@ -112,21 +123,85 @@ public class EditPOIMenuController extends MenuController {
@Override @Override
public boolean needTypeStr() { public boolean needTypeStr() {
return !Algorithms.isEmpty(pointTypeStr); return !Algorithms.isEmpty(category);
} }
@Override @Override
public Drawable getLeftIcon() { public boolean displayDistanceDirection() {
return getIcon(R.drawable.ic_action_gabout_dark, R.color.created_poi_icon_color); return true;
} }
@Override @Override
public String getTypeStr() { public String getAdditionalInfoStr() {
return pointTypeStr; return actionStr;
}
@Override
public int getAdditionalInfoColor() {
if (osmPoint.getAction() == Action.DELETE) {
return R.color.color_osm_edit_delete;
} else if (osmPoint.getAction() == Action.MODIFY || osmPoint.getAction() == Action.REOPEN) {
return R.color.color_osm_edit_modify;
} else {
return R.color.color_osm_edit_create;
}
}
@Override
public int getRightIconId() {
if (osmPoint.getGroup() == OsmPoint.Group.POI) {
OpenstreetmapPoint osmP = (OpenstreetmapPoint) osmPoint;
int iconResId = 0;
String poiTranslation = osmP.getEntity().getTag(EditPoiData.POI_TYPE_TAG);
if (poiTranslation != null) {
Map<String, PoiType> poiTypeMap = getMapActivity().getMyApplication().getPoiTypes().getAllTranslatedNames(false);
PoiType poiType = poiTypeMap.get(poiTranslation.toLowerCase());
if (poiType != null) {
String id = null;
if (RenderingIcons.containsBigIcon(poiType.getIconKeyName())) {
id = poiType.getIconKeyName();
} else if (RenderingIcons.containsBigIcon(poiType.getOsmTag() + "_" + poiType.getOsmValue())) {
id = poiType.getOsmTag() + "_" + poiType.getOsmValue();
}
if (id != null) {
iconResId = RenderingIcons.getBigIconResourceId(id);
}
}
}
if (iconResId == 0) {
iconResId = R.drawable.ic_type_info;
}
return iconResId;
} else if (osmPoint.getGroup() == OsmPoint.Group.BUG) {
return R.drawable.ic_type_bug;
} else {
return 0;
}
}
@Override
public int getAdditionalInfoIconRes() {
if (osmPoint.getAction() == Action.DELETE) {
return R.drawable.ic_action_type_delete_16;
} else if (osmPoint.getAction() == Action.MODIFY || osmPoint.getAction() == Action.REOPEN) {
return R.drawable.ic_action_type_edit_16;
} else {
return R.drawable.ic_action_type_add_16;
}
} }
@Override @Override
public boolean needStreetName() { public boolean needStreetName() {
return false; return false;
} }
private String getCategory() {
String category = "";
if (osmPoint.getGroup() == OsmPoint.Group.POI) {
category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG);
} else if (osmPoint.getGroup() == OsmPoint.Group.BUG) {
category = getMapActivity().getString(R.string.osn_bug_name);
}
return category;
}
} }

View file

@ -73,7 +73,7 @@ public class OsmBugMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
if (bug.isOpened()) { if (bug.isOpened()) {
return getIcon(R.drawable.ic_action_gabout_dark, R.color.osm_bug_unresolved_icon_color); return getIcon(R.drawable.ic_action_gabout_dark, R.color.osm_bug_unresolved_icon_color);
} else { } else {
@ -95,7 +95,7 @@ public class OsmBugMenuController extends MenuController {
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) { public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
super.addPlainMenuItems(typeStr, pointDescription, latLon); super.addPlainMenuItems(typeStr, pointDescription, latLon);
for (String description : bug.getCommentDescriptionList()) { for (String description : bug.getCommentDescriptionList()) {
addPlainMenuItem(R.drawable.ic_action_note_dark, description, true, false, null); addPlainMenuItem(R.drawable.ic_action_note_dark, null, description, true, false, null);
} }
} }

View file

@ -96,7 +96,7 @@ public class OsMoMenuController extends MenuController {
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
if (isLight()) { if (isLight()) {
return getIconOrig(R.drawable.widget_osmo_connected_location_day); return getIconOrig(R.drawable.widget_osmo_connected_location_day);
} else { } else {

View file

@ -64,17 +64,17 @@ public class ParkingPositionMenuController extends MenuController {
} }
@Override @Override
public String getAdditionalTypeStr() { public int getAdditionalInfoIconRes() {
return R.drawable.ic_action_opening_hour_16;
}
@Override
public String getAdditionalInfoStr() {
return parkingLeftDescription; return parkingLeftDescription;
} }
@Override @Override
public boolean displayAdditionalTypeStrInHours() { public int getAdditionalInfoColor() {
return true;
}
@Override
public int getTimeStrColor() {
return plugin.getParkingType() ? R.color.ctx_menu_amenity_closed_text_color : isLight() ? R.color.icon_color : R.color.dash_search_icon_dark; return plugin.getParkingType() ? R.color.ctx_menu_amenity_closed_text_color : isLight() ? R.color.icon_color : R.color.dash_search_icon_dark;
} }
@ -83,13 +83,18 @@ public class ParkingPositionMenuController extends MenuController {
return parkingTitle; return parkingTitle;
} }
@Override
public boolean navigateInPedestrianMode() {
return true;
}
@Override @Override
public boolean displayDistanceDirection() { public boolean displayDistanceDirection() {
return true; return true;
} }
@Override @Override
public Drawable getLeftIcon() { public Drawable getRightIcon() {
return getIcon(R.drawable.ic_action_parking_dark, R.color.map_widget_blue); return getIcon(R.drawable.ic_action_parking_dark, R.color.map_widget_blue);
} }

View file

@ -0,0 +1,105 @@
package net.osmand.plus.transport;
import net.osmand.data.RotatedTileBox;
import net.osmand.data.TransportRoute;
import net.osmand.data.TransportStop;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.render.RenderingRuleSearchRequest;
import net.osmand.render.RenderingRulesStorage;
import java.util.List;
public class TransportStopRoute {
public TransportStop refStop;
public TransportStopType type;
public String desc;
public TransportRoute route;
public TransportStop stop;
public int distance;
public boolean showWholeRoute;
private int cachedColor;
private boolean cachedNight;
public String getDescription(OsmandApplication ctx, boolean useDistance) {
if (useDistance && distance > 0) {
String nm = OsmAndFormatter.getFormattedDistance(distance, ctx);
if (refStop != null && !refStop.getName().equals(stop.getName())) {
nm = refStop.getName() + ", " + nm;
}
return desc + " (" + nm + ")";
}
return desc;
}
public int calculateZoom(int startPosition, RotatedTileBox currentRotatedTileBox) {
RotatedTileBox cp = currentRotatedTileBox.copy();
boolean notContains = true;
while (cp.getZoom() > 12 && notContains) {
notContains = false;
List<TransportStop> sts = route.getForwardStops();
for (int i = startPosition; i < sts.size(); i++) {
TransportStop st = sts.get(startPosition);
if (!cp.containsLatLon(st.getLocation())) {
notContains = true;
break;
}
}
cp.setZoom(cp.getZoom() - 1);
}
return cp.getZoom();
}
public int getColor(OsmandApplication ctx, boolean nightMode) {
if (cachedColor == 0 || cachedNight != nightMode) {
cachedColor = ctx.getResources().getColor(R.color.transport_route_line);
cachedNight = nightMode;
if (type != null) {
RenderingRulesStorage rrs = ctx.getRendererRegistry().getCurrentSelectedRenderer();
RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs);
req.setBooleanFilter(rrs.PROPS.R_NIGHT_MODE, nightMode);
String typeStr = type.getRendeAttr();
if (req.searchRenderingAttribute(typeStr)) {
cachedColor = req.getIntPropertyValue(rrs.PROPS.R_ATTR_COLOR_VALUE);
}
}
}
return cachedColor;
}
public int getTypeStrRes() {
if (type != null) {
switch (type) {
case BUS:
return R.string.poi_route_bus_ref;
case TRAM:
return R.string.poi_route_tram_ref;
case FERRY:
return R.string.poi_route_ferry_ref;
case TRAIN:
return R.string.poi_route_train_ref;
case SHARE_TAXI:
return R.string.poi_route_share_taxi_ref;
case FUNICULAR:
return R.string.poi_route_funicular_ref;
case LIGHT_RAIL:
return R.string.poi_route_light_rail_ref;
case MONORAIL:
return R.string.poi_route_monorail_ref;
case TROLLEYBUS:
return R.string.poi_route_trolleybus_ref;
case RAILWAY:
return R.string.poi_route_railway_ref;
case SUBWAY:
return R.string.poi_route_subway_ref;
default:
return R.string.poi_filter_public_transport;
}
} else {
return R.string.poi_filter_public_transport;
}
}
}

View file

@ -0,0 +1,54 @@
package net.osmand.plus.transport;
import net.osmand.plus.R;
public enum TransportStopType {
BUS(R.drawable.mx_route_bus_ref, R.drawable.mx_route_bus_ref, "routeBusColor"),
FERRY(R.drawable.mx_route_ferry_ref, R.drawable.mx_route_ferry_ref, "routeFerryColor"),
FUNICULAR(R.drawable.mx_route_funicular_ref, R.drawable.mx_route_funicular_ref, "routeFunicularColor"),
LIGHT_RAIL(R.drawable.mx_route_light_rail_ref, R.drawable.mx_route_light_rail_ref, "routeLightrailColor"),
MONORAIL(R.drawable.mx_route_monorail_ref, R.drawable.mx_route_monorail_ref, "routeLightrailColor"),
RAILWAY(R.drawable.mx_route_railway_ref, R.drawable.mx_route_railway_ref, "routeTrainColor"),
SHARE_TAXI(R.drawable.mx_route_share_taxi_ref, R.drawable.mx_route_share_taxi_ref, "routeShareTaxiColor"),
TRAIN(R.drawable.mx_route_train_ref, R.drawable.mx_route_train_ref, "routeTrainColor"),
TRAM(R.drawable.mx_route_tram_ref, R.drawable.mx_railway_tram_stop, "routeTramColor"),
TROLLEYBUS(R.drawable.mx_route_trolleybus_ref, R.drawable.mx_route_trolleybus_ref, "routeTrolleybusColor"),
SUBWAY(R.drawable.mx_subway_station, R.drawable.mx_subway_station, "routeTrainColor");
final int resId;
final int topResId;
final String renderAttr;
TransportStopType(int resId, int topResId, String renderAttr) {
this.resId = resId;
this.topResId = topResId;
this.renderAttr = renderAttr;
}
public int getResourceId() {
return resId;
}
public int getTopResourceId() {
return topResId;
}
public String getRendeAttr() {
return renderAttr;
}
public boolean isTopType() {
return this == TRAM || this == SUBWAY;
}
public static TransportStopType findType(String typeName) {
String tName = typeName.toUpperCase();
for (TransportStopType t : values()) {
if (t.name().equals(tName)) {
return t;
}
}
return null;
}
}

View file

@ -504,7 +504,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
view.setLatLon(lat, lon); view.setLatLon(lat, lon);
mInChangeMarkerPositionMode = true; mInChangeMarkerPositionMode = true;
mMoveMarkerBottomSheetHelper.show(menu.getLeftIcon()); mMoveMarkerBottomSheetHelper.show(menu.getRightIcon());
mark(View.INVISIBLE, R.id.map_ruler_layout, mark(View.INVISIBLE, R.id.map_ruler_layout,
R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info); R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);

View file

@ -295,7 +295,6 @@ public class MapControlsLayer extends OsmandMapLayer {
boolean nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls(); boolean nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
ImageView cancelRouteButton = (ImageView) main.findViewById(R.id.map_cancel_route_button); ImageView cancelRouteButton = (ImageView) main.findViewById(R.id.map_cancel_route_button);
cancelRouteButton.setImageDrawable(app.getIconsCache().getIcon(R.drawable.map_action_cancel, nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light)); cancelRouteButton.setImageDrawable(app.getIconsCache().getIcon(R.drawable.map_action_cancel, nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light));
AndroidUtils.setBackground(mapActivity, cancelRouteButton, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
cancelRouteButton.setOnClickListener(new View.OnClickListener() { cancelRouteButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -305,7 +304,6 @@ public class MapControlsLayer extends OsmandMapLayer {
ImageView waypointsButton = (ImageView) main.findViewById(R.id.map_waypoints_route_button); ImageView waypointsButton = (ImageView) main.findViewById(R.id.map_waypoints_route_button);
waypointsButton.setImageDrawable(app.getIconsCache().getIcon(R.drawable.map_action_flag_dark, nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light)); waypointsButton.setImageDrawable(app.getIconsCache().getIcon(R.drawable.map_action_flag_dark, nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light));
AndroidUtils.setBackground(mapActivity, waypointsButton, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
waypointsButton.setOnClickListener(new View.OnClickListener() { waypointsButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -316,7 +314,6 @@ public class MapControlsLayer extends OsmandMapLayer {
ImageView options = (ImageView) main.findViewById(R.id.map_options_route_button); ImageView options = (ImageView) main.findViewById(R.id.map_options_route_button);
options.setImageDrawable(!routeInfo ? app.getIconsCache().getIcon(R.drawable.map_action_settings, options.setImageDrawable(!routeInfo ? app.getIconsCache().getIcon(R.drawable.map_action_settings,
R.color.osmand_orange) : app.getIconsCache().getIcon(R.drawable.map_action_settings, nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light)); R.color.osmand_orange) : app.getIconsCache().getIcon(R.drawable.map_action_settings, nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light));
AndroidUtils.setBackground(mapActivity, options, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
options.setOnClickListener(new View.OnClickListener() { options.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View file

@ -18,6 +18,7 @@ import android.support.v4.content.ContextCompat;
import android.support.v4.view.MenuItemCompat; import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.PopupMenu; import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.util.Linkify; import android.text.util.Linkify;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Gravity; import android.view.Gravity;
@ -289,13 +290,6 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
return true; return true;
} }
public static void showWikipediaDialog(Context ctx, OsmandApplication app, Amenity a) {
String lang = app.getSettings().MAP_PREFERRED_LOCALE.get();
if (a.getType().isWiki()) {
showWiki(ctx, app, a, lang);
}
}
public static void showDescriptionDialog(Context ctx, OsmandApplication app, String text, String title) { public static void showDescriptionDialog(Context ctx, OsmandApplication app, String text, String title) {
showText(ctx, app, text, title); showText(ctx, app, text, title);
} }
@ -309,122 +303,6 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
return typedvalueattr.resourceId; return typedvalueattr.resourceId;
} }
@SuppressWarnings("deprecation")
private static void showWiki(final Context ctx, final OsmandApplication app, final Amenity a, final String lang) {
String preferredLang = lang;
if (Algorithms.isEmpty(preferredLang)) {
preferredLang = app.getLanguage();
}
final Dialog dialog = new Dialog(ctx,
app.getSettings().isLightContent() ?
R.style.OsmandLightTheme :
R.style.OsmandDarkTheme);
final String title = Algorithms.isEmpty(preferredLang) ? a.getName() : a.getName(preferredLang);
LinearLayout ll = new LinearLayout(ctx);
ll.setOrientation(LinearLayout.VERTICAL);
final Toolbar topBar = new Toolbar(ctx);
topBar.setClickable(true);
Drawable back = app.getIconsCache().getIcon(R.drawable.ic_arrow_back);
topBar.setNavigationIcon(back);
topBar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
topBar.setTitle(title);
topBar.setBackgroundColor(ContextCompat.getColor(ctx, getResIdFromAttribute(ctx, R.attr.pstsTabBackground)));
topBar.setTitleTextColor(ContextCompat.getColor(ctx, getResIdFromAttribute(ctx, R.attr.pstsTextColor)));
String lng = a.getContentLanguage("content", preferredLang, "en");
if (Algorithms.isEmpty(lng)) {
lng = "en";
}
final String langSelected = lng;
String content = a.getDescription(langSelected);
final Button bottomBar = new Button(ctx);
bottomBar.setText(R.string.read_full_article);
bottomBar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String article = "https://" + langSelected.toLowerCase() + ".wikipedia.org/wiki/" + title.replace(' ', '_');
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(article));
ctx.startActivity(i);
}
});
MenuItem mi = topBar.getMenu().add(langSelected.toUpperCase()).setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(final MenuItem item) {
showPopupLangMenu(ctx, topBar, app, a, dialog, langSelected);
return true;
}
});
MenuItemCompat.setShowAsAction(mi, MenuItem.SHOW_AS_ACTION_ALWAYS);
topBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
dialog.dismiss();
}
});
final WebView wv = new WebView(ctx);
WebSettings settings = wv.getSettings();
settings.setDefaultTextEncodingName("utf-8");
settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(false);
settings.setSupportZoom(true);
//Scale web view font size with system font size
float scale = ctx.getResources().getConfiguration().fontScale;
if (android.os.Build.VERSION.SDK_INT >= 14) {
settings.setTextZoom((int) (scale * 100f));
} else {
if (scale <= 0.7f) {
settings.setTextSize(WebSettings.TextSize.SMALLEST);
} else if (scale <= 0.85f) {
settings.setTextSize(WebSettings.TextSize.SMALLER);
} else if (scale <= 1.0f) {
settings.setTextSize(WebSettings.TextSize.NORMAL);
} else if (scale <= 1.15f) {
settings.setTextSize(WebSettings.TextSize.LARGER);
} else {
settings.setTextSize(WebSettings.TextSize.LARGEST);
}
}
wv.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null);
// wv.loadUrl(OsMoService.SIGN_IN_URL + app.getSettings().OSMO_DEVICE_KEY.get());
//For pinch zooming to work WebView must not be inside ScrollView
//ScrollView scrollView = new ScrollView(ctx);
ll.addView(topBar);
LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 0);
lp.weight = 1;
//ll.addView(scrollView, lp);
//scrollView.addView(wv);
ll.addView(wv, lp);
ll.addView(bottomBar, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
dialog.setContentView(ll);
wv.setFocusable(true);
wv.setFocusableInTouchMode(true);
wv.requestFocus(View.FOCUS_DOWN);
wv.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_UP:
if (!v.hasFocus()) {
v.requestFocus();
}
break;
}
return false;
}
});
dialog.setCancelable(true);
dialog.show();
}
private static void showText(final Context ctx, final OsmandApplication app, final String text, String title) { private static void showText(final Context ctx, final OsmandApplication app, final String text, String title) {
final Dialog dialog = new Dialog(ctx, final Dialog dialog = new Dialog(ctx,
app.getSettings().isLightContent() ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme); app.getSettings().isLightContent() ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme);
@ -471,50 +349,6 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
dialog.show(); dialog.show();
} }
protected static void showPopupLangMenu(final Context ctx, Toolbar tb,
final OsmandApplication app, final Amenity a,
final Dialog dialog, final String langSelected) {
final PopupMenu optionsMenu = new PopupMenu(ctx, tb, Gravity.RIGHT);
Set<String> namesSet = new TreeSet<>();
namesSet.addAll(a.getNames("content", "en"));
namesSet.addAll(a.getNames("description", "en"));
Map<String, String> names = new HashMap<>();
for (String n : namesSet) {
names.put(n, FileNameTranslationHelper.getVoiceName(ctx, n));
}
String selectedLangName = names.get(langSelected);
if (selectedLangName != null) {
names.remove(langSelected);
}
Map<String, String> sortedNames = AndroidUtils.sortByValue(names);
if (selectedLangName != null) {
MenuItem item = optionsMenu.getMenu().add(selectedLangName);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
dialog.dismiss();
showWiki(ctx, app, a, langSelected);
return true;
}
});
}
for (final Map.Entry<String, String> e : sortedNames.entrySet()) {
MenuItem item = optionsMenu.getMenu().add(e.getValue());
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
dialog.dismiss();
showWiki(ctx, app, a, e.getKey());
return true;
}
});
}
optionsMenu.show();
}
@Override @Override
public PointDescription getObjectName(Object o) { public PointDescription getObjectName(Object o) {
if (o instanceof Amenity) { if (o instanceof Amenity) {

View file

@ -16,11 +16,11 @@ import net.osmand.data.PointDescription;
import net.osmand.data.QuadRect; import net.osmand.data.QuadRect;
import net.osmand.data.QuadTree; import net.osmand.data.QuadTree;
import net.osmand.data.RotatedTileBox; import net.osmand.data.RotatedTileBox;
import net.osmand.data.TransportRoute;
import net.osmand.data.TransportStop; import net.osmand.data.TransportStop;
import net.osmand.osm.edit.Node; import net.osmand.osm.edit.Node;
import net.osmand.osm.edit.Way; import net.osmand.osm.edit.Way;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.transport.TransportStopRoute;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import java.util.ArrayList; import java.util.ArrayList;
@ -44,7 +44,7 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
private RenderingLineAttributes attrs; private RenderingLineAttributes attrs;
private MapLayerData<List<TransportStop>> data; private MapLayerData<List<TransportStop>> data;
private TransportRoute route = null; private TransportStopRoute stopRoute = null;
private boolean showTransportStops; private boolean showTransportStops;
private Path path; private Path path;
@ -66,8 +66,7 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
stopBus = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_bus); stopBus = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_bus);
stopSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_small); stopSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_transport_stop_small);
attrs = new RenderingLineAttributes("transport_route"); attrs = new RenderingLineAttributes("transport_route");
attrs.defaultWidth = (int) (12 * view.getDensity()); attrs.defaultWidth = (int) (6 * view.getDensity());
attrs.defaultColor = view.getResources().getColor(R.color.transport_route_line);
data = new OsmandMapLayer.MapLayerData<List<TransportStop>>() { data = new OsmandMapLayer.MapLayerData<List<TransportStop>>() {
{ {
ZOOM_THRESHOLD = 0; ZOOM_THRESHOLD = 0;
@ -143,12 +142,12 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
} }
} }
public TransportRoute getRoute() { public TransportStopRoute getRoute() {
return route; return stopRoute;
} }
public void setRoute(TransportRoute route) { public void setRoute(TransportStopRoute route) {
this.route = route; this.stopRoute = route;
} }
public boolean isShowTransportStops() { public boolean isShowTransportStops() {
@ -176,17 +175,18 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
return (int) (r * tb.getDensity()); return (int) (r * tb.getDensity());
} }
@Override @Override
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tb, DrawSettings settings) { public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {
List<TransportStop> objects = null; List<TransportStop> objects = null;
if (tb.getZoom() >= startZoomRoute) { if (tb.getZoom() >= startZoomRoute) {
if (route != null) { if (stopRoute != null) {
objects = route.getForwardStops(); objects = stopRoute.route.getForwardStops();
int color = stopRoute.getColor(mapActivity.getMyApplication(), settings.isNightMode());
attrs.paint.setColor(color);
attrs.updatePaints(view, settings, tb); attrs.updatePaints(view, settings, tb);
try { try {
path.reset(); path.reset();
List<Way> ws = route.getForwardWays(); List<Way> ws = stopRoute.route.getForwardWays();
if (ws != null) { if (ws != null) {
for (Way w : ws) { for (Way w : ws) {
TIntArrayList tx = new TIntArrayList(); TIntArrayList tx = new TIntArrayList();
@ -286,8 +286,8 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
@Override @Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res, boolean unknownLocation) { public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res, boolean unknownLocation) {
if(tileBox.getZoom() >= startZoomRoute && route != null) { if(tileBox.getZoom() >= startZoomRoute && stopRoute != null) {
getFromPoint(tileBox, point, res, route.getForwardStops()); getFromPoint(tileBox, point, res, stopRoute.route.getForwardStops());
} else if (tileBox.getZoom() >= startZoom && data.getResults() != null) { } else if (tileBox.getZoom() >= startZoom && data.getResults() != null) {
getFromPoint(tileBox, point, res, data.getResults()); getFromPoint(tileBox, point, res, data.getResults());
} }