diff --git a/OsmAnd/src/net/osmand/plus/helpers/TrackSelectSegmentAdapter.java b/OsmAnd/src/net/osmand/plus/helpers/TrackSelectSegmentAdapter.java index 498f638081..e9b1a67ce3 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/TrackSelectSegmentAdapter.java +++ b/OsmAnd/src/net/osmand/plus/helpers/TrackSelectSegmentAdapter.java @@ -28,6 +28,7 @@ public class TrackSelectSegmentAdapter extends RecyclerView.Adapter segments; private OnItemClickListener onItemClickListener; + private ImageView timeIcon; public TrackSelectSegmentAdapter(Context ctx, List segments) { app = (OsmandApplication) ctx.getApplicationContext(); @@ -42,14 +43,14 @@ public class TrackSelectSegmentAdapter extends RecyclerView.Adapter 1 && routeParams != null && routeParams.getSelectedSegment() != -1) { TextView distanceView = view.findViewById(R.id.distance); TextView timeView = view.findViewById(R.id.time); + ImageView timeIcon = view.findViewById(R.id.time_icon); TextView pointsView = view.findViewById(R.id.points_count); + ImageView pointsIcon = view.findViewById(R.id.points_icon); + pointsView.setVisibility(View.GONE); + pointsIcon.setVisibility(View.GONE); List segments = gpxFile.getNonEmptyTrkSegments(false); GPXUtilities.TrkSegment segment = segments.get(routeParams.getSelectedSegment()); - int point = segment.points.size(); double distance = TrackSelectSegmentAdapter.getDistance(segment); long time = TrackSelectSegmentAdapter.getSegmentTime(segment); if (time != 1) { timeView.setText(OsmAndFormatter.getFormattedDurationShort((int) (time / 1000))); } else { + timeIcon.setVisibility(View.GONE); timeView.setText(""); } distanceView.setText(OsmAndFormatter.getFormattedDistance((float) distance, app)); - pointsView.setText(String.valueOf(point)); } ImageButton editButton = view.findViewById(R.id.show_on_map); diff --git a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java index e0a7290b33..fb72c0a9c8 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java @@ -1090,10 +1090,10 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card @Override public void onSegmentSelect(GPXFile gpxFile, int selectedSegment) { + app.getSettings().GPX_ROUTE_SEGMENT.set(selectedSegment); MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { startNavigationForGPX(gpxFile, mapActivity.getMapActions()); - app.getSettings().GPX_ROUTE_SEGMENT.set(selectedSegment); RouteProvider.GPXRouteParamsBuilder paramsBuilder = app.getRoutingHelper().getCurrentGPXRoute(); if (paramsBuilder != null) { paramsBuilder.setSelectedSegment(selectedSegment); diff --git a/OsmAnd/src/net/osmand/plus/track/TrackSelectSegmentBottomSheet.java b/OsmAnd/src/net/osmand/plus/track/TrackSelectSegmentBottomSheet.java index b49c2eb898..cc60c4f057 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackSelectSegmentBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackSelectSegmentBottomSheet.java @@ -81,6 +81,7 @@ public class TrackSelectSegmentBottomSheet extends MenuBottomSheetDialogFragment TextView distance = gpxTrackContainer.findViewById(R.id.distance); TextView pointsCount = gpxTrackContainer.findViewById(R.id.points_count); TextView time = gpxTrackContainer.findViewById(R.id.time); + ImageView timeIcon = gpxTrackContainer.findViewById(R.id.time_icon); LinearLayout container = gpxTrackContainer.findViewById(R.id.container); LinearLayout containerNameAndReadSection = gpxTrackContainer.findViewById(R.id.name_and_read_section_container); container.setPadding(sidePadding, 0, 0, 0); @@ -93,7 +94,13 @@ public class TrackSelectSegmentBottomSheet extends MenuBottomSheetDialogFragment pointsCount.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14); pointsCount.setText(String.valueOf(analysis.wptPoints)); time.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14); - time.setText(analysis.isTimeSpecified() ? Algorithms.formatDuration((int) (analysis.timeSpan / 1000), app.accessibilityEnabled()) : ""); + if (analysis.isTimeSpecified()) { + time.setText(Algorithms.formatDuration((int) (analysis.timeSpan / 1000), + app.accessibilityEnabled())); + } else { + time.setText(""); + timeIcon.setVisibility(View.GONE); + } RecyclerView recyclerView = itemView.findViewById(R.id.gpx_segment_list); recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));