Refactor StatsFragment.

This commit is contained in:
Dennis Guse
2019-12-03 17:19:17 +01:00
parent 355f3ef614
commit e8c6801a32
5 changed files with 346 additions and 330 deletions
@@ -132,7 +132,7 @@ public class StringUtils {
/**
* Format a decimal number while removing trailing zeros of the decimal part (if present).
*/
static String formatDecimal(double value, int decimalPlaces) {
public static String formatDecimal(double value, int decimalPlaces) {
if (decimalPlaces < 1) {
return Long.toString(Math.round(value));
}
@@ -158,7 +158,7 @@ public class StringUtils {
* @param metricUnits true to use metric unit
* @return the formatted distance (or null) and it's unit as {@link Pair}
*/
static Pair<String, String> getDistanceParts(Context context, double distance, boolean metricUnits) {
public static Pair<String, String> getDistanceParts(Context context, double distance, boolean metricUnits) {
if (Double.isNaN(distance) || Double.isInfinite(distance)) {
return new Pair<>(null, context.getString(metricUnits ? R.string.unit_meter : R.string.unit_feet));
}