Merge pull request #6543 from osmandapp/RoutePreparation
Route preparation improvements
This commit is contained in:
commit
7ab19369a3
24 changed files with 238 additions and 106 deletions
|
@ -37,7 +37,7 @@ public class TransportRoutePlanner {
|
||||||
for(TransportRouteSegment s : endStops) {
|
for(TransportRouteSegment s : endStops) {
|
||||||
endSegments.put(s.getId(), s);
|
endSegments.put(s.getId(), s);
|
||||||
}
|
}
|
||||||
PriorityQueue<TransportRouteSegment> queue = new PriorityQueue<TransportRouteSegment>(new SegmentsComparator(ctx));
|
PriorityQueue<TransportRouteSegment> queue = new PriorityQueue<TransportRouteSegment>(startStops.size(), new SegmentsComparator(ctx));
|
||||||
for(TransportRouteSegment r : startStops){
|
for(TransportRouteSegment r : startStops){
|
||||||
r.walkDist = (float) MapUtils.getDistance(r.getLocation(), start);
|
r.walkDist = (float) MapUtils.getDistance(r.getLocation(), start);
|
||||||
r.distFromStart = r.walkDist / ctx.cfg.walkSpeed;
|
r.distFromStart = r.walkDist / ctx.cfg.walkSpeed;
|
||||||
|
|
22
OsmAnd/res/drawable/btn_border_dark.xml
Normal file
22
OsmAnd/res/drawable/btn_border_dark.xml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<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" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_enabled="false">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/activity_background_dark" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@null" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/divider_dark" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
22
OsmAnd/res/drawable/btn_border_light.xml
Normal file
22
OsmAnd/res/drawable/btn_border_light.xml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_enabled="false">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/activity_background_light" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@null" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/divider_light" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
10
OsmAnd/res/drawable/btn_border_pressed_trans_dark.xml
Normal file
10
OsmAnd/res/drawable/btn_border_pressed_trans_dark.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<solid android:color="@color/active_buttons_and_links_trans_dark" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_dark" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
10
OsmAnd/res/drawable/btn_border_pressed_trans_light.xml
Normal file
10
OsmAnd/res/drawable/btn_border_pressed_trans_light.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<solid android:color="@color/active_buttons_and_links_trans_light" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
22
OsmAnd/res/drawable/btn_border_rounded_dark.xml
Normal file
22
OsmAnd/res/drawable/btn_border_rounded_dark.xml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<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" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_enabled="false">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/activity_background_dark" />
|
||||||
|
<corners android:radius="18dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@null" />
|
||||||
|
<corners android:radius="18dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/divider_dark" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
22
OsmAnd/res/drawable/btn_border_rounded_light.xml
Normal file
22
OsmAnd/res/drawable/btn_border_rounded_light.xml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="18dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_enabled="false">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/activity_background_light" />
|
||||||
|
<corners android:radius="18dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@null" />
|
||||||
|
<corners android:radius="18dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/divider_light" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
|
@ -3,7 +3,8 @@
|
||||||
<item android:state_pressed="true">
|
<item android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="4dp" />
|
<corners android:radius="4dp" />
|
||||||
<stroke android:width="1dp" android:color="@color/route_info_go_btn_inking_dark" />
|
<solid android:color="@color/active_buttons_and_links_trans_dark" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_dark" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_enabled="false">
|
<item android:state_enabled="false">
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<item android:state_pressed="true">
|
<item android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="4dp" />
|
<corners android:radius="4dp" />
|
||||||
|
<solid android:color="@color/active_buttons_and_links_trans_light" />
|
||||||
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<item android:state_pressed="true">
|
<item android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="18dp" />
|
<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/route_info_go_btn_inking_dark" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<item android:state_pressed="true">
|
<item android:state_pressed="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="18dp" />
|
<corners android:radius="18dp" />
|
||||||
|
<solid android:color="@color/active_buttons_and_links_trans_light" />
|
||||||
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
9
OsmAnd/res/drawable/btn_pressed_trans_dark.xml
Normal file
9
OsmAnd/res/drawable/btn_pressed_trans_dark.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<solid android:color="@color/active_buttons_and_links_trans_dark" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
10
OsmAnd/res/drawable/btn_pressed_trans_light.xml
Normal file
10
OsmAnd/res/drawable/btn_pressed_trans_light.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
<solid android:color="@color/active_buttons_and_links_trans_light" />
|
||||||
|
<stroke android:width="1dp" android:color="@color/active_buttons_and_links_light" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
|
@ -24,6 +24,6 @@
|
||||||
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
||||||
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
tools:background="@drawable/btn_border_trans_light" />
|
tools:background="@drawable/btn_border_light" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -145,7 +145,7 @@
|
||||||
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
||||||
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
|
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
|
||||||
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
||||||
tools:background="@drawable/btn_border_trans_rounded_dark">
|
tools:background="@drawable/btn_border_rounded_dark">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/from_button_container"
|
android:id="@+id/from_button_container"
|
||||||
|
@ -259,7 +259,7 @@
|
||||||
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
||||||
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
|
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
|
||||||
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
||||||
tools:background="@drawable/btn_border_trans_rounded_dark">
|
tools:background="@drawable/btn_border_rounded_dark">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/via_button_container"
|
android:id="@+id/via_button_container"
|
||||||
|
@ -370,7 +370,7 @@
|
||||||
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
|
||||||
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
|
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
|
||||||
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
|
||||||
tools:background="@drawable/btn_border_trans_rounded_dark">
|
tools:background="@drawable/btn_border_rounded_dark">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/to_button_container"
|
android:id="@+id/to_button_container"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
tools:background="@drawable/btn_border_trans_dark">
|
tools:background="@drawable/btn_border_dark">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/route_option_image_view"
|
android:id="@+id/route_option_image_view"
|
||||||
|
@ -56,6 +56,6 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
tools:background="@drawable/btn_border_trans_dark" />
|
tools:background="@drawable/btn_border_dark" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,74 +1,68 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/route_option_button"
|
android:id="@+id/route_option_button"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
tools:background="@drawable/btn_border_trans_dark">
|
android:visibility="visible"
|
||||||
|
tools:background="@drawable/btn_border_dark">
|
||||||
|
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
android:id="@+id/removable_option"
|
android:id="@+id/route_removable_option_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="visible">
|
android:gravity="start|center_vertical"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp">
|
||||||
|
|
||||||
<LinearLayout
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
android:id="@+id/route_removable_option_container"
|
android:id="@+id/route_removable_option_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="start|center_vertical"
|
android:layout_gravity="center"
|
||||||
android:paddingLeft="8dp"
|
android:ellipsize="end"
|
||||||
android:paddingRight="8dp">
|
android:gravity="center"
|
||||||
|
android:letterSpacing="@dimen/text_button_letter_spacing"
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
android:maxLines="1"
|
||||||
android:id="@+id/route_removable_option_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:gravity="center"
|
|
||||||
android:letterSpacing="@dimen/text_button_letter_spacing"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:text="@string/routing_attr_avoid_motorway_name"
|
|
||||||
android:textSize="@dimen/default_sub_text_size"
|
|
||||||
osmand:typeface="@string/font_roboto_medium"
|
|
||||||
tools:ignore="UnusedAttribute"
|
|
||||||
tools:textColor="?attr/wikivoyage_active_color" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/title_divider"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:background="@color/description_font_and_bottom_sheet_icons" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/removable_option_icon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="end|center_vertical"
|
|
||||||
android:layout_marginLeft="1dp"
|
|
||||||
android:layout_marginRight="1dp"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
android:paddingLeft="@dimen/route_info_icon_vertical_padding"
|
|
||||||
android:paddingRight="@dimen/route_info_icon_vertical_padding"
|
|
||||||
android:paddingTop="3dp"
|
android:paddingTop="3dp"
|
||||||
tools:src="@drawable/ic_action_remove_dark" />
|
android:paddingBottom="3dp"
|
||||||
|
android:text="@string/routing_attr_avoid_motorway_name"
|
||||||
|
android:textSize="@dimen/default_sub_text_size"
|
||||||
|
osmand:typeface="@string/font_roboto_medium"
|
||||||
|
tools:ignore="UnusedAttribute"
|
||||||
|
tools:textColor="?attr/wikivoyage_active_color" />
|
||||||
|
|
||||||
<View
|
</LinearLayout>
|
||||||
android:id="@+id/options_divider_end"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:layout_gravity="end|center_vertical" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
<View
|
||||||
|
android:id="@+id/title_divider"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:background="@color/description_font_and_bottom_sheet_icons" />
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/removable_option_icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end|center_vertical"
|
||||||
|
android:layout_marginLeft="1dp"
|
||||||
|
android:layout_marginRight="1dp"
|
||||||
|
android:paddingLeft="@dimen/route_info_icon_vertical_padding"
|
||||||
|
android:paddingTop="3dp"
|
||||||
|
android:paddingRight="@dimen/route_info_icon_vertical_padding"
|
||||||
|
android:paddingBottom="3dp"
|
||||||
|
android:contentDescription="@string/shared_string_remove"
|
||||||
|
tools:src="@drawable/ic_action_remove_dark" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/options_divider_end"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_gravity="end|center_vertical" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
|
@ -127,9 +127,9 @@ public class AppModeDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateButtonState2(final OsmandApplication ctx, final List<ApplicationMode> visible,
|
public static void updateButtonStateForRoute(final OsmandApplication ctx, final List<ApplicationMode> visible,
|
||||||
final Set<ApplicationMode> selected, final View.OnClickListener onClickListener, final View[] buttons,
|
final Set<ApplicationMode> selected, final View.OnClickListener onClickListener, final View[] buttons,
|
||||||
int i, final boolean singleChoice, final boolean useMapTheme, final boolean nightMode) {
|
int i, final boolean singleChoice, final boolean useMapTheme, final boolean nightMode) {
|
||||||
if (buttons[i] != null) {
|
if (buttons[i] != null) {
|
||||||
View tb = buttons[i];
|
View tb = buttons[i];
|
||||||
final ApplicationMode mode = visible.get(i);
|
final ApplicationMode mode = visible.get(i);
|
||||||
|
@ -143,11 +143,11 @@ public class AppModeDialog {
|
||||||
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_checked)));
|
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_checked)));
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(ctx, iv, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
||||||
}
|
}
|
||||||
AndroidUtils.setBackground(ctx, iv, nightMode, R.drawable.btn_border_trans_light, R.drawable.ripple_dark);
|
|
||||||
} else {
|
} else {
|
||||||
if (useMapTheme) {
|
if (useMapTheme) {
|
||||||
Drawable drawable = ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light);
|
Drawable drawable = ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), nightMode ? R.color.route_info_control_icon_color_dark : R.color.route_info_control_icon_color_light);
|
||||||
|
@ -157,14 +157,14 @@ public class AppModeDialog {
|
||||||
}
|
}
|
||||||
iv.setImageDrawable(drawable);
|
iv.setImageDrawable(drawable);
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(ctx, iv, nightMode, R.drawable.btn_border_pressed_light, R.drawable.btn_border_pressed_dark);
|
||||||
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.btn_border_pressed_light, R.drawable.btn_border_pressed_dark);
|
AndroidUtils.setBackground(ctx, selection, nightMode, R.drawable.btn_border_pressed_trans_light, R.drawable.btn_border_pressed_trans_dark);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iv.setImageDrawable(ctx.getUIUtilities().getThemedIcon(mode.getSmallIconDark()));
|
iv.setImageDrawable(ctx.getUIUtilities().getThemedIcon(mode.getSmallIconDark()));
|
||||||
}
|
}
|
||||||
AndroidUtils.setBackground(ctx, iv, nightMode, R.drawable.btn_border_pressed_light, R.drawable.btn_border_pressed_dark);
|
|
||||||
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_unchecked)));
|
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_unchecked)));
|
||||||
}
|
}
|
||||||
tb.setOnClickListener(new View.OnClickListener() {
|
tb.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -188,7 +188,7 @@ public class AppModeDialog {
|
||||||
onClickListener.onClick(null);
|
onClickListener.onClick(null);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < visible.size(); i++) {
|
for (int i = 0; i < visible.size(); i++) {
|
||||||
updateButtonState2(ctx, visible, selected, onClickListener, buttons, i, singleChoice, useMapTheme, nightMode);
|
updateButtonStateForRoute(ctx, visible, selected, onClickListener, buttons, i, singleChoice, useMapTheme, nightMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -124,9 +124,11 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
|
||||||
buttonDescription.setTextColor(getResolvedColor(nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light));
|
buttonDescription.setTextColor(getResolvedColor(nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light));
|
||||||
|
|
||||||
FrameLayout buttonContainer = buttonView.findViewById(R.id.button_container);
|
FrameLayout buttonContainer = buttonView.findViewById(R.id.button_container);
|
||||||
AndroidUtils.setBackground(app, buttonContainer, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, buttonContainer, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
AndroidUtils.setBackground(app, buttonDescription, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, buttonDescription, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
|
} else {
|
||||||
|
AndroidUtils.setBackground(app, buttonContainer, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonContainer.setOnClickListener(new View.OnClickListener() {
|
buttonContainer.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
@ -533,7 +533,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
buttons[k++] = toggle;
|
buttons[k++] = toggle;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < buttons.length; i++) {
|
for (int i = 0; i < buttons.length; i++) {
|
||||||
AppModeDialog.updateButtonState2((OsmandApplication) mapActivity.getApplication(), values, selected, listener, buttons, i, true, true, nightMode);
|
AppModeDialog.updateButtonStateForRoute((OsmandApplication) mapActivity.getApplication(), values, selected, listener, buttons, i, true, true, nightMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,7 +671,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
updateOptionsButtons();
|
updateOptionsButtons();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AndroidUtils.setBackground(app, container, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
AndroidUtils.setBackground(app, container, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
item.addView(container, newLp);
|
item.addView(container, newLp);
|
||||||
optionsContainer.addView(item, lp);
|
optionsContainer.addView(item, lp);
|
||||||
}
|
}
|
||||||
|
@ -685,7 +685,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
updateOptionsButtons();
|
updateOptionsButtons();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AndroidUtils.setBackground(app, container, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
AndroidUtils.setBackground(app, container, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
item.addView(container, newLp);
|
item.addView(container, newLp);
|
||||||
optionsContainer.addView(item, lp);
|
optionsContainer.addView(item, lp);
|
||||||
}
|
}
|
||||||
|
@ -828,9 +828,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
final int colorActive = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
|
final int colorActive = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
|
||||||
final int colorDisabled = ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons);
|
final int colorDisabled = ContextCompat.getColor(app, R.color.description_font_and_bottom_sheet_icons);
|
||||||
|
|
||||||
AndroidUtils.setBackground(app, item, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
AndroidUtils.setBackground(app, item.findViewById(R.id.route_option_container), nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, item.findViewById(R.id.route_option_container), nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
|
AndroidUtils.setBackground(app, item, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
|
} else {
|
||||||
|
AndroidUtils.setBackground(app, item, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
Drawable itemDrawable = null;
|
Drawable itemDrawable = null;
|
||||||
|
@ -872,7 +874,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
AndroidUtils.setForeground(app, container, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setForeground(app, container, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setForeground(app, container, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setForeground(app, container, nightMode, R.drawable.btn_pressed_trans_light, R.drawable.btn_pressed_trans_dark);
|
||||||
}
|
}
|
||||||
AndroidUtils.setBackground(app, container.findViewById(R.id.options_divider_end), nightMode, R.color.divider_light, R.color.divider_dark);
|
AndroidUtils.setBackground(app, container.findViewById(R.id.options_divider_end), nightMode, R.color.divider_light, R.color.divider_dark);
|
||||||
AndroidUtils.setBackground(app, routeOptionImageView, nightMode, R.drawable.route_info_trans_gradient_light, R.drawable.route_info_trans_gradient_dark);
|
AndroidUtils.setBackground(app, routeOptionImageView, nightMode, R.drawable.route_info_trans_gradient_light, R.drawable.route_info_trans_gradient_dark);
|
||||||
|
@ -939,11 +941,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
viaIcon.setImageDrawable(getIconOrig(R.drawable.list_intermediate));
|
viaIcon.setImageDrawable(getIconOrig(R.drawable.list_intermediate));
|
||||||
LinearLayout viaButtonContainer = (LinearLayout) mainView.findViewById(R.id.via_button_container);
|
LinearLayout viaButtonContainer = (LinearLayout) mainView.findViewById(R.id.via_button_container);
|
||||||
|
|
||||||
AndroidUtils.setBackground(app, viaButton, nightMode, R.drawable.btn_border_trans_rounded_light, R.drawable.btn_border_trans_rounded_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, viaButton, nightMode, R.drawable.btn_border_rounded_light, R.drawable.btn_border_rounded_dark);
|
||||||
AndroidUtils.setBackground(app, viaButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
AndroidUtils.setBackground(app, viaButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, viaButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
AndroidUtils.setBackground(app, viaButtonContainer, nightMode, R.drawable.btn_border_trans_rounded_light, R.drawable.btn_border_trans_rounded_dark);
|
||||||
}
|
}
|
||||||
ImageView viaButtonImageView = (ImageView) mainView.findViewById(R.id.via_button_image_view);
|
ImageView viaButtonImageView = (ImageView) mainView.findViewById(R.id.via_button_image_view);
|
||||||
|
|
||||||
|
@ -969,11 +971,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
final FrameLayout toButton = (FrameLayout) mainView.findViewById(R.id.to_button);
|
final FrameLayout toButton = (FrameLayout) mainView.findViewById(R.id.to_button);
|
||||||
final LinearLayout toButtonContainer = (LinearLayout) mainView.findViewById(R.id.to_button_container);
|
final LinearLayout toButtonContainer = (LinearLayout) mainView.findViewById(R.id.to_button_container);
|
||||||
|
|
||||||
AndroidUtils.setBackground(app, toButton, nightMode, R.drawable.btn_border_trans_rounded_light, R.drawable.btn_border_trans_rounded_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, toButton, nightMode, R.drawable.btn_border_rounded_light, R.drawable.btn_border_rounded_dark);
|
||||||
AndroidUtils.setBackground(app, toButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
AndroidUtils.setBackground(app, toButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, toButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
AndroidUtils.setBackground(app, toButtonContainer, nightMode, R.drawable.btn_border_trans_rounded_light, R.drawable.btn_border_trans_rounded_dark);
|
||||||
}
|
}
|
||||||
ImageView toButtonImageView = (ImageView) mainView.findViewById(R.id.to_button_image_view);
|
ImageView toButtonImageView = (ImageView) mainView.findViewById(R.id.to_button_image_view);
|
||||||
|
|
||||||
|
@ -1013,11 +1015,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
FrameLayout fromButton = (FrameLayout) mainView.findViewById(R.id.from_button);
|
FrameLayout fromButton = (FrameLayout) mainView.findViewById(R.id.from_button);
|
||||||
final LinearLayout fromButtonContainer = (LinearLayout) mainView.findViewById(R.id.from_button_container);
|
final LinearLayout fromButtonContainer = (LinearLayout) mainView.findViewById(R.id.from_button_container);
|
||||||
|
|
||||||
AndroidUtils.setBackground(app, fromButton, nightMode, R.drawable.btn_border_trans_rounded_light, R.drawable.btn_border_trans_rounded_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, fromButton, nightMode, R.drawable.btn_border_rounded_light, R.drawable.btn_border_rounded_dark);
|
||||||
AndroidUtils.setBackground(app, fromButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
AndroidUtils.setBackground(app, fromButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, fromButtonContainer, nightMode, R.drawable.ripple_rounded_light, R.drawable.ripple_rounded_dark);
|
AndroidUtils.setBackground(app, fromButtonContainer, nightMode, R.drawable.btn_border_trans_rounded_light, R.drawable.btn_border_trans_rounded_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageView swapDirectionView = (ImageView) mainView.findViewById(R.id.from_button_image_view);
|
ImageView swapDirectionView = (ImageView) mainView.findViewById(R.id.from_button_image_view);
|
||||||
|
@ -1448,7 +1450,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
@Override
|
@Override
|
||||||
public long getItemId(int position) {
|
public long getItemId(int position) {
|
||||||
RouteSpinnerRow row = getItem(position);
|
RouteSpinnerRow row = getItem(position);
|
||||||
return row.id;
|
return row != null ? row.id : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1460,7 +1462,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
View getRowItemView(int position, View convertView, ViewGroup parent) {
|
View getRowItemView(int position, View convertView, ViewGroup parent) {
|
||||||
TextView label = (TextView) super.getView(position, convertView, parent);
|
TextView label = (TextView) super.getView(position, convertView, parent);
|
||||||
RouteSpinnerRow row = getItem(position);
|
RouteSpinnerRow row = getItem(position);
|
||||||
label.setText(row.text);
|
label.setText(row != null ? row.text : "");
|
||||||
label.setTextColor(!isLight() ?
|
label.setTextColor(!isLight() ?
|
||||||
ContextCompat.getColorStateList(mapActivity, android.R.color.primary_text_dark) : ContextCompat.getColorStateList(mapActivity, android.R.color.primary_text_light));
|
ContextCompat.getColorStateList(mapActivity, android.R.color.primary_text_dark) : ContextCompat.getColorStateList(mapActivity, android.R.color.primary_text_light));
|
||||||
return label;
|
return label;
|
||||||
|
@ -1471,8 +1473,8 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
||||||
TextView label = (TextView) super.getDropDownView(position, convertView, parent);
|
TextView label = (TextView) super.getDropDownView(position, convertView, parent);
|
||||||
|
|
||||||
RouteSpinnerRow row = getItem(position);
|
RouteSpinnerRow row = getItem(position);
|
||||||
label.setText(row.text);
|
label.setText(row != null ? row.text : "");
|
||||||
if (id != SPINNER_HINT_ID) {
|
if (row != null && id != SPINNER_HINT_ID) {
|
||||||
Drawable icon = null;
|
Drawable icon = null;
|
||||||
if (row.icon != null) {
|
if (row.icon != null) {
|
||||||
icon = row.icon;
|
icon = row.icon;
|
||||||
|
|
|
@ -227,7 +227,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
List<Object> activeObjects;
|
List<Object> activeObjects;
|
||||||
if ((getMyApplication().getRoutingHelper().isRoutePlanningMode() || getMyApplication().getRoutingHelper().isFollowingMode())
|
if ((mapActivity.getRoutingHelper().isRoutePlanningMode() || mapActivity.getRoutingHelper().isFollowingMode())
|
||||||
&& item != null
|
&& item != null
|
||||||
&& ((activeObjects = stableAdapter.getActiveObjects()).isEmpty() || isContainsOnlyStart(activeObjects))) {
|
&& ((activeObjects = stableAdapter.getActiveObjects()).isEmpty() || isContainsOnlyStart(activeObjects))) {
|
||||||
return mapActivity.getResources().getString(R.string.cancel_navigation);
|
return mapActivity.getResources().getString(R.string.cancel_navigation);
|
||||||
|
@ -247,7 +247,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
List<Object> activeObjects = stableAdapter.getActiveObjects();
|
List<Object> activeObjects = stableAdapter.getActiveObjects();
|
||||||
if (activeObjects.isEmpty() || isContainsOnlyStart(activeObjects)) {
|
if (activeObjects.isEmpty() || isContainsOnlyStart(activeObjects)) {
|
||||||
mapActivity.getMapActions().stopNavigationWithoutConfirm();
|
mapActivity.getMapActions().stopNavigationWithoutConfirm();
|
||||||
getMyApplication().getTargetPointsHelper().removeAllWayPoints(false, true);
|
mapActivity.getMyApplication().getTargetPointsHelper().removeAllWayPoints(false, true);
|
||||||
mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().hide();
|
mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,12 +410,12 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
}
|
}
|
||||||
|
|
||||||
addButtonDescr.setText(R.string.shared_string_add);
|
addButtonDescr.setText(R.string.shared_string_add);
|
||||||
addButtonDescr.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_action_plus, R.color.active_buttons_and_links_light), null, null, null);
|
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);
|
||||||
AndroidUtils.setBackground(app, addButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
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);
|
AndroidUtils.setBackground(app, addButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, addButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
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);
|
int colorActive = ContextCompat.getColor(mapActivity, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
|
||||||
|
@ -425,13 +425,13 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
FrameLayout clearButton = view.findViewById(R.id.clear_all_button);
|
FrameLayout clearButton = view.findViewById(R.id.clear_all_button);
|
||||||
TextView clearButtonDescr = (TextView) view.findViewById(R.id.clear_all_button_descr);
|
TextView clearButtonDescr = (TextView) view.findViewById(R.id.clear_all_button_descr);
|
||||||
clearButtonDescr.setText(R.string.shared_string_clear_all);
|
clearButtonDescr.setText(R.string.shared_string_clear_all);
|
||||||
clearButtonDescr.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_action_clear_all, R.color.active_buttons_and_links_light), null, null, null);
|
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);
|
||||||
AndroidUtils.setBackground(app, clearButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, clearButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
AndroidUtils.setBackground(app, clearButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, clearButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, clearButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, clearButtonDescr, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidUtils.setBackground(app, view.findViewById(R.id.dividerControlButtons), nightMode,
|
AndroidUtils.setBackground(app, view.findViewById(R.id.dividerControlButtons), nightMode,
|
||||||
|
@ -468,7 +468,9 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
|
||||||
if (listAdapter.getItem(item) instanceof WaypointHelper.LocationPointWrapper) {
|
if (listAdapter.getItem(item) instanceof WaypointHelper.LocationPointWrapper) {
|
||||||
WaypointHelper.LocationPointWrapper ps = (WaypointHelper.LocationPointWrapper) listAdapter.getItem(item);
|
WaypointHelper.LocationPointWrapper ps = (WaypointHelper.LocationPointWrapper) listAdapter.getItem(item);
|
||||||
showOnMap(app, ctx, ps.getPoint(), false);
|
if (ps != null) {
|
||||||
|
showOnMap(app, ctx, ps.getPoint(), false);
|
||||||
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -552,7 +554,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
|
|
||||||
public void setupRouteCalculationButtonProgressBar(@NonNull ProgressBar pb) {
|
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.route_info_cancel_button_color_dark : R.color.activity_background_light);
|
||||||
int progressColor = ContextCompat.getColor(getMyApplication(), nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_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));
|
pb.setProgressDrawable(AndroidUtils.createProgressDrawable(bgColor, progressColor));
|
||||||
}
|
}
|
||||||
|
@ -565,7 +567,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
||||||
private void updateListAdapter() {
|
private void updateListAdapter() {
|
||||||
List<WaypointHelper.LocationPointWrapper> deletedPoints = new ArrayList<>();
|
List<WaypointHelper.LocationPointWrapper> deletedPoints = new ArrayList<>();
|
||||||
listView.setEmptyView(null);
|
listView.setEmptyView(null);
|
||||||
StableArrayAdapter listAdapter = getWaypointsDrawerAdapter(true, deletedPoints, mapActivity, running, false, false);
|
StableArrayAdapter listAdapter = getWaypointsDrawerAdapter(true, deletedPoints, mapActivity, running, false, nightMode);
|
||||||
AdapterView.OnItemClickListener listener = getDrawerItemClickListener(mapActivity, running, listAdapter);
|
AdapterView.OnItemClickListener listener = getDrawerItemClickListener(mapActivity, running, listAdapter);
|
||||||
setDynamicListItems(listView, listAdapter);
|
setDynamicListItems(listView, listAdapter);
|
||||||
updateListAdapter(listAdapter, listener);
|
updateListAdapter(listAdapter, listener);
|
||||||
|
|
|
@ -27,6 +27,7 @@ public abstract class BaseRouteCard {
|
||||||
public BaseRouteCard(MapActivity mapActivity) {
|
public BaseRouteCard(MapActivity mapActivity) {
|
||||||
this.mapActivity = mapActivity;
|
this.mapActivity = mapActivity;
|
||||||
this.app = mapActivity.getMyApplication();
|
this.app = mapActivity.getMyApplication();
|
||||||
|
nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract int getCardLayoutId();
|
public abstract int getCardLayoutId();
|
||||||
|
|
|
@ -96,11 +96,11 @@ public class PublicTransportCard extends BaseRouteCard {
|
||||||
FrameLayout detailsButton = (FrameLayout) view.findViewById(R.id.details_button);
|
FrameLayout detailsButton = (FrameLayout) view.findViewById(R.id.details_button);
|
||||||
TextView detailsButtonDescr = (TextView) view.findViewById(R.id.details_button_descr);
|
TextView detailsButtonDescr = (TextView) view.findViewById(R.id.details_button_descr);
|
||||||
|
|
||||||
AndroidUtils.setBackground(app, detailsButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, detailsButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
AndroidUtils.setBackground(app, detailsButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, detailsButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, detailsButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
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);
|
int color = ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_dark : R.color.active_buttons_and_links_light);
|
||||||
detailsButtonDescr.setTextColor(color);
|
detailsButtonDescr.setTextColor(color);
|
||||||
|
@ -108,11 +108,11 @@ public class PublicTransportCard extends BaseRouteCard {
|
||||||
FrameLayout showButton = (FrameLayout) view.findViewById(R.id.show_button);
|
FrameLayout showButton = (FrameLayout) view.findViewById(R.id.show_button);
|
||||||
if (secondButtonVisible) {
|
if (secondButtonVisible) {
|
||||||
TextView showButtonDescr = (TextView) view.findViewById(R.id.show_button_descr);
|
TextView showButtonDescr = (TextView) view.findViewById(R.id.show_button_descr);
|
||||||
AndroidUtils.setBackground(app, showButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, showButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
AndroidUtils.setBackground(app, showButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, showButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, showButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, showButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
||||||
}
|
}
|
||||||
showButtonDescr.setTextColor(color);
|
showButtonDescr.setTextColor(color);
|
||||||
showButton.setVisibility(View.VISIBLE);
|
showButton.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -110,11 +110,11 @@ public class SimpleRouteCard extends BaseRouteCard {
|
||||||
|
|
||||||
protected void applyDayNightMode() {
|
protected void applyDayNightMode() {
|
||||||
FrameLayout detailsButton = view.findViewById(R.id.details_button);
|
FrameLayout detailsButton = view.findViewById(R.id.details_button);
|
||||||
AndroidUtils.setBackground(app, detailsButton, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
AndroidUtils.setBackground(app, detailsButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
|
||||||
AndroidUtils.setBackground(app, view.findViewById(R.id.details_button_descr), nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
AndroidUtils.setBackground(app, view.findViewById(R.id.details_button_descr), nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
||||||
} else {
|
} else {
|
||||||
AndroidUtils.setBackground(app, view.findViewById(R.id.details_button_descr), nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
|
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);
|
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.dividerToDropDown), nightMode, R.color.divider_light, R.color.divider_dark);
|
||||||
|
|
Loading…
Reference in a new issue