diff --git a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java
index 3fd3bf6763..7aa4389f67 100644
--- a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java
+++ b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java
@@ -119,16 +119,6 @@ public class Algorithms {
return def;
}
- public static String formatDoubleWithoutExtraZeros(double d) {
- return isInt(d) ?
- String.format(Locale.US, "%d", (long) d) :
- String.format("%s", d);
- }
-
- public static boolean isInt(double d) {
- return (d == Math.floor(d)) && !Double.isInfinite(d);
- }
-
public static int parseIntSilently(String input, int def) {
if (input != null && input.length() > 0) {
try {
@@ -798,6 +788,10 @@ public class Algorithms {
return false;
}
+ public static boolean isInt(double d) {
+ return (d == Math.floor(d)) && !Double.isInfinite(d);
+ }
+
public static boolean isInt(String value) {
int length = value.length();
for (int i = 0; i < length; i++) {
diff --git a/OsmAnd/res/layout/bottom_sheet_item_description_long_without_min_height.xml b/OsmAnd/res/layout/bottom_sheet_item_description_long_without_min_height.xml
deleted file mode 100644
index 9fe963d78f..0000000000
--- a/OsmAnd/res/layout/bottom_sheet_item_description_long_without_min_height.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
diff --git a/OsmAnd/res/layout/track_split_interval.xml b/OsmAnd/res/layout/track_split_interval.xml
index 7751d35e0f..2fdcfc467c 100644
--- a/OsmAnd/res/layout/track_split_interval.xml
+++ b/OsmAnd/res/layout/track_split_interval.xml
@@ -5,6 +5,20 @@
android:layout_height="match_parent"
android:orientation="vertical">
+
+
diff --git a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java
index ba821f411c..883cc908c5 100644
--- a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java
+++ b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java
@@ -121,19 +121,22 @@ public class OsmAndFormatter {
}
public static String getFormattedTimeInterval(OsmandApplication app, double interval) {
- String units;
+ String unitsStr;
double intervalInUnits;
if (interval < 60) {
- units = app.getString(R.string.shared_string_sec);
+ unitsStr = app.getString(R.string.shared_string_sec);
intervalInUnits = interval;
} else if (interval % 60 == 0) {
- units = app.getString(R.string.int_min);
+ unitsStr = app.getString(R.string.int_min);
intervalInUnits = (interval / 60);
} else {
- units = app.getString(R.string.int_min);
+ unitsStr = app.getString(R.string.int_min);
intervalInUnits = (interval / 60f);
}
- return Algorithms.formatDoubleWithoutExtraZeros(intervalInUnits) + " " + units;
+ String formattedInterval = Algorithms.isInt(intervalInUnits) ?
+ String.format(Locale.US, "%d", (long) intervalInUnits) :
+ String.format("%s", intervalInUnits);
+ return formattedInterval + " " + unitsStr;
}
public static String getFormattedDistanceInterval(OsmandApplication app, double interval) {
diff --git a/OsmAnd/src/net/osmand/plus/track/ColorsCard.java b/OsmAnd/src/net/osmand/plus/track/ColorsCard.java
index 0ee0885f61..e6da7e736f 100644
--- a/OsmAnd/src/net/osmand/plus/track/ColorsCard.java
+++ b/OsmAnd/src/net/osmand/plus/track/ColorsCard.java
@@ -145,7 +145,10 @@ public class ColorsCard extends BaseCard implements ColorPickerListener {
Drawable transparencyIcon = getTransparencyIcon(app, color);
Drawable colorIcon = app.getUIUtilities().getPaintedIcon(R.drawable.bg_point_circle, color);
Drawable layeredIcon = UiUtilities.getLayeredIcon(transparencyIcon, colorIcon);
- int listBgColor = ContextCompat.getColor(app, getListBackgroundColorId());
+ int listBgColorId = nightMode ?
+ R.color.card_and_list_background_dark :
+ R.color.card_and_list_background_light;
+ int listBgColor = getResolvedColor(listBgColorId);
double contrastRatio = ColorUtils.calculateContrast(color, listBgColor);
if (contrastRatio < MINIMUM_CONTRAST_RATIO) {
backgroundCircle.setBackgroundResource(nightMode ? R.drawable.circle_contour_bg_dark : R.drawable.circle_contour_bg_light);
@@ -267,11 +270,4 @@ public class ColorsCard extends BaseCard implements ColorPickerListener {
colorsListPreference.setStringsListForProfile(appMode, colorNames);
}
}
-
- @ColorRes
- private int getListBackgroundColorId() {
- return nightMode ?
- R.color.card_and_list_background_dark :
- R.color.card_and_list_background_light;
- }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/track/SplitIntervalBottomSheet.java b/OsmAnd/src/net/osmand/plus/track/SplitIntervalBottomSheet.java
index 644df0db81..7d36e90b27 100644
--- a/OsmAnd/src/net/osmand/plus/track/SplitIntervalBottomSheet.java
+++ b/OsmAnd/src/net/osmand/plus/track/SplitIntervalBottomSheet.java
@@ -96,10 +96,6 @@ public class SplitIntervalBottomSheet extends MenuBottomSheetDialogFragment {
@Override
public void createMenuItems(Bundle savedInstanceState) {
items.add(new TitleItem(getString(R.string.gpx_split_interval)));
- items.add(new LongDescriptionItem.Builder()
- .setDescription(getString(R.string.gpx_split_interval_descr))
- .setLayoutId(R.layout.bottom_sheet_item_description_long_without_min_height)
- .create());
LayoutInflater themedInflater = UiUtilities.getInflater(requireContext(), nightMode);
View view = themedInflater.inflate(R.layout.track_split_interval, null);