Fix night colors theme for route preparation

This commit is contained in:
Chumva 2019-03-26 12:31:41 +02:00
parent a234845a9d
commit 137005374a
43 changed files with 328 additions and 253 deletions

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_top_light" />
</item>
<item>
<shape>
<solid
android:color="@color/card_and_list_background_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_top_light" />
</item>
<item>
<shape>
<solid
android:color="@color/card_and_list_background_light" />
</shape>
</item>
</layer-list>

View file

@ -3,7 +3,7 @@
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="4dp" />
<stroke android:width="1dp" android:color="@color/route_info_go_btn_inking_dark" />
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_dark" />
</shape>
</item>
<item android:state_enabled="false">

View file

@ -3,7 +3,7 @@
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="18dp" />
<stroke android:width="1dp" android:color="@color/route_info_go_btn_inking_dark" />
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_dark" />
</shape>
</item>
<item android:state_enabled="false">

View file

@ -4,7 +4,7 @@
<shape android:shape="rectangle">
<corners android:radius="18dp" />
<solid android:color="@color/active_buttons_and_links_trans_dark" />
<stroke android:width="1dp" android:color="@color/route_info_go_btn_inking_dark" />
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_dark" />
</shape>
</item>
<item android:state_enabled="false">

View file

@ -5,7 +5,7 @@
</item>
<item>
<shape>
<solid android:color="@color/route_info_bg_dark" />
<solid android:color="@color/card_and_list_background_dark" />
</shape>
</item>
</layer-list>

View file

@ -6,7 +6,7 @@
<item>
<shape>
<solid
android:color="@color/route_info_bg_dark" />
android:color="@color/card_and_list_background_dark" />
</shape>
</item>
</layer-list>

View file

@ -6,7 +6,7 @@
<item>
<shape>
<solid
android:color="@color/route_info_bg_light" />
android:color="@color/card_and_list_background_light" />
</shape>
</item>
</layer-list>

View file

@ -5,7 +5,7 @@
</item>
<item>
<shape>
<solid android:color="@color/route_info_bg_light" />
<solid android:color="@color/card_and_list_background_light" />
</shape>
</item>
</layer-list>

View file

@ -4,9 +4,9 @@
<shape>
<gradient
android:angle="0"
android:startColor="#0517191a"
android:centerColor="@color/activity_background_dark"
android:endColor="@color/activity_background_dark"
android:startColor="#05222526"
android:centerColor="@color/card_and_list_background_dark"
android:endColor="@color/card_and_list_background_dark"
android:centerX="0.2"
android:type="linear" />
<corners android:radius="4dp" />

View file

@ -4,9 +4,9 @@
<shape>
<gradient
android:angle="180"
android:startColor="#0517191a"
android:centerColor="@color/activity_background_dark"
android:endColor="@color/activity_background_dark"
android:startColor="#05222526"
android:centerColor="@color/card_and_list_background_dark"
android:endColor="@color/card_and_list_background_dark"
android:centerX="0.2"
android:type="linear" />
<corners android:radius="4dp" />

View file

@ -24,7 +24,7 @@
android:id="@+id/card_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/route_info_bg"
android:background="?attr/card_and_list_background_basic"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="vertical"
@ -44,7 +44,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/list_content_padding"
android:layout_marginLeft="@dimen/list_content_padding"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
tools:text="Tracks on the map - 10" />
@ -71,7 +71,7 @@
android:layout_gravity="top"
android:layout_marginStart="@dimen/route_info_list_text_padding"
android:layout_marginLeft="@dimen/route_info_list_text_padding"
android:background="?attr/dashboard_divider" />
android:background="?attr/divider_color_basic" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/show_all_title"
@ -82,7 +82,7 @@
android:paddingBottom="@dimen/list_header_padding"
android:layout_marginStart="@dimen/route_info_list_text_padding"
android:layout_marginLeft="@dimen/route_info_list_text_padding"
android:textColor="?attr/color_dialog_buttons"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/default_sub_text_size"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"

View file

@ -12,7 +12,7 @@
android:layout_height="1dp"
android:layout_marginStart="@dimen/route_info_list_text_padding"
android:layout_marginLeft="@dimen/route_info_list_text_padding"
android:background="?attr/dashboard_divider"
android:background="?attr/divider_color_basic"
android:visibility="gone" />
<LinearLayout
@ -47,7 +47,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
tools:text="Amsterdam" />
@ -72,7 +72,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
tools:text="City" />

View file

@ -25,7 +25,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/route_info_card_row_min_height"
android:background="?attr/route_info_bg"
android:background="?attr/card_and_list_background_basic"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="horizontal">
@ -50,7 +50,7 @@
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:src="@drawable/ic_action_home_dark"
android:tint="?attr/route_info_control_icon_color" />
android:tint="@color/description_font_and_bottom_sheet_icons" />
<LinearLayout
android:layout_width="match_parent"
@ -67,7 +67,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/home_button"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
tools:ignore="UnusedAttribute" />
@ -79,7 +79,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/home_button"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
tools:ignore="UnusedAttribute"
tools:text="Amsterdam" />
@ -94,7 +94,7 @@
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:background="?attr/divider_color" />
android:background="?attr/divider_color_basic" />
<LinearLayout
android:id="@+id/work_button"
@ -116,7 +116,7 @@
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:src="@drawable/ic_action_work"
android:tint="?attr/route_info_control_icon_color" />
android:tint="@color/description_font_and_bottom_sheet_icons" />
<LinearLayout
android:layout_width="match_parent"
@ -133,7 +133,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/work_button"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
tools:ignore="UnusedAttribute" />
@ -145,7 +145,7 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/work_button"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
tools:ignore="UnusedAttribute"
tools:text="Business centre" />

View file

@ -136,6 +136,7 @@
android:layout_marginRight="@dimen/list_content_padding"
android:layout_marginBottom="3dp"
android:text="@string/route_from"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
<TextView
@ -146,7 +147,7 @@
android:layout_marginRight="@dimen/list_content_padding"
android:gravity="left"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
tools:text="My position" />
@ -182,10 +183,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/shared_string_swap"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
<ImageView
android:id="@+id/from_button_image_view"
@ -211,7 +212,7 @@
android:layout_marginLeft="@dimen/route_info_start_divider_margin"
android:layout_marginEnd="@dimen/route_info_end_divider_margin"
android:layout_marginRight="@dimen/route_info_end_divider_margin"
android:background="@color/dashboard_divider_dark"
android:background="?attr/divider_color_basic"
android:focusable="false" />
<LinearLayout
@ -251,6 +252,7 @@
android:gravity="left"
android:singleLine="true"
android:text="@string/intermediate_destinations"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
<TextView
@ -261,7 +263,7 @@
android:layout_marginRight="@dimen/list_content_padding"
android:gravity="left"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
tools:text="Intermediate point"/>
@ -297,10 +299,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/shared_string_edit"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
<ImageView
android:id="@+id/via_button_image_view"
@ -326,7 +328,7 @@
android:layout_marginLeft="@dimen/route_info_start_divider_margin"
android:layout_marginEnd="@dimen/route_info_end_divider_margin"
android:layout_marginRight="@dimen/route_info_end_divider_margin"
android:background="@color/dashboard_divider_dark"
android:background="?attr/divider_color_basic"
android:focusable="false" />
<LinearLayout
@ -363,6 +365,7 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="3dp"
android:text="@string/route_to"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
<TextView
@ -373,7 +376,7 @@
android:layout_marginRight="@dimen/list_content_padding"
android:gravity="left"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
tools:text="Destination"/>
@ -409,10 +412,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/shared_string_add"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
<ImageView
android:id="@+id/to_button_image_view"
@ -437,8 +440,8 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:focusable="false"
tools:background="@color/dashboard_divider_dark" />
android:background="?attr/divider_color_basic"
android:focusable="false" />
<FrameLayout
android:id="@+id/map_route_options"
@ -487,10 +490,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/shared_string_options"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
<ImageView
android:id="@+id/map_options_route_button_icon"

View file

