Setting format
This commit is contained in:
parent
33968534fa
commit
3e8dac9caf
2 changed files with 10 additions and 14 deletions
|
@ -5,6 +5,7 @@ import android.text.format.DateUtils;
|
|||
|
||||
import androidx.core.text.TextUtilsCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.jwetherell.openmap.common.LatLonPoint;
|
||||
import com.jwetherell.openmap.common.MGRSPoint;
|
||||
import com.jwetherell.openmap.common.UTMPoint;
|
||||
|
@ -509,19 +510,14 @@ public class OsmAndFormatter {
|
|||
result.append(formatCoordinate(lat, outputFormat)).append(" ").append(formatCoordinate(lon, outputFormat));
|
||||
} else if (outputFormat == FORMAT_DEGREES || outputFormat == FORMAT_MINUTES || outputFormat == FORMAT_SECONDS) {
|
||||
boolean isLeftToRight = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_LTR;
|
||||
if (isLeftToRight) {
|
||||
String rtlCoordinates = isLeftToRight ? "" : "\u200f";
|
||||
String rtlCoordinatesPunctuation = isLeftToRight ? ", " : " ,";
|
||||
result
|
||||
.append(formatCoordinate(lat, outputFormat)).append(" ")
|
||||
.append(lat > 0 ? NORTH : SOUTH).append(", ")
|
||||
.append(formatCoordinate(lon, outputFormat)).append(" ")
|
||||
.append(rtlCoordinates)
|
||||
.append(formatCoordinate(lat, outputFormat)).append(rtlCoordinates).append(" ").append(rtlCoordinates)
|
||||
.append(lat > 0 ? NORTH : SOUTH).append(rtlCoordinates).append(rtlCoordinatesPunctuation).append(rtlCoordinates)
|
||||
.append(formatCoordinate(lon, outputFormat)).append(rtlCoordinates).append(" ").append(rtlCoordinates)
|
||||
.append(lon > 0 ? EAST : WEST);
|
||||
} else {
|
||||
result
|
||||
.append(formatCoordinate(lat, outputFormat)).append(" ")
|
||||
.append(lon > 0 ? EAST : WEST).append(" ")
|
||||
.append(formatCoordinate(lon, outputFormat)).append(", ")
|
||||
.append(lat > 0 ? NORTH : SOUTH);
|
||||
}
|
||||
} else if (outputFormat == UTM_FORMAT) {
|
||||
UTMPoint pnt = new UTMPoint(new LatLonPoint(lat, lon));
|
||||
result
|
||||
|
|
|
@ -146,7 +146,7 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment {
|
|||
|
||||
return spannableBuilder;
|
||||
}
|
||||
return getString(R.string.ltr_or_rtl_combine_via_colon, getString(R.string.shared_string_example), formattedCoordinates);
|
||||
return formattedCoordinates;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue