diff --git a/OsmAnd/res/layout/bottom_sheet_select_segment.xml b/OsmAnd/res/layout/bottom_sheet_select_segment.xml
index 5a17fe2107..ddfa37f927 100644
--- a/OsmAnd/res/layout/bottom_sheet_select_segment.xml
+++ b/OsmAnd/res/layout/bottom_sheet_select_segment.xml
@@ -25,7 +25,7 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing"
- android:lineSpacingExtra="@dimen/line_spacing_extra_description"
+ android:lineSpacingExtra="@dimen/titleLineSpacingExtra"
android:maxLines="1"
android:text="@string/select_segments"
android:textColor="?android:textColorPrimary"
@@ -37,10 +37,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/list_header_settings_top_margin"
+ android:letterSpacing="@dimen/description_letter_spacing"
android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier"
+ android:lineSpacingExtra="@dimen/descriptionLineSpacingExtra"
android:text="@string/select_segments_description"
android:textColor="?android:textColorSecondary"
- android:textSize="@dimen/default_list_text_size"
+ android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular" />
diff --git a/OsmAnd/res/values/ids.xml b/OsmAnd/res/values/ids.xml
index 244ac99d5d..19a023ee8a 100644
--- a/OsmAnd/res/values/ids.xml
+++ b/OsmAnd/res/values/ids.xml
@@ -16,7 +16,5 @@
-
-
\ No newline at end of file
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index a086849297..107bb45da7 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -413,4 +413,7 @@
32dp
24dp
+
+ 5sp
+ 3sp
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java
index d1e6120fc4..68c07bcb30 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java
@@ -493,22 +493,28 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
if (mapActivity != null && index < card.getGpxInfoList().size()) {
GPXInfo gpxInfo = card.getGpxInfoList().get(index);
String fileName = gpxInfo.getFileName();
- GPXFile GPXFile = app.getSelectedGpxHelper().getSelectedFileByName(fileName).getGpxFile();
- FragmentManager fragmentManager = getFragmentManager();
- if (GPXFile != null && fragmentManager != null) {
- boolean isTrackContainsMultiSegment = GPXFile.getNonEmptySegmentsCount() > 1;
- if (!isTrackContainsMultiSegment) {
- selectTrackToFollow(GPXFile);
- updateSelectionMode(false);
+ SelectedGpxFile selectedGpxFile = app.getSelectedGpxHelper().getSelectedFileByName(fileName);
+ if (selectedGpxFile != null) {
+ GPXFile gpxFile = selectedGpxFile.getGpxFile();
+ if (gpxFile.getNonEmptySegmentsCount() > 1) {
+ TrackSelectSegmentBottomSheet.showInstance(mapActivity.getSupportFragmentManager(), gpxFile);
} else {
- TrackSelectSegmentBottomSheet.showInstance(fragmentManager, GPXFile);
+ updateSelectionMode(false);
+ selectTrackToFollow(gpxFile);
}
} else {
CallbackWithObject callback = new CallbackWithObject() {
@Override
public boolean processResult(GPXFile[] result) {
- selectTrackToFollow(result[0]);
- updateSelectionMode(false);
+ MapActivity mapActivity = getMapActivity();
+ if (mapActivity != null) {
+ if (result[0].getNonEmptySegmentsCount() > 1) {
+ TrackSelectSegmentBottomSheet.showInstance(mapActivity.getSupportFragmentManager(), result[0]);
+ } else {
+ updateSelectionMode(false);
+ selectTrackToFollow(result[0]);
+ }
+ }
return true;
}
};