@ -23,7 +23,7 @@
android:id="@+id/card_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/route_info_bg"
android:background="?attr/card_and_list_background_basic"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="vertical"
@ -45,7 +45,7 @@
android:layout_marginLeft="@dimen/list_content_padding"
android:text="@string/previous_route"
android:textSize="@dimen/default_desc_text_size"
android:textColor="?android:attr/textColorSecondary" />
android:textColor="@color/description_font_and_bottom_sheet_icons" />
</LinearLayout>
@ -69,7 +69,7 @@
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:src="@drawable/ic_action_previous_route"
android:tint="?attr/route_info_control_icon_color" />
android:tint="@color/description_font_and_bottom_sheet_icons" />
<LinearLayout
android:layout_width="match_parent"
@ -82,8 +82,7 @@
android:id="@+id/start_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="end"
android:textColor="@color/description_font_and_bottom_sheet_icons" android:ellipsize="end"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/home_button"
@ -96,7 +95,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:ellipsize="end"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/route_info_bg"
android:background="?attr/card_and_list_background_basic"
android:orientation="vertical">
<FrameLayout
@ -22,7 +22,7 @@
android:maxLines="1"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
@ -40,6 +40,7 @@
android:paddingRight="@dimen/content_padding"
android:text="@string/rendering_category_details"
android:textSize="@dimen/text_button_text_size"
android:textColor="?attr/active_color_basic"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute" />

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/route_info_bg"
android:background="?attr/card_and_list_background_basic"
android:orientation="vertical">
<LinearLayout
@ -40,7 +40,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="26 km" />
@ -51,7 +51,7 @@
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/total_distance"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -83,7 +83,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="20 min" />
@ -94,7 +94,7 @@
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/shared_string_time"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -148,7 +148,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="40 m" />
@ -159,7 +159,7 @@
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/average_altitude"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -191,7 +191,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="30m - 53m" />
@ -202,7 +202,7 @@
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/altitude_range"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -230,7 +230,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider" />
android:background="?attr/divider_color_basic" />
</LinearLayout>
@ -245,7 +245,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider" />
android:background="?attr/divider_color_basic" />
</LinearLayout>
@ -284,7 +284,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="174" />
@ -295,7 +295,7 @@
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/altitude_ascent"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -327,7 +327,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="164" />
@ -338,7 +338,7 @@
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/altitude_descent"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:background="?attr/selectableItemBackground"
android:orientation="vertical">
<LinearLayout
@ -25,7 +25,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/color_distance"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/default_sub_text_size"
android:textStyle="bold"
tools:text="631 m"/>
@ -35,7 +35,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/color_distance"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/default_sub_text_size"
android:textStyle="bold"
tools:text="0:50"/>
@ -62,7 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/color_distance"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/default_sub_text_size"
android:textStyle="bold"
tools:text="@string/app_version"/>
@ -73,7 +73,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="@dimen/default_sub_text_size"
android:textColor="@color/color_distance"
android:textColor="?attr/active_color_basic"
android:textStyle="bold"
tools:text="@string/app_version"/>
</LinearLayout>
@ -88,6 +88,7 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:textSize="@dimen/default_desc_text_size"
android:textColor="?attr/main_font_color_basic"
tools:text="Head Dmytrivska Street"
android:text=""/>
@ -97,6 +98,6 @@
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
android:background="?attr/divider_color_basic"/>
</LinearLayout>

View file

@ -17,6 +17,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:textColor="?attr/active_color_basic"
android:ellipsize="end"
android:gravity="center"
android:letterSpacing="@dimen/text_button_letter_spacing"
@ -33,7 +34,9 @@
<View
android:id="@+id/controls_divider"
android:layout_width="1dp"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:background="?attr/divider_color_basic"
android:visibility="gone"/>
<FrameLayout
android:id="@+id/start_button"

View file

@ -5,20 +5,20 @@
android:id="@+id/route_info_details_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/card_and_list_background_basic"
android:orientation="vertical">
<View
android:id="@+id/dividerToDropDown"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"
android:background="?attr/divider_color_basic"
android:focusable="false" />
<LinearLayout
android:id="@+id/RouteInfoControls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/route_info_bg"
android:orientation="vertical">
<LinearLayout
@ -65,7 +65,7 @@
android:layout_height="wrap_content"
android:gravity="left"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size" />
<net.osmand.plus.widgets.TextViewEx
@ -74,6 +74,7 @@
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/route_distance"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -84,6 +85,7 @@
android:id="@+id/info_divider"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?attr/divider_color_basic"
android:paddingBottom="@dimen/list_item_button_padding" />
<LinearLayout
@ -115,7 +117,7 @@
android:layout_height="wrap_content"
android:gravity="left"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size" />
<net.osmand.plus.widgets.TextViewEx
@ -124,6 +126,7 @@
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/arrive_at_time"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_sub_text_size" />
</LinearLayout>
@ -161,10 +164,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/rendering_category_details"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
</FrameLayout>

View file

@ -49,12 +49,14 @@
android:ellipsize="end"
android:maxLines="1"
android:text="@string/shared_string_target_points"
android:textAppearance="@style/TextAppearance.ListItemCategoryTitle" />
android:textColor="?attr/main_font_color_basic"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"/>
</LinearLayout>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/text_button"
android:id="@+id/sort_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
@ -66,10 +68,10 @@
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/shared_string_sort"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
</FrameLayout>
@ -124,11 +126,10 @@
android:paddingRight="8dp"
android:text="@string/shared_string_add"
android:textSize="@dimen/text_button_text_size"
android:textColor="?attr/active_color_basic"
osmand:typeface="@string/font_roboto_medium"
tools:drawableLeft="@drawable/ic_action_plus"
tools:drawableStart="@drawable/ic_action_plus"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
</FrameLayout>
@ -156,13 +157,12 @@
android:maxLines="1"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textColor="?attr/active_color_basic"
android:text="@string/shared_string_clear_all"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:drawableLeft="@drawable/ic_action_clear_all"
tools:drawableStart="@drawable/ic_action_clear_all"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
</FrameLayout>

View file

@ -20,14 +20,14 @@
android:id="@+id/top_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"
android:background="?attr/divider_color_basic"
android:focusable="false" />
<LinearLayout
android:id="@+id/routes_info_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/route_info_bg"
android:background="?attr/card_and_list_background_basic"
android:orientation="vertical"
android:paddingLeft="@dimen/route_info_buttons_padding_top_bottom"
android:paddingTop="@dimen/content_padding"
@ -51,7 +51,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="6dp"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular"
tools:text="@string/route_from" />
@ -60,7 +60,7 @@
android:id="@+id/way_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular"
tools:text="@string/route_from" />
@ -92,10 +92,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/rendering_category_details"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
</FrameLayout>
@ -119,10 +119,10 @@
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:text="@string/shared_string_show_on_map"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
tools:textColor="?attr/wikivoyage_active_color" />
tools:ignore="UnusedAttribute" />
</FrameLayout>

View file

@ -32,7 +32,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
tools:ignore="UnusedAttribute"
tools:text="@string/public_transport_warning_title" />
@ -42,7 +42,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:textColor="?android:attr/textColorSecondary"
android:textColor="@color/description_font_and_bottom_sheet_icons"
android:textSize="@dimen/default_desc_text_size"
tools:ignore="UnusedAttribute"
tools:text="@string/public_transport_warning_descr_blog" />

View file

@ -108,6 +108,10 @@
<attr name="route_info_control_icon_color" format="reference" />
<attr name="route_info_bg" format="reference" />
<attr name="flow_toolbar_bg" format="reference" />
<attr name="divider_color_basic" format="reference" />
<attr name="main_font_color_basic" format="reference" />
<attr name="active_color_basic" format="reference" />
<attr name="card_and_list_background_basic" format="reference" />
</declare-styleable>
<declare-styleable name="PagerSlidingTabStrip">

View file

@ -456,9 +456,11 @@
<color name="wiki_webview_background_dark">#17191a</color>
<!-- Basic colors -->
<color name="app_bar_main_dark">#17191a</color>
<color name="app_bar_main_dark">#101112</color>
<color name="app_bar_main_light">#ff8800</color>
<color name="activity_background_dark">#17191a</color>
<color name="status_bar_main_dark">#101112</color>
<color name="status_bar_main_light">#E68200</color>
<color name="activity_background_dark">#17181a</color>
<color name="activity_background_light">#f0f0f0</color>
<color name="card_and_list_background_dark">#222526</color>
<color name="card_and_list_background_light">#ffffff</color>

View file

@ -240,6 +240,10 @@
<item name="route_info_bg">@color/route_info_bg_light</item>
<item name="flow_toolbar_bg">@drawable/flow_toolbar_bg_light</item>
<item name="divider_color_basic">@color/divider_light</item>
<item name="main_font_color_basic">@color/main_font_light</item>
<item name="active_color_basic">@color/active_buttons_and_links_light</item>
<item name="card_and_list_background_basic">@color/card_and_list_background_light</item>
</style>
<style name="OverflowMenuButton" parent="@style/Widget.AppCompat.ActionButton.Overflow">
@ -466,6 +470,10 @@
<item name="route_info_bg">@color/route_info_bg_dark</item>
<item name="flow_toolbar_bg">@drawable/flow_toolbar_bg_dark</item>
<item name="divider_color_basic">@color/divider_dark</item>
<item name="main_font_color_basic">@color/main_font_dark</item>
<item name="active_color_basic">@color/active_buttons_and_links_dark</item>
<item name="card_and_list_background_basic">@color/card_and_list_background_dark</item>
</style>
<style name="FreeVersionBanner" parent="OsmandDarkTheme">

