-
Notifications
You must be signed in to change notification settings - Fork 551
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
feat: MapBox AutoComplete Places #1594
Conversation
@ShridharGoel @addiegupta @iamareebjamal Please review :) Query |
private fun loadPlaceSuggestions(query: String) { | ||
val geoCodingRequest = makeGeocodingRequest(query) | ||
|
||
geoCodingRequest.enqueueCall(object : Callback<GeocodingResponse> { |
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.
Cancel call onCleared
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.
Hello ,I would like to ask , I have called loadPlaceSuggesstion
inside compositeDisposable
. So why wouln't it cancel the call on dispose ?
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.
I have updated
app/src/main/java/org/fossasia/openevent/general/search/SearchLocationFragment.kt
Outdated
Show resolved
Hide resolved
@@ -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 |
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.
This should be a list of geocoding requests
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.
What if I cancel the previous request before enqueue new request ? In that way i wont have to maintain list of geocoding requests
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.
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
@iamareebjamal I have updated it. Please review it |
Peer Review |
@ShridharGoel @angmas1 Please review |
Fixes #1529
Changes:
Screenshots for the change:
F-droid
PlayStore