AdevintaSpain / Leku

:earth_africa: Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker.
https://adevintaspain.github.io/Leku/
Apache License 2.0
763 stars 170 forks source link

Reduce geocoder calls and UI updates when searching #337

Closed davidftrujillo closed 2 years ago

davidftrujillo commented 2 years ago

ISSUE

No related issue

Description

When searching, the current implementation is making too many requests to the geocoder, with the corresponding update of the results list, one for each request. You can see the effect in the first columns of screenshots.

To improve the UX in this part, my idea is to rethink the debounce implementation, applying it to the onTextChangeListener. This way the request itself will be done only after DEBOUNCE_TIME milliseconds has passed without changing the term of search.

Screenshots

Before After

Mandatory GIF

mandatory