diff --git a/OsmAnd/res/drawable/btn_border_dark.xml b/OsmAnd/res/drawable/btn_border_dark.xml
new file mode 100644
index 0000000000..f50714a963
--- /dev/null
+++ b/OsmAnd/res/drawable/btn_border_dark.xml
@@ -0,0 +1,22 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/btn_border_light.xml b/OsmAnd/res/drawable/btn_border_light.xml
new file mode 100644
index 0000000000..5c262a9204
--- /dev/null
+++ b/OsmAnd/res/drawable/btn_border_light.xml
@@ -0,0 +1,22 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/btn_border_rounded_dark.xml b/OsmAnd/res/drawable/btn_border_rounded_dark.xml
new file mode 100644
index 0000000000..3f68423d61
--- /dev/null
+++ b/OsmAnd/res/drawable/btn_border_rounded_dark.xml
@@ -0,0 +1,22 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/btn_border_rounded_light.xml b/OsmAnd/res/drawable/btn_border_rounded_light.xml
new file mode 100644
index 0000000000..aee8c9de9d
--- /dev/null
+++ b/OsmAnd/res/drawable/btn_border_rounded_light.xml
@@ -0,0 +1,22 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/btn_border_trans_dark.xml b/OsmAnd/res/drawable/btn_border_trans_dark.xml
index f50714a963..7f2d58c3ab 100644
--- a/OsmAnd/res/drawable/btn_border_trans_dark.xml
+++ b/OsmAnd/res/drawable/btn_border_trans_dark.xml
@@ -3,7 +3,8 @@
-
-
+
+
-
diff --git a/OsmAnd/res/drawable/btn_border_trans_light.xml b/OsmAnd/res/drawable/btn_border_trans_light.xml
index 5c262a9204..adc199e8c7 100644
--- a/OsmAnd/res/drawable/btn_border_trans_light.xml
+++ b/OsmAnd/res/drawable/btn_border_trans_light.xml
@@ -3,6 +3,7 @@
-
+
diff --git a/OsmAnd/res/drawable/btn_border_trans_rounded_dark.xml b/OsmAnd/res/drawable/btn_border_trans_rounded_dark.xml
index 3f68423d61..0f134230b1 100644
--- a/OsmAnd/res/drawable/btn_border_trans_rounded_dark.xml
+++ b/OsmAnd/res/drawable/btn_border_trans_rounded_dark.xml
@@ -3,6 +3,7 @@
-
+
diff --git a/OsmAnd/res/drawable/btn_border_trans_rounded_light.xml b/OsmAnd/res/drawable/btn_border_trans_rounded_light.xml
index aee8c9de9d..7b9e2b6a1b 100644
--- a/OsmAnd/res/drawable/btn_border_trans_rounded_light.xml
+++ b/OsmAnd/res/drawable/btn_border_trans_rounded_light.xml
@@ -3,6 +3,7 @@
-
+
diff --git a/OsmAnd/res/layout/mode_view_route_preparation.xml b/OsmAnd/res/layout/mode_view_route_preparation.xml
index 24a9490cfb..7e8dc8c3b4 100644
--- a/OsmAnd/res/layout/mode_view_route_preparation.xml
+++ b/OsmAnd/res/layout/mode_view_route_preparation.xml
@@ -24,6 +24,6 @@
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
android:scaleType="center"
- tools:background="@drawable/btn_border_trans_light" />
+ tools:background="@drawable/btn_border_light" />
\ No newline at end of file
diff --git a/OsmAnd/res/layout/plan_route_info.xml b/OsmAnd/res/layout/plan_route_info.xml
index 3d8abb7599..c7a0185496 100644
--- a/OsmAnd/res/layout/plan_route_info.xml
+++ b/OsmAnd/res/layout/plan_route_info.xml
@@ -141,7 +141,7 @@
android:layout_marginTop="@dimen/route_info_icon_vertical_padding"
android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
android:layout_marginBottom="@dimen/route_info_icon_vertical_padding"
- tools:background="@drawable/btn_border_trans_rounded_dark">
+ tools:background="@drawable/btn_border_rounded_dark">
+ tools:background="@drawable/btn_border_rounded_dark">
+ tools:background="@drawable/btn_border_rounded_dark">
+ tools:background="@drawable/btn_border_dark">
+ tools:background="@drawable/btn_border_dark" />
\ No newline at end of file
diff --git a/OsmAnd/res/layout/route_options_container.xml b/OsmAnd/res/layout/route_options_container.xml
index ec50f5b162..34727efa2a 100644
--- a/OsmAnd/res/layout/route_options_container.xml
+++ b/OsmAnd/res/layout/route_options_container.xml
@@ -6,7 +6,7 @@
android:layout_width="100dp"
android:layout_height="32dp"
android:orientation="horizontal"
- tools:background="@drawable/btn_border_trans_dark">
+ tools:background="@drawable/btn_border_dark">
visible,
- final Set selected, final View.OnClickListener onClickListener, final View[] buttons,
- int i, final boolean singleChoice, final boolean useMapTheme, final boolean nightMode) {
+ public static void updateButtonStateForRoute(final OsmandApplication ctx, final List visible,
+ final Set selected, final View.OnClickListener onClickListener, final View[] buttons,
+ int i, final boolean singleChoice, final boolean useMapTheme, final boolean nightMode) {
if (buttons[i] != null) {
View tb = buttons[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)));
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);
} else {
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 {
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);
@@ -164,7 +164,6 @@ public class AppModeDialog {
} else {
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)));
}
tb.setOnClickListener(new View.OnClickListener() {
@@ -188,7 +187,7 @@ public class AppModeDialog {
onClickListener.onClick(null);
}
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);
}
}
});
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java
index 0638172652..be7c2c0140 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java
@@ -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));
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) {
+ 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);
+ } else {
+ AndroidUtils.setBackground(app, buttonContainer, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark);
}
buttonContainer.setOnClickListener(new View.OnClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java
index 339f625161..eb01d3058a 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java
@@ -537,7 +537,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
buttons[k++] = toggle;
}
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);
}
}
@@ -675,7 +675,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
updateOptionsButtons(mainView);
}
});
- 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);
optionsContainer.addView(item, lp);
}
@@ -689,7 +689,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
updateOptionsButtons(mainView);
}
});
- 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);
optionsContainer.addView(item, lp);
}
@@ -832,9 +832,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 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) {
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;
@@ -956,11 +958,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
});
LinearLayout viaButtonContainer = (LinearLayout) parentView.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) {
+ 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);
} 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) parentView.findViewById(R.id.via_button_image_view);
@@ -1027,11 +1029,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
final FrameLayout toButton = (FrameLayout) parentView.findViewById(R.id.to_button);
final LinearLayout toButtonContainer = (LinearLayout) parentView.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) {
+ 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);
} 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) parentView.findViewById(R.id.to_button_image_view);
@@ -1120,11 +1122,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
FrameLayout fromButton = (FrameLayout) parentView.findViewById(R.id.from_button);
final LinearLayout fromButtonContainer = (LinearLayout) parentView.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) {
+ 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);
} 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) parentView.findViewById(R.id.from_button_image_view);
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java
index 4e653bf9b8..aeacdbc2f8 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java
@@ -411,11 +411,11 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
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);
- 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) {
+ 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);
} 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);
@@ -426,7 +426,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
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, 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);
+ AndroidUtils.setBackground(app, clearButton, nightMode, R.drawable.btn_border_light, R.drawable.btn_border_dark);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
AndroidUtils.setBackground(app, clearButtonDescr, nightMode, R.drawable.ripple_light, R.drawable.ripple_dark);
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/PublicTransportCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/PublicTransportCard.java
index 8b97ea22f0..3ef4f12728 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/PublicTransportCard.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/PublicTransportCard.java
@@ -2,6 +2,7 @@ package net.osmand.plus.routepreparationmenu.routeCards;
import android.graphics.Typeface;
import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.text.SpannableString;
@@ -96,11 +97,11 @@ public class PublicTransportCard extends BaseRouteCard {
FrameLayout detailsButton = (FrameLayout) view.findViewById(R.id.details_button);
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) {
+ 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);
} 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);
detailsButtonDescr.setTextColor(color);
@@ -108,11 +109,11 @@ public class PublicTransportCard extends BaseRouteCard {
FrameLayout showButton = (FrameLayout) view.findViewById(R.id.show_button);
if (secondButtonVisible) {
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) {
+ 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);
} 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);
showButton.setVisibility(View.VISIBLE);
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/SimpleRouteCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/SimpleRouteCard.java
index b4b0d81825..e7525859f7 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/SimpleRouteCard.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/routeCards/SimpleRouteCard.java
@@ -110,11 +110,11 @@ public class SimpleRouteCard extends BaseRouteCard {
protected void applyDayNightMode() {
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) {
+ 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);
} 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);
AndroidUtils.setBackground(app, view.findViewById(R.id.dividerToDropDown), nightMode, R.color.divider_light, R.color.divider_dark);