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

feat: MapBox AutoComplete Places #1594

Merged
merged 1 commit into from
Apr 21, 2019
Merged

feat: MapBox AutoComplete Places #1594

merged 1 commit into from
Apr 21, 2019

Conversation

RotBolt
Copy link

@RotBolt RotBolt commented Apr 12, 2019

Fixes #1529

Changes:

  • Add MapBox Java lib
  • Make Popular Locations Hide when Place Suggestions come and Vice-versa
  • Add debounce to place query newtwork request (to avoid unnecessary calls)

Screenshots for the change:

F-droid

PlayStore

@auto-label auto-label bot added the feature label Apr 12, 2019
@RotBolt
Copy link
Author

RotBolt commented Apr 12, 2019

@ShridharGoel @addiegupta @iamareebjamal Please review :)

Query
EventBrite also has "Recents option" while searching for place. Should I make separate issue or Implement in this only ?

private fun loadPlaceSuggestions(query: String) {
val geoCodingRequest = makeGeocodingRequest(query)

geoCodingRequest.enqueueCall(object : Callback<GeocodingResponse> {
Copy link
Member

Choose a reason for hiding this comment

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

Cancel call onCleared

Copy link
Author

Choose a reason for hiding this comment

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

Hello ,I would like to ask , I have called loadPlaceSuggesstion inside compositeDisposable. So why wouln't it cancel the call on dispose ?

Copy link
Author

Choose a reason for hiding this comment

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

I have updated

@@ -23,11 +33,44 @@ class SearchLocationViewModel(
val eventLocations: LiveData<List<EventLocation>> = mutableEventLocations
private val mutableShowShimmer = MutableLiveData<Boolean>()
val showShimmer: LiveData<Boolean> = mutableShowShimmer
private var geoCodingRequest: MapboxGeocoding? = null
Copy link
Member

Choose a reason for hiding this comment

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

This should be a list of geocoding requests

Copy link
Author

@RotBolt RotBolt Apr 13, 2019

Choose a reason for hiding this comment

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

What if I cancel the previous request before enqueue new request ? In that way i wont have to maintain list of geocoding requests

Copy link
Member

Choose a reason for hiding this comment

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

That works as well

- Add MapBox Java lib
- Make Popular Locations Hide when Place Suggestions come and Vice-versa
- Add debounce to place query newtwork request (to avoid unnecessary calls)
- Add english as default language for Suggesstions
@RotBolt
Copy link
Author

RotBolt commented Apr 13, 2019

Update

Add english as language to get the place suggestion in English only (unlike in the GIF of PlayStore VErsion)

@RotBolt
Copy link
Author

RotBolt commented Apr 15, 2019

@iamareebjamal I have updated it. Please review it

@iamareebjamal
Copy link
Member

Peer Review

@RotBolt
Copy link
Author

RotBolt commented Apr 20, 2019

@ShridharGoel @angmas1 Please review

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

Successfully merging this pull request may close these issues.

Custom Implementation of PlacesAutoComplete using MapBox GeoCoding API
3 participants