View file

@ -86,12 +86,12 @@ public class AppModeDialog {
final boolean checked = selected.contains(mode);
ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);
if (checked) {
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), nightMode ? R.color.route_info_checked_mode_icon_color_dark : R.color.route_info_checked_mode_icon_color_light));
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), nightMode ? R.color.active_buttons_and_links_dark : R.color.route_info_checked_mode_icon_color_light));
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_checked)));
tb.findViewById(R.id.selection).setVisibility(View.VISIBLE);
} else {
if (useMapTheme) {
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), R.color.route_info_unchecked_mode_icon_color));
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), R.color.description_font_and_bottom_sheet_icons));
iv.setBackgroundResource(AndroidUtils.resolveAttribute(ctx, android.R.attr.selectableItemBackground));
} else {
iv.setImageDrawable(ctx.getUIUtilities().getThemedIcon(mode.getSmallIconDark()));
@ -200,7 +200,7 @@ public class AppModeDialog {
int metricsY = (int) ctx.getResources().getDimension(R.dimen.route_info_modes_height);
View tb = layoutInflater.inflate(layoutId, null);
ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), isNightMode(ctx, useMapTheme) ? R.color.route_info_checked_mode_icon_color_dark : R.color.route_info_checked_mode_icon_color_light));
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), isNightMode(ctx, useMapTheme) ? R.color.active_buttons_and_links_dark : R.color.route_info_checked_mode_icon_color_light));
iv.setContentDescription(mode.toHumanString(ctx));
// tb.setCompoundDrawablesWithIntrinsicBounds(null, ctx.getIconsCache().getIcon(mode.getIconId(), R.color.app_mode_icon_color), null, null);
LayoutParams lp = new LinearLayout.LayoutParams(metricsX, metricsY);

View file

@ -1016,6 +1016,7 @@ public class GpxUiHelper {
mChart.setMarker(mv); // Set the marker to the chart
mChart.setDrawMarkers(true);
int labelsColor = ContextCompat.getColor(mChart.getContext(), R.color.description_font_and_bottom_sheet_icons);
XAxis xAxis = mChart.getXAxis();
xAxis.setDrawAxisLine(false);
xAxis.setDrawGridLines(true);
@ -1023,7 +1024,7 @@ public class GpxUiHelper {
xAxis.setGridColor(ActivityCompat.getColor(mChart.getContext(), R.color.gpx_chart_black_grid));
xAxis.enableGridDashedLine(25f, Float.MAX_VALUE, 0f);
xAxis.setPosition(BOTTOM);
xAxis.setTextColor(light ? mChart.getResources().getColor(R.color.secondary_text_light) : mChart.getResources().getColor(R.color.secondary_text_dark));
xAxis.setTextColor(labelsColor);
YAxis yAxis = mChart.getAxisLeft();
yAxis.enableGridDashedLine(10f, 5f, 0f);
@ -1033,7 +1034,7 @@ public class GpxUiHelper {
yAxis.setXOffset(16f);
yAxis.setYOffset(-6f);
yAxis.setLabelCount(yLabelsCount);
yAxis.setTextColor(light ? mChart.getResources().getColor(R.color.secondary_text_light) : mChart.getResources().getColor(R.color.secondary_text_dark));
xAxis.setTextColor(labelsColor);
yAxis = mChart.getAxisRight();
yAxis.enableGridDashedLine(10f, 5f, 0f);
@ -1043,7 +1044,7 @@ public class GpxUiHelper {
yAxis.setXOffset(16f);
yAxis.setYOffset(-6f);
yAxis.setLabelCount(yLabelsCount);
yAxis.setTextColor(light ? mChart.getResources().getColor(R.color.secondary_text_light) : mChart.getResources().getColor(R.color.secondary_text_dark));
xAxis.setTextColor(labelsColor);
yAxis.setEnabled(false);
Legend legend = mChart.getLegend();

View file

@ -49,7 +49,7 @@ public class TransportStopRouteAdapter extends ArrayAdapter<Object> {
bgColor = transportStopRoute.getColor(app, nightMode);
} else if (object instanceof String) {
routeRef = (String) object;
bgColor = ContextCompat.getColor(app, R.color.route_info_unchecked_mode_icon_color);
bgColor = ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons);
}
TextView transportStopRouteTextView = (TextView) convertView.findViewById(R.id.transport_stop_route_text);
transportStopRouteTextView.setText(routeRef);

View file

@ -110,7 +110,7 @@ public class MapMarkerMenuController extends MenuController {
private StateListDrawable createStateListShowOnTopbarIcon() {
int bgPressed = isLight() ? R.color.ctx_menu_controller_button_text_color_light_p
: R.color.ctx_menu_controller_button_text_color_dark_p;
int icPressed = isLight() ? R.color.osmand_orange : R.color.route_info_go_btn_bg_dark_p;
int icPressed = isLight() ? R.color.osmand_orange : R.color.active_buttons_and_links_dark;
return AndroidUtils.createPressedStateListDrawable(createShowOnTopbarIcon(getDeviceTopNormalColorId(), R.color.dashboard_blue),
createShowOnTopbarIcon(bgPressed, icPressed));
}

View file

@ -783,7 +783,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
}
View ll = mapActivity.getLayoutInflater().inflate(R.layout.mode_toggles, vg);
ll.setBackgroundColor(ContextCompat.getColor(mapActivity, nightMode ? R.color.route_info_bg_dark : R.color.route_info_bg_light));
ll.setBackgroundColor(ContextCompat.getColor(mapActivity, nightMode ? R.color.card_and_list_background_dark : R.color.card_and_list_background_light));
HorizontalScrollView scrollView = ll.findViewById(R.id.app_modes_scroll_container);
scrollView.setVerticalScrollBarEnabled(false);
@ -844,7 +844,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
Drawable icon = app.getUIUtilities().getIcon(iconId, color);
startButtonText.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
} else {
AndroidUtils.setBackground(app, startButton, nightMode, R.color.activity_background_light, R.color.route_info_cancel_button_color_dark);
AndroidUtils.setBackground(app, startButton, nightMode, R.color.activity_background_light, R.color.activity_background_dark);
int color = R.color.description_font_and_bottom_sheet_icons;
startButtonText.setTextColor(ContextCompat.getColor(app, color));
Drawable icon = app.getUIUtilities().getIcon(iconId, color);

View file

@ -875,7 +875,7 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
if (menu.isRouteCalculated()) {
if (publicTransportMode) {
AndroidUtils.setBackground(app, view.findViewById(R.id.start_button), nightMode, R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
textViewExProgress.color1 = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.route_info_cancel_button_color_light);
textViewExProgress.color1 = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
} else {
AndroidUtils.setBackground(app, view.findViewById(R.id.start_button), nightMode, R.color.active_buttons_and_links_light, R.color.active_buttons_and_links_dark);
textViewExProgress.color1 = ContextCompat.getColor(mapActivity, nightMode ? R.color.main_font_dark : R.color.card_and_list_background_light);
@ -923,41 +923,39 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
boolean nightMode = ctx.getMyApplication().getDaynightHelper().isNightModeForMapControls();
if (!landscapeLayout) {
View menuView = view.findViewById(R.id.route_menu_top_shadow_all);
AndroidUtils.setBackground(ctx, menuView, nightMode, R.color.route_info_bg_light, R.color.route_info_bg_dark);
AndroidUtils.setBackground(ctx, menuView, nightMode, R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
} else {
AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.route_info_menu_bg_left_light, R.drawable.route_info_menu_bg_left_dark);
}
AndroidUtils.setBackground(ctx, view.findViewById(R.id.modes_layout_toolbar_container), nightMode,
R.color.route_info_bg_light, R.color.route_info_bg_dark);
R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerFromDropDown), nightMode,
R.color.divider_light, R.color.divider_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.viaLayoutDivider), nightMode,
R.color.divider_light, R.color.divider_dark);
AndroidUtils.setBackground(ctx, mainView.findViewById(R.id.dividerButtons), nightMode,
R.color.divider_light, R.color.divider_dark);
AndroidUtils.setBackground(ctx, view.findViewById(R.id.controls_divider), nightMode,
R.color.divider_light, R.color.divider_dark);
AndroidUtils.setBackground(ctx, view.findViewById(R.id.app_modes_options_container), nightMode,
R.drawable.route_info_trans_gradient_light, R.drawable.route_info_trans_gradient_dark);
AndroidUtils.setBackground(ctx, view.findViewById(R.id.app_modes_fold_container), nightMode,
R.drawable.route_info_trans_gradient_left_light, R.drawable.route_info_trans_gradient_left_dark);
int color = ContextCompat.getColor(ctx, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
int activeColor = ContextCompat.getColor(ctx, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
((TextView) view.findViewById(R.id.cancel_button_descr)).setTextColor(activeColor);
((TextView) mainView.findViewById(R.id.from_button_description)).setTextColor(activeColor);
((TextView) mainView.findViewById(R.id.via_button_description)).setTextColor(activeColor);
((TextView) mainView.findViewById(R.id.to_button_description)).setTextColor(activeColor);
((TextView) mainView.findViewById(R.id.map_options_route_button_title)).setTextColor(activeColor);
((TextView) mainView.findViewById(R.id.from_button_description)).setTextColor(color);
((TextView) mainView.findViewById(R.id.via_button_description)).setTextColor(color);
((TextView) mainView.findViewById(R.id.to_button_description)).setTextColor(color);
((TextView) mainView.findViewById(R.id.map_options_route_button_title)).setTextColor(color);
int mainFontColor = ContextCompat.getColor(ctx, nightMode ? R.color.main_font_dark : R.color.main_font_light);
((TextView) mainView.findViewById(R.id.fromText)).setTextColor(mainFontColor);
((TextView) mainView.findViewById(R.id.ViaView)).setTextColor(mainFontColor);
((TextView) mainView.findViewById(R.id.toText)).setTextColor(mainFontColor);
((TextView) view.findViewById(R.id.cancel_button_descr)).setTextColor(
ContextCompat.getColor(ctx, nightMode ? R.color.active_buttons_and_links_dark : R.color.route_info_cancel_button_color_light));
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.fromText), nightMode);
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.toText), nightMode);
AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.ViaView), nightMode);
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.ViaSubView), nightMode);
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.toTitle), nightMode);
AndroidUtils.setTextSecondaryColor(ctx, (TextView) mainView.findViewById(R.id.fromTitle), nightMode);
int descriptionColor = ContextCompat.getColor(ctx, R.color.description_font_and_bottom_sheet_icons);
((TextView) mainView.findViewById(R.id.fromTitle)).setTextColor(descriptionColor);
((TextView) mainView.findViewById(R.id.ViaSubView)).setTextColor(descriptionColor);
((TextView) mainView.findViewById(R.id.toTitle)).setTextColor(descriptionColor);
ctx.setupRouteCalculationProgressBar((ProgressBar) mainView.findViewById(R.id.progress_bar));
setupRouteCalculationButtonProgressBar((ProgressBar) view.findViewById(R.id.progress_bar_button));
@ -1000,7 +998,7 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
public void setupRouteCalculationButtonProgressBar(@NonNull ProgressBar pb) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
int bgColor = ContextCompat.getColor(mapActivity, nightMode ? R.color.route_info_cancel_button_color_dark : R.color.activity_background_light);
int bgColor = ContextCompat.getColor(mapActivity, nightMode ? R.color.activity_background_dark : R.color.activity_background_light);
int progressColor = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
pb.setProgressDrawable(AndroidUtils.createProgressDrawable(bgColor, progressColor));
}

