Loading cardinal-android/app/src/main/java/earth/maps/cardinal/data/AddressFormatter.kt +7 −1 Original line number Diff line number Diff line Loading @@ -27,12 +27,18 @@ import javax.inject.Singleton @Singleton class AddressFormatter @Inject constructor() { private val formatter = AndroidAddressFormatter(true, true, false) private val countryFormatter = AndroidAddressFormatter(true, true, false) private val noCountryFormatter = AndroidAddressFormatter(true, false, false) fun format(address: Address): String? { try { val locale = Locale.getDefault() val fallbackCountryCode = locale.country.uppercase() val formatter = if (address.countryCode != null) { countryFormatter } else { noCountryFormatter } return formatter.format( Gson().toJson( mapOf( Loading Loading
cardinal-android/app/src/main/java/earth/maps/cardinal/data/AddressFormatter.kt +7 −1 Original line number Diff line number Diff line Loading @@ -27,12 +27,18 @@ import javax.inject.Singleton @Singleton class AddressFormatter @Inject constructor() { private val formatter = AndroidAddressFormatter(true, true, false) private val countryFormatter = AndroidAddressFormatter(true, true, false) private val noCountryFormatter = AndroidAddressFormatter(true, false, false) fun format(address: Address): String? { try { val locale = Locale.getDefault() val fallbackCountryCode = locale.country.uppercase() val formatter = if (address.countryCode != null) { countryFormatter } else { noCountryFormatter } return formatter.format( Gson().toJson( mapOf( Loading