diff --git a/OsmAnd/res/layout/transport_stop_route_item_with_icon.xml b/OsmAnd/res/layout/transport_stop_route_item_with_icon.xml index f3756ee79f..0b7d95226a 100644 --- a/OsmAnd/res/layout/transport_stop_route_item_with_icon.xml +++ b/OsmAnd/res/layout/transport_stop_route_item_with_icon.xml @@ -3,7 +3,7 @@ xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" - android:layout_height="28dp" + android:layout_height="wrap_content" android:background="@drawable/transport_stop_route_bg" android:orientation="horizontal"> @@ -11,6 +11,7 @@ android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:gravity="center_vertical" android:background="?attr/selectableItemBackgroundBorderless"> + tools:text="MT231: Start - Stop" /> diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java index cd77305fe3..a8818dd603 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java @@ -928,7 +928,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT if (mapActivity == null) { return; } - OsmandApplication app = mapActivity.getMyApplication(); FrameLayout baseItemView = new FrameLayout(view.getContext()); FrameLayout.LayoutParams baseViewLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); @@ -1026,16 +1025,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT LinearLayout llText = buildTextContainerView(view.getContext()); ll.addView(llText); - TextView routeTypeView = new TextView(view.getContext()); - LinearLayout.LayoutParams routeTypeParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - routeTypeParams.setMargins(0, dpToPx(4), 0, 0); - routeTypeView.setLayoutParams(routeTypeParams); - routeTypeView.setTextSize(16); - routeTypeView.setTextColor(getSecondaryColor()); - routeTypeView.setText(routeDescription); - llText.addView(routeTypeView); - - View routeBadge = createRouteBadge(mapActivity, transportStopRoute, isNightMode()); + View routeBadge = createRouteBadge(mapActivity, transportStopRoute, routeDescription); LinearLayout.LayoutParams routeBadgeParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); routeBadgeParams.setMargins(0, dpToPx(6), 0, dpToPx(8)); routeBadge.setLayoutParams(routeBadgeParams); @@ -1440,7 +1430,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT return ll; } - public View createRouteBadge(@NonNull MapActivity mapActivity, TransportStopRoute transportStopRoute, boolean isNightMode) { + public View createRouteBadge(@NonNull MapActivity mapActivity, TransportStopRoute transportStopRoute, String routeDescription) { OsmandApplication app = mapActivity.getMyApplication(); LinearLayout convertView = (LinearLayout) mapActivity.getLayoutInflater().inflate(R.layout.transport_stop_route_item_with_icon, null, false); if (transportStopRoute != null) { @@ -1452,7 +1442,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT int drawableResId = transportStopRoute.type == null ? R.drawable.ic_action_bus_dark : transportStopRoute.type.getResourceId(); transportStopRouteImageView.setImageDrawable(app.getUIUtilities().getPaintedIcon(drawableResId, UiUtilities.getContrastColor(mapActivity, bgColor, true))); - transportStopRouteTextView.setText(routeRef); + transportStopRouteTextView.setText(routeRef + ": " + routeDescription); GradientDrawable gradientDrawableBg = (GradientDrawable) convertView.getBackground(); gradientDrawableBg.setColor(bgColor); transportStopRouteTextView.setTextColor(UiUtilities.getContrastColor(mapActivity, bgColor, true));