View file

@ -3,16 +3,17 @@ package net.osmand.plus.routepreparationmenu;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.view.ContextThemeWrapper;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
@ -225,7 +226,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
} else {
layoutParams.setMargins(0, 0, 0, 0);
cardsContainer.setBackgroundDrawable(null);
AndroidUtils.setBackground(mainView.getContext(), mainView, isNightMode(), R.drawable.bg_map_context_menu_light, R.drawable.bg_map_context_menu_dark);
AndroidUtils.setBackground(mainView.getContext(), mainView, isNightMode(), R.drawable.bg_map_route_menu_light, R.drawable.bg_map_route_menu_dark);
}
cardsContainer.setLayoutParams(layoutParams);
}
@ -255,7 +256,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
mainView.setBackgroundDrawable(null);
} else {
cardsContainer.setBackgroundDrawable(null);
AndroidUtils.setBackground(mainView.getContext(),mainView, isNightMode(), R.drawable.bg_map_context_menu_light, R.drawable.bg_map_context_menu_dark);
AndroidUtils.setBackground(mainView.getContext(),mainView, isNightMode(), R.drawable.bg_map_route_menu_light, R.drawable.bg_map_route_menu_dark);
}
}
}
@ -299,7 +300,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
private void createRouteDirections(LinearLayout cardsContainer) {
OsmandApplication app = requireMyApplication();
TextViewEx routeDirectionsTitle = new TextViewEx(app);
AndroidUtils.setTextPrimaryColor(app, routeDirectionsTitle, isNightMode());
routeDirectionsTitle.setTextColor(getMainFontColor());
routeDirectionsTitle.setTextSize(15);
routeDirectionsTitle.setGravity(Gravity.CENTER_VERTICAL);
routeDirectionsTitle.setPadding(dpToPx(16), dpToPx(16), dpToPx(16), dpToPx(16));
@ -311,7 +312,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
for (int i = 0; i < routeDirections.size(); i++) {
RouteDirectionInfo routeDirectionInfo = routeDirections.get(i);
OnClickListener onClickListener = createRouteDirectionInfoViewClickListener(i, routeDirectionInfo);
View view = getRouteDirectionView(i, cardsContainer, routeDirectionInfo, routeDirections, onClickListener);
View view = getRouteDirectionView(i, routeDirectionInfo, routeDirections, onClickListener);
cardsContainer.addView(view);
}
}
@ -398,8 +399,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
public Drawable getCollapseIcon(boolean collapsed) {
OsmandApplication app = requireMyApplication();
return app.getUIUtilities().getIcon(collapsed ? R.drawable.ic_action_arrow_down : R.drawable.ic_action_arrow_up,
!isNightMode() ? R.color.ctx_menu_collapse_icon_color_light : R.color.ctx_menu_collapse_icon_color_dark);
return app.getUIUtilities().getIcon(collapsed ? R.drawable.ic_action_arrow_down : R.drawable.ic_action_arrow_up, R.color.description_font_and_bottom_sheet_icons);
}
private void buildSegmentItem(View view, final TransportRouteResultSegment segment,
@ -433,7 +433,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
String timeText = OsmAndFormatter.getFormattedDurationShortMinutes(startTime[0]);
SpannableString secondaryText = new SpannableString(getString(R.string.sit_on_the_stop));
secondaryText.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.primary_text_dark : R.color.primary_text_light)), 0, secondaryText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
secondaryText.setSpan(new ForegroundColorSpan(getMainFontColor()), 0, secondaryText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
SpannableString title = new SpannableString(startStop.getName(getPreferredMapLang(), isTransliterateNames()));
title.setSpan(new CustomTypefaceSpan(typeface), 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
@ -463,7 +463,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (arrivalTime > 0) {
spannable.append("~");
startIndex = spannable.length();
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.append(OsmAndFormatter.getFormattedDuration(arrivalTime, app));
spannable.setSpan(new CustomTypefaceSpan(typeface), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
} else {
@ -474,7 +474,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (spannable.length() > 0) {
startIndex = spannable.length();
spannable.append("");
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), startIndex, startIndex + 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, startIndex + 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
startIndex = spannable.length();
spannable.append(String.valueOf(stops.size())).append(" ").append(getString(R.string.transport_stops));
@ -483,7 +483,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (spannable.length() > 0) {
startIndex = spannable.length();
spannable.append("");
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), startIndex, startIndex + 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, startIndex + 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
spannable.append(OsmAndFormatter.getFormattedDistance((float) segment.getTravelDist(), app));
spannable.setSpan(new CustomTypefaceSpan(typeface), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
@ -505,7 +505,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
secondaryText.setSpan(new CustomTypefaceSpan(typeface), 0, secondaryText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
int spaceIndex = secondaryText.toString().indexOf(" ");
if (spaceIndex != -1) {
secondaryText.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.primary_text_dark : R.color.primary_text_light)), 0, spaceIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
secondaryText.setSpan(new ForegroundColorSpan(getMainFontColor()), 0, spaceIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
title = new SpannableString(endStop.getName(getPreferredMapLang(), isTransliterateNames()));
title.setSpan(new CustomTypefaceSpan(typeface), 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
@ -528,13 +528,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
walkTime = 60;
}
spannable = new SpannableStringBuilder("~");
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
startIndex = spannable.length();
spannable.append(OsmAndFormatter.getFormattedDuration(walkTime, app)).append(" ");
spannable.setSpan(new CustomTypefaceSpan(typeface), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
startIndex = spannable.length();
spannable.append(getString(R.string.shared_string_walk)).append(", ").append(OsmAndFormatter.getFormattedDistance((float) walkDist, app));
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
buildRowDivider(view, true);
buildWalkRow(view, spannable, null, new OnClickListener() {
@ -629,13 +629,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
startTime[0] += walkTime;
SpannableStringBuilder title = new SpannableStringBuilder(Algorithms.capitalizeFirstLetter(getString(R.string.shared_string_walk)));
title.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
title.setSpan(new ForegroundColorSpan(getSecondaryColor()), 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
int startIndex = title.length();
title.append(" ").append(OsmAndFormatter.getFormattedDuration(walkTime, app));
title.setSpan(new CustomTypefaceSpan(FontCache.getRobotoMedium(app)), startIndex, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
startIndex = title.length();
title.append(", ").append(OsmAndFormatter.getFormattedDistance((float) walkDist, app));
title.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), startIndex, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
title.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
buildWalkRow(infoContainer, title, imagesContainer, new OnClickListener() {
@Override
@ -713,13 +713,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
walkTime = 60;
}
SpannableStringBuilder spannable = new SpannableStringBuilder("~");
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
int startIndex = spannable.length();
spannable.append(OsmAndFormatter.getFormattedDuration(walkTime, app)).append(" ");
spannable.setSpan(new CustomTypefaceSpan(typeface), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
startIndex = spannable.length();
spannable.append(getString(R.string.shared_string_walk)).append(", ").append(OsmAndFormatter.getFormattedDistance((float) walkDist, app));
spannable.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.secondary_text_dark : R.color.secondary_text_light)), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
buildWalkRow(infoContainer, spannable, imagesContainer, new OnClickListener() {
@Override
@ -738,7 +738,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
SpannableString secondaryText = new SpannableString(getString(R.string.route_descr_destination));
secondaryText.setSpan(new CustomTypefaceSpan(typeface), 0, secondaryText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
secondaryText.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, isNightMode() ? R.color.primary_text_dark : R.color.primary_text_light)), 0, secondaryText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
secondaryText.setSpan(new ForegroundColorSpan(getMainFontColor()), 0, secondaryText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
buildDestinationRow(infoContainer, timeStr, title, secondaryText, destination.point, imagesContainer, new OnClickListener() {
@Override
@ -750,9 +750,22 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
((ViewGroup) view).addView(baseItemView);
}
@ColorInt
private int getActiveColor() {
OsmandApplication app = requireMyApplication();
return ContextCompat.getColor(app, !isNightMode() ? R.color.ctx_menu_bottom_view_url_color_light : R.color.ctx_menu_bottom_view_url_color_dark);
return ContextCompat.getColor(app, isNightMode() ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
}
@ColorInt
protected int getMainFontColor() {
OsmandApplication app = requireMyApplication();
return ContextCompat.getColor(app, isNightMode() ? R.color.main_font_dark : R.color.main_font_light);
}
@ColorInt
protected int getSecondaryColor() {
OsmandApplication app = requireMyApplication();
return ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons);
}
public void buildCollapsableRow(@NonNull View view, final Spannable title, Spannable secondaryText, boolean collapsable,
@ -892,7 +905,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0);
timeView.setTextSize(16);
AndroidUtils.setTextPrimaryColor(app, timeView, isNightMode());
timeView.setTextColor(getMainFontColor());
timeView.setText(timeText);
baseItemView.addView(timeView);
@ -942,7 +955,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
routeTypeParams.setMargins(0, dpToPx(4), 0, 0);
routeTypeView.setLayoutParams(routeTypeParams);
routeTypeView.setTextSize(16);
AndroidUtils.setTextSecondaryColor(app, routeTypeView, isNightMode());
routeTypeView.setTextColor(getSecondaryColor());
routeTypeView.setText(routeDescription);
llText.addView(routeTypeView);
@ -1012,7 +1025,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0);
timeView.setTextSize(16);
AndroidUtils.setTextPrimaryColor(app, timeView, isNightMode());
timeView.setTextColor(getMainFontColor());
timeView.setText(timeText);
baseItemView.addView(timeView);
@ -1065,7 +1078,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
});
baseView.addView(ll);
Drawable icon = getIcon(R.drawable.ic_action_pedestrian_dark, !isNightMode() ? R.color.ctx_menu_bottom_view_url_color_light : R.color.ctx_menu_bottom_view_url_color_dark);
Drawable icon = getPaintedContentIcon(R.drawable.ic_action_pedestrian_dark, getActiveColor());
ImageView iconView = new ImageView(view.getContext());
iconView.setImageDrawable(icon);
FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(24), dpToPx(24));
@ -1141,7 +1154,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0);
timeView.setTextSize(16);
AndroidUtils.setTextPrimaryColor(app, timeView, isNightMode());
timeView.setTextColor(getMainFontColor());
timeView.setText(timeText);
baseItemView.addView(timeView);
@ -1215,7 +1228,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
timeView.setLayoutParams(timeViewParams);
timeView.setPadding(0, 0, dpToPx(16), 0);
timeView.setTextSize(16);
AndroidUtils.setTextPrimaryColor(app, timeView, isNightMode());
timeView.setTextColor(getMainFontColor());
timeView.setText(timeText);
baseItemView.addView(timeView);
@ -1310,7 +1323,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
titleView.setTypeface(FontCache.getRobotoRegular(container.getContext()));
titleView.setLayoutParams(titleParams);
titleView.setTextSize(16);
AndroidUtils.setTextPrimaryColor(app, titleView, isNightMode());
titleView.setTextColor(getMainFontColor());
titleView.setText(title);
container.addView(titleView);
@ -1324,7 +1337,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
textViewDescription.setLayoutParams(descriptionParams);
textViewDescription.setTypeface(FontCache.getRobotoRegular(container.getContext()));
textViewDescription.setTextSize(14);
AndroidUtils.setTextSecondaryColor(app, textViewDescription, isNightMode());
textViewDescription.setTextColor(getSecondaryColor());
textViewDescription.setText(description);
container.addView(textViewDescription);
}
@ -1415,7 +1428,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
llHorLineParams.setMargins(dpToPx(64), 0, 0, 0);
}
horizontalLine.setLayoutParams(llHorLineParams);
horizontalLine.setBackgroundColor(app.getResources().getColor(!isNightMode() ? R.color.ctx_menu_bottom_view_divider_light : R.color.ctx_menu_bottom_view_divider_dark));
horizontalLine.setBackgroundColor(ContextCompat.getColor(app, isNightMode() ? R.color.divider_dark : R.color.divider_light));
((LinearLayout) view).addView(horizontalLine);
}
@ -1563,14 +1576,14 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
}
public View getRouteDirectionView(int position, ViewGroup parent, RouteDirectionInfo model, List<RouteDirectionInfo> directionsInfo, OnClickListener onClickListener) {
public View getRouteDirectionView(int position, RouteDirectionInfo model, List<RouteDirectionInfo> directionsInfo, OnClickListener onClickListener) {
MapActivity mapActivity = getMapActivity();
if (mapActivity == null) {
return null;
}
OsmandApplication app = mapActivity.getMyApplication();
View row = mapActivity.getLayoutInflater().inflate(R.layout.route_info_list_item, parent, false);
row.setBackgroundResource(AndroidUtils.resolveAttribute(mapActivity, android.R.attr.selectableItemBackground));
ContextThemeWrapper context = new ContextThemeWrapper(mapActivity, isNightMode() ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme);
View row = LayoutInflater.from(context).inflate(R.layout.route_info_list_item, null);
TextView label = (TextView) row.findViewById(R.id.description);
TextView distanceLabel = (TextView) row.findViewById(R.id.distance);
@ -1581,12 +1594,11 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
row.findViewById(R.id.divider).setVisibility(position == directionsInfo.size() - 1 ? View.INVISIBLE : View.VISIBLE);
TurnPathHelper.RouteDrawable drawable = new TurnPathHelper.RouteDrawable(getResources(), true);
drawable.setColorFilter(new PorterDuffColorFilter(!isNightMode() ? getResources().getColor(R.color.icon_color) : Color.WHITE, PorterDuff.Mode.SRC_ATOP));
drawable.setColorFilter(new PorterDuffColorFilter(getActiveColor(), PorterDuff.Mode.SRC_ATOP));
drawable.setRouteType(model.getTurnType());
icon.setImageDrawable(drawable);
label.setText(model.getDescriptionRoutePart());
AndroidUtils.setTextPrimaryColor(app, label, isNightMode());
if (model.distance > 0) {
distanceLabel.setText(OsmAndFormatter.getFormattedDistance(model.distance, app));
timeLabel.setText(getTimeDescription(app, model));

View file

@ -50,7 +50,6 @@ import net.osmand.plus.views.controls.DynamicListView;
import net.osmand.plus.views.controls.DynamicListViewCallbacks;
import net.osmand.plus.views.controls.StableArrayAdapter;
import net.osmand.plus.views.controls.SwipeDismissListViewTouchListener;
import net.osmand.plus.widgets.ImageViewExProgress;
import net.osmand.plus.widgets.TextViewEx;
import net.osmand.plus.widgets.TextViewExProgress;
import net.osmand.util.Algorithms;
@ -126,10 +125,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
updateTitle();
final TextViewEx sortButton = (TextViewEx) view.findViewById(R.id.text_button);
sortButton.setVisibility(View.VISIBLE);
sortButton.setTextColor(ContextCompat.getColor(app, nightMode ? R.color.color_dialog_buttons_dark : R.color.color_dialog_buttons_light));
sortButton.setOnClickListener(new View.OnClickListener() {
view.findViewById(R.id.sort_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean hasActivePoints = false;
@ -277,7 +273,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
args.putString(AddPointBottomSheetDialog.POINT_TYPE_KEY, MapRouteInfoMenu.PointType.INTERMEDIATE.name());
AddPointBottomSheetDialog fragment = new AddPointBottomSheetDialog();
fragment.setArguments(args);
fragment.setUsedOnMap(false);
fragment.setUsedOnMap(true);
fragment.show(mapActivity.getSupportFragmentManager(), AddPointBottomSheetDialog.TAG);
}
});
@ -400,18 +396,25 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
}
public void applyDayNightMode() {
final FrameLayout addButton = view.findViewById(R.id.add_button);
final TextView addButtonDescr = (TextView) view.findViewById(R.id.add_button_descr);
boolean landscapeLayout = !portrait;
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
int colorActive = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
if (!landscapeLayout) {
AndroidUtils.setBackground(app, mainView, nightMode, R.drawable.route_info_menu_bg_light, R.drawable.route_info_menu_bg_dark);
} else {
AndroidUtils.setBackground(app, mainView, nightMode, R.drawable.route_info_menu_bg_left_light, R.drawable.route_info_menu_bg_left_dark);
}
((TextView) view.findViewById(R.id.sort_button)).setTextColor(colorActive);
((TextView) view.findViewById(R.id.add_button_descr)).setTextColor(colorActive);
((TextView) view.findViewById(R.id.clear_all_button_descr)).setTextColor(colorActive);
((TextView) view.findViewById(R.id.title)).setTextColor(ContextCompat.getColor(app, nightMode ? R.color.main_font_dark : R.color.main_font_light));
FrameLayout addButton = view.findViewById(R.id.add_button);
TextView addButtonDescr = (TextView) view.findViewById(R.id.add_button_descr);
addButtonDescr.setText(R.string.shared_string_add);
addButtonDescr.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_action_plus, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light), null, null, null);
addButtonDescr.setCompoundDrawablesWithIntrinsicBounds(getPaintedContentIcon(R.drawable.ic_action_plus, colorActive), null, null, null);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
AndroidUtils.setBackground(app, addButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
AndroidUtils.setBackground(app, addButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
@ -419,14 +422,10 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
AndroidUtils.setBackground(app, addButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
}
int colorActive = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
((TextView) view.findViewById(R.id.add_button_descr)).setTextColor(colorActive);
((TextView) view.findViewById(R.id.clear_all_button_descr)).setTextColor(colorActive);
FrameLayout clearButton = view.findViewById(R.id.clear_all_button);
TextView clearButtonDescr = (TextView) view.findViewById(R.id.clear_all_button_descr);
clearButtonDescr.setText(R.string.shared_string_clear_all);
clearButtonDescr.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_action_clear_all, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light), null, null, null);
clearButtonDescr.setCompoundDrawablesWithIntrinsicBounds(getPaintedContentIcon(R.drawable.ic_action_clear_all, colorActive), null, null, null);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
AndroidUtils.setBackground(app, clearButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
@ -434,11 +433,9 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
} else {
AndroidUtils.setBackground(app, clearButtonDescr, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
}
((TextView) view.findViewById(R.id.cancel_button_descr)).setTextColor(
ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.route_info_cancel_button_color_light));
AndroidUtils.setBackground(app, view.findViewById(R.id.cancel_button), nightMode, R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
((TextView) view.findViewById(R.id.cancel_button_descr)).setTextColor(colorActive);
((TextView) view.findViewById(R.id.start_button_descr)).setText(getText(R.string.shared_string_apply));
setupRouteCalculationButtonProgressBar((ProgressBar) view.findViewById(R.id.progress_bar_button));
@ -493,7 +490,6 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
if (obj instanceof LocationPointWrapper) {
LocationPointWrapper point = (LocationPointWrapper) obj;
v = updateWaypointItemView(edit, deletedPoints, app, ctx, waypointDialogHelper, v, point, this, nightMode, flat, position);
AndroidUtils.setListItemBackground(mapActivity, v, nightMode);
}
return v;
}
@ -546,7 +542,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
}
public void setupRouteCalculationButtonProgressBar(@NonNull ProgressBar pb) {
int bgColor = ContextCompat.getColor(app, nightMode ? R.color.route_info_cancel_button_color_dark : R.color.activity_background_light);
int bgColor = ContextCompat.getColor(app, nightMode ? R.color.activity_background_dark : R.color.activity_background_light);
int progressColor = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
pb.setProgressDrawable(AndroidUtils.createProgressDrawable(bgColor, progressColor));
@ -684,6 +680,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
if (v == null || v.findViewById(R.id.info_close) == null) {
v = ctx.getLayoutInflater().inflate(R.layout.route_waypoint_item, null);
}
v.setBackgroundColor(ContextCompat.getColor(app, nightMode ? R.color.card_and_list_background_dark : R.color.card_and_list_background_light));
updatePointInfoView(app, ctx, v, point, true, nightMode, edit, false);
final ImageView move = (ImageView) v.findViewById(R.id.info_move);
@ -699,7 +696,6 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
boolean startPoint = notFlatTargets && ((TargetPoint) point.point).start;
final TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper();
boolean canRemove = !targets || !targetPointsHelper.getIntermediatePoints().isEmpty();
int iconResId = nightMode ? R.color.marker_circle_button_color_dark : R.color.ctx_menu_title_color_dark;
remove.setVisibility(View.VISIBLE);
remove.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark));
@ -735,7 +731,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
move.setVisibility(notFlatTargets ? View.VISIBLE : View.GONE);
if (notFlatTargets) {
move.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_item_move, iconResId));
move.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_item_move, R.color.description_font_and_bottom_sheet_icons));
move.setTag(new DynamicListView.DragIcon() {
@Override
public void onClick() {
@ -756,7 +752,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
final LocationPoint point = ps.getPoint();
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
if (!topBar) {
AndroidUtils.setTextPrimaryColor(activity, text, nightMode);
text.setTextColor(ContextCompat.getColor(app, nightMode ? R.color.main_font_dark : R.color.main_font_light));
}
TextView textShadow = (TextView) localView.findViewById(R.id.waypoint_text_shadow);
if (!edit) {
@ -768,6 +764,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
});
}
TextView textDist = (TextView) localView.findViewById(R.id.waypoint_dist);
textDist.setTextColor(ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light));
((ImageView) localView.findViewById(R.id.waypoint_icon)).setImageDrawable(ps.getDrawable(activity, app, nightMode));
int dist = -1;
boolean startPoint = ps.type == WaypointHelper.TARGETS && ((TargetPoint) ps.point).start;
@ -794,8 +791,8 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
String devStr = "+" + OsmAndFormatter.getFormattedDistance(ps.deviationDistance, app);
textDeviation.setText(devStr);
if (!topBar) {
int colorId = nightMode ? R.color.secondary_text_dark : R.color.secondary_text_light;
AndroidUtils.setTextSecondaryColor(activity, textDeviation, nightMode);
int colorId = R.color.description_font_and_bottom_sheet_icons;
textDeviation.setTextColor(ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons));
if (ps.deviationDirectionRight) {
textDeviation.setCompoundDrawablesWithIntrinsicBounds(
app.getUIUtilities().getIcon(R.drawable.ic_small_turn_right, colorId),
@ -829,7 +826,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
String pointDescription = "";
TextView descText = (TextView) localView.findViewById(R.id.waypoint_desc_text);
if (descText != null) {
AndroidUtils.setTextSecondaryColor(activity, descText, nightMode);
descText.setTextColor(ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons));
switch (ps.type) {
case WaypointHelper.TARGETS:
TargetPoint targetPoint = (TargetPoint) ps.point;

View file

@ -92,8 +92,23 @@ public abstract class BaseCard {
return ContextCompat.getColor(app, colorId);
}
@ColorInt
protected int getActiveColor() {
return getResolvedColor(nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
}
@ColorInt
protected int getMainFontColor() {
return getResolvedColor(nightMode ? R.color.main_font_dark : R.color.main_font_light);
}
@ColorInt
protected int getSecondaryColor() {
return getResolvedColor(R.color.description_font_and_bottom_sheet_icons);
}
protected Drawable getContentIcon(@DrawableRes int icon) {
return getColoredIcon(icon, R.color.icon_color);
return getColoredIcon(icon, R.color.description_font_and_bottom_sheet_icons);
}
protected Drawable getActiveIcon(@DrawableRes int icon) {

View file

@ -79,7 +79,7 @@ public class HomeWorkCard extends BaseCard {
args.putString(AddPointBottomSheetDialog.POINT_TYPE_KEY, home ? PointType.HOME.name() : PointType.WORK.name());
AddPointBottomSheetDialog fragment = new AddPointBottomSheetDialog();
fragment.setArguments(args);
fragment.setUsedOnMap(false);
fragment.setUsedOnMap(true);
fragment.show(mapActivity.getSupportFragmentManager(), AddPointBottomSheetDialog.TAG);
}
}

View file

@ -1,11 +1,13 @@
package net.osmand.plus.routepreparationmenu.cards;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -16,6 +18,7 @@ import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.helpers.MapMarkerDialogHelper;
import net.osmand.plus.views.DirectionDrawable;
import java.util.List;
@ -71,6 +74,11 @@ public class MapMarkersCard extends BaseCard {
List<MapMarker> markers = getMarkers();
int i = 0;
boolean showLimitExceeds = markers.size() > 4;
int mainFontColor = getMainFontColor();
int descriptionColor = getSecondaryColor();
int activeColor = getActiveColor();
ContextThemeWrapper ctx = new ContextThemeWrapper(mapActivity, !nightMode ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme);
LayoutInflater inflater = LayoutInflater.from(ctx);
for (final MapMarker marker : markers) {
@ -82,6 +90,16 @@ public class MapMarkersCard extends BaseCard {
final View remove = v.findViewById(R.id.info_close);
remove.setVisibility(View.GONE);
((TextView) v.findViewById(R.id.waypoint_dist)).setTextColor(activeColor);
((TextView) v.findViewById(R.id.waypoint_text)).setTextColor(mainFontColor);
((TextView) v.findViewById(R.id.date_group_text)).setTextColor(descriptionColor);
ImageView arrow = (ImageView) v.findViewById(R.id.direction);
Drawable arrowIcon = arrow.getDrawable();
if (arrowIcon instanceof DirectionDrawable) {
((DirectionDrawable) arrowIcon).setImage(R.drawable.ic_direction_arrow, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
}
v.setBackgroundResource(AndroidUtils.resolveAttribute(ctx, android.R.attr.selectableItemBackground));
v.setMinimumHeight(minCardHeight);
v.setOnClickListener(new View.OnClickListener() {
@ -97,7 +115,7 @@ public class MapMarkersCard extends BaseCard {
LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, AndroidUtils.dpToPx(ctx, 1f));
p.setMargins(listTextPadding, 0, 0, 0);
div.setLayoutParams(p);
AndroidUtils.setBackgroundColor(ctx, div, nightMode, R.color.dashboard_divider_light, R.color.dashboard_divider_dark);
AndroidUtils.setBackgroundColor(ctx, div, nightMode, R.color.divider_light, R.color.divider_dark);
div.setVisibility(View.VISIBLE);
root.addView(div);
}

View file

@ -22,10 +22,7 @@ import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.ContextMenuFragment;
import net.osmand.plus.base.ContextMenuFragment.MenuState;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.routepreparationmenu.RouteDetailsFragment;
import net.osmand.plus.routing.RouteCalculationResult;
import net.osmand.plus.routing.TransportRoutingHelper;
import net.osmand.plus.transport.TransportStopRoute;
@ -98,8 +95,7 @@ public class PublicTransportCard extends BaseCard {
} else {
AndroidUtils.setBackground(app, detailsButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
}
int color = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
detailsButtonDescr.setTextColor(color);
int color = getActiveColor();
detailsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -115,7 +111,7 @@ public class PublicTransportCard extends BaseCard {
FrameLayout showButton = (FrameLayout) view.findViewById(R.id.show_button);
TextView showButtonDescr = (TextView) view.findViewById(R.id.show_button_descr);
if (isCurrentRoute()) {
color = ContextCompat.getColor(app, R.color.color_white);
color = ContextCompat.getColor(app, R.color.card_and_list_background_light);
AndroidUtils.setBackground(app, showButton, nightMode, R.drawable.btn_active_light, R.drawable.btn_active_dark);
showButtonDescr.setText(R.string.shared_string_selected);
showButton.setOnClickListener(null);
@ -171,10 +167,8 @@ public class PublicTransportCard extends BaseCard {
SpannableString firstLineDesc = new SpannableString(firstLine);
Typeface typeface = FontCache.getRobotoMedium(app);
firstLineDesc.setSpan(new CustomTypefaceSpan(typeface),
firstLine.indexOf(name), firstLine.indexOf(name) + name.length(), 0);
firstLineDesc.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, nightMode ? R.color.primary_text_dark : R.color.primary_text_light)),
firstLine.indexOf(name), firstLine.indexOf(name) + name.length(), 0);
firstLineDesc.setSpan(new CustomTypefaceSpan(typeface), firstLine.indexOf(name), firstLine.indexOf(name) + name.length(), 0);
firstLineDesc.setSpan(new ForegroundColorSpan(getMainFontColor()), firstLine.indexOf(name), firstLine.indexOf(name) + name.length(), 0);
return firstLineDesc;
}
@ -199,17 +193,14 @@ public class PublicTransportCard extends BaseCard {
SpannableString secondLineDesc = new SpannableString(secondLine);
int mainFontColor = getMainFontColor();
int startTravelTime = secondLine.indexOf(travelTimeStr);
secondLineDesc.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, nightMode ? R.color.primary_text_dark : R.color.primary_text_light)),
startTravelTime, startTravelTime + travelTimeStr.length(), 0);
secondLineDesc.setSpan(new CustomTypefaceSpan(typeface),
startTravelTime, startTravelTime + travelTimeStr.length(), 0);
secondLineDesc.setSpan(new ForegroundColorSpan(mainFontColor), startTravelTime, startTravelTime + travelTimeStr.length(), 0);
secondLineDesc.setSpan(new CustomTypefaceSpan(typeface), startTravelTime, startTravelTime + travelTimeStr.length(), 0);
int startWalkTime = secondLine.lastIndexOf(walkTimeStr);
secondLineDesc.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, nightMode ? R.color.primary_text_dark : R.color.primary_text_light)),
startWalkTime, startWalkTime + walkTimeStr.length(), 0);
secondLineDesc.setSpan(new CustomTypefaceSpan(typeface),
startWalkTime, startWalkTime + walkTimeStr.length(), 0);
secondLineDesc.setSpan(new ForegroundColorSpan(mainFontColor), startWalkTime, startWalkTime + walkTimeStr.length(), 0);
secondLineDesc.setSpan(new CustomTypefaceSpan(typeface), startWalkTime, startWalkTime + walkTimeStr.length(), 0);
return secondLineDesc;
}
@ -317,16 +308,16 @@ public class PublicTransportCard extends BaseCard {
private View createWalkRouteBadge(double walkTime, @Nullable final LatLon start, @Nullable final LatLon end) {
LinearLayout bageView = (LinearLayout) getMapActivity().getLayoutInflater().inflate(R.layout.transport_stop_route_item_with_icon, null, false);
int bgColor = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
int activeColor = getActiveColor();
TextView transportStopRouteTextView = (TextView) bageView.findViewById(R.id.transport_stop_route_text);
ImageView transportStopRouteImageView = (ImageView) bageView.findViewById(R.id.transport_stop_route_icon);
transportStopRouteImageView.setImageDrawable(getColoredIcon(R.drawable.ic_action_pedestrian_dark, nightMode ? R.color.ctx_menu_bottom_view_url_color_dark : R.color.ctx_menu_bottom_view_url_color_light));
transportStopRouteImageView.setImageDrawable(getActiveIcon(R.drawable.ic_action_pedestrian_dark));
transportStopRouteTextView.setText(OsmAndFormatter.getFormattedDuration((int) walkTime, app));
GradientDrawable gradientDrawableBg = (GradientDrawable) bageView.getBackground();
gradientDrawableBg.setColor(bgColor);
transportStopRouteTextView.setTextColor(ContextCompat.getColor(app, nightMode ? R.color.ctx_menu_bottom_view_url_color_dark : R.color.ctx_menu_bottom_view_url_color_light));
gradientDrawableBg.setColor(activeColor);
transportStopRouteTextView.setTextColor(activeColor);
AndroidUtils.setBackground(app, bageView, nightMode, R.drawable.btn_border_active_light, R.drawable.btn_border_active_dark);

View file

@ -63,11 +63,8 @@ public class RouteInfoCard extends BaseCard {
private void updateHeader() {
TextView title = (TextView) view.findViewById(R.id.info_type_title);
TextView details = (TextView) view.findViewById(R.id.info_type_details);
String name = getInfoType();
title.setText(name);
details.setTextColor(ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light));
AndroidUtils.setTextPrimaryColor(app, title, nightMode);
}
private String getInfoType() {
@ -97,7 +94,7 @@ public class RouteInfoCard extends BaseCard {
Spannable text = getSpanLegend(name, segment);
TextView legend = new TextView(app);
AndroidUtils.setTextPrimaryColor(app, legend, nightMode);
legend.setTextColor(getMainFontColor());
legend.setTextSize(15);
legend.setGravity(Gravity.CENTER_VERTICAL);
legend.setCompoundDrawablePadding(AndroidUtils.dpToPx(app, 16));
@ -137,8 +134,9 @@ public class RouteInfoCard extends BaseCard {
title = Algorithms.capitalizeFirstLetter(title);
SpannableStringBuilder spannable = new SpannableStringBuilder(title);
spannable.append(": ");
spannable.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
int startIndex = spannable.length();
spannable.append(formattedDistance);
spannable.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return spannable;
}

View file

@ -1,7 +1,6 @@
package net.osmand.plus.routepreparationmenu.cards;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
@ -67,32 +66,26 @@ public class SimpleRouteCard extends BaseCard {
// infoDistanceView.setVisibility(View.GONE);
// infoDurationView.setVisibility(View.GONE);
// } else {
infoIcon.setImageDrawable(getColoredIcon(R.drawable.ic_action_route_distance, R.color.route_info_unchecked_mode_icon_color));
infoIcon.setVisibility(View.VISIBLE);
durationIcon.setImageDrawable(getColoredIcon(R.drawable.ic_action_time_span, R.color.route_info_unchecked_mode_icon_color));
durationIcon.setVisibility(View.VISIBLE);
infoDistanceView.setVisibility(View.VISIBLE);
infoDurationView.setVisibility(View.VISIBLE);
infoIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_route_distance));
infoIcon.setVisibility(View.VISIBLE);
durationIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_time_span));
durationIcon.setVisibility(View.VISIBLE);
infoDistanceView.setVisibility(View.VISIBLE);
infoDurationView.setVisibility(View.VISIBLE);
// }
// if (directionInfo >= 0 && routingHelper.getRouteDirections() != null
// && directionInfo < routingHelper.getRouteDirections().size()) {
// RouteDirectionInfo ri = routingHelper.getRouteDirections().get(directionInfo);
// } else {
TextView distanceText = (TextView) view.findViewById(R.id.DistanceText);
TextView distanceTitle = (TextView) view.findViewById(R.id.DistanceTitle);
TextView durationText = (TextView) view.findViewById(R.id.DurationText);
TextView durationTitle = (TextView) view.findViewById(R.id.DurationTitle);
TextView distanceText = (TextView) view.findViewById(R.id.DistanceText);
TextView distanceTitle = (TextView) view.findViewById(R.id.DistanceTitle);
TextView durationText = (TextView) view.findViewById(R.id.DurationText);
TextView durationTitle = (TextView) view.findViewById(R.id.DurationTitle);
distanceText.setText(OsmAndFormatter.getFormattedDistance(routingHelper.getLeftDistance(), app));
distanceText.setText(OsmAndFormatter.getFormattedDistance(routingHelper.getLeftDistance(), app));
durationText.setText(OsmAndFormatter.getFormattedDuration(routingHelper.getLeftTime(), app));
durationTitle.setText(app.getString(R.string.arrive_at_time, OsmAndFormatter.getFormattedTime(routingHelper.getLeftTime(), true)));
durationText.setText(OsmAndFormatter.getFormattedDuration(routingHelper.getLeftTime(), app));
durationTitle.setText(app.getString(R.string.arrive_at_time, OsmAndFormatter.getFormattedTime(routingHelper.getLeftTime(), true)));
AndroidUtils.setTextPrimaryColor(app, distanceText, nightMode);
AndroidUtils.setTextSecondaryColor(app, distanceTitle, nightMode);
AndroidUtils.setTextPrimaryColor(app, durationText, nightMode);
AndroidUtils.setTextSecondaryColor(app, durationTitle, nightMode);
// }
view.findViewById(R.id.details_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -103,7 +96,6 @@ public class SimpleRouteCard extends BaseCard {
}
});
view.setBackgroundColor(ContextCompat.getColor(mapActivity, nightMode ? R.color.route_info_bg_dark : R.color.route_info_bg_light));
FrameLayout detailsButton = view.findViewById(R.id.details_button);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
AndroidUtils.setBackground(app, detailsButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
@ -111,13 +103,6 @@ public class SimpleRouteCard extends BaseCard {
} else {
AndroidUtils.setBackground(app, view.findViewById(R.id.details_button_descr), nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
}
int color = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
AndroidUtils.setBackground(app, view.findViewById(R.id.dividerToDropDown), nightMode, R.color.divider_light, R.color.divider_dark);
AndroidUtils.setBackground(app, view.findViewById(R.id.info_divider), nightMode, R.color.activity_background_light, R.color.route_info_cancel_button_color_dark);
AndroidUtils.setBackground(app, view.findViewById(R.id.route_info_details_card), nightMode, R.color.activity_background_light, R.color.route_info_cancel_button_color_dark);
AndroidUtils.setBackground(app, view.findViewById(R.id.RouteInfoControls), nightMode, R.color.route_info_bg_light, R.color.route_info_bg_dark);
((TextView) view.findViewById(R.id.details_button_descr)).setTextColor(color);
buildHeader(view);
}

View file

@ -1,6 +1,7 @@
package net.osmand.plus.routepreparationmenu.cards;
import android.annotation.SuppressLint;
import android.support.v4.content.ContextCompat;
import android.support.v7.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
@ -82,6 +83,10 @@ public class TracksCard extends BaseCard {
int listContentPadding = app.getResources().getDimensionPixelSize(R.dimen.list_content_padding);
int listTextPadding = app.getResources().getDimensionPixelSize(R.dimen.route_info_list_text_padding);
int mainFontColor = getMainFontColor();
int descriptionColor = getSecondaryColor();
int dividerColor = ContextCompat.getColor(mapActivity, nightMode ? R.color.divider_dark : R.color.divider_light);
int i = 0;
boolean showLimitExceeds = list.size() > 4;
ContextThemeWrapper ctx = new ContextThemeWrapper(mapActivity, !nightMode ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme);
@ -96,11 +101,17 @@ public class TracksCard extends BaseCard {
View div = v.findViewById(R.id.divider);
LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(div.getLayoutParams().width, div.getLayoutParams().height);
p.setMargins(listTextPadding, 0, 0, 0);
div.setBackgroundColor(dividerColor);
div.setLayoutParams(p);
div.setVisibility(i == 0 ? View.GONE : View.VISIBLE);
((TextView) v.findViewById(R.id.name)).setTextColor(mainFontColor);
((TextView) v.findViewById(R.id.distance)).setTextColor(descriptionColor);
((TextView) v.findViewById(R.id.points_count)).setTextColor(descriptionColor);
((TextView) v.findViewById(R.id.time)).setTextColor(descriptionColor);
ImageView img = (ImageView) v.findViewById(R.id.icon);
img.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_polygom_dark, R.color.color_distance));
img.setImageDrawable(getActiveIcon(R.drawable.ic_action_polygom_dark));
img.setVisibility(View.VISIBLE);
LinearLayout container = (LinearLayout) v.findViewById(R.id.container);
container.setMinimumHeight(minCardHeight);
@ -137,4 +148,4 @@ public class TracksCard extends BaseCard {
((TextView) view.findViewById(R.id.gpx_card_title)).setText(
String.format("%s (%d)", app.getString(R.string.tracks_on_map), list.size()));
}
}
}

View file

@ -49,7 +49,7 @@ public class WarningCard extends BaseCard {
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
ds.setColor(ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light));
ds.setColor(getActiveColor());
ds.setUnderlineText(false);
}
@ -72,7 +72,7 @@ public class WarningCard extends BaseCard {
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
ds.setColor(ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light));
ds.setColor(getActiveColor());
ds.setUnderlineText(false);
}
@ -96,6 +96,7 @@ public class WarningCard extends BaseCard {
args.putString(AddPointBottomSheetDialog.POINT_TYPE_KEY, PointType.INTERMEDIATE.name());
AddPointBottomSheetDialog fragment = new AddPointBottomSheetDialog();
fragment.setArguments(args);
fragment.setUsedOnMap(true);
fragment.show(mapActivity.getSupportFragmentManager(), AddPointBottomSheetDialog.TAG);
}
}