-
Notifications
You must be signed in to change notification settings - Fork 120
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
import android.view.MotionEvent; | ||
import android.view.View; | ||
import android.widget.AdapterView; | ||
import android.widget.AutoCompleteTextView; | ||
|
||
import com.mapbox.services.android.ui.R; | ||
import com.mapbox.services.api.geocoding.v5.models.CarmenFeature; | ||
|
@@ -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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, good find. |
||
|
||
private static final int DEFAULT_NUMBER_OF_LINES = 1; | ||
|
||
|
@@ -44,6 +43,7 @@ public GeocoderAutoCompleteView(Context context, AttributeSet attrs) { | |
// Get attributes from attrs.xml | ||
TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.mas_geocoderWidget); | ||
imgClearButton = attributes.getDrawable(R.styleable.mas_geocoderWidget_mas_clearButtonDrawable); | ||
attributes.recycle(); | ||
|
||
// Set custom adapter | ||
adapter = new GeocoderAdapter(context); | ||
|
@@ -233,11 +233,34 @@ public void setLimit(int limit) { | |
* | ||
* @param language The locale in which results should be returned. | ||
* @since 2.0.0 | ||
* @deprecated use {@link GeocoderAutoCompleteView#setLanguages(String...)} instead | ||
*/ | ||
@Deprecated | ||
public void setLanguage(String language) { | ||
adapter.setLanguage(language); | ||
} | ||
|
||
/** | ||
* The locale in which results should be returned. | ||
* <p> | ||
* This property affects the language of returned results; generally speaking, | ||
* it does not determine which results are found. If the Geocoding API does not | ||
* recognize the language code, it may fall back to another language or the default | ||
* language. Components other than the language code, such as the country and | ||
* script codes, are ignored. | ||
* <p> | ||
* By default, this property is set to `null`, causing results to be in the default | ||
* language. | ||
* <p> | ||
* This option is experimental. | ||
* | ||
* @param languages The locale in which results should be returned. | ||
* @since 2.0.0 | ||
*/ | ||
public void setLanguages(String... languages) { | ||
adapter.setLanguage(languages); | ||
} | ||
|
||
/** | ||
* Sets the listener that will be notified when the user clicks an item in the drop down list. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.