Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several geocoding fixes and additions #512

Merged
merged 4 commits into from
Aug 1, 2017
Merged

Several geocoding fixes and additions #512

merged 4 commits into from
Aug 1, 2017

Conversation

cammace
Copy link
Contributor

@cammace cammace commented Jul 18, 2017

This PR:

  • Closes Add geocoding API for setting multiple languages #446
  • Adds support for multiple languages in geocoder auto complete widget
  • Adds support for multiple languages in geocoder API
  • Reduced API access in GeocoderAdapter.java to non-public since user has no reason for using
  • Auto complete widget now extends to Support Library widget
  • TYPE_DISTRICT and TYPE_LOCALITY result filters added
  • adds place_type support in Carman Feature
  • adds matching_text support in Carman Feature
  • adds matching_place_name support in Carman Feature
  • adds language support in Carman Feature
  • Several Javadoc improvements
  • Updated fixtures and test

I haven't added support for text_{language}, place_name_{language} and language_{language} since the field name depends on different languages. These are rarely used in the geocoder however so it might be better just to ticket out if it is too much work implementing before 2.2.0 release.

@cammace cammace added this to the v2.2.0 milestone Jul 18, 2017
@cammace cammace self-assigned this Jul 18, 2017
@cammace cammace requested a review from zugaldia July 18, 2017 20:35
@cammace
Copy link
Contributor Author

cammace commented Jul 20, 2017

Opened #515 to track the progress on adding support for text, placeName, and language in the response. Can I get your review on this one @zugaldia?

@cammace cammace mentioned this pull request Jul 20, 2017
10 tasks
Copy link
Member

@zugaldia zugaldia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions, otherwise we're very close.

@@ -43,6 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
autocomplete.setAccessToken(Utils.getMapboxAccessToken(this));
autocomplete.setType(GeocodingCriteria.TYPE_POI);
autocomplete.setLimit(10);
autocomplete.setLanguages(Locale.JAPAN.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cammace did you intend to leave Japan's locale here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

super();
builder = new MapboxGeocoding.Builder();
builder = new MapboxGeocoding.Builder<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change necessary? It looks like a change on our standard builder approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was receiving a lint warning unchecked assignment so I added the <> which seemed to make it happy. Can switch back if there's an issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's alright, I just wanted to make sure new MapboxGeocoding.Builder(); still was an option.

private String matchingText;
@SerializedName("matching_place_name")
private String matchingPlaceName;
private String language;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I missed them but I can't seem to find tests for these new fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 The methods are now being tested.

@@ -25,7 +24,7 @@
* @see <a href="https://www.mapbox.com/android-sdk/examples/geocoding/">Mapbox example</a>
* @since 1.0.0
*/
public class GeocoderAutoCompleteView extends AutoCompleteTextView {
public class GeocoderAutoCompleteView extends android.support.v7.widget.AppCompatAutoCompleteTextView {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, good find.

@cammace
Copy link
Contributor Author

cammace commented Jul 31, 2017

Ready for another review @zugaldia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add geocoding API for setting multiple languages
2 participants