You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I change the Locale parameter from outside? public Geocoder (Context context, Locale locale)
Currently in your code it can't be changed from outside, it always set to be as default by the device language.
Constructor always empty, or take a provider, but there is no way to use the other constructor with the Locale parameter.
geocoding()
/smartlocation/SmartLocation.java
/**
* @return request handler for geocoding operations
*/
public GeocodingControl geocoding() {
return geocoding(new AndroidGeocodingProvider());
}
/**
* @param geocodingProvider geocoding provider we want to use
* @return request handler for geocoding operations
*/
public GeocodingControl geocoding(GeocodingProvider geocodingProvider) {
return new GeocodingControl(this, geocodingProvider);
}
The AndroidGeocodingProvider Constructors:
/smartlocation/geocoding/providers/AndroidGeocodingProvider.java
public AndroidGeocodingProvider() {
this(Locale.getDefault());
}
public AndroidGeocodingProvider(Locale locale) {
if (locale == null) {
// This should be super weird
throw new RuntimeException("Locale is null");
}
this.locale = locale;
fromNameList = new HashMap<>();
fromLocationList = new HashMap<>();
if (!Geocoder.isPresent()) {
throw new RuntimeException("Android Geocoder not present. Please check if Geocoder.isPresent() before invoking the search");
}
}
So I need to be able working also with this constructor:
public AndroidGeocodingProvider(Locale locale) { … }
Currently It's not in use in your code, and cannot be used from outside with the geocoding() function.
The text was updated successfully, but these errors were encountered:
burekas7
changed the title
[Request] Option for set the Locale parameter
[Request] Add an option for setting the Locale parameter from outside
Nov 9, 2018
burekas7
added a commit
to burekas7/smart-location-lib
that referenced
this issue
Nov 26, 2018
Hi @mrmans0n , thanks for this library.
How can I change the Locale parameter from outside?
public Geocoder (Context context, Locale locale)
Currently in your code it can't be changed from outside, it always set to be as default by the device language.
Constructor always empty, or take a provider, but there is no way to use the other constructor with the Locale parameter.
geocoding()
/smartlocation/SmartLocation.java
The AndroidGeocodingProvider Constructors:
/smartlocation/geocoding/providers/AndroidGeocodingProvider.java
So I need to be able working also with this constructor:
Currently It's not in use in your code, and cannot be used from outside with the geocoding() function.
The text was updated successfully, but these errors were encountered: